0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
[occt.git] / src / ChFiDS / ChFiDS_SurfData.cxx
1 // Created on: 1993-11-29
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1993-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
18 #include <ChFiDS_CommonPoint.hxx>
19 #include <ChFiDS_FaceInterference.hxx>
20 #include <ChFiDS_SurfData.hxx>
21 #include <gp_Pnt2d.hxx>
22 #include <MMgt_TShared.hxx>
23 #include <Standard_Type.hxx>
24
25 IMPLEMENT_STANDARD_RTTIEXT(ChFiDS_SurfData,MMgt_TShared)
26
27 ChFiDS_SurfData::ChFiDS_SurfData () : 
28 indexOfS1(0),indexOfS2(0),indexOfConge(0),
29 isoncurv1(0),isoncurv2(0),twistons1(0),twistons2(0)
30 {}
31
32 //=======================================================================
33 //function : Copy
34 //purpose  : 
35 //=======================================================================
36
37 void ChFiDS_SurfData::Copy(const Handle(ChFiDS_SurfData)& Other)
38 {
39 indexOfS1    = Other->indexOfS1;
40 indexOfS2    = Other->indexOfS2;
41 indexOfConge = Other->indexOfConge;
42 orientation  = Other->orientation;
43 intf1        = Other->intf1;
44 intf2        = Other->intf2;
45
46 pfirstOnS1   = Other->pfirstOnS1;
47 plastOnS1    = Other->plastOnS1; 
48 pfirstOnS2   = Other->pfirstOnS2;   
49 plastOnS2    = Other->plastOnS2;  
50
51 ufspine      = Other->ufspine;
52 ulspine      = Other->ulspine;
53
54 simul        = Other->simul; 
55 p2df1        = Other->p2df1;
56 p2dl1        = Other->p2dl1;
57 p2df2        = Other->p2df2; 
58 p2dl2        = Other->p2dl2;
59
60 myfirstextend = Other->myfirstextend;
61 mylastextend  = Other->mylastextend;
62
63 twistons1 = Other->twistons1;
64 twistons2 = Other->twistons2;
65 }
66
67 //=======================================================================
68 //function : Index
69 //purpose  : 
70 //=======================================================================
71
72 Standard_Integer ChFiDS_SurfData::Index(const Standard_Integer OfS) const
73 {
74   if(OfS == 1) return indexOfS1;
75   else return indexOfS2;
76 }
77
78 //=======================================================================
79 //function : Interference
80 //purpose  : 
81 //=======================================================================
82
83 const ChFiDS_FaceInterference& ChFiDS_SurfData::Interference
84 (const Standard_Integer OnS) const
85 {
86   if(OnS == 1) return intf1;
87   else return intf2;
88 }
89
90
91 //=======================================================================
92 //function : Interference
93 //purpose  : 
94 //=======================================================================
95
96 ChFiDS_FaceInterference& ChFiDS_SurfData::ChangeInterference
97 (const Standard_Integer OnS)
98 {
99   if(OnS == 1) return intf1;
100   else return intf2;
101 }
102
103
104 //=======================================================================
105 //function : Vertex
106 //purpose  : 
107 //=======================================================================
108
109 const ChFiDS_CommonPoint&  ChFiDS_SurfData::Vertex
110 (const Standard_Boolean First,const Standard_Integer OnS) const
111 {
112   if(First && OnS == 1) return pfirstOnS1;
113   else if(First && OnS == 2) return pfirstOnS2;
114   else if(!First && OnS == 1) return plastOnS1;
115   else return plastOnS2;
116 }
117
118
119 //=======================================================================
120 //function : ChangeVertex
121 //purpose  : 
122 //=======================================================================
123
124 ChFiDS_CommonPoint&  ChFiDS_SurfData::ChangeVertex
125 (const Standard_Boolean First,const Standard_Integer OnS)
126 {
127   if(First && OnS == 1) return pfirstOnS1;
128   else if(First && OnS == 2) return pfirstOnS2;
129   else if(!First && OnS == 1) return plastOnS1;
130   else return plastOnS2;
131 }
132
133
134 //=======================================================================
135 //function : FirstSpineParam
136 //purpose  : 
137 //=======================================================================
138
139 Standard_Real ChFiDS_SurfData::FirstSpineParam()const
140 {
141   return ufspine;
142 }
143
144 //=======================================================================
145 //function : LastSpineParam
146 //purpose  : 
147 //=======================================================================
148
149 Standard_Real ChFiDS_SurfData::LastSpineParam()const
150 {
151   return ulspine;
152 }
153
154 //=======================================================================
155 //function : FirstSpineParam
156 //purpose  : 
157 //=======================================================================
158
159 void ChFiDS_SurfData::FirstSpineParam(const Standard_Real Par)
160 {
161   ufspine = Par;
162 }
163
164 //=======================================================================
165 //function : LastSpineParam
166 //purpose  : 
167 //=======================================================================
168
169 void ChFiDS_SurfData::LastSpineParam(const Standard_Real Par)
170 {
171   ulspine = Par;
172 }
173
174 //=======================================================================
175 //function : FirstExtensionValue
176 //purpose  : 
177 //=======================================================================
178
179 Standard_Real ChFiDS_SurfData::FirstExtensionValue()const
180 {
181   return myfirstextend;
182 }
183
184 //=======================================================================
185 //function : LastExtensionValue
186 //purpose  : 
187 //=======================================================================
188
189 Standard_Real ChFiDS_SurfData::LastExtensionValue()const
190 {
191   return mylastextend;
192 }
193
194 //=======================================================================
195 //function : FirstExtensionValue
196 //purpose  : 
197 //=======================================================================
198
199 void ChFiDS_SurfData::FirstExtensionValue(const Standard_Real Extend)
200 {
201   myfirstextend=Extend;
202 }
203
204 //=======================================================================
205 //function : LastExtensionValue
206 //purpose  : 
207 //=======================================================================
208
209 void ChFiDS_SurfData::LastExtensionValue(const Standard_Real Extend)
210 {
211   mylastextend=Extend;
212 }
213
214 //=======================================================================
215 //function : Simul
216 //purpose  : 
217 //=======================================================================
218
219 Handle(MMgt_TShared) ChFiDS_SurfData::Simul() const 
220 {
221   return simul;
222 }
223
224
225 //=======================================================================
226 //function : SetSimul
227 //purpose  : 
228 //=======================================================================
229
230 void ChFiDS_SurfData::SetSimul(const Handle(MMgt_TShared)& S)
231 {
232   simul = S;
233 }
234
235 //=======================================================================
236 //function : ResetSimul
237 //purpose  : 
238 //=======================================================================
239
240 void ChFiDS_SurfData::ResetSimul()
241 {
242   simul.Nullify();
243 }
244
245
246 //=======================================================================
247 //function : Get2dPoints
248 //purpose  : 
249 //=======================================================================
250
251 void ChFiDS_SurfData::Get2dPoints(gp_Pnt2d& P2df1,
252                                   gp_Pnt2d& P2dl1,
253                                   gp_Pnt2d& P2df2,
254                                   gp_Pnt2d& P2dl2) const 
255 {
256   P2df1 = p2df1;
257   P2dl1 = p2dl1;
258   P2df2 = p2df2;
259   P2dl2 = p2dl2;
260 }
261
262 //=======================================================================
263 //function : Get2dPoints
264 //purpose  : 
265 //=======================================================================
266
267 gp_Pnt2d ChFiDS_SurfData::Get2dPoints(const Standard_Boolean First,
268                                       const Standard_Integer OnS) const 
269
270 {
271   if(First && OnS == 1) return p2df1;
272   else if(!First && OnS == 1) return p2dl1;
273   else if(First && OnS == 2) return p2df2;
274   return p2dl2;
275 }
276
277 //=======================================================================
278 //function : Set2dPoints
279 //purpose  : 
280 //=======================================================================
281
282 void ChFiDS_SurfData::Set2dPoints(const gp_Pnt2d& P2df1,
283                                   const gp_Pnt2d& P2dl1,
284                                   const gp_Pnt2d& P2df2,
285                                   const gp_Pnt2d& P2dl2)
286 {
287   p2df1 = P2df1;
288   p2dl1 = P2dl1;
289   p2df2 = P2df2;
290   p2dl2 = P2dl2;
291 }
292