XGUI_Displayer* aDisp = myWorkshop->displayer();
QObjectPtrList aObjList = aDisp->displayedObjects();
+ if (myHighlightPointAspect.IsNull()) {
+ Handle(AIS_Trihedron) aTrihedron = mySelector->viewer()->getTrihedron();
+ myHighlightPointAspect =
+ new Graphic3d_AspectMarker3d(aTrihedron->getHighlightPointAspect()->Aspect().operator*());
+ }
if (myOldSelectionColor.size() == 0)
myOldSelectionColor = aDisp->selectionColor();
}
// Delete selector because it has to be redefined on next activation
if (mySelector) {
+ if (!myHighlightPointAspect.IsNull()) {
+ Handle(AIS_Trihedron) aTrihedron = mySelector->viewer()->getTrihedron();
+ aTrihedron->getHighlightPointAspect()->SetAspect(myHighlightPointAspect);
+ myHighlightPointAspect.Nullify();
+ }
myWorkshop->displayer()->setSelectionColor(myOldSelectionColor);
myProxyViewer->setSelector(0);
delete mySelector;
{
if (theMgr->getType() == OCCViewer_Viewer::Type()) {
OCCViewer_Viewer* aViewer = static_cast<OCCViewer_Viewer*>(theMgr->getViewModel());
+
+ if (myHighlightPointAspect.IsNull()) {
+ Handle(AIS_Trihedron) aTrihedron = aViewer->getTrihedron();
+ myHighlightPointAspect =
+ new Graphic3d_AspectMarker3d(aTrihedron->getHighlightPointAspect()->Aspect().operator*());
+ }
SHAPERGUI_OCCSelector* aSelector = new SHAPERGUI_OCCSelector(aViewer,
getApp()->selectionMgr());
#ifdef SALOME_PATCH_FOR_CTRL_WHEEL
bool myIsToolbarsModified;
std::vector<int> myOldSelectionColor;
+ Handle(Graphic3d_AspectMarker3d) myHighlightPointAspect;
};
#endif
//**************************************************************
XGUI_Displayer::XGUI_Displayer(XGUI_Workshop* theWorkshop)
: myWorkshop(theWorkshop), myNeedUpdate(false),
- myViewerBlockedRecursiveCount(0), myIsFirstAISContextUse(true)
+ myViewerBlockedRecursiveCount(0), myContextId(0)
{
myCustomPrs = std::shared_ptr<GeomAPI_ICustomPrs>(new XGUI_CustomPrs(theWorkshop));
}
Handle(AIS_InteractiveContext) XGUI_Displayer::AISContext() const
{
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- if (!aContext.IsNull() && myIsFirstAISContextUse/*&& !aContext->HasOpenedContext()*/) {
- XGUI_Displayer* aDisplayer = (XGUI_Displayer*)this;
- aDisplayer->myIsFirstAISContextUse = false;
+ if (!aContext.IsNull() && (myContextId != aContext.get())) {
+ myContextId = aContext.get();
if (!myWorkshop->selectionActivate()->isTrihedronActive())
selectionActivate()->deactivateTrihedron(true);
aContext->DefaultDrawer()->VIsoAspect()->SetNumber(0);
aContext->DefaultDrawer()->UIsoAspect()->SetNumber(0);
- ModuleBase_IViewer::DefaultHighlightDrawer = aContext->HighlightStyle();
-
+ Handle(AIS_Trihedron) aTrihedron = myWorkshop->viewer()->trihedron();
+ aTrihedron->getHighlightPointAspect()->SetScale(2.0);
+ aTrihedron->getHighlightPointAspect()->SetTypeOfMarker(Aspect_TOM_O_STAR);
// Commented out according to discussion in bug #2825
+ //ModuleBase_IViewer::DefaultHighlightDrawer = aContext->HighlightStyle();
//Handle(Prs3d_Drawer) aSelStyle = aContext->SelectionStyle();
//double aDeflection =
// QString(ModelAPI_ResultConstruction::DEFAULT_DEFLECTION().c_str()).toDouble();
/// Number of blocking of the viewer update. The viewer is updated only if it is zero
int myViewerBlockedRecursiveCount;
- bool myIsFirstAISContextUse; ///< Flag: first asking of AIS context: trihedron activation
+ mutable void* myContextId;
mutable bool myNeedUpdate; ///< A flag that update was requested but not done
};