1 // Created on: 1994-03-09
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1994-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_Spine.hxx>
19 #include <ChFiDS_Stripe.hxx>
20 #include <Geom2d_Curve.hxx>
21 #include <Standard_Type.hxx>
23 IMPLEMENT_STANDARD_RTTIEXT(ChFiDS_Stripe,Standard_Transient)
25 ChFiDS_Stripe::ChFiDS_Stripe ()
38 begfilled(/*Standard_False*/0), // eap, Apr 29 2002, occ293
39 endfilled(/*Standard_False*/0),
40 myOr1 (TopAbs_FORWARD),
41 myOr2 (TopAbs_FORWARD),
42 orcurv1 (TopAbs_FORWARD),
43 orcurv2 (TopAbs_FORWARD)
47 void ChFiDS_Stripe::Reset()
50 orcurv1 = orcurv2 = TopAbs_FORWARD;
56 //=======================================================================
57 //function : Parameters
59 //=======================================================================
61 void ChFiDS_Stripe::Parameters(const Standard_Boolean First,
63 Standard_Real& Pfin) const
65 if(First) {Pdeb = pardeb1; Pfin = parfin1;}
66 else {Pdeb = pardeb2; Pfin = parfin2;}
70 //=======================================================================
71 //function : SetParameters
73 //=======================================================================
75 void ChFiDS_Stripe::SetParameters(const Standard_Boolean First,
76 const Standard_Real Pdeb,
77 const Standard_Real Pfin)
79 if(First) {pardeb1 = Pdeb; parfin1 = Pfin;}
80 else {pardeb2 = Pdeb; parfin2 = Pfin;}
84 //=======================================================================
87 //=======================================================================
89 Standard_Integer ChFiDS_Stripe::Curve(const Standard_Boolean First) const
91 if(First) return indexOfcurve1;
92 else return indexOfcurve2;
96 //=======================================================================
99 //=======================================================================
101 void ChFiDS_Stripe::SetCurve(const Standard_Integer Index,
102 const Standard_Boolean First)
104 if(First) indexOfcurve1 = Index;
105 else indexOfcurve2 = Index;
109 //=======================================================================
110 //function : Handle(Geom2d_Curve)&
112 //=======================================================================
114 const Handle(Geom2d_Curve)& ChFiDS_Stripe::PCurve
115 (const Standard_Boolean First) const
117 if(First) return pcrv1;
122 //=======================================================================
123 //function : ChangePCurve
125 //=======================================================================
127 Handle(Geom2d_Curve)& ChFiDS_Stripe::ChangePCurve
128 (const Standard_Boolean First)
130 if(First) return pcrv1;
135 //=======================================================================
136 //function : Orientation
138 //=======================================================================
140 TopAbs_Orientation ChFiDS_Stripe::Orientation
141 (const Standard_Integer OnS) const
143 if(OnS == 1) return myOr1;
148 //=======================================================================
149 //function : Orientation
151 //=======================================================================
153 void ChFiDS_Stripe::SetOrientation(const TopAbs_Orientation Or,
154 const Standard_Integer OnS)
156 if(OnS == 1) myOr1 = Or;
161 //=======================================================================
162 //function : Orientation
164 //=======================================================================
166 TopAbs_Orientation ChFiDS_Stripe::Orientation
167 (const Standard_Boolean First) const
169 if(First) return orcurv1;
174 //=======================================================================
175 //function : Orientation
177 //=======================================================================
179 void ChFiDS_Stripe::SetOrientation(const TopAbs_Orientation Or,
180 const Standard_Boolean First)
182 if(First) orcurv1 = Or;
187 //=======================================================================
188 //function : IndexPoint
190 //=======================================================================
192 Standard_Integer ChFiDS_Stripe::IndexPoint
193 (const Standard_Boolean First, const Standard_Integer OnS) const
196 if (OnS == 1) return indexfirstPOnS1;
197 else return indexfirstPOnS2;
200 if (OnS == 1) return indexlastPOnS1;
201 else return indexlastPOnS2;
206 //=======================================================================
207 //function : SetIndexPoint
209 //=======================================================================
211 void ChFiDS_Stripe::SetIndexPoint(const Standard_Integer Index,
212 const Standard_Boolean First,
213 const Standard_Integer OnS)
216 if (OnS == 1) indexfirstPOnS1 = Index;
217 else indexfirstPOnS2 = Index;
220 if (OnS == 1) indexlastPOnS1 = Index;
221 else indexlastPOnS2 = Index;
225 Standard_Integer ChFiDS_Stripe::SolidIndex()const
230 void ChFiDS_Stripe::SetSolidIndex(const Standard_Integer Index)
232 indexOfSolid = Index;
236 //=======================================================================
239 //=======================================================================
241 void ChFiDS_Stripe::InDS(const Standard_Boolean First,
242 const Standard_Integer Nb) // eap, Apr 29 2002, occ293
245 begfilled = /*Standard_True*/ Nb;
248 endfilled = /*Standard_True*/ Nb;
253 //=======================================================================
256 //=======================================================================
258 Standard_Integer ChFiDS_Stripe::IsInDS(const Standard_Boolean First)const
260 if(First) return begfilled;
261 else return endfilled;