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 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_Type.hxx> |
21 | |
22 | #include <Graphic3d_ShaderProgram.hxx> |
23 | #include <Aspect_AspectLine.hxx> |
24 | #include <Aspect_TypeOfLine.hxx> |
25 | #include <Standard_Real.hxx> |
26 | class Quantity_Color; |
27 | |
28 | |
29 | class Graphic3d_AspectLine3d; |
30 | DEFINE_STANDARD_HANDLE(Graphic3d_AspectLine3d, Aspect_AspectLine) |
31 | |
32 | //! Creates and updates a group of attributes |
33 | //! for 3d line primitives. This group contains the |
34 | //! colour, the type of line, and its thickness. |
35 | class Graphic3d_AspectLine3d : public Aspect_AspectLine |
36 | { |
37 | |
38 | public: |
39 | |
40 | |
41 | //! Creates a context table for line primitives |
42 | //! defined with the following default values: |
43 | //! |
44 | //! Colour : NOC_YELLOW |
45 | //! Line type : TOL_SOLID |
46 | //! Width : 1.0 |
47 | Standard_EXPORT Graphic3d_AspectLine3d(); |
48 | |
49 | //! Creates a context table for line primitives |
50 | //! defined with the specified values. |
51 | //! Warning: <AWidth> is the "linewidth scale factor". |
52 | //! The nominal line width is 1 pixel. The width of |
53 | //! the line is determined by applying the linewidth scale |
54 | //! factor to this nominal line width. |
55 | //! The supported linewidths vary by 1-pixel units. |
56 | Standard_EXPORT Graphic3d_AspectLine3d(const Quantity_Color& AColor, const Aspect_TypeOfLine AType, const Standard_Real AWidth); |
57 | |
58 | //! Sets up OpenGL/GLSL shader program. |
59 | Standard_EXPORT void SetShaderProgram (const Handle(Graphic3d_ShaderProgram)& theProgram); |
60 | |
61 | Standard_EXPORT const Handle(Graphic3d_ShaderProgram)& ShaderProgram() const; |
62 | |
63 | |
64 | |
65 | |
66 | DEFINE_STANDARD_RTTI(Graphic3d_AspectLine3d,Aspect_AspectLine) |
67 | |
68 | protected: |
69 | |
70 | |
71 | |
72 | |
73 | private: |
74 | |
75 | |
76 | Handle(Graphic3d_ShaderProgram) MyShaderProgram; |
77 | |
78 | |
79 | }; |
80 | |
81 | |
82 | |
83 | |
84 | |
85 | |
86 | |
87 | #endif // _Graphic3d_AspectLine3d_HeaderFile |