//---------------------------------------------------------
// 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.;
myG1Crit.Nullify();
myG2Crit.Nullify();
}
+
//---------------------------------------------------------
// Fonction : FirstParameter
//---------------------------------------------------------
//! 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