0026885: Visualization - drop redundant aspects from structure level
[occt.git] / src / Graphic3d / Graphic3d_AspectLine3d.hxx
CommitLineData
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>
26class Quantity_Color;
27
28
29class Graphic3d_AspectLine3d;
30DEFINE_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.
35class Graphic3d_AspectLine3d : public Aspect_AspectLine
36{
37
38public:
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
1b9f5d95 63 //! Check for equality with another line aspect.
64 bool IsEqual (const Graphic3d_AspectLine3d& theOther)
65 {
66 if (this == &theOther)
67 {
68 return true;
69 }
70
71 return MyShaderProgram == theOther.MyShaderProgram
72 && MyType == theOther.MyType
73 && MyColor == theOther.MyColor
74 && MyWidth == theOther.MyWidth;
75 }
42cf5bc1 76
77
92efcf78 78 DEFINE_STANDARD_RTTIEXT(Graphic3d_AspectLine3d,Aspect_AspectLine)
42cf5bc1 79
80protected:
81
82
83
84
85private:
86
87
88 Handle(Graphic3d_ShaderProgram) MyShaderProgram;
89
90
91};
92
93
94
95
96
97
98
99#endif // _Graphic3d_AspectLine3d_HeaderFile