DiscussionsIssue archiveOCCT:Visualization

Archived issue #0007781

Mistake in TPrsStd_AISPresentation::UnsetMode()

Open CASCADEOCCT:Visualizationclosed0 public notes

Search issues

Description

The following code is used currently to unset display mode:

...
    Handle(AIS_InteractiveContext) ctx;
    Handle(TPrsStd_AISViewer) viewer;
    if( TPrsStd_AISViewer::Find(Label(), viewer) )
      ctx = viewer->GetInteractiveContext();
    if( !ctx.IsNull() )
      ctx->SetDisplayMode(myAIS, Standard_False); <<< INCORRECT LINE !!!
    else
      myAIS->UnsetDisplayMode();
...

First, it is incorrect to use method AIS_InteractiveContext::SetDisplayMode()
for this purpose - it does not unset the object's display mode for any
combination of its arguments.

Second, there is mistake in arguments when SetDisplayMode() is calling:
second argument has type Standard_Integer ( not Standard_Boolean ).

Additional information

Documentation remark, added by Author 2005-02-07 12:25:29:

Changes:
In TPrsStd_AISPresentation::UnsetMode() method was called
AIS_InteractiveContext::UnsetDisplayMode() instead of
AIS_InteractiveContext::SetDisplayMode().
Modified entities:
TPrsStd/TPrsStd_AISPresentation/UnsetMode()

Public activity

No public notes

Participants are labeled by their role within this record.