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