42cf5bc1 |
1 | // Created on: 1997-05-05 |
2 | // Created by: Jerome LEMONIER |
3 | // Copyright (c) 1997-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _GeomPlate_PointConstraint_HeaderFile |
18 | #define _GeomPlate_PointConstraint_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <GeomLProp_SLProps.hxx> |
24 | #include <gp_Pnt.hxx> |
25 | #include <gp_Pnt2d.hxx> |
26 | #include <gp_Vec.hxx> |
27 | #include <Standard_Real.hxx> |
28 | #include <Standard_Integer.hxx> |
29 | #include <Standard_Boolean.hxx> |
25e59720 |
30 | #include <Standard_Transient.hxx> |
42cf5bc1 |
31 | class Geom_Surface; |
32 | class Standard_ConstructionError; |
33 | class gp_Pnt; |
34 | class gp_Vec; |
35 | class gp_Pnt2d; |
36 | class GeomLProp_SLProps; |
37 | |
38 | |
39 | class GeomPlate_PointConstraint; |
25e59720 |
40 | DEFINE_STANDARD_HANDLE(GeomPlate_PointConstraint, Standard_Transient) |
42cf5bc1 |
41 | |
42 | |
43 | //! Defines points as constraints to be used to deform a surface. |
25e59720 |
44 | class GeomPlate_PointConstraint : public Standard_Transient |
42cf5bc1 |
45 | { |
46 | |
47 | public: |
48 | |
49 | |
50 | //! Constructs a point constraint object defined by Pt, a 3D point |
51 | //! Order gives the order of constraint, one of: |
52 | //! - -1 i.e. none, or 0 i.e.G0 when assigned to Pt |
53 | //! - -1 i.e. none, 0 i.e. G0, 1 i.e. G1, 2 i.e. G2 when |
54 | //! assigned to U, V and Surf. |
55 | //! In this constructor, only TolDist is given. |
56 | //! Distance tolerance represents the greatest distance |
57 | //! allowed between the constraint and the target surface. |
58 | //! Angular tolerance represents the largest angle allowed |
59 | //! between the constraint and the target surface. Curvature |
60 | //! tolerance represents the greatest difference in curvature |
61 | //! allowed between the constraint and the target surface. |
62 | //! Raises ConstructionError if Order is not 0 or -1 |
63 | Standard_EXPORT GeomPlate_PointConstraint(const gp_Pnt& Pt, const Standard_Integer Order, const Standard_Real TolDist = 0.0001); |
64 | |
65 | //! Constructs a point constraint object defined by |
66 | //! the intersection point of U and V on the surface Surf. |
67 | //! Order gives the order of constraint, one of: |
68 | //! - -1 i.e. none, or 0 i.e.G0 when assigned to Pt |
69 | //! - -1 i.e. none, 0 i.e. G0, 1 i.e. G1, 2 i.e. G2 when |
70 | //! assigned to U, V and Surf. |
71 | //! In this constructor the surface to be generated must |
72 | //! respect several tolerance values only: |
73 | //! - the distance tolerance TolDist |
74 | //! - the angular tolerance TolAng |
75 | //! - the curvature tolerance, TolCurv. |
76 | //! Distance tolerance represents the greatest distance |
77 | //! allowed between the constraint and the target surface. |
78 | //! Angular tolerance represents the largest angle allowed |
79 | //! between the constraint and the target surface. Curvature |
80 | //! tolerance represents the greatest difference in curvature |
81 | //! allowed between the constraint and the target surface.Creates a punctual constraint. |
82 | 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); |
83 | |
84 | Standard_EXPORT void SetOrder (const Standard_Integer Order); |
85 | |
86 | |
87 | //! Returns the order of constraint: G0, G1, and G2, |
88 | //! controlled respectively by G0Criterion G1Criterion and G2Criterion. |
89 | Standard_EXPORT Standard_Integer Order() const; |
90 | |
91 | |
92 | //! Allows you to set the G0 criterion. This is the law |
93 | //! defining the greatest distance allowed between the |
94 | //! constraint and the target surface. If this criterion is not |
95 | //! set, {TolDist, the distance tolerance from the constructor, is used |
96 | Standard_EXPORT void SetG0Criterion (const Standard_Real TolDist); |
97 | |
98 | |
99 | //! Allows you to set the G1 criterion. This is the law |
100 | //! defining the greatest angle allowed between the |
101 | //! constraint and the target surface. If this criterion is not |
102 | //! set, TolAng, the angular tolerance from the constructor, is used. |
103 | //! Raises ConstructionError if the point is not on the surface |
104 | Standard_EXPORT void SetG1Criterion (const Standard_Real TolAng); |
105 | |
106 | |
107 | //! Allows you to set the G2 criterion. This is the law |
108 | //! defining the greatest difference in curvature allowed |
109 | //! between the constraint and the target surface. If this |
110 | //! criterion is not set, TolCurv, the curvature tolerance from |
111 | //! the constructor, is used. |
112 | //! Raises ConstructionError if the point is not on the surface |
113 | Standard_EXPORT void SetG2Criterion (const Standard_Real TolCurv); |
114 | |
115 | |
116 | //! Returns the G0 criterion. This is the greatest distance |
117 | //! allowed between the constraint and the target surface. |
118 | Standard_EXPORT Standard_Real G0Criterion() const; |
119 | |
120 | |
121 | //! Returns the G1 criterion. This is the greatest angle |
122 | //! allowed between the constraint and the target surface. |
123 | //! Raises ConstructionError if the point is not on the surface. |
124 | Standard_EXPORT Standard_Real G1Criterion() const; |
125 | |
126 | |
127 | //! Returns the G2 criterion. This is the greatest difference |
128 | //! in curvature allowed between the constraint and the target surface. |
129 | //! Raises ConstructionError if the point is not on the surface |
130 | Standard_EXPORT Standard_Real G2Criterion() const; |
131 | |
132 | Standard_EXPORT void D0 (gp_Pnt& P) const; |
133 | |
134 | Standard_EXPORT void D1 (gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const; |
135 | |
136 | Standard_EXPORT void D2 (gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3, gp_Vec& V4, gp_Vec& V5) const; |
137 | |
138 | Standard_EXPORT Standard_Boolean HasPnt2dOnSurf() const; |
139 | |
140 | Standard_EXPORT void SetPnt2dOnSurf (const gp_Pnt2d& Pnt); |
141 | |
142 | Standard_EXPORT gp_Pnt2d Pnt2dOnSurf() const; |
143 | |
144 | Standard_EXPORT GeomLProp_SLProps& LPropSurf(); |
145 | |
146 | |
147 | |
148 | |
25e59720 |
149 | DEFINE_STANDARD_RTTIEXT(GeomPlate_PointConstraint,Standard_Transient) |
42cf5bc1 |
150 | |
151 | protected: |
152 | |
153 | |
154 | Standard_Integer myOrder; |
155 | |
156 | |
157 | private: |
158 | |
159 | |
160 | GeomLProp_SLProps myLProp; |
161 | gp_Pnt myPoint; |
162 | gp_Pnt2d myPt2d; |
163 | Handle(Geom_Surface) mySurf; |
164 | gp_Vec myD11; |
165 | gp_Vec myD12; |
166 | gp_Vec myD21; |
167 | gp_Vec myD22; |
168 | gp_Vec myD23; |
169 | Standard_Real myU; |
170 | Standard_Real myV; |
171 | Standard_Real myTolDist; |
172 | Standard_Real myTolAng; |
173 | Standard_Real myTolCurv; |
174 | Standard_Boolean hasPnt2dOnSurf; |
175 | |
176 | |
177 | }; |
178 | |
179 | |
180 | |
181 | |
182 | |
183 | |
184 | |
185 | #endif // _GeomPlate_PointConstraint_HeaderFile |