summaryrefslogtreecommitdiff
path: root/inc/ChFiDS_Spine.hxx
blob: 215bb7d73815dabf6cd8db36388908863725aa9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _ChFiDS_Spine_HeaderFile
#define _ChFiDS_Spine_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_ChFiDS_Spine_HeaderFile
#include <Handle_ChFiDS_Spine.hxx>
#endif

#ifndef _BRepAdaptor_Curve_HeaderFile
#include <BRepAdaptor_Curve.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _ChFiDS_State_HeaderFile
#include <ChFiDS_State.hxx>
#endif
#ifndef _TopTools_SequenceOfShape_HeaderFile
#include <TopTools_SequenceOfShape.hxx>
#endif
#ifndef _Handle_TColStd_HArray1OfReal_HeaderFile
#include <Handle_TColStd_HArray1OfReal.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _ChFiDS_ListOfHElSpine_HeaderFile
#include <ChFiDS_ListOfHElSpine.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _gp_Pnt_HeaderFile
#include <gp_Pnt.hxx>
#endif
#ifndef _gp_Vec_HeaderFile
#include <gp_Vec.hxx>
#endif
#ifndef _ChFiDS_ErrorStatus_HeaderFile
#include <ChFiDS_ErrorStatus.hxx>
#endif
#ifndef _MMgt_TShared_HeaderFile
#include <MMgt_TShared.hxx>
#endif
#ifndef _Handle_ChFiDS_HElSpine_HeaderFile
#include <Handle_ChFiDS_HElSpine.hxx>
#endif
#ifndef _GeomAbs_CurveType_HeaderFile
#include <GeomAbs_CurveType.hxx>
#endif
class TColStd_HArray1OfReal;
class TopoDS_Edge;
class ChFiDS_HElSpine;
class ChFiDS_ListOfHElSpine;
class gp_Pnt;
class gp_Vec;
class BRepAdaptor_Curve;
class gp_Lin;
class gp_Circ;
class TopoDS_Vertex;


//! Contains information necessary for construction of <br>
//!          a 3D fillet : <br>
//! <br>
//! <br>
//!          - guideline composed of edges of the solid, tangents <br>
//!          between them, and borders by faces tangents <br>
//!          between them. <br>
//! <br>
//!          Tools for construction of the Sp <br>
//!          by propagation from an edge of solid <br>
//!          are provided in the Builder of Fil3d. <br>
//! <br>
//!          The Spine contains among others the <br>
//!          information about the nature of extremities <br>
//!          of the fillet ( on free border , on section or closed ). <br>
//! <br>
//!          IMPORTANT NOTE  :    the guideline <br>
//!          represented in this way is not C2, although the path <br>
//!          claims it. Several palliative workarounds <br>
//!          (see the methods at the end) are planned, <br>
//!          but they are not enough. It is necessary to change <br>
//!          the approach and double the Spine of line C2 with <br>
//!          the known consequences for management of <br>
//!          interactions between KPart Blend in Fil3d. <br>
class ChFiDS_Spine : public MMgt_TShared {

public:

  
  Standard_EXPORT   ChFiDS_Spine();
  
  Standard_EXPORT   ChFiDS_Spine(const Standard_Real Tol);
  //! store edges composing the guideline <br>
        void SetEdges(const TopoDS_Edge& E) ;
  //! store the edge at the first position before all others <br>
        void PutInFirst(const TopoDS_Edge& E) ;
  
        Standard_Integer NbEdges() const;
  
       const TopoDS_Edge& Edges(const Standard_Integer I) const;
  //! stores if the start of a set of edges starts on a <br>
//! section of free border or forms  a closed contour <br>
        void SetFirstStatus(const ChFiDS_State S) ;
  //! stores if the end of a set of edges starts on a <br>
//! section of free border or forms  a closed contour <br>
        void SetLastStatus(const ChFiDS_State S) ;
  
  Standard_EXPORT   virtual  void AppendElSpine(const Handle(ChFiDS_HElSpine)& Els) ;
  
  Standard_EXPORT     Handle_ChFiDS_HElSpine ElSpine(const Standard_Integer IE) const;
  
  Standard_EXPORT     Handle_ChFiDS_HElSpine ElSpine(const TopoDS_Edge& E) const;
  
  Standard_EXPORT     Handle_ChFiDS_HElSpine ElSpine(const Standard_Real W) const;
  
  Standard_EXPORT     ChFiDS_ListOfHElSpine& ChangeElSpines() ;
  
  Standard_EXPORT   virtual  void Reset(const Standard_Boolean AllData = Standard_False) ;
  
  Standard_EXPORT     Standard_Boolean SplitDone() const;
  
  Standard_EXPORT     void SplitDone(const Standard_Boolean B) ;
  //! prepare the guideline depending on the edges that <br>
//!          are elementary arks (take parameters from <br>
//!          a single curvilinear abscissa); to be able to call <br>
//!          methods on the geometry (first,last,value,d1,d2) <br>
//!          it is necessary to start with preparation otherwise an <br>
//!          exception will be raised <br>
  Standard_EXPORT     void Load() ;
  
  Standard_EXPORT     Standard_Real Resolution(const Standard_Real R3d) const;
  
  Standard_EXPORT     Standard_Boolean IsClosed() const;
  
  Standard_EXPORT     Standard_Real FirstParameter() const;
  
  Standard_EXPORT     Standard_Real LastParameter() const;
  
  Standard_EXPORT     void SetFirstParameter(const Standard_Real Par) ;
  
