File indexing completed on 2026-09-22 08:58:49
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()
0031 : myMarkerSize(1.0f),
0032 myIsSpriteReady(false)
0033 {
0034 }
0035
0036 float MarkerSize() const { return myMarkerSize; }
0037
0038
0039 bool IsReady() const { return myIsSpriteReady; }
0040
0041
0042 void Invalidate() { myIsSpriteReady = false; }
0043
0044
0045 Standard_EXPORT bool HasPointSprite(const occ::handle<OpenGl_Context>& theCtx,
0046 const occ::handle<Graphic3d_Aspects>& theAspects);
0047
0048
0049 Standard_EXPORT bool IsDisplayListSprite(const occ::handle<OpenGl_Context>& theCtx,
0050 const occ::handle<Graphic3d_Aspects>& theAspects);
0051
0052
0053 Standard_EXPORT const occ::handle<OpenGl_PointSprite>& Sprite(
0054 const occ::handle<OpenGl_Context>& theCtx,
0055 const occ::handle<Graphic3d_Aspects>& theAspects,
0056 bool theIsAlphaSprite);
0057
0058
0059 Standard_EXPORT void UpdateRediness(const occ::handle<Graphic3d_Aspects>& theAspect);
0060
0061
0062 Standard_EXPORT void Release(OpenGl_Context* theCtx);
0063
0064 private:
0065
0066 Standard_EXPORT void build(const occ::handle<OpenGl_Context>& theCtx,
0067 const occ::handle<Graphic3d_MarkerImage>& theMarkerImage,
0068 Aspect_TypeOfMarker theType,
0069 float theScale,
0070 const NCollection_Vec4<float>& theColor,
0071 float& theMarkerSize);
0072
0073
0074 static void spriteKeys(const occ::handle<Graphic3d_MarkerImage>& theMarkerImage,
0075 Aspect_TypeOfMarker theType,
0076 float theScale,
0077 const NCollection_Vec4<float>& theColor,
0078 TCollection_AsciiString& theKey,
0079 TCollection_AsciiString& theKeyA);
0080
0081 private:
0082 occ::handle<OpenGl_PointSprite> mySprite;
0083 occ::handle<OpenGl_PointSprite> mySpriteA;
0084 float myMarkerSize;
0085 bool myIsSpriteReady;
0086 };
0087
0088 #endif