if ((!isSketcher) && (!isEditing))
return;
- // MoveTo in order to highlight current object
- aViewer->AISContext()->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView());
-
+ Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
+ if (!aContext.IsNull()) {
+ // MoveTo in order to highlight current object
+ aContext->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView());
+ }
// Remember highlighted objects for editing
ModuleBase_ISelection* aSelect = aWorkshop->selection();
if (myDragDone) {
//aOp->commit();
myCurrentSelection.clear();
+ /*Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
+ if (!aContext.IsNull()) {
// Reselect edited object
- /*aViewer->AISContext()->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView());
+ aContext->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView());
if (theEvent->modifiers() & Qt::ShiftModifier)
- aViewer->AISContext()->ShiftSelect();
+ aContext->ShiftSelect();
else
- aViewer->AISContext()->Select();
- */
+ aContext->Select();
+ */
}
}
}
void PartSet_SketcherMgr::startNestedSketch(ModuleBase_Operation* theOperation)
{
connectToPropertyPanel(true);
+ QApplication::setOverrideCursor(QCursor(QIcon(":pictures/button_plus.png").pixmap(20,20)));
}
void PartSet_SketcherMgr::stopNestedSketch(ModuleBase_Operation* theOp)
myIsResetCurrentValue = false;
myIsMouseOverViewProcessed = true;
operationMgr()->onValidateOperation();
+ QApplication::restoreOverrideCursor();
}
void PartSet_SketcherMgr::commitNestedSketch(ModuleBase_Operation* theOperation)
ModuleBase_IViewer* aViewer = theWorkshop->viewer();
Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
- XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWorkshop);
- XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
+ if (!aContext.IsNull()) {
+ XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWorkshop);
+ XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
- std::list<ResultPtr> aResults = theFeature->results();
- std::list<ResultPtr>::const_iterator aIt;
- for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt)
- {
- ResultPtr aResult = *aIt;
- AISObjectPtr aAISObj = aDisplayer->getAISObject(aResult);
- if (aAISObj.get() == NULL)
- continue;
- Handle(AIS_InteractiveObject) anAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
- for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected())
+ std::list<ResultPtr> aResults = theFeature->results();
+ std::list<ResultPtr>::const_iterator aIt;
+ for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt)
{
- Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
- if (anOwner->Selectable() != anAISIO)
- continue;
- getAttributesOrResults(anOwner, theFeature, theSketch, aResult,
- aSelectedAttributes, aSelectedResults);
- }
- for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
- Handle(SelectMgr_EntityOwner) anOwner = aContext->DetectedOwner();
- if (anOwner.IsNull())
+ ResultPtr aResult = *aIt;
+ AISObjectPtr aAISObj = aDisplayer->getAISObject(aResult);
+ if (aAISObj.get() == NULL)
continue;
- if (anOwner->Selectable() != anAISIO)
- continue;
- getAttributesOrResults(anOwner, theFeature, theSketch, aResult,
- aSelectedAttributes, aSelectedResults);
+ Handle(AIS_InteractiveObject) anAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
+ for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected())
+ {
+ Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
+ if (anOwner->Selectable() != anAISIO)
+ continue;
+ getAttributesOrResults(anOwner, theFeature, theSketch, aResult,
+ aSelectedAttributes, aSelectedResults);
+ }
+ for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
+ Handle(SelectMgr_EntityOwner) anOwner = aContext->DetectedOwner();
+ if (anOwner.IsNull())
+ continue;
+ if (anOwner->Selectable() != anAISIO)
+ continue;
+ getAttributesOrResults(anOwner, theFeature, theSketch, aResult,
+ aSelectedAttributes, aSelectedResults);
+ }
}
}
theSelection[theFeature] = std::make_pair(aSelectedAttributes, aSelectedResults);
const FeaturePtr& theSketch,
ModuleBase_IWorkshop* theWorkshop,
const FeatureToSelectionMap& theSelection,
- SelectMgr_IndexedMapOfOwner& anOwnersToSelect)
+ SelectMgr_IndexedMapOfOwner& theOwnersToSelect)
{
if (theFeature.get() == NULL)
return;
std::set<ResultPtr> aSelectedResults = anIt.value().second;
ModuleBase_IViewer* aViewer = theWorkshop->viewer();
- Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
+
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWorkshop);
XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
for (Standard_Integer i = 1, n = aSelectedOwners.Extent(); i <= n; i++) {
Handle(SelectMgr_EntityOwner) anOwner = aSelectedOwners(i);
if (!anOwner.IsNull())
- anOwnersToSelect.Add(anOwner);
+ theOwnersToSelect.Add(anOwner);
}
}
AttributePtr aPntAttr = PartSet_Tools::findAttributeBy2dPoint(theFeature, aShape, theSketch);
if (aPntAttr.get() != NULL &&
aSelectedAttributes.find(aPntAttr) != aSelectedAttributes.end()) {
- anOwnersToSelect.Add(anOwner);
+ theOwnersToSelect.Add(anOwner);
}
}
else if (aShapeType == TopAbs_EDGE) {
bool aFound = aSelectedResults.find(aResult) != aSelectedResults.end();
if (aSelectedResults.find(aResult) != aSelectedResults.end() &&
- anOwnersToSelect.FindIndex(anOwner) <= 0)
- anOwnersToSelect.Add(anOwner);
+ theOwnersToSelect.FindIndex(anOwner) <= 0)
+ theOwnersToSelect.Add(anOwner);
}
}
}