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 <Standard_Transient.hxx>
23 #include <Standard_Type.hxx>
25 IMPLEMENT_STANDARD_RTTIEXT(ChFiDS_SurfData,Standard_Transient)
27 ChFiDS_SurfData::ChFiDS_SurfData()
37 isoncurv1 (Standard_False),
38 isoncurv2 (Standard_False),
39 twistons1 (Standard_False),
40 twistons2 (Standard_False),
41 orientation (TopAbs_FORWARD)
45 //=======================================================================
48 //=======================================================================
50 void ChFiDS_SurfData::Copy(const Handle(ChFiDS_SurfData)& Other)
52 indexOfS1 = Other->indexOfS1;
53 indexOfS2 = Other->indexOfS2;
54 indexOfConge = Other->indexOfConge;
55 orientation = Other->orientation;
59 pfirstOnS1 = Other->pfirstOnS1;
60 plastOnS1 = Other->plastOnS1;
61 pfirstOnS2 = Other->pfirstOnS2;
62 plastOnS2 = Other->plastOnS2;
64 ufspine = Other->ufspine;
65 ulspine = Other->ulspine;
73 myfirstextend = Other->myfirstextend;
74 mylastextend = Other->mylastextend;
76 twistons1 = Other->twistons1;
77 twistons2 = Other->twistons2;
80 //=======================================================================
83 //=======================================================================
85 Standard_Integer ChFiDS_SurfData::Index(const Standard_Integer OfS) const
87 if(OfS == 1) return indexOfS1;
88 else return indexOfS2;
91 //=======================================================================
92 //function : Interference
94 //=======================================================================
96 const ChFiDS_FaceInterference& ChFiDS_SurfData::Interference
97 (const Standard_Integer OnS) const
99 if(OnS == 1) return intf1;
104 //=======================================================================
105 //function : Interference
107 //=======================================================================
109 ChFiDS_FaceInterference& ChFiDS_SurfData::ChangeInterference
110 (const Standard_Integer OnS)
112 if(OnS == 1) return intf1;
117 //=======================================================================
120 //=======================================================================
122 const ChFiDS_CommonPoint& ChFiDS_SurfData::Vertex
123 (const Standard_Boolean First,const Standard_Integer OnS) const
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;
132 //=======================================================================
133 //function : ChangeVertex
135 //=======================================================================
137 ChFiDS_CommonPoint& ChFiDS_SurfData::ChangeVertex
138 (const Standard_Boolean First,const Standard_Integer OnS)
140 if(First && OnS == 1) return pfirstOnS1;
141 else if(First && OnS == 2) return pfirstOnS2;
142 else if(!First && OnS == 1) return plastOnS1;
143 else return plastOnS2;
147 //=======================================================================
148 //function : FirstSpineParam
150 //=======================================================================
152 Standard_Real ChFiDS_SurfData::FirstSpineParam()const
157 //=======================================================================
158 //function : LastSpineParam
160 //=======================================================================
162 Standard_Real ChFiDS_SurfData::LastSpineParam()const
167 //=======================================================================
168 //function : FirstSpineParam
170 //=======================================================================
172 void ChFiDS_SurfData::FirstSpineParam(const Standard_Real Par)
177 //=======================================================================
178 //function : LastSpineParam
180 //=======================================================================
182 void ChFiDS_SurfData::LastSpineParam(const Standard_Real Par)
187 //=======================================================================
188 //function : FirstExtensionValue
190 //=======================================================================
192 Standard_Real ChFiDS_SurfData::FirstExtensionValue()const
194 return myfirstextend;
197 //=======================================================================
198 //function : LastExtensionValue
200 //=======================================================================
202 Standard_Real ChFiDS_SurfData::LastExtensionValue()const
207 //=======================================================================
208 //function : FirstExtensionValue
210 //=======================================================================
212 void ChFiDS_SurfData::FirstExtensionValue(const Standard_Real Extend)
214 myfirstextend=Extend;
217 //=======================================================================
218 //function : LastExtensionValue
220 //=======================================================================
222 void ChFiDS_SurfData::LastExtensionValue(const Standard_Real Extend)
227 //=======================================================================
230 //=======================================================================
232 Handle(Standard_Transient) ChFiDS_SurfData::Simul() const
238 //=======================================================================
239 //function : SetSimul
241 //=======================================================================
243 void ChFiDS_SurfData::SetSimul(const Handle(Standard_Transient)& S)
248 //=======================================================================
249 //function : ResetSimul
251 //=======================================================================
253 void ChFiDS_SurfData::ResetSimul()
259 //=======================================================================
260 //function : Get2dPoints
262 //=======================================================================
264 void ChFiDS_SurfData::Get2dPoints(gp_Pnt2d& P2df1,
267 gp_Pnt2d& P2dl2) const
275 //=======================================================================
276 //function : Get2dPoints
278 //=======================================================================
280 gp_Pnt2d ChFiDS_SurfData::Get2dPoints(const Standard_Boolean First,
281 const Standard_Integer OnS) const
284 if(First && OnS == 1) return p2df1;
285 else if(!First && OnS == 1) return p2dl1;
286 else if(First && OnS == 2) return p2df2;
290 //=======================================================================
291 //function : Set2dPoints
293 //=======================================================================
295 void ChFiDS_SurfData::Set2dPoints(const gp_Pnt2d& P2df1,
296 const gp_Pnt2d& P2dl1,
297 const gp_Pnt2d& P2df2,
298 const gp_Pnt2d& P2dl2)