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: Jerome LEMONIER
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_PointConstraint_HeaderFile
0018 #define _GeomPlate_PointConstraint_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <GeomLProp_SLProps.hxx>
0024 #include <gp_Pnt.hxx>
0025 #include <gp_Pnt2d.hxx>
0026 #include <gp_Vec.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <Standard_Transient.hxx>
0029 class Geom_Surface;
0030 
0031 
0032 class GeomPlate_PointConstraint;
0033 DEFINE_STANDARD_HANDLE(GeomPlate_PointConstraint, Standard_Transient)
0034 
0035 
0036 //! Defines points as constraints to be used to deform a surface.
0037 class GeomPlate_PointConstraint : public Standard_Transient
0038 {
0039 
0040 public:
0041 
0042   
0043   //! Constructs a point constraint object defined by  Pt, a 3D point
0044   //! Order gives the order of constraint, one of:
0045   //! -   -1 i.e. none, or 0 i.e.G0 when assigned to Pt
0046   //! -   -1 i.e. none, 0 i.e. G0, 1 i.e. G1, 2 i.e. G2 when
0047   //! assigned to U, V and Surf.
0048   //! In this constructor, only TolDist is given.
0049   //! Distance tolerance represents the greatest distance
0050   //! allowed between the constraint and the target surface.
0051   //! Angular tolerance represents the largest angle allowed
0052   //! between the constraint and the target surface. Curvature
0053   //! tolerance represents the greatest difference in curvature
0054   //! allowed between the constraint and the target surface.
0055   //! Raises   ConstructionError if Order  is  not  0  or  -1
0056   Standard_EXPORT GeomPlate_PointConstraint(const gp_Pnt& Pt, const Standard_Integer Order, const Standard_Real TolDist = 0.0001);
0057   
0058   //! Constructs a point constraint object defined by
0059   //! the intersection point of U and V on the surface Surf.
0060   //! Order gives the order of constraint, one of:
0061   //! -   -1 i.e. none, or 0 i.e.G0 when assigned to Pt
0062   //! -   -1 i.e. none, 0 i.e. G0, 1 i.e. G1, 2 i.e. G2 when
0063   //! assigned to U, V and Surf.
0064   //! In this constructor the surface to be generated must
0065   //! respect several tolerance values only:
0066   //! -   the distance tolerance TolDist
0067   //! -   the angular tolerance TolAng
0068   //! -   the curvature tolerance, TolCurv.
0069   //! Distance tolerance represents the greatest distance
0070   //! allowed between the constraint and the target surface.
0071   //! Angular tolerance represents the largest angle allowed
0072   //! between the constraint and the target surface. Curvature
0073   //! tolerance represents the greatest difference in curvature
0074   //! allowed between the constraint and the target surface.Creates a punctual constraint.
0075   Standard_EXPORT GeomPlate_PointConstraint(const Standard_Real U, const Standard_Real V, const Handle(Geom_Surface)& Surf, const Standard_Integer Order, const Standard_Real TolDist = 0.0001, const Standard_Real TolAng = 0.01, const Standard_Real TolCurv = 0.1);
0076   
0077   Standard_EXPORT void SetOrder (const Standard_Integer Order);
0078   
0079 
0080   //! Returns the order of constraint: G0, G1, and G2,
0081   //! controlled respectively by G0Criterion G1Criterion and G2Criterion.
0082   Standard_EXPORT Standard_Integer Order() const;
0083   
0084 
0085   //! Allows you to set the G0 criterion. This is the law
0086   //! defining the greatest distance allowed between the
0087   //! constraint and the target surface. If this criterion is not
0088   //! set, {TolDist, the distance tolerance from the constructor, is used
0089   Standard_EXPORT void SetG0Criterion (const Standard_Real TolDist);
0090   
0091 
0092   //! Allows you to set the G1 criterion. This is the law
0093   //! defining the greatest angle allowed between the
0094   //! constraint and the target surface. If this criterion is not
0095   //! set, TolAng, the angular tolerance from the constructor, is used.
0096   //! Raises   ConstructionError  if  the  point  is  not  on  the  surface
0097   Standard_EXPORT void SetG1Criterion (const Standard_Real TolAng);
0098   
0099 
0100   //! Allows you to set the G2 criterion. This is the law
0101   //! defining the greatest difference in curvature allowed
0102   //! between the constraint and the target surface. If this
0103   //! criterion is not set, TolCurv, the curvature tolerance from
0104   //! the constructor, is used.
0105   //! Raises   ConstructionError if  the  point  is  not  on  the  surface
0106   Standard_EXPORT void SetG2Criterion (const Standard_Real TolCurv);
0107   
0108 
0109   //! Returns the G0 criterion. This is the greatest distance
0110   //! allowed between the constraint and the target surface.
0111   Standard_EXPORT Standard_Real G0Criterion() const;
0112   
0113 
0114   //! Returns the G1 criterion. This is the greatest angle
0115   //! allowed between the constraint and the target surface.
0116   //! Raises   ConstructionError if  the  point  is  not  on  the  surface.
0117   Standard_EXPORT Standard_Real G1Criterion() const;
0118   
0119 
0120   //! Returns the G2 criterion. This is the greatest difference
0121   //! in curvature allowed between the constraint and the target surface.
0122   //! Raises   ConstructionError if  the  point  is  not  on  the  surface
0123   Standard_EXPORT Standard_Real G2Criterion() const;
0124   
0125   Standard_EXPORT void D0 (gp_Pnt& P) const;
0126   
0127   Standard_EXPORT void D1 (gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const;
0128   
0129   Standard_EXPORT void D2 (gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3, gp_Vec& V4, gp_Vec& V5) const;
0130   
0131   Standard_EXPORT Standard_Boolean HasPnt2dOnSurf() const;
0132   
0133   Standard_EXPORT void SetPnt2dOnSurf (const gp_Pnt2d& Pnt);
0134   
0135   Standard_EXPORT gp_Pnt2d Pnt2dOnSurf() const;
0136   
0137   Standard_EXPORT GeomLProp_SLProps& LPropSurf();
0138 
0139 
0140 
0141 
0142   DEFINE_STANDARD_RTTIEXT(GeomPlate_PointConstraint,Standard_Transient)
0143 
0144 protected:
0145 
0146 
0147   Standard_Integer myOrder;
0148 
0149 
0150 private:
0151 
0152 
0153   GeomLProp_SLProps myLProp;
0154   gp_Pnt myPoint;
0155   gp_Pnt2d myPt2d;
0156   Handle(Geom_Surface) mySurf;
0157   gp_Vec myD11;
0158   gp_Vec myD12;
0159   gp_Vec myD21;
0160   gp_Vec myD22;
0161   gp_Vec myD23;
0162   Standard_Real myU;
0163   Standard_Real myV;
0164   Standard_Real myTolDist;
0165   Standard_Real myTolAng;
0166   Standard_Real myTolCurv;
0167   Standard_Boolean hasPnt2dOnSurf;
0168 
0169 
0170 };
0171 
0172 
0173 
0174 
0175 
0176 
0177 
0178 #endif // _GeomPlate_PointConstraint_HeaderFile