File indexing completed on 2025-01-18 10:04:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef OpenGl_Group_HeaderFile
0017 #define OpenGl_Group_HeaderFile
0018
0019 #include <Graphic3d_Group.hxx>
0020 #include <Graphic3d_Structure.hxx>
0021
0022 #include <OpenGl_Aspects.hxx>
0023 #include <OpenGl_Element.hxx>
0024
0025 class OpenGl_Structure;
0026
0027 struct OpenGl_ElementNode
0028 {
0029 OpenGl_Element* elem;
0030 OpenGl_ElementNode* next;
0031 DEFINE_STANDARD_ALLOC
0032 };
0033
0034
0035 class OpenGl_Group : public Graphic3d_Group
0036 {
0037 public:
0038
0039
0040
0041 Standard_EXPORT OpenGl_Group (const Handle(Graphic3d_Structure)& theStruct);
0042
0043 Standard_EXPORT virtual void Clear (const Standard_Boolean theToUpdateStructureMgr) Standard_OVERRIDE;
0044
0045
0046 virtual Handle(Graphic3d_Aspects) Aspects() const Standard_OVERRIDE
0047 {
0048 return myAspects != NULL
0049 ? myAspects->Aspect()
0050 : Handle(Graphic3d_Aspects)();
0051 }
0052
0053
0054 bool HasPersistence() const
0055 {
0056 return !myTrsfPers.IsNull()
0057 || (myStructure != NULL && !myStructure->TransformPersistence().IsNull());
0058 }
0059
0060
0061 Standard_EXPORT virtual void SetGroupPrimitivesAspect (const Handle(Graphic3d_Aspects)& theAspect) Standard_OVERRIDE;
0062
0063
0064 Standard_EXPORT virtual void SetPrimitivesAspect (const Handle(Graphic3d_Aspects)& theAspect) Standard_OVERRIDE;
0065
0066
0067 Standard_EXPORT virtual void SynchronizeAspects() Standard_OVERRIDE;
0068
0069
0070 Standard_EXPORT virtual void ReplaceAspects (const Graphic3d_MapOfAspectsToAspects& theMap) Standard_OVERRIDE;
0071
0072
0073 Standard_EXPORT virtual void AddPrimitiveArray (const Graphic3d_TypeOfPrimitiveArray theType,
0074 const Handle(Graphic3d_IndexBuffer)& theIndices,
0075 const Handle(Graphic3d_Buffer)& theAttribs,
0076 const Handle(Graphic3d_BoundBuffer)& theBounds,
0077 const Standard_Boolean theToEvalMinMax) Standard_OVERRIDE;
0078
0079
0080 Standard_EXPORT virtual void AddText (const Handle(Graphic3d_Text)& theTextParams,
0081 const Standard_Boolean theToEvalMinMax) Standard_OVERRIDE;
0082
0083 Standard_EXPORT virtual void SetFlippingOptions (const Standard_Boolean theIsEnabled,
0084 const gp_Ax2& theRefPlane) Standard_OVERRIDE;
0085
0086
0087 Standard_EXPORT virtual void SetStencilTestOptions (const Standard_Boolean theIsEnabled) Standard_OVERRIDE;
0088
0089 public:
0090
0091 OpenGl_Structure* GlStruct() const { return (OpenGl_Structure* )(myStructure->CStructure().operator->()); }
0092
0093 Standard_EXPORT void AddElement (OpenGl_Element* theElem);
0094
0095 Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
0096 Standard_EXPORT virtual void Release (const Handle(OpenGl_Context)& theGlCtx);
0097
0098
0099 const OpenGl_ElementNode* FirstNode() const { return myFirst; }
0100
0101
0102 const OpenGl_Aspects* GlAspects() const { return myAspects; }
0103
0104
0105 Standard_Boolean IsRaytracable() const { return myIsRaytracable; }
0106
0107
0108 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0109
0110 protected:
0111
0112 Standard_EXPORT virtual ~OpenGl_Group();
0113
0114 private:
0115
0116
0117
0118
0119
0120
0121
0122
0123 Standard_EXPORT bool renderFiltered (const Handle(OpenGl_Workspace)& theWorkspace,
0124 OpenGl_Element* theElement) const;
0125
0126 protected:
0127
0128 OpenGl_Aspects* myAspects;
0129 OpenGl_ElementNode* myFirst;
0130 OpenGl_ElementNode* myLast;
0131 Standard_Boolean myIsRaytracable;
0132
0133 public:
0134
0135 DEFINE_STANDARD_RTTIEXT(OpenGl_Group,Graphic3d_Group)
0136
0137 };
0138
0139 DEFINE_STANDARD_HANDLE(OpenGl_Group, Graphic3d_Group)
0140
0141 #endif