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,MMgt_TShared)
25 ChFiDS_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)
32 void ChFiDS_Stripe::Reset()
35 orcurv1 = orcurv2 = TopAbs_FORWARD;
41 //=======================================================================
42 //function : Parameters
44 //=======================================================================
46 void ChFiDS_Stripe::Parameters(const Standard_Boolean First,
48 Standard_Real& Pfin) const
50 if(First) {Pdeb = pardeb1; Pfin = parfin1;}
51 else {Pdeb = pardeb2; Pfin = parfin2;}
55 //=======================================================================
56 //function : SetParameters
58 //=======================================================================
60 void ChFiDS_Stripe::SetParameters(const Standard_Boolean First,
61 const Standard_Real Pdeb,
62 const Standard_Real Pfin)
64 if(First) {pardeb1 = Pdeb; parfin1 = Pfin;}
65 else {pardeb2 = Pdeb; parfin2 = Pfin;}
69 //=======================================================================
72 //=======================================================================
74 Standard_Integer ChFiDS_Stripe::Curve(const Standard_Boolean First) const
76 if(First) return indexOfcurve1;
77 else return indexOfcurve2;
81 //=======================================================================
84 //=======================================================================
86 void ChFiDS_Stripe::SetCurve(const Standard_Integer Index,
87 const Standard_Boolean First)
89 if(First) indexOfcurve1 = Index;
90 else indexOfcurve2 = Index;
94 //=======================================================================
95 //function : Handle(Geom2d_Curve)&
97 //=======================================================================
99 const Handle(Geom2d_Curve)& ChFiDS_Stripe::PCurve
100 (const Standard_Boolean First) const
102 if(First) return pcrv1;
107 //=======================================================================
108 //function : ChangePCurve
110 //=======================================================================
112 Handle(Geom2d_Curve)& ChFiDS_Stripe::ChangePCurve
113 (const Standard_Boolean First)
115 if(First) return pcrv1;
120 //=======================================================================
121 //function : Orientation
123 //=======================================================================
125 TopAbs_Orientation ChFiDS_Stripe::Orientation
126 (const Standard_Integer OnS) const
128 if(OnS == 1) return myOr1;
133 //=======================================================================
134 //function : Orientation
136 //=======================================================================
138 void ChFiDS_Stripe::SetOrientation(const TopAbs_Orientation Or,
139 const Standard_Integer OnS)
141 if(OnS == 1) myOr1 = Or;
146 //=======================================================================
147 //function : Orientation
149 //=======================================================================
151 TopAbs_Orientation ChFiDS_Stripe::Orientation
152 (const Standard_Boolean First) const
154 if(First) return orcurv1;
159 //=======================================================================
160 //function : Orientation
162 //=======================================================================
164 void ChFiDS_Stripe::SetOrientation(const TopAbs_Orientation Or,
165 const Standard_Boolean First)
167 if(First) orcurv1 = Or;
172 //=======================================================================
173 //function : IndexPoint
175 //=======================================================================
177 Standard_Integer ChFiDS_Stripe::IndexPoint
178 (const Standard_Boolean First, const Standard_Integer OnS) const
181 if (OnS == 1) return indexfirstPOnS1;
182 else return indexfirstPOnS2;
185 if (OnS == 1) return indexlastPOnS1;
186 else return indexlastPOnS2;
191 //=======================================================================
192 //function : SetIndexPoint
194 //=======================================================================
196 void ChFiDS_Stripe::SetIndexPoint(const Standard_Integer Index,
197 const Standard_Boolean First,
198 const Standard_Integer OnS)
201 if (OnS == 1) indexfirstPOnS1 = Index;
202 else indexfirstPOnS2 = Index;
205 if (OnS == 1) indexlastPOnS1 = Index;
206 else indexlastPOnS2 = Index;
210 Standard_Integer ChFiDS_Stripe::SolidIndex()const
215 void ChFiDS_Stripe::SetSolidIndex(const Standard_Integer Index)
217 indexOfSolid = Index;
221 //=======================================================================
224 //=======================================================================
226 void ChFiDS_Stripe::InDS(const Standard_Boolean First,
227 const Standard_Integer Nb) // eap, Apr 29 2002, occ293
230 begfilled = /*Standard_True*/ Nb;
233 endfilled = /*Standard_True*/ Nb;
238 //=======================================================================
241 //=======================================================================
243 Standard_Integer ChFiDS_Stripe::IsInDS(const Standard_Boolean First)const
245 if(First) return begfilled;
246 else return endfilled;