  Standard_EXPORT     void SetLastParameter(const Standard_Real Par) ;
  //! gives the total length of all arcs before the <br>
//!          number IndexSp <br>
  Standard_EXPORT     Standard_Real FirstParameter(const Standard_Integer IndexSpine) const;
  //! gives the total length till the ark with number <br>
//!          IndexSpine (inclus) <br>
  Standard_EXPORT     Standard_Real LastParameter(const Standard_Integer IndexSpine) const;
  //! gives the length of ark with number IndexSp <br>
  Standard_EXPORT     Standard_Real Length(const Standard_Integer IndexSpine) const;
  
  Standard_EXPORT     Standard_Boolean IsPeriodic() const;
  
  Standard_EXPORT     Standard_Real Period() const;
  
  Standard_EXPORT     Standard_Real Absc(const Standard_Real U) ;
  
  Standard_EXPORT     Standard_Real Absc(const Standard_Real U,const Standard_Integer I) ;
  
  Standard_EXPORT     void Parameter(const Standard_Real AbsC,Standard_Real& U,const Standard_Boolean Oriented = Standard_True) ;
  
  Standard_EXPORT     void Parameter(const Standard_Integer Index,const Standard_Real AbsC,Standard_Real& U,const Standard_Boolean Oriented = Standard_True) ;
  
  Standard_EXPORT     gp_Pnt Value(const Standard_Real AbsC) ;
  
  Standard_EXPORT     void D0(const Standard_Real AbsC,gp_Pnt& P) ;
  
  Standard_EXPORT     void D1(const Standard_Real AbsC,gp_Pnt& P,gp_Vec& V1) ;
  
  Standard_EXPORT     void D2(const Standard_Real AbsC,gp_Pnt& P,gp_Vec& V1,gp_Vec& V2) ;
  
  Standard_EXPORT     void SetCurrent(const Standard_Integer Index) ;
  //! sets the current curve and returns it <br>
  Standard_EXPORT    const BRepAdaptor_Curve& CurrentElementarySpine(const Standard_Integer Index) ;
  
        Standard_Integer CurrentIndexOfElementarySpine() const;
  
  Standard_EXPORT     GeomAbs_CurveType GetType() const;
  
  Standard_EXPORT     gp_Lin Line() const;
  
  Standard_EXPORT     gp_Circ Circle() const;
  //! returns if the set of edges starts on a free boundary <br>
//!          or if the first vertex is a breakpoint or if the set is <br>
//!          closed <br>
        ChFiDS_State FirstStatus() const;
  //! returns the state at the end of the set <br>
        ChFiDS_State LastStatus() const;
  
        ChFiDS_State Status(const Standard_Boolean IsFirst) const;
  
        void SetStatus(const ChFiDS_State S,const Standard_Boolean IsFirst) ;
  //!  returns   if the  set  of  edges starts (or   end) on <br>
//!          Tangency point. <br>
        Standard_Boolean IsTangencyExtremity(const Standard_Boolean IsFirst) const;
  
        void SetTangencyExtremity(const Standard_Boolean IsTangency,const Standard_Boolean IsFirst) ;
  
  Standard_EXPORT     Standard_Real Absc(const TopoDS_Vertex& V) const;
  
  Standard_EXPORT     TopoDS_Vertex FirstVertex() const;
  
  Standard_EXPORT     TopoDS_Vertex LastVertex() const;
  
  Standard_EXPORT     void SetFirstTgt(const Standard_Real W) ;
  
  Standard_EXPORT     void SetLastTgt(const Standard_Real W) ;
  
  Standard_EXPORT     Standard_Boolean HasFirstTgt() const;
  
  Standard_EXPORT     Standard_Boolean HasLastTgt() const;
  //! set a parameter reference for the approx. <br>
  Standard_EXPORT     void SetReference(const Standard_Real W) ;
  //! set  a  parameter  reference  for  the approx,  at the <br>
//!          middle  of edge I. <br>
  Standard_EXPORT     void SetReference(const Standard_Integer I) ;
  
  Standard_EXPORT     Standard_Integer Index(const Standard_Real W,const Standard_Boolean Forward = Standard_True) const;
  
  Standard_EXPORT     Standard_Integer Index(const TopoDS_Edge& E) const;
  
  Standard_EXPORT     void UnsetReference() ;
  
  Standard_EXPORT     void SetErrorStatus(const ChFiDS_ErrorStatus state) ;
  
  Standard_EXPORT     ChFiDS_ErrorStatus ErrorStatus() const;




  DEFINE_STANDARD_RTTI(ChFiDS_Spine)

protected:


Standard_Boolean splitdone;
ChFiDS_ListOfHElSpine elspines;


private: 

  
  Standard_EXPORT     void Prepare(Standard_Real& L,Standard_Integer& Index) const;

BRepAdaptor_Curve myCurve;
Standard_Integer indexofcurve;
ChFiDS_State firstState;
ChFiDS_State lastState;
TopTools_SequenceOfShape spine;
Handle_TColStd_HArray1OfReal abscissa;
Standard_Real tolesp;
Standard_Real firstparam;
Standard_Real lastparam;
Standard_Boolean firstprolon;
Standard_Boolean lastprolon;
Standard_Boolean firstistgt;
Standard_Boolean lastistgt;
Standard_Real firsttgtpar;
Standard_Real lasttgtpar;
Standard_Boolean hasfirsttgt;
Standard_Boolean haslasttgt;
gp_Pnt firstori;
gp_Pnt lastori;
gp_Vec firsttgt;
gp_Vec lasttgt;
Standard_Real valref;
Standard_Boolean hasref;
ChFiDS_ErrorStatus errorstate;


};


#include <ChFiDS_Spine.lxx>



// other Inline functions and methods (like "C++: function call" methods)


#endif