mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0030153: Visualization, TKOpenGl - AIS_ColoredShape::SynchronizeAspects() doesn't update all aspects
AIS_InteractiveObject::SynchronizeAspects() now propagates event to OpenGl_Group::SynchronizeAspects() which properly handles all aspects defined within the group.
This commit is contained in:
parent
f2eaecb217
commit
eaac086605
@ -615,31 +615,9 @@ void AIS_InteractiveObject::SynchronizeAspects()
|
|||||||
|
|
||||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPrs3d->Presentation()->Groups()); aGroupIter.More(); aGroupIter.Next())
|
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPrs3d->Presentation()->Groups()); aGroupIter.More(); aGroupIter.Next())
|
||||||
{
|
{
|
||||||
Handle(Graphic3d_Group)& aGrp = aGroupIter.ChangeValue();
|
if (!aGroupIter.Value().IsNull())
|
||||||
if (aGrp.IsNull())
|
|
||||||
{
|
{
|
||||||
continue;
|
aGroupIter.ChangeValue()->SynchronizeAspects();
|
||||||
}
|
|
||||||
|
|
||||||
Handle(Graphic3d_AspectLine3d) aLineAspect = aGrp->LineAspect();
|
|
||||||
Handle(Graphic3d_AspectFillArea3d) aFaceAspect = aGrp->FillAreaAspect();
|
|
||||||
Handle(Graphic3d_AspectMarker3d) aMarkerAspect = aGrp->MarkerAspect();
|
|
||||||
Handle(Graphic3d_AspectText3d) aTextAspect = aGrp->TextAspect();
|
|
||||||
if (!aLineAspect.IsNull())
|
|
||||||
{
|
|
||||||
aGrp->SetGroupPrimitivesAspect (aLineAspect);
|
|
||||||
}
|
|
||||||
if (!aFaceAspect.IsNull())
|
|
||||||
{
|
|
||||||
aGrp->SetGroupPrimitivesAspect (aFaceAspect);
|
|
||||||
}
|
|
||||||
if (!aMarkerAspect.IsNull())
|
|
||||||
{
|
|
||||||
aGrp->SetGroupPrimitivesAspect (aMarkerAspect);
|
|
||||||
}
|
|
||||||
if (!aTextAspect.IsNull())
|
|
||||||
{
|
|
||||||
aGrp->SetGroupPrimitivesAspect (aTextAspect);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,6 +146,9 @@ public:
|
|||||||
//! after this call in the group.
|
//! after this call in the group.
|
||||||
virtual void SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& theAspect) = 0;
|
virtual void SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& theAspect) = 0;
|
||||||
|
|
||||||
|
//! Update presentation aspects after their modification.
|
||||||
|
virtual void SynchronizeAspects() = 0;
|
||||||
|
|
||||||
//! Returns TRUE if aspect is set for the group.
|
//! Returns TRUE if aspect is set for the group.
|
||||||
Standard_EXPORT Standard_Boolean IsGroupPrimitivesAspectSet (const Graphic3d_GroupAspect theAspect) const;
|
Standard_EXPORT Standard_Boolean IsGroupPrimitivesAspectSet (const Graphic3d_GroupAspect theAspect) const;
|
||||||
|
|
||||||
|
@ -79,8 +79,11 @@ public:
|
|||||||
return myResources.ShaderProgram;
|
return myResources.ShaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
|
Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const Standard_OVERRIDE;
|
||||||
Standard_EXPORT virtual void Release (OpenGl_Context* theContext);
|
Standard_EXPORT virtual void Release (OpenGl_Context* theContext) Standard_OVERRIDE;
|
||||||
|
|
||||||
|
//! Update presentation aspects parameters after their modification.
|
||||||
|
virtual void SynchronizeAspects() Standard_OVERRIDE { SetAspect (myAspect); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -53,8 +53,11 @@ public:
|
|||||||
return myResources.ShaderProgram;
|
return myResources.ShaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
|
Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const Standard_OVERRIDE;
|
||||||
Standard_EXPORT virtual void Release (OpenGl_Context* theContext);
|
Standard_EXPORT virtual void Release (OpenGl_Context* theContext) Standard_OVERRIDE;
|
||||||
|
|
||||||
|
//! Update presentation aspects parameters after their modification.
|
||||||
|
virtual void SynchronizeAspects() Standard_OVERRIDE { SetAspect (myAspect); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -95,8 +95,11 @@ public:
|
|||||||
return myResources.ShaderProgram();
|
return myResources.ShaderProgram();
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
|
Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const Standard_OVERRIDE;
|
||||||
Standard_EXPORT virtual void Release (OpenGl_Context* theContext);
|
Standard_EXPORT virtual void Release (OpenGl_Context* theContext) Standard_OVERRIDE;
|
||||||
|
|
||||||
|
//! Update presentation aspects parameters after their modification.
|
||||||
|
virtual void SynchronizeAspects() Standard_OVERRIDE { SetAspect (myAspect); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -59,8 +59,11 @@ public:
|
|||||||
return myResources.ShaderProgram;
|
return myResources.ShaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
|
Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const Standard_OVERRIDE;
|
||||||
Standard_EXPORT virtual void Release (OpenGl_Context* theContext);
|
Standard_EXPORT virtual void Release (OpenGl_Context* theContext) Standard_OVERRIDE;
|
||||||
|
|
||||||
|
//! Update presentation aspects parameters after their modification.
|
||||||
|
virtual void SynchronizeAspects() Standard_OVERRIDE { SetAspect (myAspect); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -60,6 +60,9 @@ public:
|
|||||||
//! Return TRUE if primitive type generates shaded triangulation (to be used in filters).
|
//! Return TRUE if primitive type generates shaded triangulation (to be used in filters).
|
||||||
virtual Standard_Boolean IsFillDrawMode() const { return false; }
|
virtual Standard_Boolean IsFillDrawMode() const { return false; }
|
||||||
|
|
||||||
|
//! Update parameters of the drawable elements.
|
||||||
|
virtual void SynchronizeAspects() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Standard_EXPORT virtual ~OpenGl_Element();
|
Standard_EXPORT virtual ~OpenGl_Element();
|
||||||
|
@ -264,6 +264,34 @@ void OpenGl_Group::SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& th
|
|||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// =======================================================================
|
||||||
|
// function : SynchronizeAspects
|
||||||
|
// purpose :
|
||||||
|
// =======================================================================
|
||||||
|
void OpenGl_Group::SynchronizeAspects()
|
||||||
|
{
|
||||||
|
if (myAspectFace != NULL)
|
||||||
|
{
|
||||||
|
myAspectFace->SynchronizeAspects();
|
||||||
|
}
|
||||||
|
if (myAspectLine != NULL)
|
||||||
|
{
|
||||||
|
myAspectLine->SynchronizeAspects();
|
||||||
|
}
|
||||||
|
if (myAspectMarker != NULL)
|
||||||
|
{
|
||||||
|
myAspectMarker->SynchronizeAspects();
|
||||||
|
}
|
||||||
|
if (myAspectText != NULL)
|
||||||
|
{
|
||||||
|
myAspectText->SynchronizeAspects();
|
||||||
|
}
|
||||||
|
for (OpenGl_ElementNode* aNode = myFirst; aNode != NULL; aNode = aNode->next)
|
||||||
|
{
|
||||||
|
aNode->elem->SynchronizeAspects();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// function : AddPrimitiveArray
|
// function : AddPrimitiveArray
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -103,6 +103,9 @@ public:
|
|||||||
//! Append text aspect as an element.
|
//! Append text aspect as an element.
|
||||||
Standard_EXPORT virtual void SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& theAspect) Standard_OVERRIDE;
|
Standard_EXPORT virtual void SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& theAspect) Standard_OVERRIDE;
|
||||||
|
|
||||||
|
//! Update presentation aspects after their modification.
|
||||||
|
Standard_EXPORT virtual void SynchronizeAspects() Standard_OVERRIDE;
|
||||||
|
|
||||||
//! Add primitive array element
|
//! Add primitive array element
|
||||||
Standard_EXPORT virtual void AddPrimitiveArray (const Graphic3d_TypeOfPrimitiveArray theType,
|
Standard_EXPORT virtual void AddPrimitiveArray (const Graphic3d_TypeOfPrimitiveArray theType,
|
||||||
const Handle(Graphic3d_IndexBuffer)& theIndices,
|
const Handle(Graphic3d_IndexBuffer)& theIndices,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user