Warning, file /include/opencascade/OpenGl_Aspects.hxx was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _OpenGl_Aspects_Header
0015 #define _OpenGl_Aspects_Header
0016
0017 #include <OpenGl_Element.hxx>
0018 #include <OpenGl_AspectsProgram.hxx>
0019 #include <OpenGl_AspectsTextureSet.hxx>
0020 #include <OpenGl_AspectsSprite.hxx>
0021 #include <Graphic3d_Aspects.hxx>
0022
0023
0024 class OpenGl_Aspects : public OpenGl_Element
0025 {
0026 public:
0027
0028 Standard_EXPORT OpenGl_Aspects();
0029
0030
0031 Standard_EXPORT OpenGl_Aspects(const Handle(Graphic3d_Aspects)& theAspect);
0032
0033
0034 const Handle(Graphic3d_Aspects)& Aspect() const { return myAspect; }
0035
0036
0037 Standard_EXPORT void SetAspect(const Handle(Graphic3d_Aspects)& theAspect);
0038
0039
0040 Graphic3d_TypeOfShadingModel ShadingModel() const { return myShadingModel; }
0041
0042
0043 void SetNoLighting() { myShadingModel = Graphic3d_TypeOfShadingModel_Unlit; }
0044
0045
0046 const Handle(OpenGl_TextureSet)& TextureSet(const Handle(OpenGl_Context)& theCtx,
0047 bool theToHighlight = false) const
0048 {
0049 const Handle(OpenGl_PointSprite)& aSprite = myResSprite.Sprite(theCtx, myAspect, false);
0050 const Handle(OpenGl_PointSprite)& aSpriteA = myResSprite.Sprite(theCtx, myAspect, true);
0051 return myResTextureSet.TextureSet(theCtx, myAspect, aSprite, aSpriteA, theToHighlight);
0052 }
0053
0054
0055
0056 const Handle(OpenGl_ShaderProgram)& ShaderProgramRes(const Handle(OpenGl_Context)& theCtx) const
0057 {
0058 return myResProgram.ShaderProgram(theCtx, myAspect->ShaderProgram());
0059 }
0060
0061
0062 Standard_ShortReal MarkerSize() const { return myResSprite.MarkerSize(); }
0063
0064
0065 bool HasPointSprite(const Handle(OpenGl_Context)& theCtx) const
0066 {
0067 return myResSprite.HasPointSprite(theCtx, myAspect);
0068 }
0069
0070
0071 bool IsDisplayListSprite(const Handle(OpenGl_Context)& theCtx) const
0072 {
0073 return myResSprite.IsDisplayListSprite(theCtx, myAspect);
0074 }
0075
0076
0077
0078 const Handle(OpenGl_PointSprite)& SpriteRes(const Handle(OpenGl_Context)& theCtx,
0079 bool theIsAlphaSprite) const
0080 {
0081 return myResSprite.Sprite(theCtx, myAspect, theIsAlphaSprite);
0082 }
0083
0084 Standard_EXPORT virtual void Render(const Handle(OpenGl_Workspace)& theWorkspace) const
0085 Standard_OVERRIDE;
0086 Standard_EXPORT virtual void Release(OpenGl_Context* theContext) Standard_OVERRIDE;
0087
0088
0089 virtual void SynchronizeAspects() Standard_OVERRIDE { SetAspect(myAspect); }
0090
0091
0092 Standard_EXPORT void DumpJson(Standard_OStream& theOStream,
0093 Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0094
0095 protected:
0096
0097 mutable OpenGl_AspectsProgram myResProgram;
0098 mutable OpenGl_AspectsTextureSet myResTextureSet;
0099 mutable OpenGl_AspectsSprite myResSprite;
0100
0101 Handle(Graphic3d_Aspects) myAspect;
0102 Graphic3d_TypeOfShadingModel myShadingModel;
0103
0104 public:
0105 DEFINE_STANDARD_ALLOC
0106 };
0107
0108 #endif