1 // Created on: 1996-08-09
2 // Created by: Herve LOUESSARD
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _LocalAnalysis_CurveContinuity_HeaderFile
18 #define _LocalAnalysis_CurveContinuity_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <GeomAbs_Shape.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <LocalAnalysis_StatusErrorType.hxx>
28 class StdFail_NotDone;
30 class GeomLProp_CLProps;
34 //! This class gives tools to check local continuity C0
35 //! C1 C2 G1 G2 between two points situated on two curves
36 class LocalAnalysis_CurveContinuity
44 //! -u1 is the parameter of the point on Curv1
45 //! -u2 is the parameter of the point on Curv2
46 //! -Order is the required continuity:
47 //! GeomAbs_C0 GeomAbs_C1 GeomAbs_C2
48 //! GeomAbs_G1 GeomAbs_G2
50 //! -EpsNul is used to detect a a vector with nul
53 //! -EpsC0 is used for C0 continuity to confuse two
56 //! -EpsC1 is an angular tolerance in radians used
57 //! for C1 continuity to compare the angle between
58 //! the first derivatives
60 //! -EpsC2 is an angular tolerance in radians used
61 //! for C2 continuity to compare the angle between
62 //! the second derivatives
64 //! -EpsG1 is an angular tolerance in radians used
65 //! for G1 continuity to compare the angle between
68 //! -EpsG2 is an angular tolerance in radians used
69 //! for G2 continuity to compare the angle between
72 //! - percent : percentage of curvature variation (unitless)
73 //! used for G2 continuity
75 //! - Maxlen is the maximum length of Curv1 or Curv2 in
76 //! meters used to detect nul curvature (in mm)
78 //! the constructor computes the quantities which are
79 //! necessary to check the continuity in the following cases:
83 //! - the distance between P1 and P2 with P1=Curv1 (u1) and
89 //! - the angle between the first derivatives
90 //! dCurv1(u1) dCurv2(u2)
91 //! -------- and ---------
94 //! - the ratio between the magnitudes of the first
97 //! the angle value is between 0 and PI/2
101 //! - the angle between the second derivatives
103 //! d Curv1(u1) d Curv2(u2)
104 //! ---------- ----------
108 //! the angle value is between 0 and PI/2
110 //! - the ratio between the magnitudes of the second
115 //! the angle between the tangents at each point
117 //! the angle value is between 0 and PI/2
121 //! -the angle between the normals at each point
123 //! the angle value is between 0 and PI/2
125 //! - the relative variation of curvature:
126 //! |curvat1-curvat2|
127 //! ------------------
129 //! (curvat1*curvat2)
131 //! where curvat1 is the curvature at the first point
132 //! and curvat2 the curvature at the second point
133 Standard_EXPORT LocalAnalysis_CurveContinuity(const Handle(Geom_Curve)& Curv1, const Standard_Real u1, const Handle(Geom_Curve)& Curv2, const Standard_Real u2, const GeomAbs_Shape Order, const Standard_Real EpsNul = 0.001, const Standard_Real EpsC0 = 0.001, const Standard_Real EpsC1 = 0.001, const Standard_Real EpsC2 = 0.001, const Standard_Real EpsG1 = 0.001, const Standard_Real EpsG2 = 0.001, const Standard_Real Percent = 0.01, const Standard_Real Maxlen = 10000);
135 Standard_EXPORT Standard_Boolean IsDone() const;
137 Standard_EXPORT LocalAnalysis_StatusErrorType StatusError() const;
139 Standard_EXPORT GeomAbs_Shape ContinuityStatus() const;
141 Standard_EXPORT Standard_Real C0Value() const;
143 Standard_EXPORT Standard_Real C1Angle() const;
145 Standard_EXPORT Standard_Real C1Ratio() const;
147 Standard_EXPORT Standard_Real C2Angle() const;
149 Standard_EXPORT Standard_Real C2Ratio() const;
151 Standard_EXPORT Standard_Real G1Angle() const;
153 Standard_EXPORT Standard_Real G2Angle() const;
155 Standard_EXPORT Standard_Real G2CurvatureVariation() const;
157 Standard_EXPORT Standard_Boolean IsC0() const;
159 Standard_EXPORT Standard_Boolean IsC1() const;
161 Standard_EXPORT Standard_Boolean IsC2() const;
163 Standard_EXPORT Standard_Boolean IsG1() const;
165 Standard_EXPORT Standard_Boolean IsG2() const;
179 Standard_EXPORT void CurvC0 (GeomLProp_CLProps& Curv1, GeomLProp_CLProps& Curv2);
181 Standard_EXPORT void CurvC1 (GeomLProp_CLProps& Curv1, GeomLProp_CLProps& Curv2);
183 Standard_EXPORT void CurvC2 (GeomLProp_CLProps& Curv1, GeomLProp_CLProps& Curv2);
185 Standard_EXPORT void CurvG1 (GeomLProp_CLProps& Curv1, GeomLProp_CLProps& Curv2);
187 Standard_EXPORT void CurvG2 (GeomLProp_CLProps& Curv1, GeomLProp_CLProps& Curv2);
190 Standard_Real myContC0;
191 Standard_Real myContC1;
192 Standard_Real myContC2;
193 Standard_Real myContG1;
194 Standard_Real myContG2;
195 Standard_Real myCourbC1;
196 Standard_Real myCourbC2;
197 Standard_Real myG2Variation;
198 Standard_Real myLambda1;
199 Standard_Real myLambda2;
200 GeomAbs_Shape myTypeCont;
201 Standard_Real myepsnul;
202 Standard_Real myepsC0;
203 Standard_Real myepsC1;
204 Standard_Real myepsC2;
205 Standard_Real myepsG1;
206 Standard_Real myepsG2;
207 Standard_Real myMaxLon;
208 Standard_Real myperce;
209 Standard_Boolean myIsDone;
210 LocalAnalysis_StatusErrorType myErrorStatus;
221 #endif // _LocalAnalysis_CurveContinuity_HeaderFile