File indexing completed on 2025-01-18 10:04:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _OpenGl_AspectsSprite_Header
0015 #define _OpenGl_AspectsSprite_Header
0016
0017 #include <Graphic3d_Aspects.hxx>
0018 #include <Graphic3d_TextureMap.hxx>
0019
0020 class OpenGl_Context;
0021 class OpenGl_PointSprite;
0022
0023
0024 class OpenGl_AspectsSprite
0025 {
0026 public:
0027 DEFINE_STANDARD_ALLOC
0028 public:
0029
0030 OpenGl_AspectsSprite() : myMarkerSize (1.0f), myIsSpriteReady (Standard_False) {}
0031
0032 Standard_ShortReal MarkerSize() const { return myMarkerSize; }
0033
0034
0035 bool IsReady() const { return myIsSpriteReady; }
0036
0037
0038 void Invalidate() { myIsSpriteReady = false; }
0039
0040
0041 Standard_EXPORT bool HasPointSprite (const Handle(OpenGl_Context)& theCtx,
0042 const Handle(Graphic3d_Aspects)& theAspects);
0043
0044
0045 Standard_EXPORT bool IsDisplayListSprite (const Handle(OpenGl_Context)& theCtx,
0046 const Handle(Graphic3d_Aspects)& theAspects);
0047
0048
0049 Standard_EXPORT const Handle(OpenGl_PointSprite)& Sprite (const Handle(OpenGl_Context)& theCtx,
0050 const Handle(Graphic3d_Aspects)& theAspects,
0051 bool theIsAlphaSprite);
0052
0053
0054 Standard_EXPORT void UpdateRediness (const Handle(Graphic3d_Aspects)& theAspect);
0055
0056
0057 Standard_EXPORT void Release (OpenGl_Context* theCtx);
0058
0059 private:
0060
0061
0062 Standard_EXPORT void build (const Handle(OpenGl_Context)& theCtx,
0063 const Handle(Graphic3d_MarkerImage)& theMarkerImage,
0064 Aspect_TypeOfMarker theType,
0065 Standard_ShortReal theScale,
0066 const Graphic3d_Vec4& theColor,
0067 Standard_ShortReal& theMarkerSize);
0068
0069
0070 static void spriteKeys (const Handle(Graphic3d_MarkerImage)& theMarkerImage,
0071 Aspect_TypeOfMarker theType,
0072 Standard_ShortReal theScale,
0073 const Graphic3d_Vec4& theColor,
0074 TCollection_AsciiString& theKey,
0075 TCollection_AsciiString& theKeyA);
0076
0077 private:
0078
0079 Handle(OpenGl_PointSprite) mySprite;
0080 Handle(OpenGl_PointSprite) mySpriteA;
0081 Standard_ShortReal myMarkerSize;
0082 Standard_Boolean myIsSpriteReady;
0083
0084 };
0085
0086 #endif