1 // Created by: NW,JPB,CAL
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _Graphic3d_AspectMarker3d_HeaderFile
17 #define _Graphic3d_AspectMarker3d_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
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.hxx>
33 class Graphic3d_AspectMarker3d;
34 DEFINE_STANDARD_HANDLE(Graphic3d_AspectMarker3d, Aspect_AspectMarker)
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
45 //! Creates a context table for marker primitives
46 //! defined with the following default values:
48 //! Marker type : TOM_X
51 Standard_EXPORT Graphic3d_AspectMarker3d();
53 Standard_EXPORT Graphic3d_AspectMarker3d(const Aspect_TypeOfMarker theType, const Quantity_Color& theColor, const Standard_Real theScale);
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);
59 //! Creates a context table for marker primitives
60 //! defined with the specified values.
61 Standard_EXPORT Graphic3d_AspectMarker3d(const Handle(Image_PixMap)& theTextureImage);
63 //! Returns marker's texture size.
64 Standard_EXPORT void GetTextureSize (Standard_Integer& theWidth, Standard_Integer& theHeight) const;
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;
71 //! Set marker's image texture.
72 Standard_EXPORT void SetMarkerImage (const Handle(Graphic3d_MarkerImage)& theImage);
74 Standard_EXPORT void SetBitMap (const Standard_Integer theWidth, const Standard_Integer theHeight, const Handle(TColStd_HArray1OfByte)& theTexture);
76 //! Sets up OpenGL/GLSL shader program.
77 Standard_EXPORT void SetShaderProgram (const Handle(Graphic3d_ShaderProgram)& theProgram);
79 Standard_EXPORT const Handle(Graphic3d_ShaderProgram)& ShaderProgram() const;
84 DEFINE_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d,Aspect_AspectMarker)
89 Handle(Graphic3d_MarkerImage) myMarkerImage;
95 Handle(Graphic3d_ShaderProgram) MyShaderProgram;
106 #endif // _Graphic3d_AspectMarker3d_HeaderFile