Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:46

0001 // Created by: NW,JPB,CAL
0002 // Copyright (c) 1991-1999 Matra Datavision
0003 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _Graphic3d_AspectLine3d_HeaderFile
0017 #define _Graphic3d_AspectLine3d_HeaderFile
0018 
0019 #include <Graphic3d_Aspects.hxx>
0020 
0021 //! Creates and updates a group of attributes for 3d line primitives.
0022 //! This group contains the color, the type of line, and its thickness.
0023 class Graphic3d_AspectLine3d : public Graphic3d_Aspects
0024 {
0025   DEFINE_STANDARD_RTTIEXT(Graphic3d_AspectLine3d, Graphic3d_Aspects)
0026 public:
0027 
0028   //! Creates a context table for line primitives
0029   //! defined with the following default values:
0030   //!
0031   //! Color = Quantity_NOC_YELLOW;
0032   //! Type  = Aspect_TOL_SOLID;
0033   //! Width = 1.0;
0034   Standard_EXPORT Graphic3d_AspectLine3d();
0035   
0036   //! Creates a context table for line primitives defined with the specified values.
0037   //! Warning: theWidth is the "line width scale factor".
0038   //! The nominal line width is 1 pixel.
0039   //! The width of the line is determined by applying the line width scale factor to this nominal line width.
0040   //! The supported line widths vary by 1-pixel units.
0041   Standard_EXPORT Graphic3d_AspectLine3d (const Quantity_Color& theColor,
0042                                           Aspect_TypeOfLine theType,
0043                                           Standard_Real theWidth);
0044 
0045   //! Return line type.
0046   Aspect_TypeOfLine Type() const { return myLineType; }
0047 
0048   //! Modifies the type of line.
0049   void SetType (const Aspect_TypeOfLine theType) { SetLineType (theType); }
0050 
0051   //! Return line width.
0052   Standard_ShortReal Width() const { return myLineWidth; }
0053 
0054   //! Modifies the line thickness.
0055   //! Warning: Raises Standard_OutOfRange if the width is a negative value.
0056   void SetWidth (const Standard_Real theWidth) { SetWidth ((float )theWidth); }
0057 
0058   //! Modifies the line thickness.
0059   //! Warning: Raises Standard_OutOfRange if the width is a negative value.
0060   void SetWidth (Standard_ShortReal theWidth)
0061   {
0062     SetLineWidth (theWidth);
0063   }
0064 
0065 };
0066 
0067 DEFINE_STANDARD_HANDLE(Graphic3d_AspectLine3d, Graphic3d_Aspects)
0068 
0069 #endif // _Graphic3d_AspectLine3d_HeaderFile