
Fri, 01/23/2015 - 22:04
Forums:
Hello,
I would like to clear my view window without deleting the objects presented in it. On OCCT 6.7.9, AIS_InteractiveContext::RemovelAll() did the trick, but now on 6.8.0 I get the following exception:
00007FFD7E7B0 : Standard_NoSuchObject: TCollection_DataMap::Find
Any clues as to why this is happening?
Thanks in advance,
Rodrigo
Mon, 01/26/2015 - 18:17
Just an update:
I tested AIS_InteractiveContext::Remove(const Handle(AIS_InteractiveObject)& aniobj) instead of RemoveAll(), in particular using an argument of type Handle(AIS_Shape), to clear the view from the only object in it.
The problem repeats itself, though the number code on the exception is different:
00007FFB3457E7B0 : Standard_NoSuchObject: TCollection_DataMap::Find
Tue, 01/27/2015 - 17:26
Dear Rodrigo,
To say something definite a complete scenario to reproduce the issue should be provided, because there are no problems to remove AIS_Shape from context in Draw Harness.
For now it looks like an application bug.
Best regards
FSR.
Tue, 01/27/2015 - 18:07
Thank you for the reply, FSR. I will continue my investigation of the issue, as you are probably correct.
Wed, 02/04/2015 - 05:44
Just closing this issue, I managed to track it down to the following:
// Part 1
handle_modelo3D = new AIS_Shape(t_shape);
myAIScontext->Display(handle_modelo3D, AIS_Shaded, TopAbs_FACE);
// Part 2
myAIScontext->CloseAllContexts();
myAIScontext->OpenLocalContext();
myAIScontext->ActivateStandardMode(TopAbs_FACE);
myAIScontext->SelectionColor(Quantity_NOC_RED);
// Part 3
myAIScontext>RemoveAll();
After some teste, I noticed the problem only ocurred after issuing OpenLocalContext() on Part 2, which exists because it is the only thing that worked (I wanted a single face of my model to highlight when the mouse cursor moved over it).
So I've made the following changes to part 3. I don't even know if removing an AIS_Shape from closed contexts does anything, but it solved my problem.
// Part 3
myAIScontext->CloseAllContexts();
myAIScontext->Remove(handle_modelo3D);
I am leaving this here in case other people have the same issue. Thanks again!