0028832: MMgt_TShared can be replaced by Standard_Transient
[occt.git] / src / ChFiDS / ChFiDS_SurfData.cxx
CommitLineData
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>
25e59720 22#include <Standard_Transient.hxx>
42cf5bc1 23#include <Standard_Type.hxx>
7fd59977 24
25e59720 25IMPLEMENT_STANDARD_RTTIEXT(ChFiDS_SurfData,Standard_Transient)
92efcf78 26
7fd59977 27ChFiDS_SurfData::ChFiDS_SurfData () :
28indexOfS1(0),indexOfS2(0),indexOfConge(0),
29isoncurv1(0),isoncurv2(0),twistons1(0),twistons2(0)
30{}
31
32//=======================================================================
33//function : Copy
34//purpose :
35//=======================================================================
36
37void ChFiDS_SurfData::Copy(const Handle(ChFiDS_SurfData)& Other)
38{
39indexOfS1 = Other->indexOfS1;
40indexOfS2 = Other->indexOfS2;
41indexOfConge = Other->indexOfConge;
42orientation = Other->orientation;
43intf1 = Other->intf1;
44intf2 = Other->intf2;
45
46pfirstOnS1 = Other->pfirstOnS1;
47plastOnS1 = Other->plastOnS1;
48pfirstOnS2 = Other->pfirstOnS2;
49plastOnS2 = Other->plastOnS2;
50
51ufspine = Other->ufspine;
52ulspine = Other->ulspine;
53
54simul = Other->simul;
55p2df1 = Other->p2df1;
56p2dl1 = Other->p2dl1;
57p2df2 = Other->p2df2;
58p2dl2 = Other->p2dl2;
59
60myfirstextend = Other->myfirstextend;
61mylastextend = Other->mylastextend;
62
63twistons1 = Other->twistons1;
64twistons2 = Other->twistons2;
65}
66
67//=======================================================================
68//function : Index
69//purpose :
70//=======================================================================
71
72Standard_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
83const 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
96ChFiDS_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
109const 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
124ChFiDS_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
139Standard_Real ChFiDS_SurfData::FirstSpineParam()const
140{
141 return ufspine;
142}
143
144//=======================================================================
145//function : LastSpineParam
146//purpose :
147//=======================================================================
148
149Standard_Real ChFiDS_SurfData::LastSpineParam()const
150{
151 return ulspine;
152}
153
154//=======================================================================
155//function : FirstSpineParam
156//purpose :
157//=======================================================================
158
159void ChFiDS_SurfData::FirstSpineParam(const Standard_Real Par)
160{
161 ufspine = Par;
162}
163
164//=======================================================================
165//function : LastSpineParam
166//purpose :
167//=======================================================================
168
169void ChFiDS_SurfData::LastSpineParam(const Standard_Real Par)
170{
171 ulspine = Par;
172}
173
174//=======================================================================
175//function : FirstExtensionValue
176//purpose :
177//=======================================================================
178
179Standard_Real ChFiDS_SurfData::FirstExtensionValue()const
180{
181 return myfirstextend;
182}
183
184//=======================================================================
185//function : LastExtensionValue
186//purpose :
187//=======================================================================
188
189Standard_Real ChFiDS_SurfData::LastExtensionValue()const
190{
191 return mylastextend;
192}
193
194//=======================================================================
195//function : FirstExtensionValue
196//purpose :
197//=======================================================================
198
199void ChFiDS_SurfData::FirstExtensionValue(const Standard_Real Extend)
200{
201 myfirstextend=Extend;
202}
203
204//=======================================================================
205//function : LastExtensionValue
206//purpose :
207//=======================================================================
208
209void ChFiDS_SurfData::LastExtensionValue(const Standard_Real Extend)
210{
211 mylastextend=Extend;
212}
213
214//=======================================================================
215//function : Simul
216//purpose :
217//=======================================================================
218
25e59720 219Handle(Standard_Transient) ChFiDS_SurfData::Simul() const
7fd59977 220{
221 return simul;
222}
223
224
225//=======================================================================
226//function : SetSimul
227//purpose :
228//=======================================================================
229
25e59720 230void ChFiDS_SurfData::SetSimul(const Handle(Standard_Transient)& S)
7fd59977 231{
232 simul = S;
233}
234
235//=======================================================================
236//function : ResetSimul
237//purpose :
238//=======================================================================
239
240void ChFiDS_SurfData::ResetSimul()
241{
242 simul.Nullify();
243}
244
245
246//=======================================================================
247//function : Get2dPoints
248//purpose :
249//=======================================================================
250
251void 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
267gp_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
282void 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