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
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_ArrowAspect_HeaderFile
18 #define _Prs3d_ArrowAspect_HeaderFile
20 #include <Graphic3d_AspectLine3d.hxx>
21 #include <Prs3d_BasicAspect.hxx>
23 //! A framework for displaying arrows in representations of dimensions and relations.
24 class Prs3d_ArrowAspect : public Prs3d_BasicAspect
26 DEFINE_STANDARD_RTTIEXT(Prs3d_ArrowAspect, Prs3d_BasicAspect)
29 //! Constructs an empty framework for displaying arrows
30 //! in representations of lengths. The lengths displayed
31 //! are either on their own or in chamfers, fillets,
32 //! diameters and radii.
33 Standard_EXPORT Prs3d_ArrowAspect();
35 //! Constructs a framework to display an arrow with a
36 //! shaft of the length aLength and having a head with
37 //! sides at the angle anAngle from each other.
38 Standard_EXPORT Prs3d_ArrowAspect(const Standard_Real anAngle, const Standard_Real aLength);
40 Standard_EXPORT Prs3d_ArrowAspect(const Handle(Graphic3d_AspectLine3d)& theAspect);
42 //! defines the angle of the arrows.
43 Standard_EXPORT void SetAngle (const Standard_Real anAngle);
45 //! returns the current value of the angle used when drawing an arrow.
46 Standard_Real Angle() const { return myAngle; }
48 //! Defines the length of the arrows.
49 void SetLength (const Standard_Real theLength) { myLength = theLength; }
51 //! Returns the current value of the length used when drawing an arrow.
52 Standard_Real Length() const { return myLength; }
54 //! Turns usage of arrow zoomable on/off
55 void SetZoomable (bool theIsZoomable) { myIsZoomable = theIsZoomable; }
57 //! Returns TRUE when the Arrow Zoomable is on; TRUE by default.
58 bool IsZoomable() const { return myIsZoomable; }
60 void SetColor (const Quantity_Color& theColor) { myArrowAspect->SetColor (theColor); }
62 const Handle(Graphic3d_AspectLine3d)& Aspect() const { return myArrowAspect; }
64 void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect) { myArrowAspect = theAspect; }
66 //! Dumps the content of me into the stream
67 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
71 Handle(Graphic3d_AspectLine3d) myArrowAspect;
72 Standard_Real myAngle;
73 Standard_Real myLength;
74 Standard_Boolean myIsZoomable;
78 DEFINE_STANDARD_HANDLE(Prs3d_ArrowAspect, Prs3d_BasicAspect)
80 #endif // _Prs3d_ArrowAspect_HeaderFile