void PartSet_Module::addViewerItems(QMenu* theMenu) const
{
- if (!PartSet_SketcherMgr::isSketchOperation(myWorkshop->currentOperation()) &&
- !isSketchFeatureOperationActive())
+ ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
+ if (!PartSet_SketcherMgr::isSketchOperation(anOperation) &&
+ !PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
return;
+
ModuleBase_ISelection* aSelection = myWorkshop->selection();
QObjectPtrList aObjects = aSelection->selectedPresentations();
if (aObjects.size() > 0) {
void PartSet_Module::onOperationActivatedByPreselection()
{
- ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
- if(aOperation && isSketchFeatureOperationActive()) {
+ ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
+ if(anOperation && PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
// Set final definitions if they are necessary
//propertyPanelDefined(aOperation);
/// Commit sketcher operations automatically
- aOperation->commit();
+ anOperation->commit();
}
}
void PartSet_Module::onNoMoreWidgets()
{
- if (isSketchFeatureOperationActive()) {
- ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
- if (aOperation) {
+ ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
+ if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
+ if (anOperation) {
if (myRestartingMode != RM_Forbided)
myRestartingMode = RM_LastFeatureUsed;
- aOperation->commit();
+ anOperation->commit();
}
}
}
return 0;
}
-bool PartSet_Module::isSketchFeatureOperationActive() const
-{
- bool isCurrentSketchOp = false;
- ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
- if (aOperation) {
- FeaturePtr aFeature = aOperation->feature();
- std::shared_ptr<SketchPlugin_Feature> aSPFeature =
- std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
- isCurrentSketchOp = aSPFeature.get() != NULL;
- }
- return isCurrentSketchOp;
-}
-
void PartSet_Module::createActions()
{
QAction* aAction = new QAction(QIcon(":pictures/delete.png"), tr("Delete"), this);
void PartSet_Module::deleteObjects()
{
- bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(myWorkshop->currentOperation());
- if (!isSketchOp && !isSketchFeatureOperationActive())
+ ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
+ bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation);
+ if (!isSketchOp && !PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
return;
// sketch feature should be skipped, only sub-features can be removed
}
//}
}
-
QString aDescription = tr("Delete");
+ /**
+ // according to #355 feature, it is not necessary to inform about dependencies during
+ // sketch delete operation
+ //
if (!aRefFeatures.empty()) {
QStringList aRefNames;
std::set<FeaturePtr>::const_iterator anIt = aRefFeatures.begin(),
if (aRes != QMessageBox::Yes)
return;
}
- }
+ }*/
SessionPtr aMgr = ModelAPI_Session::get();
aMgr->startOperation(aDescription.toStdString());
/// Breaks sequense of automatically resterted operations
void breakOperationSequence();
- /// Check whether the sketch operation is active
- /// \return boolean result
- bool isSketchOperationActive() const;
-
- /// Check whether the sketch feature operation is active
- /// \return boolean result
- bool isSketchFeatureOperationActive() const;
-
/// Create all actions for context menus. It is called on creation of module
/// Put the created actions into an internal map
void createActions();