{
PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(
myWorkshop->operationMgr()->currentOperation());
- if (aPreviewOp) {
+ Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
+ if (aPreviewOp && (!aView.IsNull())) {
XGUI_Selection* aSelection = myWorkshop->selector()->selection();
// Initialise operation with preliminary selection
std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
- aPreviewOp->mousePressed(theEvent, myWorkshop->viewer()->activeView(), aSelected, aHighlighted);
+ aPreviewOp->mousePressed(theEvent, aView, aSelected, aHighlighted);
}
}
{
PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(
myWorkshop->operationMgr()->currentOperation());
- if (aPreviewOp) {
+ Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
+ if (aPreviewOp && (!aView.IsNull())) {
XGUI_Selection* aSelection = myWorkshop->selector()->selection();
// Initialise operation with preliminary selection
std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
- aPreviewOp->mouseReleased(theEvent, myWorkshop->viewer()->activeView(), aSelected, aHighlighted);
+ aPreviewOp->mouseReleased(theEvent, aView, aSelected, aHighlighted);
}
}
{
PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(
myWorkshop->operationMgr()->currentOperation());
- if (aPreviewOp)
- aPreviewOp->mouseMoved(theEvent, myWorkshop->viewer()->activeView());
+ Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
+ if (aPreviewOp && (!aView.IsNull()))
+ aPreviewOp->mouseMoved(theEvent, aView);
}
void PartSet_Module::onKeyRelease(QKeyEvent* theEvent)
{
PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(
myWorkshop->operationMgr()->currentOperation());
- if (aPreviewOp)
- {
+ Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
+ if (aPreviewOp && (!aView.IsNull())) {
XGUI_Selection* aSelection = myWorkshop->selector()->selection();
// Initialise operation with preliminary selection
std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
- aPreviewOp->mouseDoubleClick(theEvent, myWorkshop->viewer()->activeView(), aSelected,
- aHighlighted);
+ aPreviewOp->mouseDoubleClick(theEvent, aView, aSelected, aHighlighted);
}
}
return myWorkshop->salomeConnector()->viewer()->activeView();
} else {
XGUI_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
- return aViewer->activeViewWindow()->viewPort()->getView();
+ return (aViewer->activeViewWindow())?
+ aViewer->activeViewWindow()->viewPort()->getView():
+ Handle(V3d_View)();
}
}
}
else {
XGUI_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
- aViewer->activeViewWindow()->viewPort()->fitAll();
+ if (aViewer->activeViewWindow())
+ aViewer->activeViewWindow()->viewPort()->fitAll();
}
}