Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-04-26
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_LineAspect_HeaderFile
0018 #define _Prs3d_LineAspect_HeaderFile
0019 
0020 #include <Graphic3d_AspectLine3d.hxx>
0021 #include <Prs3d_BasicAspect.hxx>
0022 #include <Quantity_Color.hxx>
0023 
0024 //! A framework for defining how a line will be displayed
0025 //! in a presentation. Aspects of line display include
0026 //! width, color and type of line.
0027 //! The definition set by this class is then passed to the
0028 //! attribute manager Prs3d_Drawer.
0029 //! Any object which requires a value for line aspect as
0030 //! an argument may then be given the attribute manager
0031 //! as a substitute argument in the form of a field such as myDrawer for example.
0032 class Prs3d_LineAspect : public Prs3d_BasicAspect
0033 {
0034   DEFINE_STANDARD_RTTIEXT(Prs3d_LineAspect, Prs3d_BasicAspect)
0035 public:
0036   
0037   //! Constructs a framework for line aspect defined by
0038   //! -   the color aColor
0039   //! -   the type of line aType and
0040   //! -   the line thickness aWidth.
0041   //! Type of line refers to whether the line is solid or dotted, for example.
0042   Standard_EXPORT Prs3d_LineAspect (const Quantity_Color& theColor, const Aspect_TypeOfLine theType, const Standard_Real theWidth);
0043   
0044   Prs3d_LineAspect(const Handle(Graphic3d_AspectLine3d)& theAspect) : myAspect (theAspect) {}
0045 
0046   //! Sets the line color defined at the time of construction.
0047   //! Default value: Quantity_NOC_YELLOW
0048   void SetColor (const Quantity_Color& theColor) { myAspect->SetColor (theColor); }
0049 
0050   //! Sets the type of line defined at the time of construction.
0051   //! This could, for example, be solid, dotted or made up of dashes.
0052   //! Default value: Aspect_TOL_SOLID
0053   void SetTypeOfLine (const Aspect_TypeOfLine theType) { myAspect->SetType (theType); }
0054   
0055   //! Sets the line width defined at the time of construction.
0056   //! Default value: 1.
0057   void SetWidth (const Standard_Real theWidth) { myAspect->SetWidth (theWidth); }
0058 
0059   //! Returns the line aspect. This is defined as the set of
0060   //! color, type and thickness attributes.
0061   const Handle(Graphic3d_AspectLine3d)& Aspect() const { return myAspect; }
0062   
0063   void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect) { myAspect = theAspect; }
0064 
0065   //! Dumps the content of me into the stream
0066   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0067 
0068 protected:
0069 
0070   Handle(Graphic3d_AspectLine3d) myAspect;
0071 
0072 };
0073 
0074 DEFINE_STANDARD_HANDLE(Prs3d_LineAspect, Prs3d_BasicAspect)
0075 
0076 #endif // _Prs3d_LineAspect_HeaderFile