]> OCCT Git - occt.git/commitdiff
0027718: Class GeomPlate_CurveConstraint contains two same constructors
authornbv <nbv@opencascade.com>
Wed, 27 Jul 2016 16:12:28 +0000 (19:12 +0300)
committerapv <apv@opencascade.com>
Fri, 29 Jul 2016 11:23:05 +0000 (14:23 +0300)
Two constructors have been combined to one.

src/GeomPlate/GeomPlate_CurveConstraint.cxx
src/GeomPlate/GeomPlate_CurveConstraint.hxx

index 2368ee7a6654729394666e775f8dcb1841ddb423..6a66b701ba3ca9d9b3e8567d7f28d1a0121133a3 100644 (file)
@@ -54,67 +54,53 @@ myLProp(2,1.e-4)
 //---------------------------------------------------------
 //         Constructeurs avec courbe sur surface
 //---------------------------------------------------------
-GeomPlate_CurveConstraint :: GeomPlate_CurveConstraint (const Handle(Adaptor3d_HCurveOnSurface)& Boundary,
+GeomPlate_CurveConstraint :: GeomPlate_CurveConstraint (const Handle(Adaptor3d_HCurve)& Boundary,
                                                const Standard_Integer Tang,
                                                const Standard_Integer NPt,
                                                const Standard_Real TolDist,
                                                const Standard_Real TolAng,
                                                const Standard_Real TolCurv
 ) :
-myFrontiere(Boundary),
 myLProp(2,TolDist),
 myTolDist(TolDist),
 myTolAng(TolAng),
 myTolCurv(TolCurv)
-{ myOrder=Tang;
+{
+  myOrder=Tang;
   if ((Tang<-1)||(Tang>2))
     Standard_Failure::Raise("GeomPlate : The continuity is not G0 G1 or G2"); 
   myNbPoints=NPt;
   myConstG0=Standard_True;
   myConstG1=Standard_True;
   myConstG2=Standard_True;
- if (myFrontiere.IsNull())
-    Standard_Failure::Raise("GeomPlate_CurveConstraint : Curve must be on a Surface"); 
-  Handle(Geom_Surface) Surf;
-  Handle(GeomAdaptor_HSurface) GS1;
-  GS1 = Handle(GeomAdaptor_HSurface)::DownCast(myFrontiere->ChangeCurve().GetSurface());
-  if (!GS1.IsNull()) {
-    Surf=GS1->ChangeSurface().Surface();
-  }
-  else {
-//      Handle(BRepAdaptor_HSurface) BS1;
-//      BS1=Handle(BRepAdaptor_HSurface)::DownCast(myFrontiere->ChangeCurve().GetSurface());
-//      Surf = BRep_Tool::Surface(BS1->ChangeSurface().Face());
-    Standard_Failure::Raise("GeomPlate_CurveConstraint : Surface must be GeomAdaptor_Surface");     
+
+  myFrontiere = Handle(Adaptor3d_HCurveOnSurface)::DownCast(Boundary);
+
+  if (myFrontiere.IsNull())
+  {
+    my3dCurve = Boundary;
   }
-  myLProp.SetSurface(Surf);
-  my2dCurve.Nullify();
-  myHCurve2d.Nullify();
-  myTolU=0.;
-  myTolV=0.;
-  myG0Crit.Nullify();
-  myG1Crit.Nullify();
-  myG2Crit.Nullify();
+  else
+  {
+    Handle(Geom_Surface) Surf;
+    Handle(GeomAdaptor_HSurface) GS1 = Handle(GeomAdaptor_HSurface)::
+                            DownCast(myFrontiere->ChangeCurve().GetSurface());
 
-}
+    if (!GS1.IsNull()) {
+      Surf=GS1->ChangeSurface().Surface();
+    }
+    else {
+      //      Handle(BRepAdaptor_HSurface) BS1;
+      //      BS1=Handle(BRepAdaptor_HSurface)::DownCast(myFrontiere->
+      //                                            ChangeCurve().GetSurface());
+      //      Surf = BRep_Tool::Surface(BS1->ChangeSurface().Face());
+      Standard_Failure::Raise(
+                    "GeomPlate_CurveConstraint : Surface must be GeomAdaptor_Surface");
+    }
+
+    myLProp.SetSurface(Surf);
+  }
 
-//---------------------------------------------------------
-//    Constructeurs avec courbe 3d (pour continuite G0 G-1)
-//---------------------------------------------------------
-GeomPlate_CurveConstraint :: GeomPlate_CurveConstraint (const Handle(Adaptor3d_HCurve)& Boundary,
-                                               const Standard_Integer Tang, 
-                                               const Standard_Integer NPt,
-                                               const Standard_Real TolDist) :
-my3dCurve(Boundary),
-myLProp(2,TolDist),
-myTolDist(TolDist)
-{ myOrder=Tang;
-  if ((Tang!=-1)&&(Tang!=0))
-    Standard_Failure::Raise("GeomPlate : The continuity is not G0 or G-1"); 
-  myNbPoints=NPt;
-  myConstG0=Standard_True;
-  myConstG1=Standard_True;
-  myConstG2=Standard_True;
   my2dCurve.Nullify();
   myHCurve2d.Nullify();
   myTolU=0.;
@@ -123,6 +109,7 @@ myTolDist(TolDist)
   myG1Crit.Nullify();
   myG2Crit.Nullify();
 }
+
 //---------------------------------------------------------
 // Fonction : FirstParameter
 //---------------------------------------------------------
index ec830687392a7f166032863a49ce93ef46b67040..a958eda69104bb3c337e245ba7d424a6050a649c 100644 (file)
@@ -60,16 +60,7 @@ public:
   //! TolCurv is the maximum error to satisfy for G2 constraints
   //! These errors can be replaced by laws of criterion.
   //! Raises    ConstructionError if Order is not -1 , 0,  1,  2
-  Standard_EXPORT GeomPlate_CurveConstraint(const Handle(Adaptor3d_HCurveOnSurface)& Boundary, const Standard_Integer Order, const Standard_Integer NPt = 10, const Standard_Real TolDist = 0.0001, const Standard_Real TolAng = 0.01, const Standard_Real TolCurv = 0.1);
-  
-  //! Create a constraint
-  //! Order is the order of the constraint. The possible values for order are -1,0.
-  //! Order i means constraints Gi
-  //! Npt is the number of points associated with the constraint.
-  //! TolDist is the maximum error to satisfy for G0 constraints
-  //! These errors can be replaced by laws of criterion.
-  //! Raises    ConstructionError if Order  is  not  0  or  -1
-  Standard_EXPORT GeomPlate_CurveConstraint(const Handle(Adaptor3d_HCurve)& Boundary, const Standard_Integer Tang, const Standard_Integer NPt = 10, const Standard_Real TolDist = 0.0001);
+  Standard_EXPORT GeomPlate_CurveConstraint(const Handle(Adaptor3d_HCurve)& Boundary, const Standard_Integer Order, const Standard_Integer NPt = 10, const Standard_Real TolDist = 0.0001, const Standard_Real TolAng = 0.01, const Standard_Real TolCurv = 0.1);
   
   //! Allows you to set the order of continuity required for
   //! the constraints: G0, G1, and G2, controlled