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_AspectMarker3d_HeaderFile |
17 | #define _Graphic3d_AspectMarker3d_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_Type.hxx> |
21 | |
22 | #include <Graphic3d_MarkerImage.hxx> |
23 | #include <Graphic3d_ShaderProgram.hxx> |
24 | #include <Aspect_AspectMarker.hxx> |
25 | #include <Aspect_TypeOfMarker.hxx> |
26 | #include <Standard_Real.hxx> |
27 | #include <Standard_Integer.hxx> |
28 | #include <TColStd_HArray1OfByte.hxx> |
29 | #include <Image_PixMap_Handle.hxx> |
30 | class Quantity_Color; |
31 | |
32 | |
33 | class Graphic3d_AspectMarker3d; |
34 | DEFINE_STANDARD_HANDLE(Graphic3d_AspectMarker3d, Aspect_AspectMarker) |
35 | |
36 | //! Creates and updates an attribute group for |
37 | //! marker type primitives. This group contains the type |
38 | //! of marker, its colour, and its scale factor. |
39 | class Graphic3d_AspectMarker3d : public Aspect_AspectMarker |
40 | { |
41 | |
42 | public: |
43 | |
44 | |
45 | //! Creates a context table for marker primitives |
46 | //! defined with the following default values: |
47 | //! |
48 | //! Marker type : TOM_X |
49 | //! Colour : YELLOW |
50 | //! Scale factor: 1.0 |
51 | Standard_EXPORT Graphic3d_AspectMarker3d(); |
52 | |
53 | Standard_EXPORT Graphic3d_AspectMarker3d(const Aspect_TypeOfMarker theType, const Quantity_Color& theColor, const Standard_Real theScale); |
54 | |
55 | //! Creates a context table for marker primitives |
56 | //! defined with the specified values. |
57 | Standard_EXPORT Graphic3d_AspectMarker3d(const Quantity_Color& theColor, const Standard_Integer theWidth, const Standard_Integer theHeight, const Handle(TColStd_HArray1OfByte)& theTextureBitmap); |
58 | |
59 | //! Creates a context table for marker primitives |
60 | //! defined with the specified values. |
61 | Standard_EXPORT Graphic3d_AspectMarker3d(const Image_PixMap_Handle& theTextureImage); |
62 | |
63 | //! Returns marker's texture size. |
64 | Standard_EXPORT void GetTextureSize (Standard_Integer& theWidth, Standard_Integer& theHeight) const; |
65 | |
66 | //! Returns marker's image texture. |
67 | //! Could be null handle if marker aspect has been initialized as |
68 | //! default type of marker. |
69 | Standard_EXPORT const Handle(Graphic3d_MarkerImage)& GetMarkerImage() const; |
70 | |
71 | //! Set marker's image texture. |
72 | Standard_EXPORT void SetMarkerImage (const Handle(Graphic3d_MarkerImage)& theImage); |
73 | |
74 | Standard_EXPORT void SetBitMap (const Standard_Integer theWidth, const Standard_Integer theHeight, const Handle(TColStd_HArray1OfByte)& theTexture); |
75 | |
76 | //! Sets up OpenGL/GLSL shader program. |
77 | Standard_EXPORT void SetShaderProgram (const Handle(Graphic3d_ShaderProgram)& theProgram); |
78 | |
79 | Standard_EXPORT const Handle(Graphic3d_ShaderProgram)& ShaderProgram() const; |
80 | |
81 | |
82 | |
83 | |
92efcf78 |
84 | DEFINE_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d,Aspect_AspectMarker) |
42cf5bc1 |
85 | |
86 | protected: |
87 | |
88 | |
89 | Handle(Graphic3d_MarkerImage) myMarkerImage; |
90 | |
91 | |
92 | private: |
93 | |
94 | |
95 | Handle(Graphic3d_ShaderProgram) MyShaderProgram; |
96 | |
97 | |
98 | }; |
99 | |
100 | |
101 | |
102 | |
103 | |
104 | |
105 | |
106 | #endif // _Graphic3d_AspectMarker3d_HeaderFile |