Updating test cases for 23828 issue to mark them as known on Mac OS X platform.
[occt.git] / src / Prs3d / Prs3d_Drawer.cxx
CommitLineData
b311480e 1// Copyright (c) 1995-1999 Matra Datavision
2// Copyright (c) 1999-2012 OPEN CASCADE SAS
3//
4// The content of this file is subject to the Open CASCADE Technology Public
5// License Version 6.5 (the "License"). You may not use the content of this file
6// except in compliance with the License. Please obtain a copy of the License
7// at http://www.opencascade.org and read it completely before using this file.
8//
9// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11//
12// The Original Code and all software distributed under the License is
13// distributed on an "AS IS" basis, without warranty of any kind, and the
14// Initial Developer hereby disclaims all such warranties, including without
15// limitation, any warranties of merchantability, fitness for a particular
16// purpose or non-infringement. Please see the License for the specific terms
17// and conditions governing the rights and limitations under the License.
18
7fd59977 19#define BUC60488 //GG_10/10/99 Set correctly all fields
20
21#include <Prs3d_Drawer.ixx>
22
23Prs3d_Drawer::Prs3d_Drawer(): myNbPoints(30),myIsoOnPlane(Standard_False),
24 myFreeBoundaryDraw(Standard_True),
25 myUnFreeBoundaryDraw(Standard_True),
26 myWireDraw(Standard_True),
27#ifdef BUC60488
28 myShadingAspect( new Prs3d_ShadingAspect()),
29#endif
30 myShadingAspectGlobal(Standard_True),
31 myChordialDeviation(0.0001),
32 myTypeOfDeflection(Aspect_TOD_RELATIVE),
33 myMaximalParameterValue(500000.),
34 myDeviationCoefficient(0.001),
35 myHLRDeviationCoefficient(0.02),
c6541a0c
D
36 myDeviationAngle(12*M_PI/180),
37 myHLRAngle(20*M_PI/180),
7fd59977 38 myLineDrawArrow(Standard_False),
a2d5ab2e 39 myDrawHiddenLine(Standard_False),
40 myFaceBoundaryDraw(Standard_False)
7fd59977 41{
42}
43
44void Prs3d_Drawer::SetTypeOfDeflection(const Aspect_TypeOfDeflection aTypeOfDeflection){
45
46 myTypeOfDeflection = aTypeOfDeflection;}
47
48Aspect_TypeOfDeflection Prs3d_Drawer::TypeOfDeflection() const {
49
50 return myTypeOfDeflection;
51
52}
53
54
55void Prs3d_Drawer::SetIsoOnPlane(const Standard_Boolean OnOff)
56{
57 myIsoOnPlane = OnOff;
58}
59
60
61Standard_Boolean Prs3d_Drawer::IsoOnPlane()const
62{
63 return myIsoOnPlane;
64}
65
66
67Standard_Integer Prs3d_Drawer::Discretisation() const
68{
69 return myNbPoints;
70}
71
72
73void Prs3d_Drawer::SetDiscretisation(const Standard_Integer d)
74{
75 myNbPoints = d;
76}
77
78
79void Prs3d_Drawer::SetMaximalChordialDeviation(
80 const Quantity_Length aChordialDeviation) {
81 myChordialDeviation = aChordialDeviation;
82}
83
84Quantity_Length Prs3d_Drawer::MaximalChordialDeviation() const {
85 return myChordialDeviation;
86}
87
88//
89//=======================================================================
90//function : SetDeviationCoefficient
91//purpose :
92//=======================================================================
93
94void Prs3d_Drawer::SetDeviationCoefficient (const Standard_Real aCoefficient) {
95
96 myDeviationCoefficient = aCoefficient;
97}
98
99//=======================================================================
100//function : DeviationCoefficient
101//purpose :
102//=======================================================================
103
104Standard_Real Prs3d_Drawer::DeviationCoefficient () const {
105
106 return myDeviationCoefficient;
107}
108
109//=======================================================================
110//function : SetHLRDeviationCoefficient
111//purpose :
112//=======================================================================
113
114void Prs3d_Drawer::SetHLRDeviationCoefficient (const Standard_Real aCoefficient) {
115
116 myHLRDeviationCoefficient = aCoefficient;
117}
118
119//=======================================================================
120//function : HLRDeviationCoefficient
121//purpose :
122//=======================================================================
123
124Standard_Real Prs3d_Drawer::HLRDeviationCoefficient () const {
125
126 return myHLRDeviationCoefficient;
127}
128
129//=======================================================================
130//function : SetHLRAngle
131//purpose :
132//=======================================================================
133
134void Prs3d_Drawer::SetHLRAngle (const Standard_Real anAngle) {
135
136 myHLRAngle = anAngle;
137}
138
139//=======================================================================
140//function : HLRAngle
141//purpose :
142//=======================================================================
143
144Standard_Real Prs3d_Drawer::HLRAngle () const {
145
146 return myHLRAngle;
147}
148
149//=======================================================================
150//function : SetDeviationAngle
151//purpose :
152//=======================================================================
153
154void Prs3d_Drawer::SetDeviationAngle (const Standard_Real anAngle)
155{
156 myDeviationAngle = anAngle;
157}
158
159//=======================================================================
160//function : DeviationAngle
161//purpose :
162//=======================================================================
163
164Standard_Real Prs3d_Drawer::DeviationAngle () const
165{
166 return myDeviationAngle;
167}
168
169
170void Prs3d_Drawer::SetMaximalParameterValue (const Standard_Real Value) {
171 myMaximalParameterValue = Value;
172}
173
174Standard_Real Prs3d_Drawer::MaximalParameterValue () const {
175 return myMaximalParameterValue;
176}
177
178Handle (Prs3d_IsoAspect) Prs3d_Drawer::UIsoAspect (){
179
180 if (myUIsoAspect.IsNull())
181 myUIsoAspect = new Prs3d_IsoAspect
182 (Quantity_NOC_GRAY75,Aspect_TOL_SOLID,0.5,1);
183
184 return myUIsoAspect;
185}
186
187void Prs3d_Drawer::SetUIsoAspect ( const Handle(Prs3d_IsoAspect)& anAspect) {
188 myUIsoAspect = anAspect;
189}
190
191Handle (Prs3d_IsoAspect) Prs3d_Drawer::VIsoAspect () {
192 if (myVIsoAspect.IsNull())
193 myVIsoAspect = new Prs3d_IsoAspect
194 (Quantity_NOC_GRAY75,Aspect_TOL_SOLID,0.5,1);
195
196 return myVIsoAspect;
197}
198
199void Prs3d_Drawer::SetVIsoAspect ( const Handle(Prs3d_IsoAspect)& anAspect) {
200 myVIsoAspect = anAspect;
201}
202
203Handle (Prs3d_LineAspect) Prs3d_Drawer::FreeBoundaryAspect () {
204 if (myFreeBoundaryAspect.IsNull())
205 myFreeBoundaryAspect = new Prs3d_LineAspect
206 (Quantity_NOC_GREEN,Aspect_TOL_SOLID,1.);
207
208 return myFreeBoundaryAspect;
209}
210
211void Prs3d_Drawer::SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& anAspect) {
212 myFreeBoundaryAspect = anAspect;
213}
214
215void Prs3d_Drawer::SetFreeBoundaryDraw ( const Standard_Boolean OnOff ) {
216 myFreeBoundaryDraw = OnOff;
217}
218
219Standard_Boolean Prs3d_Drawer::FreeBoundaryDraw () const {
220return myFreeBoundaryDraw;
221}
222
223Handle (Prs3d_LineAspect) Prs3d_Drawer::UnFreeBoundaryAspect (){
224 if (myUnFreeBoundaryAspect.IsNull())
225 myUnFreeBoundaryAspect = new Prs3d_LineAspect
226 (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.);
227 return myUnFreeBoundaryAspect;
228}
229
230void Prs3d_Drawer::SetUnFreeBoundaryAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
231 myUnFreeBoundaryAspect = anAspect;
232}
233
234void Prs3d_Drawer::SetUnFreeBoundaryDraw ( const Standard_Boolean OnOff ) {
235 myUnFreeBoundaryDraw = OnOff;
236}
237
238Standard_Boolean Prs3d_Drawer::UnFreeBoundaryDraw () const {
239 return myUnFreeBoundaryDraw;
240}
241
242Handle (Prs3d_LineAspect) Prs3d_Drawer::WireAspect () {
243 if (myWireAspect.IsNull())
244 myWireAspect = new Prs3d_LineAspect(Quantity_NOC_RED,Aspect_TOL_SOLID,1.);
245
246 return myWireAspect;
247}
248
249void Prs3d_Drawer::SetWireAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
250 myWireAspect = anAspect;
251}
252void Prs3d_Drawer::SetWireDraw ( const Standard_Boolean OnOff ) {
253 myWireDraw = OnOff;
254}
255
256Standard_Boolean Prs3d_Drawer::WireDraw () const {
257return myWireDraw;
258}
259
260
261Handle (Prs3d_LineAspect) Prs3d_Drawer::LineAspect () {
262 if (myLineAspect.IsNull())
263 myLineAspect = new Prs3d_LineAspect
264 (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.);
265 return myLineAspect;
266}
267
268void Prs3d_Drawer::SetLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
269 myLineAspect = anAspect;
270}
271
272Handle (Prs3d_TextAspect) Prs3d_Drawer::TextAspect () {
273 if (myTextAspect.IsNull())
274 myTextAspect = new Prs3d_TextAspect();
275
276 return myTextAspect;
277}
278
279void Prs3d_Drawer::SetTextAspect ( const Handle(Prs3d_TextAspect)& anAspect) {
280 myTextAspect = anAspect;
281}
282
283Handle (Prs3d_ShadingAspect) Prs3d_Drawer::ShadingAspect () {
284 if (myShadingAspect.IsNull())
285 myShadingAspect = new Prs3d_ShadingAspect();
286
287 return myShadingAspect;
288}
289
290void Prs3d_Drawer::SetShadingAspect ( const Handle(Prs3d_ShadingAspect)& anAspect) {
291 myShadingAspect = anAspect;
292}
293
294void Prs3d_Drawer::SetShadingAspectGlobal(const Standard_Boolean aValue) {
295 myShadingAspectGlobal = aValue;
296}
297
298Standard_Boolean Prs3d_Drawer::ShadingAspectGlobal() const {
299
300 return myShadingAspectGlobal;
301
302}
303
304void Prs3d_Drawer::SetLineArrowDraw ( const Standard_Boolean OnOff ) {
305 myLineDrawArrow = OnOff;
306}
307
308Standard_Boolean Prs3d_Drawer::LineArrowDraw () const {
309return myLineDrawArrow;
310}
311
312Handle (Prs3d_ArrowAspect) Prs3d_Drawer::ArrowAspect() {
313 if (myArrowAspect.IsNull())
314 myArrowAspect = new Prs3d_ArrowAspect;
315
316 return myArrowAspect;
317}
318
319void Prs3d_Drawer::SetArrowAspect ( const Handle(Prs3d_ArrowAspect)& anAspect) {
320 myArrowAspect = anAspect;
321}
322
323Handle (Prs3d_PointAspect) Prs3d_Drawer::PointAspect() {
324 if (myPointAspect.IsNull())
325 myPointAspect = new Prs3d_PointAspect
326 (Aspect_TOM_PLUS,Quantity_NOC_YELLOW,1.);
327
328 return myPointAspect;
329}
330
331void Prs3d_Drawer::SetPointAspect ( const Handle(Prs3d_PointAspect)& anAspect) {
332 myPointAspect = anAspect;
333}
334
335Standard_Boolean Prs3d_Drawer::DrawHiddenLine () const {return myDrawHiddenLine;}
336
337void Prs3d_Drawer::EnableDrawHiddenLine () {myDrawHiddenLine=Standard_True;}
338
339void Prs3d_Drawer::DisableDrawHiddenLine () {myDrawHiddenLine=Standard_False;}
340
341Handle (Prs3d_LineAspect) Prs3d_Drawer::HiddenLineAspect () {
342 if (myHiddenLineAspect.IsNull())
343 myHiddenLineAspect = new Prs3d_LineAspect
344 (Quantity_NOC_YELLOW,Aspect_TOL_DASH,0.5);
345
346 return myHiddenLineAspect;
347}
348
349void Prs3d_Drawer::SetHiddenLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
350 myHiddenLineAspect = anAspect;
351}
352
353Handle (Prs3d_LineAspect) Prs3d_Drawer::SeenLineAspect () {
354 if (mySeenLineAspect.IsNull())
355 mySeenLineAspect = new Prs3d_LineAspect
356 (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.);
357
358 return mySeenLineAspect;
359}
360
361void Prs3d_Drawer::SetSeenLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
362 mySeenLineAspect = anAspect;
363}
364
365Handle (Prs3d_LineAspect) Prs3d_Drawer::VectorAspect () {
366 if (myVectorAspect.IsNull())
367 myVectorAspect = new Prs3d_LineAspect
368 (Quantity_NOC_SKYBLUE,Aspect_TOL_SOLID,1.);
369
370 return myVectorAspect;
371}
372
373void Prs3d_Drawer::SetVectorAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
374 myVectorAspect = anAspect;
375}
376
377Handle (Prs3d_DatumAspect) Prs3d_Drawer::DatumAspect () {
378 if (myDatumAspect.IsNull())
379 myDatumAspect = new Prs3d_DatumAspect;
380
381 return myDatumAspect;
382}
383
384void Prs3d_Drawer::SetDatumAspect ( const Handle(Prs3d_DatumAspect)& anAspect) {
385 myDatumAspect = anAspect;
386}
387
388Handle (Prs3d_PlaneAspect) Prs3d_Drawer::PlaneAspect () {
389 if (myPlaneAspect.IsNull())
390 myPlaneAspect = new Prs3d_PlaneAspect;
391
392 return myPlaneAspect;
393}
394
395void Prs3d_Drawer::SetPlaneAspect ( const Handle(Prs3d_PlaneAspect)& anAspect) {
396 myPlaneAspect = anAspect;
397}
398
399Handle (Prs3d_LengthAspect) Prs3d_Drawer::LengthAspect () {
400 if (myLengthAspect.IsNull())
401 myLengthAspect = new Prs3d_LengthAspect;
402
403 return myLengthAspect;
404}
405
406void Prs3d_Drawer::SetLengthAspect ( const Handle(Prs3d_LengthAspect)& anAspect) {
407 myLengthAspect = anAspect;
408}
409
410
411
412Handle (Prs3d_AngleAspect) Prs3d_Drawer::AngleAspect () {
413 if (myAngleAspect.IsNull())
414 myAngleAspect = new Prs3d_AngleAspect;
415
416 return myAngleAspect;
417}
418
419void Prs3d_Drawer::SetAngleAspect ( const Handle(Prs3d_AngleAspect)& anAspect) {
420 myAngleAspect = anAspect;
421}
422
423Handle (Prs3d_RadiusAspect) Prs3d_Drawer::RadiusAspect () const {
424 return myRadiusAspect;
425}
426
427void Prs3d_Drawer::SetRadiusAspect ( const Handle(Prs3d_RadiusAspect)& anAspect) {
428 myRadiusAspect = anAspect;
429}
430
431Handle (Prs3d_LineAspect) Prs3d_Drawer::SectionAspect () {
432 if (mySectionAspect.IsNull())
433 mySectionAspect = new Prs3d_LineAspect
434 (Quantity_NOC_ORANGE,Aspect_TOL_SOLID,1.);
435
436 return mySectionAspect;
437}
438
439void Prs3d_Drawer::SetSectionAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
440 mySectionAspect = anAspect;
441}
a2d5ab2e 442
443// =======================================================================
444// function : SetFaceBoundaryDraw
445// purpose :
446// =======================================================================
447void Prs3d_Drawer::SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled)
448{
449 myFaceBoundaryDraw = theIsEnabled;
450}
451
452// =======================================================================
453// function : IsFaceBoundaryDraw
454// purpose :
455// =======================================================================
456Standard_Boolean Prs3d_Drawer::IsFaceBoundaryDraw () const
457{
458 return myFaceBoundaryDraw;
459}
460
461// =======================================================================
462// function : SetFaceBoundaryAspect
463// purpose :
464// =======================================================================
465void Prs3d_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
466{
467 myFaceBoundaryAspect = theAspect;
468}
469
470// =======================================================================
471// function : FaceBoundaryAspect
472// purpose :
473// =======================================================================
474Handle_Prs3d_LineAspect Prs3d_Drawer::FaceBoundaryAspect ()
475{
476 if (myFaceBoundaryAspect.IsNull ())
477 {
478 myFaceBoundaryAspect =
479 new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0);
480 }
481
482 return myFaceBoundaryAspect;
483}