1 // Created by: NW,JPB,CAL
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _Graphic3d_AspectLine3d_HeaderFile
17 #define _Graphic3d_AspectLine3d_HeaderFile
19 #include <Graphic3d_Aspects.hxx>
21 //! Creates and updates a group of attributes for 3d line primitives.
22 //! This group contains the color, the type of line, and its thickness.
23 class Graphic3d_AspectLine3d : public Graphic3d_Aspects
25 DEFINE_STANDARD_RTTIEXT(Graphic3d_AspectLine3d, Graphic3d_Aspects)
28 //! Creates a context table for line primitives
29 //! defined with the following default values:
31 //! Color = Quantity_NOC_YELLOW;
32 //! Type = Aspect_TOL_SOLID;
34 Standard_EXPORT Graphic3d_AspectLine3d();
36 //! Creates a context table for line primitives defined with the specified values.
37 //! Warning: theWidth is the "line width scale factor".
38 //! The nominal line width is 1 pixel.
39 //! The width of the line is determined by applying the line width scale factor to this nominal line width.
40 //! The supported line widths vary by 1-pixel units.
41 Standard_EXPORT Graphic3d_AspectLine3d (const Quantity_Color& theColor,
42 Aspect_TypeOfLine theType,
43 Standard_Real theWidth);
46 Aspect_TypeOfLine Type() const { return myLineType; }
48 //! Modifies the type of line.
49 void SetType (const Aspect_TypeOfLine theType) { myLineType = theType; }
51 //! Return line width.
52 Standard_ShortReal Width() const { return myLineWidth; }
54 //! Modifies the line thickness.
55 //! Warning: Raises Standard_OutOfRange if the width is a negative value.
56 void SetWidth (const Standard_Real theWidth) { SetWidth ((float )theWidth); }
58 //! Modifies the line thickness.
59 //! Warning: Raises Standard_OutOfRange if the width is a negative value.
60 void SetWidth (Standard_ShortReal theWidth)
62 SetLineWidth (theWidth);
67 DEFINE_STANDARD_HANDLE(Graphic3d_AspectLine3d, Graphic3d_Aspects)
69 #endif // _Graphic3d_AspectLine3d_HeaderFile