42cf5bc1 |
1 | // Created on: 1997-12-19 |
2 | // Created by: Philippe MANGIN |
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 _GeomFill_CorrectedFrenet_HeaderFile |
18 | #define _GeomFill_CorrectedFrenet_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <gp_Vec.hxx> |
24 | #include <Standard_Boolean.hxx> |
25 | #include <TColStd_HArray1OfReal.hxx> |
26 | #include <TColgp_HArray1OfVec.hxx> |
27 | #include <GeomFill_TrihedronLaw.hxx> |
28 | #include <Standard_Real.hxx> |
29 | #include <TColStd_SequenceOfReal.hxx> |
30 | #include <TColgp_SequenceOfVec.hxx> |
31 | #include <Standard_Integer.hxx> |
32 | #include <GeomAbs_Shape.hxx> |
33 | #include <TColStd_Array1OfReal.hxx> |
34 | #include <GeomFill_Trihedron.hxx> |
35 | class GeomFill_Frenet; |
36 | class Law_Function; |
42cf5bc1 |
37 | |
38 | class GeomFill_CorrectedFrenet; |
39 | DEFINE_STANDARD_HANDLE(GeomFill_CorrectedFrenet, GeomFill_TrihedronLaw) |
40 | |
41 | //! Defined an Corrected Frenet Trihedron Law It is |
42 | //! like Frenet with an Torsion's minimization |
43 | class GeomFill_CorrectedFrenet : public GeomFill_TrihedronLaw |
44 | { |
45 | |
46 | public: |
47 | |
48 | |
49 | Standard_EXPORT GeomFill_CorrectedFrenet(); |
50 | |
51 | Standard_EXPORT GeomFill_CorrectedFrenet(const Standard_Boolean ForEvaluation); |
52 | |
53 | Standard_EXPORT virtual Handle(GeomFill_TrihedronLaw) Copy() const Standard_OVERRIDE; |
54 | |
c22b52d6 |
55 | Standard_EXPORT virtual void SetCurve (const Handle(Adaptor3d_Curve)& C) Standard_OVERRIDE; |
42cf5bc1 |
56 | |
57 | Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE; |
58 | |
59 | //! compute Triedrhon on curve at parameter <Param> |
60 | Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, gp_Vec& Tangent, gp_Vec& Normal, gp_Vec& BiNormal) Standard_OVERRIDE; |
61 | |
62 | //! compute Triedrhon and derivative Trihedron on curve |
63 | //! at parameter <Param> |
a25d5aaa |
64 | //! Warning : It used only for C1 or C2 approximation |
42cf5bc1 |
65 | Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, gp_Vec& Tangent, gp_Vec& DTangent, gp_Vec& Normal, gp_Vec& DNormal, gp_Vec& BiNormal, gp_Vec& DBiNormal) Standard_OVERRIDE; |
66 | |
67 | //! compute Trihedron on curve |
68 | //! first and seconde derivatives. |
a25d5aaa |
69 | //! Warning : It used only for C2 approximation |
42cf5bc1 |
70 | Standard_EXPORT virtual Standard_Boolean D2 (const Standard_Real Param, gp_Vec& Tangent, gp_Vec& DTangent, gp_Vec& D2Tangent, gp_Vec& Normal, gp_Vec& DNormal, gp_Vec& D2Normal, gp_Vec& BiNormal, gp_Vec& DBiNormal, gp_Vec& D2BiNormal) Standard_OVERRIDE; |
71 | |
72 | //! Returns the number of intervals for continuity |
73 | //! <S>. |
74 | //! May be one if Continuity(me) >= <S> |
75 | Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE; |
76 | |
77 | //! Stores in <T> the parameters bounding the intervals |
78 | //! of continuity <S>. |
79 | //! |
21c7c457 |
80 | //! The array must provide enough room to accommodate |
42cf5bc1 |
81 | //! for the parameters. i.e. T.Length() > NbIntervals() |
82 | Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE; |
83 | |
84 | //! Tries to define the best trihedron mode |
85 | //! for the curve. It can be: |
86 | //! - Frenet |
87 | //! - CorrectedFrenet |
88 | //! - DiscreteTrihedron |
89 | //! Warning: the CorrectedFrenet must be constructed |
90 | //! with option ForEvaluation = True, |
91 | //! the curve must be set by method SetCurve. |
92 | Standard_EXPORT GeomFill_Trihedron EvaluateBestMode(); |
93 | |
94 | //! Get average value of Tangent(t) and Normal(t) it is usfull to |
95 | //! make fast approximation of rational surfaces. |
96 | Standard_EXPORT virtual void GetAverageLaw (gp_Vec& ATangent, gp_Vec& ANormal, gp_Vec& ABiNormal) Standard_OVERRIDE; |
97 | |
98 | //! Say if the law is Constant. |
99 | Standard_EXPORT virtual Standard_Boolean IsConstant() const Standard_OVERRIDE; |
100 | |
101 | //! Return True. |
102 | Standard_EXPORT virtual Standard_Boolean IsOnlyBy3dCurve() const Standard_OVERRIDE; |
103 | |
104 | |
105 | |
106 | |
92efcf78 |
107 | DEFINE_STANDARD_RTTIEXT(GeomFill_CorrectedFrenet,GeomFill_TrihedronLaw) |
42cf5bc1 |
108 | |
109 | protected: |
110 | |
111 | |
112 | |
113 | |
114 | private: |
115 | |
116 | |
117 | Standard_EXPORT void Init(); |
118 | |
119 | //! Computes BSpline representation of Normal evolution at one |
120 | //! interval of continuity of Frenet. Returns True if FuncInt = 0 |
121 | Standard_EXPORT Standard_Boolean InitInterval (const Standard_Real First, const Standard_Real Last, const Standard_Real Step, Standard_Real& startAng, gp_Vec& prevTangent, gp_Vec& prevNormal, gp_Vec& aT, gp_Vec& aN, Handle(Law_Function)& FuncInt, TColStd_SequenceOfReal& SeqPoles, TColStd_SequenceOfReal& SeqAngle, TColgp_SequenceOfVec& SeqTangent, TColgp_SequenceOfVec& SeqNormal) const; |
122 | |
123 | //! Computes angle of Normal evolution of Frenet between any two points on the curve. |
124 | Standard_EXPORT Standard_Real CalcAngleAT (const gp_Vec& Tangent, const gp_Vec& Normal, const gp_Vec& prevTangent, const gp_Vec& prevNormal) const; |
125 | |
126 | //! Get corrected value of angle of Normal evolution of Frenet |
127 | Standard_EXPORT Standard_Real GetAngleAT (const Standard_Real P) const; |
128 | |
129 | Handle(GeomFill_Frenet) frenet; |
130 | Handle(Law_Function) EvolAroundT; |
131 | Handle(Law_Function) TLaw; |
132 | gp_Vec AT; |
133 | gp_Vec AN; |
134 | Standard_Boolean isFrenet; |
135 | Standard_Boolean myForEvaluation; |
136 | Handle(TColStd_HArray1OfReal) HArrPoles; |
137 | Handle(TColStd_HArray1OfReal) HArrAngle; |
138 | Handle(TColgp_HArray1OfVec) HArrTangent; |
139 | Handle(TColgp_HArray1OfVec) HArrNormal; |
140 | |
141 | |
142 | }; |
143 | |
144 | |
145 | |
146 | |
147 | |
148 | |
149 | |
150 | #endif // _GeomFill_CorrectedFrenet_HeaderFile |