Example #1
0
void eraseObjectFromContext(Handle_AIS_InteractiveObject object,
                            Handle_AIS_InteractiveContext context)
{
  if (!object.IsNull()) {
    context->Erase(object, Standard_False);
    context->Remove(object, Standard_False);
    context->Clear(object, Standard_False); // Remove() can be used too
    context->SelectionManager()->Remove(object);
    while (!object.IsNull())
      object.Nullify();
  }
}
Example #2
0
void eraseGpxObjectFromContext(
        const Handle_AIS_InteractiveObject &object,
        const Handle_AIS_InteractiveContext &context)
{
    if (!object.IsNull()) {
        context->Erase(object, Standard_False);
        context->Remove(object, Standard_False);
#if OCC_VERSION_HEX < 0x060900
        context->Clear(object, Standard_False); // Note: Remove() can be used too
#else
        context->ClearPrs(object, 0, Standard_False);
#endif
        context->SelectionManager()->Remove(object);

        Handle_AIS_InteractiveObject objectHCopy = object;
        while (!objectHCopy.IsNull())
            objectHCopy.Nullify();
    }
}