0028726: Quantity_NameOfColor should be replaced by Quantity_Color in function input...
[occt.git] / src / Prs3d / Prs3d_ArrowAspect.hxx
1 // Created on: 1993-06-11
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_ArrowAspect_HeaderFile
18 #define _Prs3d_ArrowAspect_HeaderFile
19
20 #include <Graphic3d_AspectLine3d.hxx>
21 #include <Prs3d_BasicAspect.hxx>
22 #include <Quantity_PlaneAngle.hxx>
23 #include <Quantity_Length.hxx>
24
25 //! A framework for displaying arrows in representations of dimensions and relations.
26 class Prs3d_ArrowAspect : public Prs3d_BasicAspect
27 {
28   DEFINE_STANDARD_RTTIEXT(Prs3d_ArrowAspect, Prs3d_BasicAspect)
29 public:
30
31   //! Constructs an empty framework for displaying arrows
32   //! in representations of lengths. The lengths displayed
33   //! are either on their own or in chamfers, fillets,
34   //! diameters and radii.
35   Standard_EXPORT Prs3d_ArrowAspect();
36   
37   //! Constructs a framework to display an arrow with a
38   //! shaft of the length aLength and having a head with
39   //! sides at the angle anAngle from each other.
40   Standard_EXPORT Prs3d_ArrowAspect(const Quantity_PlaneAngle anAngle, const Quantity_Length aLength);
41   
42   Standard_EXPORT Prs3d_ArrowAspect(const Handle(Graphic3d_AspectLine3d)& theAspect);
43   
44   //! defines the angle of the arrows.
45   Standard_EXPORT void SetAngle (const Quantity_PlaneAngle anAngle);
46   
47   //! returns the current value of the angle used when drawing an arrow.
48   Quantity_PlaneAngle Angle() const { return myAngle; }
49
50   //! Defines the length of the arrows.
51   void SetLength (const Quantity_Length theLength) { myLength = theLength; }
52
53   //! Returns the current value of the length used when drawing an arrow.
54   Quantity_Length Length() const { return myLength; }
55
56   void SetColor (const Quantity_Color& theColor) { myArrowAspect->SetColor (theColor); }
57   
58   const Handle(Graphic3d_AspectLine3d)& Aspect() const { return myArrowAspect; }
59   
60   void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect) { myArrowAspect = theAspect; }
61
62 protected:
63
64   Handle(Graphic3d_AspectLine3d) myArrowAspect;
65   Quantity_PlaneAngle myAngle;
66   Quantity_Length myLength;
67
68 };
69
70 DEFINE_STANDARD_HANDLE(Prs3d_ArrowAspect, Prs3d_BasicAspect)
71
72 #endif // _Prs3d_ArrowAspect_HeaderFile