From 01296da21c335d139984c662306561e59d528edb Mon Sep 17 00:00:00 2001 From: snn Date: Thu, 23 Aug 2018 17:34:33 +0300 Subject: [PATCH] rebase on CR0-OCCT730 (V7_3_0) --- .../BinMXCAFDoc_AnimationDriver.cxx | 5 ++--- .../BinMXCAFDoc_AnimationDriver.hxx | 4 ++-- .../BinMXCAFDoc_AnimationToolDriver.cxx | 4 ++-- .../BinMXCAFDoc_AnimationToolDriver.hxx | 4 ++-- src/Graphic3d/Graphic3d_Group.hxx | 4 ++-- src/OpenGl/OpenGl_AspectFillCapping.hxx | 3 +++ src/OpenGl/OpenGl_CappingRenderer.cxx | 14 ++++++------- src/OpenGl/OpenGl_Workspace.hxx | 21 ++++++++++++++++--- src/XCAFDoc/XCAFDoc_NotesTool.hxx | 16 -------------- .../XmlMXCAFDoc_AnimationDriver.cxx | 6 ++---- .../XmlMXCAFDoc_AnimationDriver.hxx | 4 ++-- .../XmlMXCAFDoc_AnimationToolDriver.cxx | 4 ++-- .../XmlMXCAFDoc_AnimationToolDriver.hxx | 4 ++-- 13 files changed, 46 insertions(+), 47 deletions(-) diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_AnimationDriver.cxx b/src/BinMXCAFDoc/BinMXCAFDoc_AnimationDriver.cxx index 492f3e07b7..5d3e976b94 100644 --- a/src/BinMXCAFDoc/BinMXCAFDoc_AnimationDriver.cxx +++ b/src/BinMXCAFDoc/BinMXCAFDoc_AnimationDriver.cxx @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -56,7 +56,7 @@ static void putByteArray(BinObjMgt_Persistent& theTarget, const Handle(TColStd_H //purpose : //======================================================================= BinMXCAFDoc_AnimationDriver::BinMXCAFDoc_AnimationDriver - (const Handle(CDM_MessageDriver)& theMsgDriver) + (const Handle(Message_Messenger)& theMsgDriver) : BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Animation)->Name()) { } @@ -80,7 +80,6 @@ Standard_Boolean BinMXCAFDoc_AnimationDriver::Paste(const BinObjMgt_Persistent& BinObjMgt_RRelocationTable& /*theRelocTable*/) const { Handle(XCAFDoc_Animation) anAtt = Handle(XCAFDoc_Animation)::DownCast(theTarget); - Standard_Real aDensity; TCollection_AsciiString aName; if (!(theSource >> aName)) diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_AnimationDriver.hxx b/src/BinMXCAFDoc/BinMXCAFDoc_AnimationDriver.hxx index 0c3bd4cee4..669bdf444f 100644 --- a/src/BinMXCAFDoc/BinMXCAFDoc_AnimationDriver.hxx +++ b/src/BinMXCAFDoc/BinMXCAFDoc_AnimationDriver.hxx @@ -23,7 +23,7 @@ #include #include #include -class CDM_MessageDriver; +class Message_Messenger; class TDF_Attribute; class BinObjMgt_Persistent; @@ -38,7 +38,7 @@ class BinMXCAFDoc_AnimationDriver : public BinMDF_ADriver public: - Standard_EXPORT BinMXCAFDoc_AnimationDriver(const Handle(CDM_MessageDriver)& theMsgDriver); + Standard_EXPORT BinMXCAFDoc_AnimationDriver(const Handle(Message_Messenger)& theMsgDriver); Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_AnimationToolDriver.cxx b/src/BinMXCAFDoc/BinMXCAFDoc_AnimationToolDriver.cxx index 00afab34e5..7417545321 100644 --- a/src/BinMXCAFDoc/BinMXCAFDoc_AnimationToolDriver.cxx +++ b/src/BinMXCAFDoc/BinMXCAFDoc_AnimationToolDriver.cxx @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -28,7 +28,7 @@ IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationToolDriver, BinMDF_ADriver) //purpose : //======================================================================= BinMXCAFDoc_AnimationToolDriver::BinMXCAFDoc_AnimationToolDriver - (const Handle(CDM_MessageDriver)& theMsgDriver) + (const Handle(Message_Messenger)& theMsgDriver) : BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_AnimationTool)->Name()) { } diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_AnimationToolDriver.hxx b/src/BinMXCAFDoc/BinMXCAFDoc_AnimationToolDriver.hxx index 313955b303..8a533011a3 100644 --- a/src/BinMXCAFDoc/BinMXCAFDoc_AnimationToolDriver.hxx +++ b/src/BinMXCAFDoc/BinMXCAFDoc_AnimationToolDriver.hxx @@ -23,7 +23,7 @@ #include #include #include -class CDM_MessageDriver; +class Message_Messenger; class TDF_Attribute; class BinObjMgt_Persistent; @@ -36,7 +36,7 @@ class BinMXCAFDoc_AnimationToolDriver : public BinMDF_ADriver { public: - Standard_EXPORT BinMXCAFDoc_AnimationToolDriver(const Handle(CDM_MessageDriver)& theMsgDriver); + Standard_EXPORT BinMXCAFDoc_AnimationToolDriver(const Handle(Message_Messenger)& theMsgDriver); Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; diff --git a/src/Graphic3d/Graphic3d_Group.hxx b/src/Graphic3d/Graphic3d_Group.hxx index 0b63804174..02f5f0779e 100644 --- a/src/Graphic3d/Graphic3d_Group.hxx +++ b/src/Graphic3d/Graphic3d_Group.hxx @@ -75,10 +75,10 @@ class Graphic3d_ArrayOfPrimitives; //! with aspects and primitives and choose the group usage model beforehand out of application needs. //! Note that some Graphic3d_Group class virtual methods contain only base implementation //! that is extended by the descendant class in OpenGl package. -class Graphic3d_Group : public MMgt_TShared +class Graphic3d_Group : public Standard_Transient { friend class Graphic3d_Structure; - DEFINE_STANDARD_RTTIEXT(Graphic3d_Group,MMgt_TShared) + DEFINE_STANDARD_RTTIEXT(Graphic3d_Group, Standard_Transient) public: diff --git a/src/OpenGl/OpenGl_AspectFillCapping.hxx b/src/OpenGl/OpenGl_AspectFillCapping.hxx index 07261676e0..bf4438853d 100644 --- a/src/OpenGl/OpenGl_AspectFillCapping.hxx +++ b/src/OpenGl/OpenGl_AspectFillCapping.hxx @@ -55,6 +55,9 @@ public: //! Returns the shading aspect for drawing hatch layer of a section. Standard_EXPORT const OpenGl_AspectFace* HatchingFaceAspect() const; + //! Returns estimated GPU memory usage for holding data without considering overheads and allocation alignment rules. + Standard_Size EstimatedDataSize() const Standard_OVERRIDE{ return 0; } + protected: Handle(Graphic3d_AspectFillCapping) myAspect; //!< Section style settings from application's level. diff --git a/src/OpenGl/OpenGl_CappingRenderer.cxx b/src/OpenGl/OpenGl_CappingRenderer.cxx index 9009e9989c..1d5ae2f7b0 100644 --- a/src/OpenGl/OpenGl_CappingRenderer.cxx +++ b/src/OpenGl/OpenGl_CappingRenderer.cxx @@ -68,6 +68,9 @@ namespace } OpenGl_Element* GlElement() const { return myGlElement; } + //! Returns estimated GPU memory usage for holding data without considering overheads and allocation alignment rules. + Standard_Size EstimatedDataSize() const Standard_OVERRIDE { return 0; } + private: OpenGl_Element* myGlElement; @@ -203,7 +206,7 @@ void OpenGl_CappingRenderer::renderOne (const Handle(OpenGl_Workspace)& theWo aContext->ShaderManager()->UpdateClippingState(); glClear (GL_STENCIL_BUFFER_BIT); - glColorMask (GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); + const bool aColorMaskBack = aContext->SetColorMask(false); // override aspects, disable culling theWorkspace->SetAspectFace (&theWorkspace->NoneCulling()); @@ -232,7 +235,7 @@ void OpenGl_CappingRenderer::renderOne (const Handle(OpenGl_Workspace)& theWo aContext->ShaderManager()->UpdateClippingState(); // render capping plane using the generated stencil mask - glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + aContext->SetColorMask(aColorMaskBack); if (theWorkspace->UseDepthWrite()) { glDepthMask (GL_TRUE); @@ -298,7 +301,7 @@ void OpenGl_CappingRenderer::renderOne (const Handle(OpenGl_Workspace)& theWo aViewScale = static_cast (aViewDim.Y() / aContext->Viewport()[3]); } - aHatchScale = 1.0f / (aViewScale * anAspectHatching->TextureSet (aContext)->First()->SizeY()); + aHatchScale = 1.0f / (aViewScale * anAspectHatching->TextureSet(aContext)->First()->SizeY()); } } @@ -440,8 +443,5 @@ Standard_Boolean OpenGl_CappingRenderFilter::ShouldRender (const Handle(OpenGl_W return Standard_False; } - const OpenGl_PrimitiveArray* aPArray = dynamic_cast (theGlElement); - return aPArray != NULL - && aPArray->DrawMode() >= OpenGl_PrimitiveArray::THE_FILLPRIM_FROM - && aPArray->DrawMode() <= OpenGl_PrimitiveArray::THE_FILLPRIM_TO; + return theGlElement->IsFillDrawMode(); } diff --git a/src/OpenGl/OpenGl_Workspace.hxx b/src/OpenGl/OpenGl_Workspace.hxx index 4a3e602471..e84d928bcc 100644 --- a/src/OpenGl/OpenGl_Workspace.hxx +++ b/src/OpenGl/OpenGl_Workspace.hxx @@ -17,9 +17,13 @@ #define _OpenGl_Workspace_Header #include +#include #include -#include +#include +#include +#include +#include #include #include #include @@ -260,8 +264,17 @@ public: //! Returns face aspect for textured font rendering. const OpenGl_AspectFace& FontFaceAspect() const { return myFontFaceAspect; } + //! Sets and applies current polygon offset. + void SetPolygonOffset (const Graphic3d_PolygonOffset& theParams); + + //! Returns currently applied polygon offset parameters. + const Graphic3d_PolygonOffset& AppliedPolygonOffset() { return myPolygonOffsetApplied; } + //! Returns capping algorithm rendering filter. - const Handle(OpenGl_CappingAlgoFilter)& DefaultCappingAlgoFilter() const { return myDefaultCappingAlgoFilter; } + const Handle(OpenGl_CappingRenderFilter)& CappingRenderFilter() const + { + return myCappingRenderFilter; + } //! Returns face aspect for none culling mode. const OpenGl_AspectFace& NoneCulling() const { return myNoneCulling; } @@ -282,7 +295,7 @@ protected: //! @name protected fields Handle(OpenGl_Context) myGlContext; Standard_Boolean myUseZBuffer; Standard_Boolean myUseDepthWrite; - Handle(OpenGl_CappingAlgoFilter) myDefaultCappingAlgoFilter; + Handle(OpenGl_CappingRenderFilter) myCappingRenderFilter; OpenGl_AspectFace myNoneCulling; OpenGl_AspectFace myFrontCulling; OpenGl_AspectFace myFontFaceAspect; @@ -306,6 +319,8 @@ protected: //! @name fields related to status OpenGl_Matrix myModelViewMatrix; //!< Model matrix with applied structure transformations + Graphic3d_PolygonOffset myPolygonOffsetApplied; //!< currently applied polygon offset + OpenGl_AspectFace myAspectFaceHl; //!< Hiddenline aspect Handle(OpenGl_TextureSet) myEnvironmentTexture; diff --git a/src/XCAFDoc/XCAFDoc_NotesTool.hxx b/src/XCAFDoc/XCAFDoc_NotesTool.hxx index 29303da0b8..7480d134fd 100644 --- a/src/XCAFDoc/XCAFDoc_NotesTool.hxx +++ b/src/XCAFDoc/XCAFDoc_NotesTool.hxx @@ -127,10 +127,6 @@ public: //! \param [in] theItemId - assembly item ID. //! \return annotated item label if it is found, otherwise - null label. Standard_EXPORT TDF_Label FindAnnotatedItem(const XCAFDoc_AssemblyItemId& theItemId) const; - Standard_EXPORT TDF_Label FindAnnotatedItemAttr(const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theGUID) const; - Standard_EXPORT TDF_Label FindAnnotatedItemSubshape(const XCAFDoc_AssemblyItemId& theItemId, - Standard_Integer theSubshapeIndex) const; //! Finds a label of the given labeled item in the annotated items hive. //! \param [in] theItemLabel - item label. @@ -235,12 +231,6 @@ public: //! \return number of added labels. Standard_EXPORT Standard_Integer GetNotes(const XCAFDoc_AssemblyItemId& theItemId, TDF_LabelSequence& theNoteLabels) const; - Standard_EXPORT Standard_Integer GetAttrNotes(const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theGUID, - TDF_LabelSequence& theNoteLabels) const; - Standard_EXPORT Standard_Integer GetSubshapeNotes(const XCAFDoc_AssemblyItemId& theItemId, - Standard_Integer theSubshapeIndex, - TDF_LabelSequence& theNoteLabels) const; //! Gets all note labels of the labeled item. //! Notes linked to item's attributes aren't @@ -295,12 +285,6 @@ public: //! \return a handle to the assembly reference attribute. Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNote(const TDF_Label& theNoteLabel, const XCAFDoc_AssemblyItemId& theItemId); - Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNoteToAttr(const TDF_Label& theNoteLabel, - const XCAFDoc_AssemblyItemId& theItemId, - const Standard_GUID& theGUID); - Standard_EXPORT Handle(XCAFDoc_AssemblyItemRef) AddNoteToSubshape(const TDF_Label& theNoteLabel, - const XCAFDoc_AssemblyItemId& theItemId, - Standard_Integer theSubshapeIndex); //! Adds the given note to the labeled item. //! \param [in] theNoteLabel - note label. diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationDriver.cxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationDriver.cxx index 99ba3fc242..28a911dd35 100644 --- a/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationDriver.cxx +++ b/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationDriver.cxx @@ -14,7 +14,7 @@ // commercial license or contractual agreement. -#include +#include #include #include #include @@ -37,7 +37,7 @@ IMPLEMENT_DOMSTRING(AnimationLastIdx, "animation_last_idx") //purpose : Constructor //======================================================================= XmlMXCAFDoc_AnimationDriver::XmlMXCAFDoc_AnimationDriver - (const Handle(CDM_MessageDriver)& theMsgDriver) + (const Handle(Message_Messenger)& theMsgDriver) : XmlMDF_ADriver (theMsgDriver, "xcaf", "Animation") {} @@ -85,8 +85,6 @@ Standard_Boolean XmlMXCAFDoc_AnimationDriver::Paste return Standard_False; Handle(TColStd_HArray1OfByte) anAnim = new TColStd_HArray1OfByte(anAnimFirstIdx, anAnimLastIdx); - const Standard_Integer aMaxSize = anImageLastIdx - anImageFirstIdx + anAnimLastIdx - anAnimFirstIdx + 2; - XmlObjMgt_DOMString aDataStr = XmlObjMgt::GetStringValue(theSource); Standard_SStream anSS(aDataStr.GetString()); diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationDriver.hxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationDriver.hxx index 1cdf3685e8..7c23181c87 100644 --- a/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationDriver.hxx +++ b/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationDriver.hxx @@ -23,7 +23,7 @@ #include #include #include -class CDM_MessageDriver; +class Message_Messenger; class TDF_Attribute; class XmlObjMgt_Persistent; @@ -38,7 +38,7 @@ class XmlMXCAFDoc_AnimationDriver : public XmlMDF_ADriver public: - Standard_EXPORT XmlMXCAFDoc_AnimationDriver(const Handle(CDM_MessageDriver)& theMessageDriver); + Standard_EXPORT XmlMXCAFDoc_AnimationDriver(const Handle(Message_Messenger)& theMessageDriver); Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationToolDriver.cxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationToolDriver.cxx index 5ee0e0b917..4dd5a9a259 100644 --- a/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationToolDriver.cxx +++ b/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationToolDriver.cxx @@ -13,7 +13,7 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include +#include #include #include #include @@ -27,7 +27,7 @@ IMPLEMENT_STANDARD_RTTIEXT(XmlMXCAFDoc_AnimationToolDriver,XmlMDF_ADriver) //purpose : //======================================================================= XmlMXCAFDoc_AnimationToolDriver::XmlMXCAFDoc_AnimationToolDriver - (const Handle(CDM_MessageDriver)& theMsgDriver) + (const Handle(Message_Messenger)& theMsgDriver) : XmlMDF_ADriver (theMsgDriver, "xcaf", "AnimationTool") { } diff --git a/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationToolDriver.hxx b/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationToolDriver.hxx index 731d34fcf4..2adf4ef4a9 100644 --- a/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationToolDriver.hxx +++ b/src/XmlMXCAFDoc/XmlMXCAFDoc_AnimationToolDriver.hxx @@ -23,7 +23,7 @@ #include #include #include -class CDM_MessageDriver; +class Message_Messenger; class TDF_Attribute; class XmlObjMgt_Persistent; @@ -38,7 +38,7 @@ class XmlMXCAFDoc_AnimationToolDriver : public XmlMDF_ADriver public: - Standard_EXPORT XmlMXCAFDoc_AnimationToolDriver(const Handle(CDM_MessageDriver)& theMsgDriver); + Standard_EXPORT XmlMXCAFDoc_AnimationToolDriver(const Handle(Message_Messenger)& theMsgDriver); Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; -- 2.39.5