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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
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>
25 IMPLEMENT_STANDARD_RTTIEXT(ChFiDS_SurfData,MMgt_TShared)
27 ChFiDS_SurfData::ChFiDS_SurfData () :
28 indexOfS1(0),indexOfS2(0),indexOfConge(0),
29 isoncurv1(0),isoncurv2(0),twistons1(0),twistons2(0)
32 //=======================================================================
35 //=======================================================================
37 void ChFiDS_SurfData::Copy(const Handle(ChFiDS_SurfData)& Other)
39 indexOfS1 = Other->indexOfS1;
40 indexOfS2 = Other->indexOfS2;
41 indexOfConge = Other->indexOfConge;
42 orientation = Other->orientation;
46 pfirstOnS1 = Other->pfirstOnS1;
47 plastOnS1 = Other->plastOnS1;
48 pfirstOnS2 = Other->pfirstOnS2;
49 plastOnS2 = Other->plastOnS2;
51 ufspine = Other->ufspine;
52 ulspine = Other->ulspine;
60 myfirstextend = Other->myfirstextend;
61 mylastextend = Other->mylastextend;
63 twistons1 = Other->twistons1;
64 twistons2 = Other->twistons2;
67 //=======================================================================
70 //=======================================================================
72 Standard_Integer ChFiDS_SurfData::Index(const Standard_Integer OfS) const
74 if(OfS == 1) return indexOfS1;
75 else return indexOfS2;
78 //=======================================================================
79 //function : Interference
81 //=======================================================================
83 const ChFiDS_FaceInterference& ChFiDS_SurfData::Interference
84 (const Standard_Integer OnS) const
86 if(OnS == 1) return intf1;
91 //=======================================================================
92 //function : Interference
94 //=======================================================================
96 ChFiDS_FaceInterference& ChFiDS_SurfData::ChangeInterference
97 (const Standard_Integer OnS)
99 if(OnS == 1) return intf1;
104 //=======================================================================
107 //=======================================================================
109 const ChFiDS_CommonPoint& ChFiDS_SurfData::Vertex
110 (const Standard_Boolean First,const Standard_Integer OnS) const
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;
119 //=======================================================================
120 //function : ChangeVertex
122 //=======================================================================
124 ChFiDS_CommonPoint& ChFiDS_SurfData::ChangeVertex
125 (const Standard_Boolean First,const Standard_Integer OnS)
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;
134 //=======================================================================
135 //function : FirstSpineParam
137 //=======================================================================
139 Standard_Real ChFiDS_SurfData::FirstSpineParam()const
144 //=======================================================================
145 //function : LastSpineParam
147 //=======================================================================
149 Standard_Real ChFiDS_SurfData::LastSpineParam()const
154 //=======================================================================
155 //function : FirstSpineParam
157 //=======================================================================
159 void ChFiDS_SurfData::FirstSpineParam(const Standard_Real Par)
164 //=======================================================================
165 //function : LastSpineParam
167 //=======================================================================
169 void ChFiDS_SurfData::LastSpineParam(const Standard_Real Par)
174 //=======================================================================
175 //function : FirstExtensionValue
177 //=======================================================================
179 Standard_Real ChFiDS_SurfData::FirstExtensionValue()const
181 return myfirstextend;
184 //=======================================================================
185 //function : LastExtensionValue
187 //=======================================================================
189 Standard_Real ChFiDS_SurfData::LastExtensionValue()const
194 //=======================================================================
195 //function : FirstExtensionValue
197 //=======================================================================
199 void ChFiDS_SurfData::FirstExtensionValue(const Standard_Real Extend)
201 myfirstextend=Extend;
204 //=======================================================================
205 //function : LastExtensionValue
207 //=======================================================================
209 void ChFiDS_SurfData::LastExtensionValue(const Standard_Real Extend)
214 //=======================================================================
217 //=======================================================================
219 Handle(MMgt_TShared) ChFiDS_SurfData::Simul() const
225 //=======================================================================
226 //function : SetSimul
228 //=======================================================================
230 void ChFiDS_SurfData::SetSimul(const Handle(MMgt_TShared)& S)
235 //=======================================================================
236 //function : ResetSimul
238 //=======================================================================
240 void ChFiDS_SurfData::ResetSimul()
246 //=======================================================================
247 //function : Get2dPoints
249 //=======================================================================
251 void ChFiDS_SurfData::Get2dPoints(gp_Pnt2d& P2df1,
254 gp_Pnt2d& P2dl2) const
262 //=======================================================================
263 //function : Get2dPoints
265 //=======================================================================
267 gp_Pnt2d ChFiDS_SurfData::Get2dPoints(const Standard_Boolean First,
268 const Standard_Integer OnS) const
271 if(First && OnS == 1) return p2df1;
272 else if(!First && OnS == 1) return p2dl1;
273 else if(First && OnS == 2) return p2df2;
277 //=======================================================================
278 //function : Set2dPoints
280 //=======================================================================
282 void ChFiDS_SurfData::Set2dPoints(const gp_Pnt2d& P2df1,
283 const gp_Pnt2d& P2dl1,
284 const gp_Pnt2d& P2df2,
285 const gp_Pnt2d& P2dl2)