Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-03 08:33:46

0001 // Created on: 1993-06-11
0002 // Created by: Jean-Louis FRENKEL
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Prs3d_ArrowAspect_HeaderFile
0018 #define _Prs3d_ArrowAspect_HeaderFile
0019 
0020 #include <Graphic3d_AspectLine3d.hxx>
0021 #include <Prs3d_BasicAspect.hxx>
0022 
0023 //! A framework for displaying arrows in representations of dimensions and relations.
0024 class Prs3d_ArrowAspect : public Prs3d_BasicAspect
0025 {
0026   DEFINE_STANDARD_RTTIEXT(Prs3d_ArrowAspect, Prs3d_BasicAspect)
0027 public:
0028   //! Constructs an empty framework for displaying arrows
0029   //! in representations of lengths. The lengths displayed
0030   //! are either on their own or in chamfers, fillets,
0031   //! diameters and radii.
0032   Standard_EXPORT Prs3d_ArrowAspect();
0033 
0034   //! Constructs a framework to display an arrow with a
0035   //! shaft of the length aLength and having a head with
0036   //! sides at the angle anAngle from each other.
0037   Standard_EXPORT Prs3d_ArrowAspect(const Standard_Real anAngle, const Standard_Real aLength);
0038 
0039   Standard_EXPORT Prs3d_ArrowAspect(const Handle(Graphic3d_AspectLine3d)& theAspect);
0040 
0041   //! defines the angle of the arrows.
0042   Standard_EXPORT void SetAngle(const Standard_Real anAngle);
0043 
0044   //! returns the current value of the angle used when drawing an arrow.
0045   Standard_Real Angle() const { return myAngle; }
0046 
0047   //! Defines the length of the arrows.
0048   void SetLength(const Standard_Real theLength) { myLength = theLength; }
0049 
0050   //! Returns the current value of the length used when drawing an arrow.
0051   Standard_Real Length() const { return myLength; }
0052 
0053   //! Turns usage of arrow zoomable on/off
0054   void SetZoomable(bool theIsZoomable) { myIsZoomable = theIsZoomable; }
0055 
0056   //! Returns TRUE when the Arrow Zoomable is on; TRUE by default.
0057   bool IsZoomable() const { return myIsZoomable; }
0058 
0059   void SetColor(const Quantity_Color& theColor) { myArrowAspect->SetColor(theColor); }
0060 
0061   const Handle(Graphic3d_AspectLine3d)& Aspect() const { return myArrowAspect; }
0062 
0063   void SetAspect(const Handle(Graphic3d_AspectLine3d)& theAspect) { myArrowAspect = theAspect; }
0064 
0065   //! Dumps the content of me into the stream
0066   Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream,
0067                                         Standard_Integer  theDepth = -1) const Standard_OVERRIDE;
0068 
0069 protected:
0070   Handle(Graphic3d_AspectLine3d) myArrowAspect;
0071   Standard_Real                  myAngle;
0072   Standard_Real                  myLength;
0073   Standard_Boolean               myIsZoomable;
0074 };
0075 
0076 DEFINE_STANDARD_HANDLE(Prs3d_ArrowAspect, Prs3d_BasicAspect)
0077 
0078 #endif // _Prs3d_ArrowAspect_HeaderFile