File indexing completed on 2026-09-14 09:15:22
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()
0032 : myIsTextureReady(false)
0033 {
0034 }
0035
0036
0037 bool IsReady() const { return myIsTextureReady; }
0038
0039
0040 void Invalidate() { myIsTextureReady = false; }
0041
0042
0043 const occ::handle<OpenGl_TextureSet>& TextureSet(
0044 const occ::handle<OpenGl_Context>& theCtx,
0045 const occ::handle<Graphic3d_Aspects>& theAspect,
0046 const occ::handle<OpenGl_PointSprite>& theSprite,
0047 const occ::handle<OpenGl_PointSprite>& theSpriteA,
0048 bool theToHighlight)
0049 {
0050 if (!myIsTextureReady)
0051 {
0052 build(theCtx, theAspect, theSprite, theSpriteA);
0053 myIsTextureReady = true;
0054 }
0055 return theToHighlight && !myTextures[1].IsNull() ? myTextures[1] : myTextures[0];
0056 }
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_Aspects>& theAspect,
0068 const occ::handle<OpenGl_PointSprite>& theSprite,
0069 const occ::handle<OpenGl_PointSprite>& theSpriteA);
0070
0071 private:
0072 occ::handle<OpenGl_TextureSet> myTextures[2];
0073 bool myIsTextureReady;
0074 };
0075
0076 #endif