Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:42

0001 // Created on: 1997-05-05
0002 // Created by: Joelle CHAUVET
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _GeomPlate_CurveConstraint_HeaderFile
0018 #define _GeomPlate_CurveConstraint_HeaderFile
0019 
0020 #include <Adaptor3d_CurveOnSurface.hxx>
0021 #include <GeomLProp_SLProps.hxx>
0022 
0023 class Geom2d_Curve;
0024 class Law_Function;
0025 class gp_Pnt;
0026 class gp_Vec;
0027 
0028 class GeomPlate_CurveConstraint;
0029 DEFINE_STANDARD_HANDLE(GeomPlate_CurveConstraint, Standard_Transient)
0030 
0031 
0032 //! Defines curves as constraints to be used to deform a surface.
0033 class GeomPlate_CurveConstraint : public Standard_Transient
0034 {
0035 
0036 public:
0037 
0038   
0039 
0040   //! Initializes an empty curve constraint object.
0041   Standard_EXPORT GeomPlate_CurveConstraint();
0042   
0043   //! Create a constraint
0044   //! Order is the order of the constraint. The possible values for order are -1,0,1,2.
0045   //! Order i means constraints Gi
0046   //! Npt is the number of points associated with the constraint.
0047   //! TolDist is the maximum error to satisfy for G0 constraints
0048   //! TolAng is the maximum error to satisfy for G1 constraints
0049   //! TolCurv is the maximum error to satisfy for G2 constraints
0050   //! These errors can be replaced by laws of criterion.
0051   //! Raises    ConstructionError if Order is not -1 , 0,  1,  2
0052   Standard_EXPORT GeomPlate_CurveConstraint(const Handle(Adaptor3d_Curve)& 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);
0053   
0054   //! Allows you to set the order of continuity required for
0055   //! the constraints: G0, G1, and G2, controlled
0056   //! respectively by G0Criterion G1Criterion and G2Criterion.
0057   Standard_EXPORT void SetOrder (const Standard_Integer Order);
0058   
0059   //! Returns the order of constraint, one of G0, G1 or G2.
0060   Standard_EXPORT Standard_Integer Order() const;
0061   
0062   //! Returns the number of points on the curve used as a
0063   //! constraint. The default setting is 10. This parameter
0064   //! affects computation time, which increases by the cube of
0065   //! the number of points.
0066   Standard_EXPORT Standard_Integer NbPoints() const;
0067   
0068 
0069   //! Allows you to set the number of points on the curve
0070   //! constraint. The default setting is 10. This parameter
0071   //! affects computation time, which increases by the cube of
0072   //! the number of points.
0073   Standard_EXPORT void SetNbPoints (const Standard_Integer NewNb);
0074   
0075 
0076   //! Allows you to set the G0 criterion. This is the law
0077   //! defining the greatest distance allowed between the
0078   //! constraint and the target surface for each point of the
0079   //! constraint. If this criterion is not set, TolDist, the
0080   //! distance tolerance from the constructor, is used.
0081   Standard_EXPORT void SetG0Criterion (const Handle(Law_Function)& G0Crit);
0082   
0083 
0084   //! Allows you to set the G1 criterion. This is the law
0085   //! defining the greatest angle allowed between the
0086   //! constraint and the target surface. If this criterion is not
0087   //! set, TolAng, the angular tolerance from the constructor, is used.
0088   //! Raises  ConstructionError if  the  curve  is  not  on  a  surface
0089   Standard_EXPORT void SetG1Criterion (const Handle(Law_Function)& G1Crit);
0090   
0091   Standard_EXPORT void SetG2Criterion (const Handle(Law_Function)& G2Crit);
0092   
0093   //! Returns the G0 criterion at the parametric point U on
0094   //! the curve. This is the greatest distance allowed between
0095   //! the constraint and the target surface at U.
0096   Standard_EXPORT Standard_Real G0Criterion (const Standard_Real U) const;
0097   
0098   //! Returns the G1 criterion at the parametric point U on
0099   //! the curve. This is the greatest angle allowed between
0100   //! the constraint and the target surface at U.
0101   //! Raises  ConstructionError if  the  curve  is  not  on  a  surface
0102   Standard_EXPORT Standard_Real G1Criterion (const Standard_Real U) const;
0103   
0104   //! Returns the G2 criterion at the parametric point U on
0105   //! the curve. This is the greatest difference in curvature
0106   //! allowed between the constraint and the target surface at U.
0107   //! Raises  ConstructionError if  the  curve  is  not  on  a  surface
0108   Standard_EXPORT Standard_Real G2Criterion (const Standard_Real U) const;
0109   
0110   Standard_EXPORT Standard_Real FirstParameter() const;
0111   
0112   Standard_EXPORT Standard_Real LastParameter() const;
0113   
0114   Standard_EXPORT Standard_Real Length() const;
0115   
0116   Standard_EXPORT GeomLProp_SLProps& LPropSurf (const Standard_Real U);
0117   
0118   Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt& P) const;
0119   
0120   Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const;
0121   
0122   Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3, gp_Vec& V4, gp_Vec& V5) const;
0123   
0124   Standard_EXPORT Handle(Adaptor3d_Curve) Curve3d() const;
0125   
0126   //! loads a 2d curve associated the surface resulting of the constraints
0127   Standard_EXPORT void SetCurve2dOnSurf (const Handle(Geom2d_Curve)& Curve2d);
0128   
0129   //! Returns a 2d curve associated the surface resulting of the constraints
0130   Standard_EXPORT Handle(Geom2d_Curve) Curve2dOnSurf() const;
0131   
0132   //! loads a 2d curve  resulting from the normal projection of
0133   //! the curve on the initial surface
0134   Standard_EXPORT void SetProjectedCurve (const Handle(Adaptor2d_Curve2d)& Curve2d, const Standard_Real TolU, const Standard_Real TolV);
0135   
0136   //! Returns the projected curve resulting from the normal projection of the
0137   //! curve on the initial surface
0138   Standard_EXPORT Handle(Adaptor2d_Curve2d) ProjectedCurve() const;
0139 
0140 
0141 
0142 
0143   DEFINE_STANDARD_RTTIEXT(GeomPlate_CurveConstraint,Standard_Transient)
0144 
0145 protected:
0146 
0147 
0148   Handle(Adaptor3d_CurveOnSurface) myFrontiere;
0149   Standard_Integer myNbPoints;
0150   Standard_Integer myOrder;
0151   Handle(Adaptor3d_Curve) my3dCurve;
0152   Standard_Integer myTang;
0153   Handle(Geom2d_Curve) my2dCurve;
0154   Handle(Adaptor2d_Curve2d) myHCurve2d;
0155   Handle(Law_Function) myG0Crit;
0156   Handle(Law_Function) myG1Crit;
0157   Handle(Law_Function) myG2Crit;
0158   Standard_Boolean myConstG0;
0159   Standard_Boolean myConstG1;
0160   Standard_Boolean myConstG2;
0161   GeomLProp_SLProps myLProp;
0162   Standard_Real myTolDist;
0163   Standard_Real myTolAng;
0164   Standard_Real myTolCurv;
0165   Standard_Real myTolU;
0166   Standard_Real myTolV;
0167 
0168 };
0169 
0170 #endif // _GeomPlate_CurveConstraint_HeaderFile