0028263: Coding Rules - clean up definition of the class Graphic3d_MaterialAspect
[occt.git] / src / Prs3d / Prs3d_DatumAspect.hxx
1 // Created on: 1993-07-30
2 // Created by: Jean-Louis FRENKEL
3 // Copyright (c) 1993-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_DatumAspect_HeaderFile
18 #define _Prs3d_DatumAspect_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22 #include <Standard_Boolean.hxx>
23 #include <Quantity_Length.hxx>
24 #include <Prs3d_BasicAspect.hxx>
25 #include <Prs3d_LineAspect.hxx>
26 #include <Standard_Real.hxx>
27
28 //! A framework to define the display of datums.
29 class Prs3d_DatumAspect : public Prs3d_BasicAspect
30 {
31   DEFINE_STANDARD_RTTIEXT(Prs3d_DatumAspect, Prs3d_BasicAspect)
32 public:
33
34   //! An empty framework to define the display of datums.
35   Standard_EXPORT Prs3d_DatumAspect();
36   
37   //! Returns the attributes for display of the first axis.
38   const Handle(Prs3d_LineAspect)& FirstAxisAspect() const { return myFirstAxisAspect; }
39   
40   //! Returns the attributes for display of the second axis.
41   const Handle(Prs3d_LineAspect)& SecondAxisAspect() const { return mySecondAxisAspect; }
42   
43   //! Returns the attributes for display of the third axis.
44   const Handle(Prs3d_LineAspect)& ThirdAxisAspect() const { return myThirdAxisAspect; }
45   
46   //! Sets the DrawFirstAndSecondAxis attributes to active.
47   void SetDrawFirstAndSecondAxis (const Standard_Boolean theToDraw) { myDrawFirstAndSecondAxis = theToDraw; }
48   
49   //! Returns true if the first and second axes can be drawn.
50   Standard_Boolean DrawFirstAndSecondAxis() const { return myDrawFirstAndSecondAxis; }
51
52   //! Sets the DrawThirdAxis attributes to active.
53   void SetDrawThirdAxis (const Standard_Boolean theToDraw) { myDrawThirdAxis = theToDraw; }
54   
55   //! Returns true if the third axis can be drawn.
56   Standard_Boolean DrawThirdAxis() const { return myDrawThirdAxis; }
57
58   //! Sets the lengths of the three axes.
59   void SetAxisLength (const Standard_Real theL1, const Standard_Real theL2, const Standard_Real theL3)
60   {
61     myFirstAxisLength  = theL1;
62     mySecondAxisLength = theL2;
63     myThirdAxisLength  = theL3;
64   }
65
66   //! Returns the length of the displayed first axis.
67   Quantity_Length FirstAxisLength() const { return myFirstAxisLength; }
68
69   //! Returns the length of the displayed second axis.
70   Quantity_Length SecondAxisLength() const { return mySecondAxisLength; }
71   
72   //! Returns the length of the displayed third axis.
73   Quantity_Length ThirdAxisLength() const { return myThirdAxisLength; }
74
75   //! Sets option to draw or not to draw text labels for axes
76   void SetToDrawLabels (const Standard_Boolean theToDraw) { myToDrawLabels = theToDraw; }
77
78   //! @return true if axes labels are drawn
79   Standard_Boolean ToDrawLabels() const { return myToDrawLabels; }
80
81 private:
82
83   Handle(Prs3d_LineAspect) myFirstAxisAspect;
84   Handle(Prs3d_LineAspect) mySecondAxisAspect;
85   Handle(Prs3d_LineAspect) myThirdAxisAspect;
86   Standard_Boolean myDrawFirstAndSecondAxis;
87   Standard_Boolean myDrawThirdAxis;
88   Standard_Boolean myToDrawLabels;
89   Quantity_Length myFirstAxisLength;
90   Quantity_Length mySecondAxisLength;
91   Quantity_Length myThirdAxisLength;
92
93 };
94
95 DEFINE_STANDARD_HANDLE(Prs3d_DatumAspect, Prs3d_BasicAspect)
96
97 #endif // _Prs3d_DatumAspect_HeaderFile