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