0030640: Visualization, Graphic3d_Camera - add option creating Projection matrix...
[occt.git] / src / Graphic3d / Graphic3d_AspectLine3d.hxx
1 // Created by: NW,JPB,CAL
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _Graphic3d_AspectLine3d_HeaderFile
17 #define _Graphic3d_AspectLine3d_HeaderFile
18
19 #include <Graphic3d_Aspects.hxx>
20
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
24 {
25   DEFINE_STANDARD_RTTIEXT(Graphic3d_AspectLine3d, Graphic3d_Aspects)
26 public:
27
28   //! Creates a context table for line primitives
29   //! defined with the following default values:
30   //!
31   //! Color = Quantity_NOC_YELLOW;
32   //! Type  = Aspect_TOL_SOLID;
33   //! Width = 1.0;
34   Standard_EXPORT Graphic3d_AspectLine3d();
35   
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);
44
45   //! Return line type.
46   Aspect_TypeOfLine Type() const { return myLineType; }
47
48   //! Modifies the type of line.
49   void SetType (const Aspect_TypeOfLine theType) { SetLineType (theType); }
50
51   //! Return line width.
52   Standard_ShortReal Width() const { return myLineWidth; }
53
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); }
57
58   //! Modifies the line thickness.
59   //! Warning: Raises Standard_OutOfRange if the width is a negative value.
60   void SetWidth (Standard_ShortReal theWidth)
61   {
62     SetLineWidth (theWidth);
63   }
64
65 };
66
67 DEFINE_STANDARD_HANDLE(Graphic3d_AspectLine3d, Graphic3d_Aspects)
68
69 #endif // _Graphic3d_AspectLine3d_HeaderFile