const int MOUSE_SENSITIVITY_IN_PIXEL = 10; ///< defines the local context mouse selection sensitivity
XGUI_Displayer::XGUI_Displayer(XGUI_Workshop* theWorkshop)
+ : myUseExternalObjects(false), myWorkshop(theWorkshop)
{
- myWorkshop = theWorkshop;
}
XGUI_Displayer::~XGUI_Displayer()
myResult2AISObjectMap[theObject] = theAIS;
aContext->Display(anAISIO, false);
aContext->SetDisplayMode(anAISIO, isShading? Shading : Wireframe, isUpdateViewer);
+ if (aContext->HasOpenedContext()) {
+ if (myUseExternalObjects) {
+ if (myActiveSelectionModes.size() == 0)
+ aContext->Activate(anAISIO);
+ else {
+ foreach(int aMode, myActiveSelectionModes) {
+ aContext->Activate(anAISIO, aMode);
+ }
+ }
+ }
+ }
}
}
//aContext->OpenLocalContext(false/*use displayed objects*/, true/*allow shape decomposition*/);
aContext->OpenLocalContext();
aContext->NotUseDisplayedObjects();
+
+ myUseExternalObjects = false;
+ myActiveSelectionModes.clear();
}
}
ic->CloseAllContexts(false);
if (isUpdateViewer)
updateViewer();
+ myUseExternalObjects = false;
+ myActiveSelectionModes.clear();
}
}
{
Handle(AIS_InteractiveContext) aContext = AISContext();
Handle(AIS_InteractiveObject) anAISIO = theAIS->impl<Handle(AIS_InteractiveObject)>();
- if (!anAISIO.IsNull())
+ if (!anAISIO.IsNull()) {
aContext->Display(anAISIO, isUpdate);
+ if (aContext->HasOpenedContext()) {
+ if (myUseExternalObjects) {
+ if (myActiveSelectionModes.size() == 0)
+ aContext->Activate(anAISIO);
+ else {
+ foreach(int aMode, myActiveSelectionModes) {
+ aContext->Activate(anAISIO, aMode);
+ }
+ }
+ }
+ }
+ }
}
void XGUI_Displayer::erase(AISObjectPtr theAIS, const bool isUpdate)
return;
aContext->UseDisplayedObjects();
+ myUseExternalObjects = true;
+ myActiveSelectionModes = theModes;
//Deactivate trihedron which can be activated in local selector
AIS_ListOfInteractive aPrsList;