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 #ifndef _Prs3d_Drawer_HeaderFile
16 #define _Prs3d_Drawer_HeaderFile
18 #include <Standard.hxx>
19 #include <Standard_Type.hxx>
21 #include <Handle_Prs3d_IsoAspect.hxx>
22 #include <Standard_Integer.hxx>
23 #include <Standard_Boolean.hxx>
24 #include <Handle_Prs3d_LineAspect.hxx>
25 #include <Handle_Prs3d_TextAspect.hxx>
26 #include <Handle_Prs3d_ShadingAspect.hxx>
27 #include <Quantity_Length.hxx>
28 #include <Aspect_TypeOfDeflection.hxx>
29 #include <Standard_Real.hxx>
30 #include <Handle_Prs3d_PointAspect.hxx>
31 #include <Prs3d_VertexDrawMode.hxx>
32 #include <Handle_Prs3d_PlaneAspect.hxx>
33 #include <Handle_Prs3d_ArrowAspect.hxx>
34 #include <Handle_Prs3d_DatumAspect.hxx>
35 #include <Handle_Prs3d_DimensionAspect.hxx>
36 #include <Prs3d_DimensionUnits.hxx>
37 #include <Prs3d_TypeOfHLR.hxx>
38 #include <MMgt_TShared.hxx>
40 class Prs3d_IsoAspect;
41 class Prs3d_LineAspect;
42 class Prs3d_TextAspect;
43 class Prs3d_ShadingAspect;
44 class Prs3d_PointAspect;
45 class Prs3d_PlaneAspect;
46 class Prs3d_ArrowAspect;
47 class Prs3d_DatumAspect;
48 class Prs3d_DimensionAspect;
49 class TCollection_AsciiString;
51 DEFINE_STANDARD_HANDLE(Prs3d_Drawer, MMgt_TShared)
53 //! A graphic attribute manager which governs how
54 //! objects such as color, width, line thickness and deflection are displayed.
55 //! A drawer includes an instance of the Aspect classes with particular default values.
56 class Prs3d_Drawer : public MMgt_TShared
61 //! Default constructor.
62 Standard_EXPORT Prs3d_Drawer();
64 //! Sets the type of chordal deflection.
65 //! This indicates whether the deflection value is absolute or relative to the size of the object.
66 Standard_EXPORT void SetTypeOfDeflection (const Aspect_TypeOfDeflection theTypeOfDeflection);
68 //! Returns the type of chordal deflection.
69 //! This indicates whether the deflection value is absolute or relative to the size of the object.
70 Aspect_TypeOfDeflection TypeOfDeflection() const
72 return HasOwnTypeOfDeflection() || myLink.IsNull()
74 : myLink->TypeOfDeflection();
77 //! Returns true if the drawer has a type of deflection setting active.
78 Standard_Boolean HasOwnTypeOfDeflection() const { return myHasOwnTypeOfDeflection; }
80 //! Defines the maximal chordial deviation when drawing any curve.
81 //! Even if the type of deviation is set to TOD_Relative, this value is used by:
82 //! Prs3d_DeflectionCurve
83 //! Prs3d_WFDeflectionSurface
84 //! Prs3d_WFDeflectionRestrictedFace
85 Standard_EXPORT void SetMaximalChordialDeviation (const Quantity_Length theChordialDeviation);
87 //! Returns the maximal chordal deviation. The default value is 0.1.
88 //! Drawings of curves or patches are made with respect to an absolute maximal chordal deviation.
89 Quantity_Length MaximalChordialDeviation() const
91 return HasOwnMaximalChordialDeviation() || myLink.IsNull()
93 : myLink->MaximalChordialDeviation();
96 //! Returns true if the drawer has a maximal chordial deviation setting active.
97 Standard_Boolean HasOwnMaximalChordialDeviation() const { return myHasOwnChordialDeviation; }
99 //! Sets the type of HLR algorithm used by drawer's interactive objects
100 Standard_EXPORT void SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR);
102 //! Returns the type of HLR algorithm currently in use.
103 Standard_EXPORT Prs3d_TypeOfHLR TypeOfHLR();
105 //! Returns true if the type of HLR is not equal to Prs3d_TOH_NotSet.
106 Standard_Boolean HasOwnTypeOfHLR() const { return (myTypeOfHLR != Prs3d_TOH_NotSet); }
108 //! Defines the maximum value allowed for the first and last
109 //! parameters of an infinite curve.
110 Standard_EXPORT void SetMaximalParameterValue (const Standard_Real theValue);
112 //! Sets the maximum value allowed for the first and last
113 //! parameters of an infinite curve. By default, this value is 500000.
114 Standard_Real MaximalParameterValue() const
116 return HasOwnMaximalParameterValue() || myLink.IsNull()
117 ? myMaximalParameterValue
118 : myLink->MaximalParameterValue();
121 //! Returns true if the drawer has a maximum value allowed for the first and last
122 //! parameters of an infinite curve setting active.
123 Standard_Boolean HasOwnMaximalParameterValue() const { return myHasOwnMaximalParameterValue; }
125 //! Sets IsoOnPlane on or off by setting the parameter theIsEnabled to true or false.
126 Standard_EXPORT void SetIsoOnPlane (const Standard_Boolean theIsEnabled);
128 //! Returns True if the drawing of isos on planes is enabled.
129 Standard_Boolean IsoOnPlane() const
131 return HasOwnIsoOnPlane() || myLink.IsNull()
133 : myLink->IsoOnPlane();
136 //! Returns true if the drawer has IsoOnPlane setting active.
137 Standard_Boolean HasOwnIsoOnPlane() const { return myHasOwnIsoOnPlane; }
139 //! Sets the discretisation parameter theValue.
140 Standard_EXPORT void SetDiscretisation (const Standard_Integer theValue);
142 //! Returns the discretisation setting.
143 Standard_Integer Discretisation() const
145 return HasOwnDiscretisation() || myLink.IsNull()
147 : myLink->Discretisation();
150 //! Returns true if the drawer has discretisation setting active.
151 Standard_Boolean HasOwnDiscretisation() const { return myHasOwnNbPoints; }
153 //! Sets the deviation coefficient theCoefficient.
154 //! Also sets the hasOwnDeviationCoefficient flag to Standard_True and myPreviousDeviationCoefficient
155 Standard_EXPORT void SetDeviationCoefficient (const Standard_Real theCoefficient);
157 //! Returns the deviation coefficient.
158 //! Drawings of curves or patches are made with respect
159 //! to a maximal chordal deviation. A Deviation coefficient
160 //! is used in the shading display mode. The shape is
161 //! seen decomposed into triangles. These are used to
162 //! calculate reflection of light from the surface of the
163 //! object. The triangles are formed from chords of the
164 //! curves in the shape. The deviation coefficient gives
165 //! the highest value of the angle with which a chord can
166 //! deviate from a tangent to a curve. If this limit is
167 //! reached, a new triangle is begun.
168 //! This deviation is absolute and is set through the
169 //! method: SetMaximalChordialDeviation. The default value is 0.001.
170 //! In drawing shapes, however, you are allowed to ask
171 //! for a relative deviation. This deviation will be:
172 //! SizeOfObject * DeviationCoefficient.
173 Standard_Real DeviationCoefficient() const
175 return HasOwnDeviationCoefficient() || myLink.IsNull()
176 ? myDeviationCoefficient
177 : myLink->DeviationCoefficient();
180 //! Sets the hasOwnDeviationCoefficient flag to Standard_False
181 void SetDeviationCoefficient()
183 myHasOwnDeviationCoefficient = Standard_False;
186 //! Returns true if there is a local setting for deviation
187 //! coefficient in this framework for a specific interactive object.
188 Standard_Boolean HasOwnDeviationCoefficient() const { return myHasOwnDeviationCoefficient; }
190 //! Saves the previous value used for the chordal
191 //! deviation coefficient.
192 Standard_Real PreviousDeviationCoefficient() const
194 return myHasOwnDeviationCoefficient
195 ? myPreviousDeviationCoefficient
199 //! Sets the deviation coefficient aCoefficient for removal
200 //! of hidden lines created by different viewpoints in
201 //! different presentations. The Default value is 0.02.
202 //! Also sets the hasOwnHLRDeviationCoefficient flag to Standard_True and myPreviousHLRDeviationCoefficient
203 Standard_EXPORT void SetHLRDeviationCoefficient (const Standard_Real theCoefficient);
205 //! Returns the real number value of the hidden line
206 //! removal deviation coefficient in this framework, if the flag
207 //! hasOwnHLRDeviationCoefficient is true or there is no Link.
208 //! Else the shape's HLR deviation coefficient is used.
209 //! A Deviation coefficient is used in the shading display
210 //! mode. The shape is seen decomposed into triangles.
211 //! These are used to calculate reflection of light from the
212 //! surface of the object.
213 //! The triangles are formed from chords of the curves in
214 //! the shape. The deviation coefficient give the highest
215 //! value of the angle with which a chord can deviate
216 //! from a tangent to a curve. If this limit is reached, a new triangle is begun.
217 //! To find the hidden lines, hidden line display mode
218 //! entails recalculation of the view at each different projector perspective.
219 //! Since hidden lines entail calculations of more than
220 //! usual complexity to decompose them into these
221 //! triangles, a deviation coefficient allowing greater
222 //! tolerance is used. This increases efficiency in calculation.
223 //! The Default value is 0.02.
224 Standard_Real HLRDeviationCoefficient() const
226 return HasOwnHLRDeviationCoefficient() || myLink.IsNull()
227 ? myHLRDeviationCoefficient
228 : myLink->HLRDeviationCoefficient();
231 //! Sets the hasOwnHLRDeviationCoefficient flag to Standard_False
232 void SetHLRDeviationCoefficient()
234 myHasOwnHLRDeviationCoefficient = Standard_False;
237 //! Returns true if the there is a setting for HLR deviation
238 //! coefficient in this framework for a specific interactive object.
239 Standard_Boolean HasOwnHLRDeviationCoefficient() const { return myHasOwnHLRDeviationCoefficient; }
241 //! Returns the previous value of the hidden line removal deviation coefficient.
242 Standard_Real PreviousHLRDeviationCoefficient() const
244 return myHasOwnHLRDeviationCoefficient
245 ? myPreviousHLRDeviationCoefficient
249 //! Sets the deviation angle theAngle.
250 //! Also sets the hasOwnDeviationAngle flag to Standard_True, and myPreviousDeviationAngle.
251 Standard_EXPORT void SetDeviationAngle (const Standard_Real theAngle);
253 //! Returns the value for deviation angle.
254 Standard_Real DeviationAngle() const
256 return HasOwnDeviationAngle() || myLink.IsNull()
258 : myLink->DeviationAngle();
261 //! Sets the hasOwnDeviationAngle flag to Standard_False
262 void SetDeviationAngle()
264 myHasOwnDeviationAngle = Standard_False;
267 //! Returns true if the there is a local setting for deviation
268 //! angle in this framework for a specific interactive object.
269 Standard_Boolean HasOwnDeviationAngle() const { return myHasOwnDeviationAngle; }
271 //! Returns the previous deviation angle
272 Standard_Real PreviousDeviationAngle() const
274 return myHasOwnDeviationAngle
275 ? myPreviousDeviationAngle
279 //! Sets anAngle, the angle of maximum chordal deviation for removal of hidden lines created by
280 //! different viewpoints in different presentations.
281 //! The default value is 20 * M_PI / 180.
282 //! Also sets the hasOwnHLRDeviationAngle flag to Standard_True and myPreviousHLRDeviationAngle.
283 Standard_EXPORT void SetHLRAngle (const Standard_Real theAngle);
285 //! Returns the real number value of the deviation angle
286 //! in hidden line removal views. The default value is 20 * M_PI / 180.
287 Standard_Real HLRAngle() const
289 return HasOwnHLRDeviationAngle() || myLink.IsNull()
291 : myLink->HLRAngle();
294 //! Sets the hasOwnHLRDeviationAngle flag to Standard_False
297 myHasOwnHLRDeviationAngle = Standard_False;
300 //! Returns true if the there is a setting for HLR deviation
301 //! angle in this framework for a specific interactive object.
302 Standard_Boolean HasOwnHLRDeviationAngle() const { return myHasOwnHLRDeviationAngle; }
304 //! Returns the previous value of the HLR deviation angle.
305 Standard_Real PreviousHLRDeviationAngle() const
307 return myHasOwnHLRDeviationAngle
308 ? myPreviousHLRDeviationAngle
312 //! Sets IsAutoTriangulated on or off by setting the parameter theIsEnabled to true or false.
313 //! If this flag is True automatic re-triangulation with deflection-check logic will be applied.
314 //! Else this feature will be disable and triangulation is expected to be computed by application itself
315 //! and no shading presentation at all if unavailable.
316 Standard_EXPORT void SetAutoTriangulation (const Standard_Boolean theIsEnabled);
318 //! Returns True if automatic triangulation is enabled.
319 Standard_Boolean IsAutoTriangulation() const
321 return HasOwnIsAutoTriangulation() || myLink.IsNull()
322 ? myIsAutoTriangulated
323 : myLink->IsAutoTriangulation();
326 //! Returns true if the drawer has IsoOnPlane setting active.
327 Standard_Boolean HasOwnIsAutoTriangulation() const { return myHasOwnIsAutoTriangulated; }
329 //! Defines the attributes which are used when drawing an
330 //! U isoparametric curve of a face. Defines the number
331 //! of U isoparametric curves to be drawn for a single face.
332 //! The LineAspect for U isoparametric lines can be edited
333 //! (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
334 //! The default values are:
335 //! COLOR : Quantity_NOC_GRAY75
336 //! TYPE OF LINE: Aspect_TOL_SOLID
339 //! These attributes are used by the following algorithms:
340 //! Prs3d_WFDeflectionSurface
341 //! Prs3d_WFDeflectionRestrictedFace
342 Standard_EXPORT const Handle(Prs3d_IsoAspect)& UIsoAspect();
344 Standard_EXPORT void SetUIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect);
346 //! Returns true if the drawer has its own attribute for
347 //! UIso aspect that overrides the one in the link.
348 Standard_Boolean HasOwnUIsoAspect() const { return myHasOwnUIsoAspect; }
350 //! Defines the attributes which are used when drawing an
351 //! V isoparametric curve of a face. Defines the number
352 //! of V isoparametric curves to be drawn for a single face.
353 //! The LineAspect for V isoparametric lines can be edited
354 //! (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
355 //! The default values are:
356 //! COLOR : Quantity_NOC_GRAY82
357 //! TYPE OF LINE: Aspect_TOL_SOLID
360 //! These attributes are used by the following algorithms:
361 //! Prs3d_WFDeflectionSurface
362 //! Prs3d_WFDeflectionRestrictedFace
363 Standard_EXPORT const Handle(Prs3d_IsoAspect)& VIsoAspect();
365 //! Sets the appearance of V isoparameters - theAspect.
366 Standard_EXPORT void SetVIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect);
368 //! Returns true if the drawer has its own attribute for
369 //! VIso aspect that overrides the one in the link.
370 Standard_Boolean HasOwnVIsoAspect() const { return myHasOwnVIsoAspect; }
372 //! Returns wire aspect settings.
373 //! The LineAspect for the free boundaries can be edited.
374 //! The default values are:
375 //! Color: Quantity_NOC_GREEN
376 //! Type of line: Aspect_TOL_SOLID
378 //! These attributes are used by the algorithm Prs3d_WFShape.
379 Standard_EXPORT const Handle(Prs3d_LineAspect)& WireAspect();
381 //! Sets the parameter theAspect for display of wires.
382 Standard_EXPORT void SetWireAspect (const Handle(Prs3d_LineAspect)& theAspect);
384 //! Returns true if the drawer has its own attribute for
385 //! wire aspect that overrides the one in the link.
386 Standard_Boolean HasOwnWireAspect() const { return myHasOwnWireAspect; }
388 //! Sets WireDraw on or off by setting the parameter theIsEnabled to true or false.
389 Standard_EXPORT void SetWireDraw(const Standard_Boolean theIsEnabled);
391 //! Returns True if the drawing of the wire is enabled.
392 Standard_Boolean WireDraw() const
394 return HasOwnWireDraw() || myLink.IsNull()
396 : myLink->WireDraw();
399 //! Returns true if the drawer has its own attribute for
400 //! "draw wires" flag that overrides the one in the link.
401 Standard_Boolean HasOwnWireDraw() const { return myHasOwnWireDraw; }
403 //! Returns the point aspect setting. The default values are
404 //! Color: Quantity_NOC_YELLOW
405 //! Type of marker: Aspect_TOM_PLUS
407 //! These attributes are used by the algorithms Prs3d_Point.
408 Standard_EXPORT const Handle(Prs3d_PointAspect)& PointAspect();
410 //! Sets the parameter theAspect for display attributes of points
411 Standard_EXPORT void SetPointAspect (const Handle(Prs3d_PointAspect)& theAspect);
413 //! Returns true if the drawer has its own attribute for
414 //! point aspect that overrides the one in the link.
415 Standard_Boolean HasOwnPointAspect() const { return myHasOwnPointAspect; }
417 //! Returns settings for line aspects.
418 //! These settings can be edited. The default values are:
419 //! Color: Quantity_NOC_YELLOW
420 //! Type of line: Aspect_TOL_SOLID
422 //! These attributes are used by the following algorithms:
426 Standard_EXPORT const Handle(Prs3d_LineAspect)& LineAspect();
428 //! Sets the parameter theAspect for display attributes of lines.
429 Standard_EXPORT void SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
431 //! Returns true if the drawer has its own attribute for
432 //! line aspect that overrides the one in the link.
433 Standard_Boolean HasOwnLineAspect() const { return myHasOwnLineAspect; }
435 //! Returns settings for text aspect.
436 //! These settings can be edited. The default value is:
437 //! - Color: Quantity_NOC_YELLOW
438 Standard_EXPORT const Handle(Prs3d_TextAspect)& TextAspect();
440 //! Sets the parameter theAspect for display attributes of text.
441 Standard_EXPORT void SetTextAspect (const Handle(Prs3d_TextAspect)& theAspect);
443 //! Returns true if the drawer has its own attribute for
444 //! text aspect that overrides the one in the link.
445 Standard_Boolean HasOwnTextAspect() const { return myHasOwnTextAspect; }
447 //! Returns settings for shading aspects.
448 //! These settings can be edited. The default values are:
449 //! - Color: Quantity_NOC_YELLOW
450 //! - Material: Graphic3d_NOM_BRASS
451 //! Shading aspect is obtained through decomposition of
452 //! 3d faces into triangles, each side of each triangle
453 //! being a chord of the corresponding curved edge in the face.
454 //! Reflection of light in each projector perspective is then calculated for each of the
455 //! resultant triangular planes.
456 Standard_EXPORT const Handle(Prs3d_ShadingAspect)& ShadingAspect();
458 //! Sets the parameter theAspect for display attributes of shading.
459 Standard_EXPORT void SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theAspect);
461 //! Returns true if the drawer has its own attribute for
462 //! shading aspect that overrides the one in the link.
463 Standard_Boolean HasOwnShadingAspect() const { return myHasOwnShadingAspect; }
465 //! Returns True if the ShadingAspect is applied
466 //! to the whole presentation.
467 Standard_Boolean ShadingAspectGlobal() const
469 return HasOwnShadingAspectGlobal() || myLink.IsNull()
470 ? myShadingAspectGlobal
471 : myLink->ShadingAspectGlobal();
474 //! Indicates that the ShadingAspect will be apply
475 //! to the whole presentation. This allows to modify
476 //! the aspect without recomputing the content of the presentation.
477 Standard_EXPORT void SetShadingAspectGlobal (const Standard_Boolean theValue);
479 //! Returns true if the drawer has its own attribute for
480 //! ShadingAspectGlobal flag that overrides the one in the link.
481 Standard_Boolean HasOwnShadingAspectGlobal() const { return myHasOwnShadingAspectGlobal; }
483 //! Returns settings for seen line aspects.
484 //! These settings can be edited. The default values are:
485 //! Color: Quantity_NOC_YELLOW
486 //! Type of line: Aspect_TOL_SOLID
488 Standard_EXPORT const Handle(Prs3d_LineAspect)& SeenLineAspect();
490 //! Sets the parameter theAspect for the display of seen lines in hidden line removal mode.
491 Standard_EXPORT void SetSeenLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
493 //! Returns true if the drawer has its own attribute for
494 //! seen line aspect that overrides the one in the link.
495 Standard_Boolean HasOwnSeenLineAspect() const { return myHasOwnSeenLineAspect; }
497 //! Returns settings for the appearance of planes.
498 Standard_EXPORT const Handle(Prs3d_PlaneAspect)& PlaneAspect();
500 //! Sets the parameter theAspect for the display of planes.
501 Standard_EXPORT void SetPlaneAspect (const Handle(Prs3d_PlaneAspect)& theAspect);
503 //! Returns true if the drawer has its own attribute for
504 //! plane aspect that overrides the one in the link.
505 Standard_Boolean HasOwnPlaneAspect() const { return myHasOwnPlaneAspect; }
507 //! Returns the attributes for display of arrows.
508 Standard_EXPORT const Handle(Prs3d_ArrowAspect)& ArrowAspect();
510 //! Sets the parameter theAspect for display attributes of arrows.
511 Standard_EXPORT void SetArrowAspect (const Handle(Prs3d_ArrowAspect)& theAspect);
513 //! Returns true if the drawer has its own attribute for
514 //! arrow aspect that overrides the one in the link.
515 Standard_Boolean HasOwnArrowAspect() const { return myHasOwnArrowAspect; }
517 //! Enables the drawing of an arrow at the end of each line.
518 //! By default the arrows are not drawn.
519 Standard_EXPORT void SetLineArrowDraw (const Standard_Boolean theIsEnabled);
521 //! Returns True if drawing an arrow at the end of each edge is enabled
522 //! and False otherwise (the default).
523 Standard_Boolean LineArrowDraw() const
525 return HasOwnLineArrowDraw() || myLink.IsNull()
527 : myLink->LineArrowDraw();
530 //! Returns true if the drawer has its own attribute for
531 //! "draw arrow" flag that overrides the one in the link.
532 Standard_Boolean HasOwnLineArrowDraw() const
534 return myHasOwnLineArrowDraw;
537 //! Returns settings for hidden line aspects.
538 //! These settings can be edited. The default values are:
539 //! Color: Quantity_NOC_YELLOW
540 //! Type of line: Aspect_TOL_DASH
542 Standard_EXPORT const Handle(Prs3d_LineAspect)& HiddenLineAspect();
544 //! Sets the parameter theAspect for the display of hidden lines in hidden line removal mode.
545 Standard_EXPORT void SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
547 //! Returns true if the drawer has its own attribute for
548 //! hidden lines aspect that overrides the one in the link.
549 Standard_Boolean HasOwnHiddenLineAspect() const { return myHasOwnHiddenLineAspect; }
551 //! Returns Standard_True if the hidden lines are to be drawn.
552 //! By default the hidden lines are not drawn.
553 Standard_Boolean DrawHiddenLine() const
555 return HasOwnDrawHiddenLine() || myLink.IsNull()
557 : myLink->DrawHiddenLine();
560 //! Enables the DrawHiddenLine function.
561 Standard_EXPORT void EnableDrawHiddenLine();
563 //! Disables the DrawHiddenLine function.
564 Standard_EXPORT void DisableDrawHiddenLine();
566 //! Returns true if the drawer has its own attribute for
567 //! "draw hidden lines" flag that overrides the one in the link.
568 Standard_Boolean HasOwnDrawHiddenLine() const { return myHasOwnDrawHiddenLine; }
570 //! Returns settings for the appearance of vectors.
571 //! These settings can be edited. The default values are:
572 //! Color: Quantity_NOC_SKYBLUE
573 //! Type of line: Aspect_TOL_SOLID
575 Standard_EXPORT const Handle(Prs3d_LineAspect)& VectorAspect();
577 //! Sets the modality theAspect for the display of vectors.
578 Standard_EXPORT void SetVectorAspect (const Handle(Prs3d_LineAspect)& theAspect);
580 //! Returns true if the drawer has its own attribute for
581 //! vector aspect that overrides the one in the link.
582 Standard_Boolean HasOwnVectorAspect() const { return myHasOwnVectorAspect; }
584 //! Sets the mode of visualization of vertices of a TopoDS_Shape instance.
585 //! By default, only stand-alone vertices (not belonging topologically to an edge) are drawn,
586 //! that corresponds to Prs3d_VDM_Standalone mode.
587 //! Switching to Prs3d_VDM_Standalone mode makes all shape's vertices visible.
588 //! To inherit this parameter from the global drawer instance ("the link") when it is present,
589 //! Prs3d_VDM_Inherited value should be used.
590 Standard_EXPORT void SetVertexDrawMode (const Prs3d_VertexDrawMode theMode);
592 //! Returns the current mode of visualization of vertices of a TopoDS_Shape instance.
593 Standard_EXPORT Prs3d_VertexDrawMode VertexDrawMode();
595 //! Returns true if the vertex draw mode is not equal to <b>Prs3d_VDM_Inherited</b>.
596 //! This means that individual vertex draw mode value (i.e. not inherited from the global
597 //! drawer) is used for a specific interactive object.
598 Standard_Boolean HasOwnVertexDrawMode() const { return (myVertexDrawMode != Prs3d_VDM_Inherited); }
600 //! Returns settings for the appearance of datums.
601 //! These settings can be edited. The default values for the three axes are:
602 //! Color: Quantity_NOC_PEACHPUFF
603 //! Type of line: Aspect_TOL_SOLID
605 Standard_EXPORT const Handle(Prs3d_DatumAspect)& DatumAspect();
607 //! Sets the modality theAspect for the display of datums.
608 Standard_EXPORT void SetDatumAspect (const Handle(Prs3d_DatumAspect)& theAspect);
610 //! Returns true if the drawer has its own attribute for
611 //! datum aspect that overrides the one in the link.
612 Standard_Boolean HasOwnDatumAspect() const { return myHasOwnDatumAspect; }
614 //! The LineAspect for the wire can be edited.
615 //! The default values are:
616 //! Color: Quantity_NOC_ORANGE
617 //! Type of line: Aspect_TOL_SOLID
619 //! These attributes are used by the algorithm Prs3d_WFShape.
620 Standard_EXPORT const Handle(Prs3d_LineAspect)& SectionAspect();
622 //! Sets the parameter theAspect for display attributes of sections.
623 Standard_EXPORT void SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect);
625 //! Returns true if the drawer has its own attribute for
626 //! section aspect that overrides the one in the link.
627 Standard_Boolean HasOwnSectionAspect() const { return myHasOwnSectionAspect; }
629 //! Sets the parameter theAspect for the display of free boundaries.
630 //! The method sets aspect owned by the drawer that will be used during
631 //! visualization instead of the one set in link.
632 Standard_EXPORT void SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect);
634 //! Returns the values for presentation of free boundaries,
635 //! in other words, boundaries which are not shared.
636 //! The LineAspect for the free boundaries can be edited.
637 //! The default values are:
638 //! Color: Quantity_NOC_GREEN
639 //! Type of line: Aspect_TOL_SOLID
641 //! These attributes are used by the algorithm Prs3d_WFShape
642 Standard_EXPORT const Handle(Prs3d_LineAspect)& FreeBoundaryAspect();
644 //! Returns true if the drawer has its own attribute for
645 //! free boundaries aspect that overrides the one in the link.
646 Standard_Boolean HasOwnFreeBoundaryAspect() const { return myHasOwnFreeBoundaryAspect; }
648 //! Enables or disables drawing of free boundaries for shading presentations.
649 //! The method sets drawing flag owned by the drawer that will be used during
650 //! visualization instead of the one set in link.
651 //! theIsEnabled is a boolean flag indicating whether the free boundaries should be
653 Standard_EXPORT void SetFreeBoundaryDraw (const Standard_Boolean theIsEnabled);
655 //! Returns True if the drawing of the free boundaries is enabled
656 //! True is the default setting.
657 Standard_Boolean FreeBoundaryDraw() const
659 return HasOwnFreeBoundaryDraw() || myLink.IsNull()
661 : myLink->FreeBoundaryDraw();
664 //! Returns true if the drawer has its own attribute for
665 //! "draw free boundaries" flag that overrides the one in the link.
666 Standard_Boolean HasOwnFreeBoundaryDraw() const { return myHasOwnFreeBoundaryDraw; }
668 //! Sets the parameter theAspect for the display of shared boundaries.
669 //! The method sets aspect owned by the drawer that will be used during
670 //! visualization instead of the one set in link.
671 Standard_EXPORT void SetUnFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect);
673 //! Returns settings for shared boundary line aspects.
674 //! The LineAspect for the unfree boundaries can be edited.
675 //! The default values are:
676 //! Color: Quantity_NOC_YELLOW
677 //! Type of line: Aspect_TOL_SOLID
679 //! These attributes are used by the algorithm Prs3d_WFShape
680 Standard_EXPORT const Handle(Prs3d_LineAspect)& UnFreeBoundaryAspect();
682 //! Returns true if the drawer has its own attribute for
683 //! unfree boundaries aspect that overrides the one in the link.
684 Standard_Boolean HasOwnUnFreeBoundaryAspect() const { return myHasOwnUnFreeBoundaryAspect; }
686 //! Enables or disables drawing of shared boundaries for shading presentations.
687 //! The method sets drawing flag owned by the drawer that will be used during
688 //! visualization instead of the one set in link.
689 //! theIsEnabled is a boolean flag indicating whether the shared boundaries should be drawn or not.
690 Standard_EXPORT void SetUnFreeBoundaryDraw (const Standard_Boolean theIsEnabled);
692 //! Returns True if the drawing of the shared boundaries is enabled.
693 //! True is the default setting.
694 Standard_Boolean UnFreeBoundaryDraw() const
696 return HasOwnUnFreeBoundaryDraw() || myLink.IsNull()
697 ? myUnFreeBoundaryDraw
698 : myLink->UnFreeBoundaryDraw();
701 //! Returns true if the drawer has its own attribute for
702 //! "draw shared boundaries" flag that overrides the one in the link.
703 Standard_Boolean HasOwnUnFreeBoundaryDraw() const { return myHasOwnUnFreeBoundaryDraw; }
705 //! Sets line aspect for face boundaries.
706 //! The method sets line aspect owned by the drawer that will be used during
707 //! visualization instead of the one set in link.
708 //! theAspect is the line aspect that determines the look of the face boundaries.
709 Standard_EXPORT void SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect);
711 //! Returns line aspect of face boundaries.
712 Standard_EXPORT const Handle(Prs3d_LineAspect)& FaceBoundaryAspect();
714 //! Returns true if the drawer has its own attribute for
715 //! face boundaries aspect that overrides the one in the link.
716 Standard_Boolean HasOwnFaceBoundaryAspect() const { return myHasOwnFaceBoundaryAspect; }
718 //! Enables or disables face boundary drawing for shading presentations.
719 //! The method sets drawing flag owned by the drawer that will be used during
720 //! visualization instead of the one set in link.
721 //! theIsEnabled is a boolean flag indicating whether the face boundaries should be drawn or not.
722 Standard_EXPORT void SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled);
724 //! Checks whether the face boundary drawing is enabled or not.
725 Standard_Boolean FaceBoundaryDraw() const
727 return HasOwnFaceBoundaryDraw() || myLink.IsNull()
729 : myLink->FaceBoundaryDraw();
732 //! Returns true if the drawer has its own attribute for
733 //! "draw face boundaries" flag that overrides the one in the link.
734 Standard_Boolean HasOwnFaceBoundaryDraw() const { return myHasOwnFaceBoundaryDraw; }
736 //! Returns settings for the appearance of dimensions.
737 Standard_EXPORT const Handle(Prs3d_DimensionAspect)& DimensionAspect();
739 //! Sets the settings for the appearance of dimensions.
740 //! The method sets aspect owned by the drawer that will be used during
741 //! visualization instead of the one set in link.
742 Standard_EXPORT void SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect);
744 //! Returns true if the drawer has its own attribute for
745 //! the appearance of dimensions that overrides the one in the link.
746 Standard_Boolean HasOwnDimensionAspect() const { return myHasOwnDimensionAspect; }
748 //! Sets dimension length model units for computing of dimension presentation.
749 //! The method sets value owned by the drawer that will be used during
750 //! visualization instead of the one set in link.
751 Standard_EXPORT void SetDimLengthModelUnits (const TCollection_AsciiString& theUnits);
753 //! Sets dimension angle model units for computing of dimension presentation.
754 //! The method sets value owned by the drawer that will be used during
755 //! visualization instead of the one set in link.
756 Standard_EXPORT void SetDimAngleModelUnits (const TCollection_AsciiString& theUnits);
758 //! Returns length model units for the dimension presentation.
759 const TCollection_AsciiString& DimLengthModelUnits() const
761 return HasOwnDimLengthModelUnits() || myLink.IsNull()
762 ? myDimensionModelUnits.GetLengthUnits()
763 : myLink->DimLengthModelUnits();
766 //! Returns angle model units for the dimension presentation.
767 const TCollection_AsciiString& DimAngleModelUnits() const
769 return HasOwnDimAngleModelUnits() || myLink.IsNull()
770 ? myDimensionModelUnits.GetAngleUnits()
771 : myLink->DimAngleModelUnits();
774 //! Returns true if the drawer has its own attribute for
775 //! dimension length model units that overrides the one in the link.
776 Standard_Boolean HasOwnDimLengthModelUnits() const { return myHasOwnDimLengthModelUnits; }
778 //! Returns true if the drawer has its own attribute for
779 //! dimension angle model units that overrides the one in the link.
780 Standard_Boolean HasOwnDimAngleModelUnits() const { return myHasOwnDimAngleModelUnits; }
782 //! Sets length units in which value for dimension presentation is displayed.
783 //! The method sets value owned by the drawer that will be used during
784 //! visualization instead of the one set in link.
785 Standard_EXPORT void SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits);
787 //! Sets angle units in which value for dimension presentation is displayed.
788 //! The method sets value owned by the drawer that will be used during
789 //! visualization instead of the one set in link.
790 Standard_EXPORT void SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits);
792 //! Returns length units in which dimension presentation is displayed.
793 const TCollection_AsciiString& DimLengthDisplayUnits() const
795 return HasOwnDimLengthDisplayUnits() || myLink.IsNull()
796 ? myDimensionDisplayUnits.GetLengthUnits()
797 : myLink->DimLengthDisplayUnits();
800 //! Returns angle units in which dimension presentation is displayed.
801 const TCollection_AsciiString& DimAngleDisplayUnits() const
803 return HasOwnDimAngleDisplayUnits() || myLink.IsNull()
804 ? myDimensionDisplayUnits.GetAngleUnits()
805 : myLink->DimAngleDisplayUnits();
808 //! Returns true if the drawer has its own attribute for
809 //! length units in which dimension presentation is displayed
810 //! that overrides the one in the link.
811 Standard_Boolean HasOwnDimLengthDisplayUnits() const { return myHasOwnDimLengthDisplayUnits; }
813 //! Returns true if the drawer has its own attribute for
814 //! angle units in which dimension presentation is displayed
815 //! that overrides the one in the link.
816 Standard_Boolean HasOwnDimAngleDisplayUnits() const { return myHasOwnDimAngleDisplayUnits; }
818 //! Returns the drawer to which the current object references.
819 const Handle(Prs3d_Drawer)& Link() { return myLink; }
821 //! Returns true if the current object has a link on the other drawer.
822 Standard_Boolean HasLink() const { return !myLink.IsNull(); }
824 //! Sets theDrawer as a link to which the current object references.
825 void Link (const Handle(Prs3d_Drawer)& theDrawer)
830 //! Removes local attributes.
831 Standard_EXPORT void ClearLocalAttributes();
835 Handle(Prs3d_Drawer) myLink;
837 Standard_Integer myNbPoints;
838 Standard_Boolean myHasOwnNbPoints;
839 Standard_Real myMaximalParameterValue;
840 Standard_Boolean myHasOwnMaximalParameterValue;
841 Quantity_Length myChordialDeviation;
842 Standard_Boolean myHasOwnChordialDeviation;
843 Aspect_TypeOfDeflection myTypeOfDeflection;
844 Standard_Boolean myHasOwnTypeOfDeflection;
845 Prs3d_TypeOfHLR myTypeOfHLR;
846 Standard_Real myDeviationCoefficient;
847 Standard_Real myPreviousDeviationCoefficient;
848 Standard_Boolean myHasOwnDeviationCoefficient;
849 Standard_Real myHLRDeviationCoefficient;
850 Standard_Boolean myHasOwnHLRDeviationCoefficient;
851 Standard_Real myPreviousHLRDeviationCoefficient;
852 Standard_Real myDeviationAngle;
853 Standard_Boolean myHasOwnDeviationAngle;
854 Standard_Real myPreviousDeviationAngle;
855 Standard_Real myHLRAngle;
856 Standard_Boolean myHasOwnHLRDeviationAngle;
857 Standard_Real myPreviousHLRDeviationAngle;
858 Standard_Boolean myIsoOnPlane;
859 Standard_Boolean myHasOwnIsoOnPlane;
860 Standard_Boolean myIsAutoTriangulated;
861 Standard_Boolean myHasOwnIsAutoTriangulated;
863 Handle(Prs3d_IsoAspect) myUIsoAspect;
864 Standard_Boolean myHasOwnUIsoAspect;
865 Handle(Prs3d_IsoAspect) myVIsoAspect;
866 Standard_Boolean myHasOwnVIsoAspect;
867 Handle(Prs3d_LineAspect) myWireAspect;
868 Standard_Boolean myHasOwnWireAspect;
869 Standard_Boolean myWireDraw;
870 Standard_Boolean myHasOwnWireDraw;
871 Handle(Prs3d_PointAspect) myPointAspect;
872 Standard_Boolean myHasOwnPointAspect;
873 Handle(Prs3d_LineAspect) myLineAspect;
874 Standard_Boolean myHasOwnLineAspect;
875 Handle(Prs3d_TextAspect) myTextAspect;
876 Standard_Boolean myHasOwnTextAspect;
877 Handle(Prs3d_ShadingAspect) myShadingAspect;
878 Standard_Boolean myHasOwnShadingAspect;
879 Standard_Boolean myShadingAspectGlobal;
880 Standard_Boolean myHasOwnShadingAspectGlobal;
881 Handle(Prs3d_PlaneAspect) myPlaneAspect;
882 Standard_Boolean myHasOwnPlaneAspect;
883 Handle(Prs3d_LineAspect) mySeenLineAspect;
884 Standard_Boolean myHasOwnSeenLineAspect;
885 Handle(Prs3d_ArrowAspect) myArrowAspect;
886 Standard_Boolean myHasOwnArrowAspect;
887 Standard_Boolean myLineArrowDraw;
888 Standard_Boolean myHasOwnLineArrowDraw;
889 Handle(Prs3d_LineAspect) myHiddenLineAspect;
890 Standard_Boolean myHasOwnHiddenLineAspect;
891 Standard_Boolean myDrawHiddenLine;
892 Standard_Boolean myHasOwnDrawHiddenLine;
893 Handle(Prs3d_LineAspect) myVectorAspect;
894 Standard_Boolean myHasOwnVectorAspect;
895 Prs3d_VertexDrawMode myVertexDrawMode;
896 Handle(Prs3d_DatumAspect) myDatumAspect;
897 Standard_Boolean myHasOwnDatumAspect;
898 Handle(Prs3d_LineAspect) mySectionAspect;
899 Standard_Boolean myHasOwnSectionAspect;
901 Handle(Prs3d_LineAspect) myFreeBoundaryAspect;
902 Standard_Boolean myHasOwnFreeBoundaryAspect;
903 Standard_Boolean myFreeBoundaryDraw;
904 Standard_Boolean myHasOwnFreeBoundaryDraw;
905 Handle(Prs3d_LineAspect) myUnFreeBoundaryAspect;
906 Standard_Boolean myHasOwnUnFreeBoundaryAspect;
907 Standard_Boolean myUnFreeBoundaryDraw;
908 Standard_Boolean myHasOwnUnFreeBoundaryDraw;
909 Handle(Prs3d_LineAspect) myFaceBoundaryAspect;
910 Standard_Boolean myHasOwnFaceBoundaryAspect;
911 Standard_Boolean myFaceBoundaryDraw;
912 Standard_Boolean myHasOwnFaceBoundaryDraw;
914 Handle(Prs3d_DimensionAspect) myDimensionAspect;
915 Standard_Boolean myHasOwnDimensionAspect;
916 Prs3d_DimensionUnits myDimensionModelUnits;
917 Standard_Boolean myHasOwnDimLengthModelUnits;
918 Standard_Boolean myHasOwnDimAngleModelUnits;
919 Prs3d_DimensionUnits myDimensionDisplayUnits;
920 Standard_Boolean myHasOwnDimLengthDisplayUnits;
921 Standard_Boolean myHasOwnDimAngleDisplayUnits;
925 DEFINE_STANDARD_RTTI(Prs3d_Drawer, MMgt_TShared)
929 #endif // _Prs3d_Drawer_HeaderFile