1 // Created on: 1994-01-17
2 // Created by: Modelistation
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Prs3d_PlaneAspect_HeaderFile
18 #define _Prs3d_PlaneAspect_HeaderFile
20 #include <Prs3d_LineAspect.hxx>
22 //! A framework to define the display of planes.
23 class Prs3d_PlaneAspect : public Prs3d_BasicAspect
25 DEFINE_STANDARD_RTTIEXT(Prs3d_PlaneAspect, Prs3d_BasicAspect)
28 //! Constructs an empty framework for the display of planes.
29 Standard_EXPORT Prs3d_PlaneAspect();
31 //! Returns the attributes of displayed edges involved in the presentation of planes.
32 const Handle(Prs3d_LineAspect)& EdgesAspect() const { return myEdgesAspect; }
34 //! Returns the attributes of displayed isoparameters involved in the presentation of planes.
35 const Handle(Prs3d_LineAspect)& IsoAspect() const { return myIsoAspect; }
37 //! Returns the settings for displaying an arrow.
38 const Handle(Prs3d_LineAspect)& ArrowAspect() const { return myArrowAspect; }
40 void SetArrowsLength (const Standard_Real theLength) { myArrowsLength = theLength; }
42 //! Returns the length of the arrow shaft used in the display of arrows.
43 Standard_Real ArrowsLength() const { return myArrowsLength; }
45 //! Sets the angle of the arrowhead used in the display of planes.
46 void SetArrowsSize (const Standard_Real theSize) { myArrowsSize = theSize; }
48 //! Returns the size of arrows used in the display of planes.
49 Standard_Real ArrowsSize() const { return myArrowsSize; }
51 //! Sets the angle of the arrowhead used in the display
52 //! of arrows involved in the presentation of planes.
53 void SetArrowsAngle (const Standard_Real theAngle) { myArrowsAngle = theAngle; }
55 //! Returns the angle of the arrowhead used in the
56 //! display of arrows involved in the presentation of planes.
57 Standard_Real ArrowsAngle() const { return myArrowsAngle; }
59 //! Sets the display attributes defined in DisplayCenterArrow to active.
60 void SetDisplayCenterArrow (const Standard_Boolean theToDraw) { myDrawCenterArrow = theToDraw; }
62 //! Returns true if the display of center arrows is allowed.
63 Standard_Boolean DisplayCenterArrow() const { return myDrawCenterArrow; }
65 //! Sets the display attributes defined in DisplayEdgesArrows to active.
66 void SetDisplayEdgesArrows (const Standard_Boolean theToDraw) { myDrawEdgesArrows = theToDraw; }
68 //! Returns true if the display of edge arrows is allowed.
69 Standard_Boolean DisplayEdgesArrows() const { return myDrawEdgesArrows; }
71 void SetDisplayEdges (const Standard_Boolean theToDraw) { myDrawEdges = theToDraw; }
73 Standard_Boolean DisplayEdges() const { return myDrawEdges; }
75 //! Sets the display attributes defined in DisplayIso to active.
76 void SetDisplayIso (const Standard_Boolean theToDraw) { myDrawIso = theToDraw; }
78 //! Returns true if the display of isoparameters is allowed.
79 Standard_Boolean DisplayIso() const { return myDrawIso; }
81 void SetPlaneLength (const Standard_Real theLX, const Standard_Real theLY)
83 myPlaneXLength = theLX;
84 myPlaneYLength = theLY;
87 //! Returns the length of the x axis used in the display of planes.
88 Standard_Real PlaneXLength() const { return myPlaneXLength; }
90 //! Returns the length of the y axis used in the display of planes.
91 Standard_Real PlaneYLength() const { return myPlaneYLength; }
93 //! Sets the distance L between isoparameters used in the display of planes.
94 void SetIsoDistance (const Standard_Real theL) { myIsoDistance = theL; }
96 //! Returns the distance between isoparameters used in the display of planes.
97 Standard_Real IsoDistance() const { return myIsoDistance; }
99 //! Dumps the content of me into the stream
100 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
104 Handle(Prs3d_LineAspect) myEdgesAspect;
105 Handle(Prs3d_LineAspect) myIsoAspect;
106 Handle(Prs3d_LineAspect) myArrowAspect;
107 Standard_Real myArrowsLength;
108 Standard_Real myArrowsSize;
109 Standard_Real myArrowsAngle;
110 Standard_Real myPlaneXLength;
111 Standard_Real myPlaneYLength;
112 Standard_Real myIsoDistance;
113 Standard_Boolean myDrawCenterArrow;
114 Standard_Boolean myDrawEdgesArrows;
115 Standard_Boolean myDrawEdges;
116 Standard_Boolean myDrawIso;
120 DEFINE_STANDARD_HANDLE(Prs3d_PlaneAspect, Prs3d_BasicAspect)
122 #endif // _Prs3d_PlaneAspect_HeaderFile