Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:15:48

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   //! Creates a context table for line primitives
0028   //! defined with the following default values:
0029   //!
0030   //! Color = Quantity_NOC_YELLOW;
0031   //! Type  = Aspect_TOL_SOLID;
0032   //! Width = 1.0;
0033   Standard_EXPORT Graphic3d_AspectLine3d();
0034 
0035   //! Creates a context table for line primitives defined with the specified values.
0036   //! Warning: theWidth is the "line width scale factor".
0037   //! The nominal line width is 1 pixel.
0038   //! The width of the line is determined by applying the line width scale factor to this nominal
0039   //! line width. The supported line widths vary by 1-pixel units.
0040   Standard_EXPORT Graphic3d_AspectLine3d(const Quantity_Color& theColor,
0041                                          Aspect_TypeOfLine     theType,
0042                                          double                theWidth);
0043 
0044   //! Return line type.
0045   Aspect_TypeOfLine Type() const { return myLineType; }
0046 
0047   //! Modifies the type of line.
0048   void SetType(const Aspect_TypeOfLine theType) { SetLineType(theType); }
0049 
0050   //! Return line width.
0051   float Width() const { return myLineWidth; }
0052 
0053   //! Modifies the line thickness.
0054   //! Warning: Raises Standard_OutOfRange if the width is a negative value.
0055   void SetWidth(const double theWidth) { SetWidth((float)theWidth); }
0056 
0057   //! Modifies the line thickness.
0058   //! Warning: Raises Standard_OutOfRange if the width is a negative value.
0059   void SetWidth(float theWidth) { SetLineWidth(theWidth); }
0060 };
0061 
0062 #endif // _Graphic3d_AspectLine3d_HeaderFile