0024059: Eliminate compiler warning C4701 in MSVC++ with warning level 4
[occt.git] / src / ChFiDS / ChFiDS_Stripe.cxx
1 // Created on: 1994-03-09
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
5 //
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
10 //
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 //
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
20
21
22
23 #include <ChFiDS_Stripe.ixx>
24
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)
30 {}
31
32 void 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
46 void 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
60 void 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
74 Standard_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
86 void 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 //=======================================================================
95 //function : Handle_Geom2d_Curve&
96 //purpose  : 
97 //=======================================================================
98
99 const 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
112 Handle(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
125 TopAbs_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
138 void 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
151 TopAbs_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
164 void 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
177 Standard_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
196 void 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
210 Standard_Integer ChFiDS_Stripe::SolidIndex()const
211 {
212   return indexOfSolid;
213 }
214
215 void ChFiDS_Stripe::SetSolidIndex(const Standard_Integer Index)
216 {
217   indexOfSolid = Index;
218 }
219
220
221 //=======================================================================
222 //function : InDS
223 //purpose  : 
224 //=======================================================================
225
226 void 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
243 Standard_Integer ChFiDS_Stripe::IsInDS(const Standard_Boolean First)const
244 {
245   if(First) return begfilled;
246   else return endfilled;
247 }