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
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_DatumAspect_HeaderFile
18 #define _Prs3d_DatumAspect_HeaderFile
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>
28 //! A framework to define the display of datums.
29 class Prs3d_DatumAspect : public Prs3d_BasicAspect
31 DEFINE_STANDARD_RTTIEXT(Prs3d_DatumAspect, Prs3d_BasicAspect)
34 //! An empty framework to define the display of datums.
35 Standard_EXPORT Prs3d_DatumAspect();
37 //! Returns the attributes for display of the first axis.
38 const Handle(Prs3d_LineAspect)& FirstAxisAspect() const { return myFirstAxisAspect; }
40 //! Returns the attributes for display of the second axis.
41 const Handle(Prs3d_LineAspect)& SecondAxisAspect() const { return mySecondAxisAspect; }
43 //! Returns the attributes for display of the third axis.
44 const Handle(Prs3d_LineAspect)& ThirdAxisAspect() const { return myThirdAxisAspect; }
46 //! Sets the DrawFirstAndSecondAxis attributes to active.
47 void SetDrawFirstAndSecondAxis (const Standard_Boolean theToDraw) { myDrawFirstAndSecondAxis = theToDraw; }
49 //! Returns true if the first and second axes can be drawn.
50 Standard_Boolean DrawFirstAndSecondAxis() const { return myDrawFirstAndSecondAxis; }
52 //! Sets the DrawThirdAxis attributes to active.
53 void SetDrawThirdAxis (const Standard_Boolean theToDraw) { myDrawThirdAxis = theToDraw; }
55 //! Returns true if the third axis can be drawn.
56 Standard_Boolean DrawThirdAxis() const { return myDrawThirdAxis; }
58 //! Sets the lengths of the three axes.
59 void SetAxisLength (const Standard_Real theL1, const Standard_Real theL2, const Standard_Real theL3)
61 myFirstAxisLength = theL1;
62 mySecondAxisLength = theL2;
63 myThirdAxisLength = theL3;
66 //! Returns the length of the displayed first axis.
67 Quantity_Length FirstAxisLength() const { return myFirstAxisLength; }
69 //! Returns the length of the displayed second axis.
70 Quantity_Length SecondAxisLength() const { return mySecondAxisLength; }
72 //! Returns the length of the displayed third axis.
73 Quantity_Length ThirdAxisLength() const { return myThirdAxisLength; }
75 //! Sets option to draw or not to draw text labels for axes
76 void SetToDrawLabels (const Standard_Boolean theToDraw) { myToDrawLabels = theToDraw; }
78 //! @return true if axes labels are drawn
79 Standard_Boolean ToDrawLabels() const { return myToDrawLabels; }
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;
95 DEFINE_STANDARD_HANDLE(Prs3d_DatumAspect, Prs3d_BasicAspect)
97 #endif // _Prs3d_DatumAspect_HeaderFile