0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / BRepLProp / BRepLProp_CLProps.hxx
1 // Created on: 1994-02-24
2 // Created by: Laurent BOURESCHE
3 // Copyright (c) 1994-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 _BRepLProp_CLProps_HeaderFile
18 #define _BRepLProp_CLProps_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22
23 #include <BRepAdaptor_Curve.hxx>
24 #include <gp_Pnt.hxx>
25 #include <gp_Vec.hxx>
26 #include <gp_Dir.hxx>
27 #include <LProp_Status.hxx>
28 class LProp_BadContinuity;
29 class Standard_DomainError;
30 class Standard_OutOfRange;
31 class LProp_NotDefined;
32 class BRepAdaptor_Curve;
33 class gp_Vec;
34 class gp_Pnt;
35 class gp_Dir;
36 class BRepLProp_CurveTool;
37
38
39
40 class BRepLProp_CLProps 
41 {
42 public:
43
44   DEFINE_STANDARD_ALLOC
45
46   
47   //! Initializes the local properties of the curve <C>
48   //! The current point and the derivatives are
49   //! computed at the same time, which allows an
50   //! optimization of the computation time.
51   //! <N> indicates the maximum number of derivations to
52   //! be done (0, 1, 2 or 3). For example, to compute
53   //! only the tangent, N should be equal to 1.
54   //! <Resolution> is the linear tolerance (it is used to test
55   //! if a vector is null).
56   Standard_EXPORT BRepLProp_CLProps(const BRepAdaptor_Curve& C, const Standard_Integer N, const Standard_Real Resolution);
57   
58   //! Same as previous constructor but here the parameter is
59   //! set to the value <U>.
60   //! All the computations done will be related to <C> and <U>.
61   Standard_EXPORT BRepLProp_CLProps(const BRepAdaptor_Curve& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution);
62   
63   //! Same as previous constructor but here the parameter is
64   //! set to the value <U> and the curve is set
65   //! with SetCurve.
66   //! the curve can have a empty constructor
67   //! All the computations done will be related to <C> and <U>
68   //! when the functions "set" will be done.
69   Standard_EXPORT BRepLProp_CLProps(const Standard_Integer N, const Standard_Real Resolution);
70   
71   //! Initializes the local properties of the curve
72   //! for the parameter value <U>.
73   Standard_EXPORT void SetParameter (const Standard_Real U);
74   
75   //! Initializes the local properties of the curve
76   //! for the new curve.
77   Standard_EXPORT void SetCurve (const BRepAdaptor_Curve& C);
78   
79   //! Returns the Point.
80   Standard_EXPORT const gp_Pnt& Value() const;
81   
82   //! Returns the first derivative.
83   //! The derivative is computed if it has not been yet.
84   Standard_EXPORT const gp_Vec& D1();
85   
86   //! Returns the second derivative.
87   //! The derivative is computed if it has not been yet.
88   Standard_EXPORT const gp_Vec& D2();
89   
90   //! Returns the third derivative.
91   //! The derivative is computed if it has not been yet.
92   Standard_EXPORT const gp_Vec& D3();
93   
94   //! Returns True if the tangent is defined.
95   //! For example, the tangent is not defined if the
96   //! three first derivatives are all null.
97   Standard_EXPORT Standard_Boolean IsTangentDefined();
98   
99   //! output  the tangent direction <D>
100   Standard_EXPORT void Tangent (gp_Dir& D);
101   
102   //! Returns the curvature.
103   Standard_EXPORT Standard_Real Curvature();
104   
105   //! Returns the normal direction <N>.
106   Standard_EXPORT void Normal (gp_Dir& N);
107   
108   //! Returns the centre of curvature <P>.
109   Standard_EXPORT void CentreOfCurvature (gp_Pnt& P);
110
111
112
113
114 protected:
115
116
117
118
119
120 private:
121
122
123
124   BRepAdaptor_Curve myCurve;
125   Standard_Real myU;
126   Standard_Integer myDerOrder;
127   Standard_Real myCN;
128   Standard_Real myLinTol;
129   gp_Pnt myPnt;
130   gp_Vec myDerivArr[3];
131   gp_Dir myTangent;
132   Standard_Real myCurvature;
133   LProp_Status myTangentStatus;
134   Standard_Integer mySignificantFirstDerivativeOrder;
135
136
137 };
138
139
140
141
142
143
144
145 #endif // _BRepLProp_CLProps_HeaderFile