1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <Prs3d_Drawer.hxx>
16 #include <Prs3d_ArrowAspect.hxx>
17 #include <Prs3d_DatumAspect.hxx>
18 #include <Prs3d_DimensionAspect.hxx>
19 #include <Prs3d_IsoAspect.hxx>
20 #include <Prs3d_LineAspect.hxx>
21 #include <Prs3d_PlaneAspect.hxx>
22 #include <Prs3d_PointAspect.hxx>
23 #include <Prs3d_ShadingAspect.hxx>
24 #include <Prs3d_TextAspect.hxx>
26 IMPLEMENT_STANDARD_HANDLE (Prs3d_Drawer, MMgt_TShared)
27 IMPLEMENT_STANDARD_RTTIEXT(Prs3d_Drawer, MMgt_TShared)
29 // =======================================================================
30 // function : Prs3d_Drawer
32 // =======================================================================
33 Prs3d_Drawer::Prs3d_Drawer()
35 myHasOwnNbPoints (Standard_False),
36 myMaximalParameterValue (500000.),
37 myHasOwnMaximalParameterValue (Standard_False),
38 myChordialDeviation (0.0001),
39 myHasOwnChordialDeviation (Standard_False),
40 myTypeOfDeflection (Aspect_TOD_RELATIVE),
41 myHasOwnTypeOfDeflection (Standard_False),
42 myTypeOfHLR (Prs3d_TOH_NotSet),
43 myDeviationCoefficient (0.001),
44 myHasOwnDeviationCoefficient (Standard_False),
45 myHLRDeviationCoefficient (0.02),
46 myHasOwnHLRDeviationCoefficient (Standard_False),
47 myDeviationAngle (12.0 * M_PI / 180.0),
48 myHasOwnDeviationAngle (Standard_False),
49 myHLRAngle (20.0 * M_PI / 180.0),
50 myHasOwnHLRDeviationAngle (Standard_False),
51 myIsoOnPlane (Standard_False),
52 myHasOwnIsoOnPlane (Standard_False),
54 myHasOwnUIsoAspect (Standard_False),
55 myHasOwnVIsoAspect (Standard_False),
56 myHasOwnWireAspect (Standard_False),
57 myWireDraw (Standard_True),
58 myHasOwnWireDraw (Standard_False),
59 myHasOwnPointAspect (Standard_False),
60 myHasOwnLineAspect (Standard_False),
61 myHasOwnTextAspect (Standard_False),
62 myHasOwnShadingAspect (Standard_False),
63 myShadingAspectGlobal (Standard_True),
64 myHasOwnShadingAspectGlobal (Standard_False),
65 myHasOwnPlaneAspect (Standard_False),
66 myHasOwnSeenLineAspect (Standard_False),
67 myHasOwnArrowAspect (Standard_False),
68 myLineArrowDraw (Standard_False),
69 myHasOwnLineArrowDraw (Standard_False),
70 myHasOwnHiddenLineAspect (Standard_False),
71 myDrawHiddenLine (Standard_False),
72 myHasOwnDrawHiddenLine (Standard_False),
73 myHasOwnVectorAspect (Standard_False),
74 myVertexDrawMode (Prs3d_VDM_Inherited),
75 myHasOwnDatumAspect (Standard_False),
76 myHasOwnSectionAspect (Standard_False),
78 myHasOwnFreeBoundaryAspect (Standard_False),
79 myFreeBoundaryDraw (Standard_True),
80 myHasOwnFreeBoundaryDraw (Standard_False),
81 myHasOwnUnFreeBoundaryAspect (Standard_False),
82 myUnFreeBoundaryDraw (Standard_True),
83 myHasOwnUnFreeBoundaryDraw (Standard_False),
84 myHasOwnFaceBoundaryAspect (Standard_False),
85 myFaceBoundaryDraw (Standard_False),
86 myHasOwnFaceBoundaryDraw (Standard_False),
88 myHasOwnDimensionAspect (Standard_False),
89 myHasOwnDimLengthModelUnits (Standard_False),
90 myHasOwnDimAngleModelUnits (Standard_False),
91 myHasOwnDimLengthDisplayUnits (Standard_False),
92 myHasOwnDimAngleDisplayUnits (Standard_False)
94 myDimensionModelUnits.SetLengthUnits ("m");
95 myDimensionModelUnits.SetAngleUnits ("rad");
96 myDimensionDisplayUnits.SetLengthUnits ("m");
97 myDimensionDisplayUnits.SetAngleUnits ("deg");
100 // =======================================================================
101 // function : SetTypeOfDeflection
103 // =======================================================================
105 void Prs3d_Drawer::SetTypeOfDeflection (const Aspect_TypeOfDeflection theTypeOfDeflection)
107 myHasOwnTypeOfDeflection = Standard_True;
108 myTypeOfDeflection = theTypeOfDeflection;
111 // =======================================================================
112 // function : SetMaximalChordialDeviation
114 // =======================================================================
116 void Prs3d_Drawer::SetMaximalChordialDeviation (const Quantity_Length theChordialDeviation)
118 myHasOwnChordialDeviation = Standard_True;
119 myChordialDeviation = theChordialDeviation;
122 // =======================================================================
123 // function : SetTypeOfHLR
124 // purpose : set type of HLR algorithm
125 // =======================================================================
127 void Prs3d_Drawer::SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR)
129 myTypeOfHLR = theTypeOfHLR;
132 // =======================================================================
133 // function : TypeOfHLR
134 // purpose : gets type of HLR algorithm
135 // =======================================================================
137 Prs3d_TypeOfHLR Prs3d_Drawer::TypeOfHLR()
139 if (!HasOwnTypeOfHLR())
141 if (!myLink.IsNull())
143 return myLink->TypeOfHLR();
145 // Prs3d_TOH_PolyAlgo is default value for this setting.
146 myTypeOfHLR = Prs3d_TOH_PolyAlgo;
151 // =======================================================================
152 // function : SetMaximalParameterValue
154 // =======================================================================
156 void Prs3d_Drawer::SetMaximalParameterValue (const Standard_Real theValue)
158 myHasOwnMaximalParameterValue = Standard_True;
159 myMaximalParameterValue = theValue;
162 // =======================================================================
163 // function : SetIsoOnPlane
165 // =======================================================================
167 void Prs3d_Drawer::SetIsoOnPlane (const Standard_Boolean theIsEnabled)
169 myHasOwnIsoOnPlane = Standard_True;
170 myIsoOnPlane = theIsEnabled;
173 // =======================================================================
174 // function : SetDiscretisation
176 // =======================================================================
178 void Prs3d_Drawer::SetDiscretisation (const Standard_Integer theValue)
180 myHasOwnNbPoints = Standard_True;
181 myNbPoints = theValue;
184 //=======================================================================
185 //function : SetDeviationCoefficient
187 //=======================================================================
189 void Prs3d_Drawer::SetDeviationCoefficient (const Standard_Real theCoefficient)
191 myPreviousDeviationCoefficient = DeviationCoefficient();
192 myDeviationCoefficient = theCoefficient;
193 myHasOwnDeviationCoefficient = Standard_True;
196 //=======================================================================
197 //function : SetHLRDeviationCoefficient
199 //=======================================================================
201 void Prs3d_Drawer::SetHLRDeviationCoefficient (const Standard_Real theCoefficient)
203 myPreviousHLRDeviationCoefficient = HLRDeviationCoefficient();
204 myHLRDeviationCoefficient = theCoefficient;
205 myHasOwnHLRDeviationCoefficient = Standard_True;
208 //=======================================================================
209 //function : SetDeviationAngle
211 //=======================================================================
213 void Prs3d_Drawer::SetDeviationAngle (const Standard_Real theAngle)
215 myPreviousDeviationAngle = DeviationAngle();
216 myDeviationAngle = theAngle;
217 myHasOwnDeviationAngle = Standard_True;
220 //=======================================================================
221 //function : SetHLRAngle
223 //=======================================================================
225 void Prs3d_Drawer::SetHLRAngle (const Standard_Real theAngle)
227 myPreviousHLRDeviationAngle = HLRAngle();
228 myHLRAngle = theAngle;
229 myHasOwnHLRDeviationAngle = Standard_True;
232 // =======================================================================
233 // function : FreeBoundaryAspect
235 // =======================================================================
237 const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FreeBoundaryAspect()
239 if (!HasOwnFreeBoundaryAspect())
241 if (!myLink.IsNull())
243 return myLink->FreeBoundaryAspect();
245 if (myFreeBoundaryAspect.IsNull())
247 myFreeBoundaryAspect = new Prs3d_LineAspect (Quantity_NOC_GREEN, Aspect_TOL_SOLID, 1.0);
250 return myFreeBoundaryAspect;
253 // =======================================================================
254 // function : FreeBoundaryAspect
256 // =======================================================================
258 void Prs3d_Drawer::SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
260 myFreeBoundaryAspect = theAspect;
261 myHasOwnFreeBoundaryAspect = !myFreeBoundaryAspect.IsNull();
264 // =======================================================================
265 // function : SetFreeBoundaryDraw
267 // =======================================================================
269 void Prs3d_Drawer::SetFreeBoundaryDraw (const Standard_Boolean theIsEnabled)
271 myHasOwnFreeBoundaryDraw = Standard_True;
272 myFreeBoundaryDraw = theIsEnabled;
275 // =======================================================================
276 // function : UnFreeBoundaryAspect
278 // =======================================================================
280 const Handle(Prs3d_LineAspect)& Prs3d_Drawer::UnFreeBoundaryAspect()
282 if (!HasOwnUnFreeBoundaryAspect())
284 if (!myLink.IsNull())
286 return myLink->UnFreeBoundaryAspect();
288 if (myUnFreeBoundaryAspect.IsNull())
290 myUnFreeBoundaryAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_SOLID, 1.0);
293 return myUnFreeBoundaryAspect;
296 // =======================================================================
297 // function : SetUnFreeBoundaryAspect
299 // =======================================================================
301 void Prs3d_Drawer::SetUnFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
303 myUnFreeBoundaryAspect = theAspect;
304 myHasOwnUnFreeBoundaryAspect = !myUnFreeBoundaryAspect.IsNull();
307 // =======================================================================
308 // function : SetUnFreeBoundaryDraw
310 // =======================================================================
312 void Prs3d_Drawer::SetUnFreeBoundaryDraw (const Standard_Boolean theIsEnabled)
314 myHasOwnUnFreeBoundaryDraw = Standard_True;
315 myUnFreeBoundaryDraw = theIsEnabled;
318 // =======================================================================
319 // function : FaceBoundaryAspect
321 // =======================================================================
323 const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FaceBoundaryAspect()
325 if (!HasOwnFaceBoundaryAspect())
327 if (!myLink.IsNull())
329 return myLink->FaceBoundaryAspect();
331 if (myFaceBoundaryAspect.IsNull())
333 myFaceBoundaryAspect = new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0);
336 return myFaceBoundaryAspect;
339 // =======================================================================
340 // function : SetFaceBoundaryAspect
342 // =======================================================================
344 void Prs3d_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
346 myFaceBoundaryAspect = theAspect;
347 myHasOwnFaceBoundaryAspect = !myFaceBoundaryAspect.IsNull();
350 // =======================================================================
351 // function : SetFaceBoundaryDraw
353 // =======================================================================
355 void Prs3d_Drawer::SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled)
357 myHasOwnFaceBoundaryDraw = Standard_True;
358 myFaceBoundaryDraw = theIsEnabled;
361 // =======================================================================
362 // function : DimensionAspect
364 // =======================================================================
366 const Handle(Prs3d_DimensionAspect)& Prs3d_Drawer::DimensionAspect()
368 if (!HasOwnDimensionAspect())
370 if (!myLink.IsNull())
372 return myLink->DimensionAspect();
374 if (myDimensionAspect.IsNull())
376 myDimensionAspect = new Prs3d_DimensionAspect;
379 return myDimensionAspect;
382 // =======================================================================
383 // function : SetDimensionAspect
385 // =======================================================================
387 void Prs3d_Drawer::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect)
389 myDimensionAspect = theAspect;
390 myHasOwnDimensionAspect = !myDimensionAspect.IsNull();
393 // =======================================================================
394 // function : SetDimLengthModelUnits
396 // =======================================================================
398 void Prs3d_Drawer::SetDimLengthModelUnits (const TCollection_AsciiString& theUnits)
400 myHasOwnDimLengthModelUnits = Standard_True;
401 myDimensionModelUnits.SetLengthUnits (theUnits);
404 // =======================================================================
405 // function : SetDimAngleModelUnits
407 // =======================================================================
409 void Prs3d_Drawer::SetDimAngleModelUnits (const TCollection_AsciiString& theUnits)
411 myHasOwnDimAngleModelUnits = Standard_True;
412 myDimensionModelUnits.SetAngleUnits (theUnits);
415 // =======================================================================
416 // function : SetDimLengthDisplayUnits
418 // =======================================================================
420 void Prs3d_Drawer::SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits)
422 myHasOwnDimLengthDisplayUnits = Standard_True;
423 myDimensionDisplayUnits.SetLengthUnits (theUnits);
426 // =======================================================================
427 // function : SetDimAngleDisplayUnits
429 // =======================================================================
431 void Prs3d_Drawer::SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits)
433 myHasOwnDimAngleDisplayUnits = Standard_True;
434 myDimensionDisplayUnits.SetAngleUnits (theUnits);
437 // =======================================================================
438 // function : UIsoAspect
440 // =======================================================================
442 const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::UIsoAspect()
444 if (!HasOwnUIsoAspect())
446 if (!myLink.IsNull())
448 return myLink->UIsoAspect();
450 if (myUIsoAspect.IsNull())
452 myUIsoAspect = new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1);
458 // =======================================================================
459 // function : SetUIsoAspect
461 // =======================================================================
463 void Prs3d_Drawer::SetUIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
465 myUIsoAspect = theAspect;
466 myHasOwnUIsoAspect = !myUIsoAspect.IsNull();
469 // =======================================================================
470 // function : VIsoAspect
472 // =======================================================================
474 const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::VIsoAspect()
476 if (!HasOwnVIsoAspect())
478 if (!myLink.IsNull())
480 return myLink->VIsoAspect();
482 if (myVIsoAspect.IsNull())
484 myVIsoAspect = new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1);
490 // =======================================================================
491 // function : SetVIsoAspect
493 // =======================================================================
495 void Prs3d_Drawer::SetVIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
497 myVIsoAspect = theAspect;
498 myHasOwnVIsoAspect= !myVIsoAspect.IsNull();
501 // =======================================================================
502 // function : WireAspect
504 // =======================================================================
506 const Handle(Prs3d_LineAspect)& Prs3d_Drawer::WireAspect()
508 if (!HasOwnWireAspect())
510 if (!myLink.IsNull())
512 return myLink->WireAspect();
514 if (myWireAspect.IsNull())
516 myWireAspect = new Prs3d_LineAspect (Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0);
522 // =======================================================================
523 // function : SetWireAspect
525 // =======================================================================
527 void Prs3d_Drawer::SetWireAspect (const Handle(Prs3d_LineAspect)& theAspect)
529 myWireAspect = theAspect;
530 myHasOwnWireAspect = !myWireAspect.IsNull();
533 // =======================================================================
534 // function : SetWireDraw
536 // =======================================================================
538 void Prs3d_Drawer::SetWireDraw (const Standard_Boolean theIsEnabled)
540 myHasOwnWireDraw = Standard_True;
541 myWireDraw = theIsEnabled;
544 // =======================================================================
545 // function : PointAspect
547 // =======================================================================
549 const Handle(Prs3d_PointAspect)& Prs3d_Drawer::PointAspect()
551 if (!HasOwnPointAspect())
553 if (!myLink.IsNull())
555 return myLink->PointAspect();
557 if (myPointAspect.IsNull())
559 myPointAspect = new Prs3d_PointAspect (Aspect_TOM_PLUS, Quantity_NOC_YELLOW, 1.0);
562 return myPointAspect;
565 // =======================================================================
566 // function : SetPointAspect
568 // =======================================================================
570 void Prs3d_Drawer::SetPointAspect (const Handle(Prs3d_PointAspect)& theAspect)
572 myPointAspect = theAspect;
573 myHasOwnPointAspect = !myPointAspect.IsNull();
576 // =======================================================================
577 // function : LineAspect
579 // =======================================================================
581 const Handle(Prs3d_LineAspect)& Prs3d_Drawer::LineAspect()
583 if (!HasOwnLineAspect())
585 if (!myLink.IsNull())
587 return myLink->LineAspect();
589 if (myLineAspect.IsNull())
591 myLineAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_SOLID, 1.0);
597 // =======================================================================
598 // function : SetLineAspect
600 // =======================================================================
602 void Prs3d_Drawer::SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
604 myLineAspect = theAspect;
605 myHasOwnLineAspect = !myLineAspect.IsNull();
608 // =======================================================================
609 // function : TextAspect
611 // =======================================================================
613 const Handle(Prs3d_TextAspect)& Prs3d_Drawer::TextAspect()
615 if (!HasOwnTextAspect())
617 if (!myLink.IsNull())
619 return myLink->TextAspect();
621 if (myTextAspect.IsNull())
623 myTextAspect = new Prs3d_TextAspect();
629 // =======================================================================
630 // function : SetTextAspect
632 // =======================================================================
634 void Prs3d_Drawer::SetTextAspect (const Handle(Prs3d_TextAspect)& theAspect)
636 myTextAspect = theAspect;
637 myHasOwnTextAspect = !myTextAspect.IsNull();
640 // =======================================================================
641 // function : ShadingAspect
643 // =======================================================================
645 const Handle(Prs3d_ShadingAspect)& Prs3d_Drawer::ShadingAspect()
647 if (!HasOwnShadingAspect())
649 if (!myLink.IsNull())
651 return myLink->ShadingAspect();
653 if (myShadingAspect.IsNull())
655 myShadingAspect = new Prs3d_ShadingAspect();
658 return myShadingAspect;
661 // =======================================================================
662 // function : SetShadingAspect
664 // =======================================================================
666 void Prs3d_Drawer::SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theAspect)
668 myShadingAspect = theAspect;
669 myHasOwnShadingAspect = !myShadingAspect.IsNull();
672 // =======================================================================
673 // function : SetShadingAspectGlobal
675 // =======================================================================
677 void Prs3d_Drawer::SetShadingAspectGlobal (const Standard_Boolean theValue)
679 myHasOwnShadingAspectGlobal = Standard_True;
680 myShadingAspectGlobal = theValue;
683 // =======================================================================
684 // function : PlaneAspect
686 // =======================================================================
688 const Handle(Prs3d_PlaneAspect)& Prs3d_Drawer::PlaneAspect()
690 if (!HasOwnPlaneAspect())
692 if (!myLink.IsNull())
694 return myLink->PlaneAspect();
696 if (myPlaneAspect.IsNull())
698 myPlaneAspect = new Prs3d_PlaneAspect();
701 return myPlaneAspect;
704 // =======================================================================
705 // function : SetPlaneAspect
707 // =======================================================================
709 void Prs3d_Drawer::SetPlaneAspect (const Handle(Prs3d_PlaneAspect)& theAspect)
711 myPlaneAspect = theAspect;
712 myHasOwnPlaneAspect = !myPlaneAspect.IsNull();
715 // =======================================================================
716 // function : SeenLineAspect
718 // =======================================================================
720 const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SeenLineAspect()
722 if (!HasOwnSeenLineAspect())
724 if (!myLink.IsNull())
726 return myLink->SeenLineAspect();
728 if (mySeenLineAspect.IsNull())
730 mySeenLineAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_SOLID, 1.0);
733 return mySeenLineAspect;
736 // =======================================================================
737 // function : SetSeenLineAspect
739 // =======================================================================
741 void Prs3d_Drawer::SetSeenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
743 mySeenLineAspect = theAspect;
744 myHasOwnSeenLineAspect = !mySeenLineAspect.IsNull();
747 // =======================================================================
748 // function : ArrowAspect
750 // =======================================================================
752 const Handle(Prs3d_ArrowAspect)& Prs3d_Drawer::ArrowAspect()
754 if (!HasOwnArrowAspect())
756 if (!myLink.IsNull())
758 return myLink->ArrowAspect();
760 if (myArrowAspect.IsNull())
762 myArrowAspect = new Prs3d_ArrowAspect();
765 return myArrowAspect;
768 // =======================================================================
769 // function : SetArrowAspect
771 // =======================================================================
773 void Prs3d_Drawer::SetArrowAspect (const Handle(Prs3d_ArrowAspect)& theAspect)
775 myArrowAspect = theAspect;
776 myHasOwnArrowAspect = !myArrowAspect.IsNull();
779 // =======================================================================
780 // function : SetLineArrowDraw
782 // =======================================================================
784 void Prs3d_Drawer::SetLineArrowDraw (const Standard_Boolean theIsEnabled)
786 myHasOwnLineArrowDraw = Standard_True;
787 myLineArrowDraw = theIsEnabled;
790 // =======================================================================
791 // function : HiddenLineAspect
793 // =======================================================================
795 const Handle(Prs3d_LineAspect)& Prs3d_Drawer::HiddenLineAspect()
797 if (!HasOwnHiddenLineAspect())
799 if (!myLink.IsNull())
801 return myLink->HiddenLineAspect();
803 if (myHiddenLineAspect.IsNull())
805 myHiddenLineAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_DASH, 0.5);
808 return myHiddenLineAspect;
811 // =======================================================================
812 // function : SetHiddenLineAspect
814 // =======================================================================
816 void Prs3d_Drawer::SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
818 myHiddenLineAspect = theAspect;
819 myHasOwnHiddenLineAspect = !myHiddenLineAspect.IsNull();
822 // =======================================================================
823 // function : EnableDrawHiddenLineDraw
825 // =======================================================================
827 void Prs3d_Drawer::EnableDrawHiddenLine()
829 myHasOwnDrawHiddenLine = Standard_True;
830 myDrawHiddenLine = Standard_True;
833 // =======================================================================
834 // function : DisableDrawHiddenLine
836 // =======================================================================
838 void Prs3d_Drawer::DisableDrawHiddenLine()
840 myHasOwnDrawHiddenLine = Standard_True;
841 myDrawHiddenLine = Standard_False;
844 // =======================================================================
845 // function : VectorAspect
847 // =======================================================================
849 const Handle(Prs3d_LineAspect)& Prs3d_Drawer::VectorAspect()
851 if (!HasOwnVectorAspect())
853 if (!myLink.IsNull())
855 return myLink->VectorAspect();
857 if (myVectorAspect.IsNull())
859 myVectorAspect = new Prs3d_LineAspect (Quantity_NOC_SKYBLUE, Aspect_TOL_SOLID, 1.0);
862 return myVectorAspect;
865 // =======================================================================
866 // function : SetVectorAspect
868 // =======================================================================
870 void Prs3d_Drawer::SetVectorAspect (const Handle(Prs3d_LineAspect)& theAspect)
872 myVectorAspect = theAspect;
873 myHasOwnVectorAspect = !myVectorAspect.IsNull();
876 // =======================================================================
877 // function : SetVertexDrawMode
879 // =======================================================================
881 void Prs3d_Drawer::SetVertexDrawMode (const Prs3d_VertexDrawMode theMode)
883 // Prs3d_VDM_Inherited is default value and means
884 // that correct value should be taken from the Link if it exists.
885 myVertexDrawMode = theMode;
888 // =======================================================================
889 // function : VertexDrawMode
891 // =======================================================================
893 Prs3d_VertexDrawMode Prs3d_Drawer::VertexDrawMode()
895 if (!HasOwnVertexDrawMode())
897 if (!myLink.IsNull())
899 return myLink->VertexDrawMode();
901 // Prs3d_VDM_Isolated is default value for this setting.
902 myVertexDrawMode = Prs3d_VDM_Isolated;
904 return myVertexDrawMode;
907 // =======================================================================
908 // function : DatumAspect
910 // =======================================================================
912 const Handle(Prs3d_DatumAspect)& Prs3d_Drawer::DatumAspect()
914 if (!HasOwnDatumAspect())
916 if (!myLink.IsNull())
918 return myLink->DatumAspect();
920 if (myDatumAspect.IsNull())
922 myDatumAspect = new Prs3d_DatumAspect();
925 return myDatumAspect;
928 // =======================================================================
929 // function : SetDatumAspect
931 // =======================================================================
933 void Prs3d_Drawer::SetDatumAspect (const Handle(Prs3d_DatumAspect)& theAspect)
935 myDatumAspect = theAspect;
936 myHasOwnDatumAspect = !myDatumAspect.IsNull();
939 // =======================================================================
940 // function : SectionAspect
942 // =======================================================================
944 const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SectionAspect()
946 if (!HasOwnSectionAspect())
948 if (!myLink.IsNull())
950 return myLink->SectionAspect();
952 if (mySectionAspect.IsNull())
954 mySectionAspect = new Prs3d_LineAspect (Quantity_NOC_ORANGE, Aspect_TOL_SOLID, 1.0);
957 return mySectionAspect;
960 // =======================================================================
961 // function : SetSectionAspect
963 // =======================================================================
965 void Prs3d_Drawer::SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect)
967 mySectionAspect = theAspect;
968 myHasOwnSectionAspect = !mySectionAspect.IsNull();
971 // =======================================================================
972 // function : SetSectionAspect
974 // =======================================================================
976 void Prs3d_Drawer::ClearLocalAttributes()
983 myUIsoAspect.Nullify();
984 myVIsoAspect.Nullify();
985 myFreeBoundaryAspect.Nullify();
986 myUnFreeBoundaryAspect.Nullify();
987 myFaceBoundaryAspect.Nullify();
988 myWireAspect.Nullify();
989 myLineAspect.Nullify();
990 myTextAspect.Nullify();
991 myShadingAspect.Nullify();
992 myPointAspect.Nullify();
993 myPlaneAspect.Nullify();
994 myArrowAspect.Nullify();
995 myHiddenLineAspect.Nullify();
996 mySeenLineAspect.Nullify();
997 myVectorAspect .Nullify();
998 myDatumAspect.Nullify();
999 myDimensionAspect.Nullify();
1000 mySectionAspect.Nullify();
1002 myHasOwnUIsoAspect = Standard_False;
1003 myHasOwnVIsoAspect = Standard_False;
1004 myHasOwnWireAspect = Standard_False;
1005 myHasOwnPointAspect = Standard_False;
1006 myHasOwnLineAspect = Standard_False;
1007 myHasOwnTextAspect = Standard_False;
1008 myHasOwnShadingAspect = Standard_False;
1009 myHasOwnPlaneAspect = Standard_False;
1010 myHasOwnSeenLineAspect = Standard_False;
1011 myHasOwnArrowAspect = Standard_False;
1012 myHasOwnHiddenLineAspect = Standard_False;
1013 myHasOwnVectorAspect = Standard_False;
1014 myHasOwnDatumAspect = Standard_False;
1015 myHasOwnSectionAspect = Standard_False;
1016 myHasOwnFreeBoundaryAspect = Standard_False;
1017 myHasOwnUnFreeBoundaryAspect = Standard_False;
1018 myHasOwnFaceBoundaryAspect = Standard_False;
1019 myHasOwnDimensionAspect = Standard_False;
1021 myHasOwnNbPoints = Standard_False;
1022 myHasOwnMaximalParameterValue = Standard_False;
1023 myHasOwnTypeOfDeflection = Standard_False;
1024 myHasOwnChordialDeviation = Standard_False;
1025 myHasOwnDeviationCoefficient = Standard_False;
1026 myHasOwnHLRDeviationCoefficient = Standard_False;
1027 myHasOwnDeviationAngle = Standard_False;
1028 myHasOwnHLRDeviationAngle = Standard_False;
1029 myHasOwnIsoOnPlane = Standard_False;
1030 myHasOwnWireDraw = Standard_False;
1031 myHasOwnShadingAspectGlobal = Standard_False;
1032 myHasOwnLineArrowDraw = Standard_False;
1033 myHasOwnDrawHiddenLine = Standard_False;
1034 myHasOwnFreeBoundaryDraw = Standard_False;
1035 myHasOwnUnFreeBoundaryDraw = Standard_False;
1036 myHasOwnFaceBoundaryDraw = Standard_False;
1037 myHasOwnDimLengthModelUnits = Standard_False;
1038 myHasOwnDimLengthDisplayUnits = Standard_False;
1039 myHasOwnDimAngleModelUnits = Standard_False;
1040 myHasOwnDimAngleDisplayUnits = Standard_False;
1042 myVertexDrawMode = Prs3d_VDM_Inherited;
1043 myTypeOfHLR = Prs3d_TOH_NotSet;