0028832: MMgt_TShared can be replaced by Standard_Transient
[occt.git] / src / ChFiDS / ChFiDS_Stripe.cxx
CommitLineData
b311480e 1// Created on: 1994-03-09
2// Created by: Isabelle GRIGNON
3// Copyright (c) 1994-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_Spine.hxx>
19#include <ChFiDS_Stripe.hxx>
20#include <Geom2d_Curve.hxx>
21#include <Standard_Type.hxx>
7fd59977 22
25e59720 23IMPLEMENT_STANDARD_RTTIEXT(ChFiDS_Stripe,Standard_Transient)
92efcf78 24
7fd59977 25ChFiDS_Stripe::ChFiDS_Stripe ():
26 begfilled(/*Standard_False*/0), // eap, Apr 29 2002, occ293
27 endfilled(/*Standard_False*/0),
28 orcurv1(TopAbs_FORWARD),
29 orcurv2(TopAbs_FORWARD)
30{}
31
32void ChFiDS_Stripe::Reset()
33{
34 myHdata.Nullify();
35 orcurv1 = orcurv2 = TopAbs_FORWARD;
36 pcrv1.Nullify();
37 pcrv1.Nullify();
38 mySpine->Reset();
39}
40
41//=======================================================================
42//function : Parameters
43//purpose :
44//=======================================================================
45
46void ChFiDS_Stripe::Parameters(const Standard_Boolean First,
47 Standard_Real& Pdeb,
48 Standard_Real& Pfin) const
49{
50 if(First) {Pdeb = pardeb1; Pfin = parfin1;}
51 else {Pdeb = pardeb2; Pfin = parfin2;}
52}
53
54
55//=======================================================================
56//function : SetParameters
57//purpose :
58//=======================================================================
59
60void ChFiDS_Stripe::SetParameters(const Standard_Boolean First,
61 const Standard_Real Pdeb,
62 const Standard_Real Pfin)
63{
64 if(First) {pardeb1 = Pdeb; parfin1 = Pfin;}
65 else {pardeb2 = Pdeb; parfin2 = Pfin;}
66}
67
68
69//=======================================================================
70//function : Curve
71//purpose :
72//=======================================================================
73
74Standard_Integer ChFiDS_Stripe::Curve(const Standard_Boolean First) const
75{
76 if(First) return indexOfcurve1;
77 else return indexOfcurve2;
78}
79
80
81//=======================================================================
82//function : SetCurve
83//purpose :
84//=======================================================================
85
86void ChFiDS_Stripe::SetCurve(const Standard_Integer Index,
87 const Standard_Boolean First)
88{
89 if(First) indexOfcurve1 = Index;
90 else indexOfcurve2 = Index;
91}
92
93
94//=======================================================================
857ffd5e 95//function : Handle(Geom2d_Curve)&
7fd59977 96//purpose :
97//=======================================================================
98
99const Handle(Geom2d_Curve)& ChFiDS_Stripe::PCurve
100(const Standard_Boolean First) const
101{
102 if(First) return pcrv1;
103 else return pcrv2;
104}
105
106
107//=======================================================================
108//function : ChangePCurve
109//purpose :
110//=======================================================================
111
112Handle(Geom2d_Curve)& ChFiDS_Stripe::ChangePCurve
113(const Standard_Boolean First)
114{
115 if(First) return pcrv1;
116 else return pcrv2;
117}
118
119
120//=======================================================================
121//function : Orientation
122//purpose :
123//=======================================================================
124
125TopAbs_Orientation ChFiDS_Stripe::Orientation
126(const Standard_Integer OnS) const
127{
128 if(OnS == 1) return myOr1;
129 else return myOr2;
130}
131
132
133//=======================================================================
134//function : Orientation
135//purpose :
136//=======================================================================
137
138void ChFiDS_Stripe::SetOrientation(const TopAbs_Orientation Or,
139 const Standard_Integer OnS)
140{
141 if(OnS == 1) myOr1 = Or;
142 else myOr2 = Or;
143}
144
145
146//=======================================================================
147//function : Orientation
148//purpose :
149//=======================================================================
150
151TopAbs_Orientation ChFiDS_Stripe::Orientation
152(const Standard_Boolean First) const
153{
154 if(First) return orcurv1;
155 else return orcurv2;
156}
157
158
159//=======================================================================
160//function : Orientation
161//purpose :
162//=======================================================================
163
164void ChFiDS_Stripe::SetOrientation(const TopAbs_Orientation Or,
165 const Standard_Boolean First)
166{
167 if(First) orcurv1 = Or;
168 else orcurv2 = Or;
169}
170
171
172//=======================================================================
173//function : IndexPoint
174//purpose :
175//=======================================================================
176
177Standard_Integer ChFiDS_Stripe::IndexPoint
178(const Standard_Boolean First, const Standard_Integer OnS) const
179{
180 if(First){
181 if (OnS == 1) return indexfirstPOnS1;
182 else return indexfirstPOnS2;
183 }
184 else{
185 if (OnS == 1) return indexlastPOnS1;
186 else return indexlastPOnS2;
187 }
188}
189
190
191//=======================================================================
192//function : SetIndexPoint
193//purpose :
194//=======================================================================
195
196void ChFiDS_Stripe::SetIndexPoint(const Standard_Integer Index,
197 const Standard_Boolean First,
198 const Standard_Integer OnS)
199{
200 if(First){
201 if (OnS == 1) indexfirstPOnS1 = Index;
202 else indexfirstPOnS2 = Index;
203 }
204 else{
205 if (OnS == 1) indexlastPOnS1 = Index;
206 else indexlastPOnS2 = Index;
207 }
208}
209
210Standard_Integer ChFiDS_Stripe::SolidIndex()const
211{
212 return indexOfSolid;
213}
214
215void ChFiDS_Stripe::SetSolidIndex(const Standard_Integer Index)
216{
217 indexOfSolid = Index;
218}
219
220
221//=======================================================================
222//function : InDS
223//purpose :
224//=======================================================================
225
226void ChFiDS_Stripe::InDS(const Standard_Boolean First,
227 const Standard_Integer Nb) // eap, Apr 29 2002, occ293
228{
229 if(First){
230 begfilled = /*Standard_True*/ Nb;
231 }
232 else{
233 endfilled = /*Standard_True*/ Nb;
234 }
235}
236
237
238//=======================================================================
239//function : IsInDS
240//purpose :
241//=======================================================================
242
243Standard_Integer ChFiDS_Stripe::IsInDS(const Standard_Boolean First)const
244{
245 if(First) return begfilled;
246 else return endfilled;
247}