View Issue Details

IDProjectCategoryView StatusLast Update
0033325CommunityOCCT:Visualizationpublic2023-02-09 13:40
Reporterfrancois_lauzon Assigned Tosshutina  
PrioritynormalSeverityminor 
Status newResolutionopen 
PlatformWindowsOSVC++ 2019 
Product Version7.6.3 
Summary0033325: AIS_InteractiveContext::setObjectStatus not using ToPropagateVisualState() in AIS_InteractiveContext::setObjectStatus()
DescriptionIn OCC 7.7.0
The method AIS_InteractiveContext::setObjectStatus() is not using the flag ToPropagateVisualState() to propagate or not the parent object status.
This cause a child object of a parent, at startup, to not having the presentation compute (or something similar), the child object is invisible.

To fix the issue, I simply used the same steps in AIS_InteractiveContext::setObjectStatus() as what is done in PrsMgr_PresentationManager::Clear(), PrsMgr_PresentationManager::Display(), ...
Where the ToPropagateVisualState() is tested before.

A fix is also proposed below...
Steps To ReproduceCreate an object as a child of another (using PrsMgr_PresentableObject::AddChild() )
Display the parent object... this will propagate the display status to the child
When we try to display the child object (using AIS_InteractiveContext), nothing will be done as it is already tag as displayed
Additional information
and documentation updates
Here is the fix:
void AIS_InteractiveContext::setObjectStatus (const Handle(AIS_InteractiveObject)& theIObj,
                                              const PrsMgr_DisplayStatus theStatus,
                                              const Standard_Integer theDispMode,
                                              const Standard_Integer theSelectionMode)
{
  theIObj->SetDisplayStatus (theStatus);
  if (theStatus != PrsMgr_DisplayStatus_None)
  {
    Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus();
    aStatus->SetDisplayMode (theDispMode);
    if (theSelectionMode != -1)
    {
      aStatus->AddSelectionMode (theSelectionMode);
    }
    myObjects.Bind (theIObj, aStatus);
  }
  else
  {
    myObjects.UnBind (theIObj);
  }

  if (theIObj->ToPropagateVisualState()) {
      for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (theIObj->Children()); aPrsIter.More(); aPrsIter.Next())
      {
        Handle(AIS_InteractiveObject) aChild (Handle(AIS_InteractiveObject)::DownCast (aPrsIter.Value()));
        if (aChild.IsNull())
        {
          continue;
        }

        setObjectStatus (aChild, theStatus, theDispMode, theSelectionMode);
      }
  }
}
TagsNo tags attached.
Test case number

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2023-02-08 19:04 francois_lauzon New Issue
2023-02-08 19:04 francois_lauzon Assigned To => sshutina
2023-02-09 13:40 dpasukhi Additional Information Updated