Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:39

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 
0029   //! Constructs an empty framework for displaying arrows
0030   //! in representations of lengths. The lengths displayed
0031   //! are either on their own or in chamfers, fillets,
0032   //! diameters and radii.
0033   Standard_EXPORT Prs3d_ArrowAspect();
0034   
0035   //! Constructs a framework to display an arrow with a
0036   //! shaft of the length aLength and having a head with
0037   //! sides at the angle anAngle from each other.
0038   Standard_EXPORT Prs3d_ArrowAspect(const Standard_Real anAngle, const Standard_Real aLength);
0039   
0040   Standard_EXPORT Prs3d_ArrowAspect(const Handle(Graphic3d_AspectLine3d)& theAspect);
0041   
0042   //! defines the angle of the arrows.
0043   Standard_EXPORT void SetAngle (const Standard_Real anAngle);
0044   
0045   //! returns the current value of the angle used when drawing an arrow.
0046   Standard_Real Angle() const { return myAngle; }
0047 
0048   //! Defines the length of the arrows.
0049   void SetLength (const Standard_Real theLength) { myLength = theLength; }
0050 
0051   //! Returns the current value of the length used when drawing an arrow.
0052   Standard_Real Length() const { return myLength; }
0053 
0054   //! Turns usage of arrow zoomable on/off
0055   void SetZoomable (bool theIsZoomable) { myIsZoomable = theIsZoomable; }
0056 
0057   //! Returns TRUE when the Arrow Zoomable is on; TRUE by default.
0058   bool IsZoomable() const { return myIsZoomable; }
0059 
0060   void SetColor (const Quantity_Color& theColor) { myArrowAspect->SetColor (theColor); }
0061   
0062   const Handle(Graphic3d_AspectLine3d)& Aspect() const { return myArrowAspect; }
0063   
0064   void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect) { myArrowAspect = theAspect; }
0065 
0066   //! Dumps the content of me into the stream
0067   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0068 
0069 protected:
0070 
0071   Handle(Graphic3d_AspectLine3d) myArrowAspect;
0072   Standard_Real myAngle;
0073   Standard_Real myLength;
0074   Standard_Boolean myIsZoomable;
0075 
0076 };
0077 
0078 DEFINE_STANDARD_HANDLE(Prs3d_ArrowAspect, Prs3d_BasicAspect)
0079 
0080 #endif // _Prs3d_ArrowAspect_HeaderFile