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_AspectsTextureSet_Header
0015 #define _OpenGl_AspectsTextureSet_Header
0016
0017 #include <Graphic3d_Aspects.hxx>
0018 #include <Graphic3d_TextureMap.hxx>
0019
0020 class OpenGl_Context;
0021 class OpenGl_TextureSet;
0022 class OpenGl_PointSprite;
0023
0024
0025 class OpenGl_AspectsTextureSet
0026 {
0027 public:
0028 DEFINE_STANDARD_ALLOC
0029 public:
0030
0031 OpenGl_AspectsTextureSet() : myIsTextureReady (Standard_False) {}
0032
0033
0034 bool IsReady() const { return myIsTextureReady; }
0035
0036
0037 void Invalidate() { myIsTextureReady = false; }
0038
0039
0040 const Handle(OpenGl_TextureSet)& TextureSet (const Handle(OpenGl_Context)& theCtx,
0041 const Handle(Graphic3d_Aspects)& theAspect,
0042 const Handle(OpenGl_PointSprite)& theSprite,
0043 const Handle(OpenGl_PointSprite)& theSpriteA,
0044 bool theToHighlight)
0045 {
0046 if (!myIsTextureReady)
0047 {
0048 build (theCtx, theAspect, theSprite, theSpriteA);
0049 myIsTextureReady = true;
0050 }
0051 return theToHighlight && !myTextures[1].IsNull()
0052 ? myTextures[1]
0053 : myTextures[0];
0054 }
0055
0056
0057 Standard_EXPORT void UpdateRediness (const Handle(Graphic3d_Aspects)& theAspect);
0058
0059
0060 Standard_EXPORT void Release (OpenGl_Context* theCtx);
0061
0062 private:
0063
0064
0065 Standard_EXPORT void build (const Handle(OpenGl_Context)& theCtx,
0066 const Handle(Graphic3d_Aspects)& theAspect,
0067 const Handle(OpenGl_PointSprite)& theSprite,
0068 const Handle(OpenGl_PointSprite)& theSpriteA);
0069
0070 private:
0071
0072 Handle(OpenGl_TextureSet) myTextures[2];
0073 Standard_Boolean myIsTextureReady;
0074
0075 };
0076
0077 #endif