42cf5bc1 |
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 | |
bf5f0ca2 |
19 | #include <Graphic3d_Aspects.hxx> |
42cf5bc1 |
20 | |
b6472664 |
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. |
bf5f0ca2 |
23 | class Graphic3d_AspectLine3d : public Graphic3d_Aspects |
42cf5bc1 |
24 | { |
bf5f0ca2 |
25 | DEFINE_STANDARD_RTTIEXT(Graphic3d_AspectLine3d, Graphic3d_Aspects) |
42cf5bc1 |
26 | public: |
27 | |
42cf5bc1 |
28 | //! Creates a context table for line primitives |
29 | //! defined with the following default values: |
30 | //! |
b6472664 |
31 | //! Color = Quantity_NOC_YELLOW; |
32 | //! Type = Aspect_TOL_SOLID; |
33 | //! Width = 1.0; |
42cf5bc1 |
34 | Standard_EXPORT Graphic3d_AspectLine3d(); |
35 | |
b6472664 |
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. |
bf5f0ca2 |
41 | Standard_EXPORT Graphic3d_AspectLine3d (const Quantity_Color& theColor, |
42 | Aspect_TypeOfLine theType, |
43 | Standard_Real theWidth); |
b6472664 |
44 | |
45 | //! Return line type. |
bf5f0ca2 |
46 | Aspect_TypeOfLine Type() const { return myLineType; } |
b6472664 |
47 | |
48 | //! Modifies the type of line. |
bf5f0ca2 |
49 | void SetType (const Aspect_TypeOfLine theType) { myLineType = theType; } |
b6472664 |
50 | |
51 | //! Return line width. |
bf5f0ca2 |
52 | Standard_ShortReal Width() const { return myLineWidth; } |
b6472664 |
53 | |
54 | //! Modifies the line thickness. |
bf5f0ca2 |
55 | //! Warning: Raises Standard_OutOfRange if the width is a negative value. |
b6472664 |
56 | void SetWidth (const Standard_Real theWidth) { SetWidth ((float )theWidth); } |
57 | |
58 | //! Modifies the line thickness. |
bf5f0ca2 |
59 | //! Warning: Raises Standard_OutOfRange if the width is a negative value. |
60 | void SetWidth (Standard_ShortReal theWidth) |
1b9f5d95 |
61 | { |
bf5f0ca2 |
62 | SetLineWidth (theWidth); |
b6472664 |
63 | } |
42cf5bc1 |
64 | |
42cf5bc1 |
65 | }; |
66 | |
bf5f0ca2 |
67 | DEFINE_STANDARD_HANDLE(Graphic3d_AspectLine3d, Graphic3d_Aspects) |
42cf5bc1 |
68 | |
69 | #endif // _Graphic3d_AspectLine3d_HeaderFile |