}
PartSet_SketcherMgr::PartSet_SketcherMgr(PartSet_Module* theModule)
- : QObject(theModule), myModule(theModule), myIsDragging(false), myDragDone(false),
- myIsMouseOverWindow(false),
+ : QObject(theModule), myModule(theModule), myIsEditLaunching(false), myIsDragging(false),
+ myDragDone(false), myIsMouseOverWindow(false),
myIsMouseOverViewProcessed(true), myPreviousUpdateViewerEnabled(true),
myIsPopupMenuActive(false)
{
}
} else if (isSketchOpe && isEditing) {
// If selected another object commit current result
+ bool aPrevLaunchingState = myIsEditLaunching;
+ myIsEditLaunching = true;
aFOperation->commit();
myIsDragging = true;
// selected entities, e.g. selection of point(attribute on a line) should edit the point
restoreSelection();
launchEditing();
+ myIsEditLaunching = aPrevLaunchingState;
if (aFeature.get() != NULL) {
std::shared_ptr<SketchPlugin_Feature> aSPFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
//}
/// improvement to deselect automatically all eventual selected objects, when
// returning to the neutral point of the Sketcher
- workshop()->selector()->clearSelection();
+ bool isClearSelectionPossible = true;
+ if (myIsEditLaunching) {
+ ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
+ (theOperation);
+ if (aFOperation) {
+ FeaturePtr aFeature = aFOperation->feature();
+ if (aFeature.get() && PartSet_SketcherMgr::isEntity(aFeature->getKind())) {
+ isClearSelectionPossible = false;
+ }
+ }
+ }
+ if (isClearSelectionPossible)
+ workshop()->selector()->clearSelection();
}
void PartSet_SketcherMgr::commitNestedSketch(ModuleBase_Operation* theOperation)
aDisplayed = displayObject(anObject);
if (aDisplayed)
aDoFitAll = aDoFitAll || neededFitAll(anObject, aNbOfShownObjects);
+
+ // workaround for #1750: sub results should be sent here to be displayed
+ FeaturePtr anObjectFeature = ModelAPI_Feature::feature(anObject);
+ if (anObjectFeature.get() && anObjectFeature->getKind() == "Partition") {
+ XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
+ if (anOperationMgr->hasOperation()) {
+ ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
+ (anOperationMgr->currentOperation());
+ if (aFOperation && aFOperation->isEditOperation() && aFOperation->id() == "Remove_SubShapes") {
+ ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(anObject);
+ if (aCompsolidResult.get() != NULL) { // display all sub results
+ for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) {
+ ObjectPtr aSubObject = aCompsolidResult->subResult(i);
+ aSubObject->setDisplayed(true);
+ aDisplayed = displayObject(aSubObject);
+ if (aDisplayed)
+ aDoFitAll = aDoFitAll || neededFitAll(aSubObject, aNbOfShownObjects);
+ }
+ }
+ }
+ }
+ }
} else
anObject->setDisplayed(false);
}