X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FOpenGl%2FOpenGl_Structure.hxx;h=efac3ace6d3efc70d8eed9e1e1d358c9a3dbf65d;hp=68147108cd05e3f97345679ca4d2bbb008f2af96;hb=1be4179947116e54658924f0149d3f35743a899a;hpb=3e05329c4cf565910bfcf85653f45fbbcb66bdcb diff --git a/src/OpenGl/OpenGl_Structure.hxx b/src/OpenGl/OpenGl_Structure.hxx index 68147108cd..efac3ace6d 100644 --- a/src/OpenGl/OpenGl_Structure.hxx +++ b/src/OpenGl/OpenGl_Structure.hxx @@ -78,15 +78,15 @@ public: Standard_EXPORT virtual void Disconnect (Graphic3d_CStructure& theStructure) Standard_OVERRIDE; //! Synchronize structure transformation - Standard_EXPORT virtual void UpdateTransformation() Standard_OVERRIDE; + Standard_EXPORT virtual void SetTransformation (const Handle(Geom_Transformation)& theTrsf) Standard_OVERRIDE; - //! Highlight entire structure with color - Standard_EXPORT virtual void HighlightWithColor (const Graphic3d_Vec3& theColor, - const Standard_Boolean theToCreate) Standard_OVERRIDE; + //! Highlights structure according to the given style and updates corresponding class fields + //! (highlight status and style) + Standard_EXPORT virtual void GraphicHighlight (const Handle(Graphic3d_HighlightStyle)& theStyle, + const Handle(Graphic3d_Structure)& theStruct) Standard_OVERRIDE; - //! Highlight structure using boundary box - Standard_EXPORT virtual void HighlightWithBndBox (const Handle(Graphic3d_Structure)& theStruct, - const Standard_Boolean theToCreate) Standard_OVERRIDE; + //! Unighlights structure and updates corresponding class fields (highlight status and style) + Standard_EXPORT virtual void GraphicUnhighlight() Standard_OVERRIDE; //! Create shadow link to this structure Standard_EXPORT virtual Handle(Graphic3d_CStructure) ShadowLink (const Handle(Graphic3d_StructureManager)& theManager) const Standard_OVERRIDE; @@ -105,13 +105,6 @@ public: return (OpenGl_GraphicDriver* )myGraphicDriver.operator->(); } - void clearHighlightBox (const Handle(OpenGl_Context)& theGlCtx); - - void setHighlightColor (const Handle(OpenGl_Context)& theGlCtx, - const Graphic3d_Vec3& theColor); - - void clearHighlightColor (const Handle(OpenGl_Context)& theGlCtx); - Standard_EXPORT void Clear (const Handle(OpenGl_Context)& theGlCtx); //! Renders the structure. @@ -145,9 +138,7 @@ public: || IsForHighlight || IsMutable || Is2dText - || (TransformPersistence.Flags & Graphic3d_TMF_2d) != 0 - || (TransformPersistence.Flags & Graphic3d_TMF_PanPers) != 0 - || (TransformPersistence.Flags & Graphic3d_TMF_TriedronPers) != 0; + || (!myTrsfPers.IsNull() && myTrsfPers->IsTrihedronOr2d()); } //! This method releases GL resources without actual elements destruction. @@ -183,10 +174,15 @@ protected: Standard_EXPORT void renderGeometry (const Handle(OpenGl_Workspace)& theWorkspace, bool& theHasClosed) const; + //! Highlight structure using boundary box + Standard_EXPORT void highlightWithBndBox (const Handle(Graphic3d_Structure)& theStruct); + + //! Invalidates highlight box and releases graphic resources it uses + Standard_EXPORT void clearHighlightBox (const Handle(OpenGl_Context)& theGlCtx); + protected: Handle(OpenGl_Group) myHighlightBox; - OpenGl_Vec4* myHighlightColor; OpenGl_Structure* myInstancedStructure;