0031313: Foundation Classes - Dump improvement for classes
[occt.git] / src / Prs3d / Prs3d_PlaneAspect.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Prs3d_PlaneAspect_HeaderFile
18 #define _Prs3d_PlaneAspect_HeaderFile
19
20 #include <Prs3d_LineAspect.hxx>
21
22 //! A framework to define the display of planes.
23 class Prs3d_PlaneAspect : public Prs3d_BasicAspect
24 {
25   DEFINE_STANDARD_RTTIEXT(Prs3d_PlaneAspect, Prs3d_BasicAspect)
26 public:
27
28   //! Constructs an empty framework for the display of planes.
29   Standard_EXPORT Prs3d_PlaneAspect();
30   
31   //! Returns the attributes of displayed edges involved in the presentation of planes.
32   const Handle(Prs3d_LineAspect)& EdgesAspect() const { return myEdgesAspect; }
33
34   //! Returns the attributes of displayed isoparameters involved in the presentation of planes.
35   const Handle(Prs3d_LineAspect)& IsoAspect() const { return myIsoAspect; }
36   
37   //! Returns the settings for displaying an arrow.
38   const Handle(Prs3d_LineAspect)& ArrowAspect() const { return myArrowAspect; }
39   
40   void SetArrowsLength (const Standard_Real theLength) { myArrowsLength = theLength; }
41   
42   //! Returns the length of the arrow shaft used in the display of arrows.
43   Standard_Real ArrowsLength() const { return myArrowsLength; }
44   
45   //! Sets the angle of the arrowhead used in the display of planes.
46   void SetArrowsSize (const Standard_Real theSize) { myArrowsSize = theSize; }
47   
48   //! Returns the size of arrows used in the display of planes.
49   Standard_Real ArrowsSize() const { return myArrowsSize; }
50
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; }
54   
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; }
58   
59   //! Sets the display attributes defined in DisplayCenterArrow to active.
60   void SetDisplayCenterArrow (const Standard_Boolean theToDraw) { myDrawCenterArrow = theToDraw; }
61   
62   //! Returns true if the display of center arrows is allowed.
63   Standard_Boolean DisplayCenterArrow() const { return myDrawCenterArrow; }
64   
65   //! Sets the display attributes defined in DisplayEdgesArrows to active.
66   void SetDisplayEdgesArrows (const Standard_Boolean theToDraw) { myDrawEdgesArrows = theToDraw; }
67   
68   //! Returns true if the display of edge arrows is allowed.
69   Standard_Boolean DisplayEdgesArrows() const { return myDrawEdgesArrows; }
70   
71   void SetDisplayEdges (const Standard_Boolean theToDraw) { myDrawEdges = theToDraw; }
72   
73   Standard_Boolean DisplayEdges() const { return myDrawEdges; }
74   
75   //! Sets the display attributes defined in DisplayIso to active.
76   void SetDisplayIso (const Standard_Boolean theToDraw) { myDrawIso = theToDraw; }
77   
78   //! Returns true if the display of isoparameters is allowed.
79   Standard_Boolean DisplayIso() const { return myDrawIso; }
80   
81   void SetPlaneLength (const Standard_Real theLX, const Standard_Real theLY)
82   {
83     myPlaneXLength = theLX;
84     myPlaneYLength = theLY;
85   }
86   
87   //! Returns the length of the x axis used in the display of planes.
88   Standard_Real PlaneXLength() const { return myPlaneXLength; }
89   
90   //! Returns the length of the y axis used in the display of planes.
91   Standard_Real PlaneYLength() const { return myPlaneYLength; }
92   
93   //! Sets the distance L between isoparameters used in the display of planes.
94   void SetIsoDistance (const Standard_Real theL) { myIsoDistance = theL; }
95   
96   //! Returns the distance between isoparameters used in the display of planes.
97   Standard_Real IsoDistance() const { return myIsoDistance; }
98
99   //! Dumps the content of me into the stream
100   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
101
102 protected:
103
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;
117
118 };
119
120 DEFINE_STANDARD_HANDLE(Prs3d_PlaneAspect, Prs3d_BasicAspect)
121
122 #endif // _Prs3d_PlaneAspect_HeaderFile