DiscussionsIssue archiveOCCT:Visualization

Archived issue #0030153

Visualization, TKOpenGl - AIS_ColoredShape::SynchronizeAspects() doesn't update all aspects

Open CASCADEOCCT:Visualizationclosed12 public notes

Search issues

Description

OpenGl_Group::SetGroupPrimitivesAspect method not work properly in some cases, because part of aspect fields is cached and updated only for the whole group. But in some cases is needed to update aspect fields for every group members.

Steps to reproduce

Not required

Public activity

12 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon Sep 24 11:53:12 2018 +0300

    0030153: Visualization - In some cases Graphic3d_Aspect not applied for models which contain many groups
    
    Added new virtual method OpenGl_Element::UpdateParameters().
    This method is needed for updating aspects for all OpenGl group members.
    Added new virtual method Graphic3d_Group::UpdateAspects().
    This method is overriden in OpenGl_Group and implement logic for updating presentation aspects after their modification.
02Commenter 3
+  //! Update presentation aspects after their modification.
+  Standard_EXPORT virtual void UpdateAspects() Standard_OVERRIDE;

It would be better calling method in the same way as where it is actually used - e.g. AIS_InteractiveObject::SynchronizeAspects().

+  //! Update parameters of the drawable elements.
+  virtual void UpdateParameters() = 0;

It doesn't look reasonable forcing every OpenGl_Element implementation defining this method.

+  OpenGl_ElementNode* aNode = myFirst;
+  while (aNode != NULL)
+  {

for(;;) loop syntax is preferable.

@@ -101,6 +116,7 @@ void OpenGl_Group::SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d
   {
     myAspectLine->SetAspect (theAspect);
   }
+  updateGroupElementNodes();

These updateGroupElementNodes() in Set**Aspect() look unrelated and redundant.
03Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon Sep 24 11:53:12 2018 +0300

    0030153: Visualization, TKOpenGl - AIS_ColoredShape::SynchronizeAspects() doesn't update all aspects
    
    Added new virtual method OpenGl_Element::UpdateParameters().
    This method is needed for updating aspects for all OpenGl group members.
    Added new virtual method Graphic3d_Group::SynchronizeAspects().
    This method is overriden in OpenGl_Group and implement logic for updating presentation aspects after their modification.
04Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
05Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
06Commenter 6
07Commenter 2
Branch [archived branch] has been created by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon Sep 24 11:53:12 2018 +0300

    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.
08Commenter 3
Please take the patch.
09Commenter 1
Combination -
OCCT branch : [archived branch] SHA - [revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17202.059999999743 / 17379.439999999933 [-1.02%]
Products
Total CPU difference: 7450.570000000066 / 7467.690000000077 [-0.23%]
Windows-64-VC14:
OCCT
Total CPU difference: 17412.784819698452 / 17536.33761169853 [-0.70%]
Products
Total CPU difference: 8346.287501499997 / 8382.276932199968 [-0.43%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
10Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
11Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
12Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]