X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_Module.cpp;h=b35aaf442d332bf922a924764eca4f2ebb804005;hb=cd8f50ce5c9cf41e43a1f9b7155d12aad1c37494;hp=8c818d861c0666a7b4edaeee80268643560e114b;hpb=37bb85d16f7edad800d250a0aa976686f3d24ad7;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 8c818d861..b35aaf442 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -165,9 +165,8 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop) "Multi selector item color in operation", Config_Prop::Color, PartSet_CustomPrs::OPERATION_HIGHLIGHT_COLOR()); - - Config_PropManager::registerProp(SKETCH_TAB_NAME, "disable_input_fields", "Disable input fields", - Config_Prop::Boolean, "true"); + //Config_PropManager::registerProp(SKETCH_TAB_NAME, "disable_input_fields", "Disable input fields", + // Config_Prop::Boolean, "true"); } PartSet_Module::~PartSet_Module() @@ -259,7 +258,7 @@ void PartSet_Module::connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, c void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation) { - if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation, sketchMgr()->activeSketch())) { + if (sketchMgr()->isNestedSketchOperation(theOperation)) { mySketchMgr->commitNestedSketch(theOperation); } @@ -369,8 +368,7 @@ void PartSet_Module::updateSketcherOnStart(ModuleBase_Operation* theOperation) if (PartSet_SketcherMgr::isSketchOperation(theOperation)) { mySketchMgr->startSketch(theOperation); } - else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation, - sketchMgr()->activeSketch())) { + else if (sketchMgr()->isNestedSketchOperation(theOperation)) { mySketchMgr->startNestedSketch(theOperation); } } @@ -401,7 +399,7 @@ void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation) bool isModifiedResults = myCustomPrs->deactivate(ModuleBase_IModule::CustomizeResults, false); bool isModified = isModifiedArgs || isModifiedResults; - if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation, sketchMgr()->activeSketch())) { + if (sketchMgr()->isNestedSketchOperation(theOperation)) { mySketchMgr->stopNestedSketch(theOperation); } else if (PartSet_SketcherMgr::isSketchOperation(theOperation)) @@ -490,8 +488,7 @@ bool PartSet_Module::canActivateSelection(const ObjectPtr& theObject) const ModuleBase_Operation* anOperation = myWorkshop->currentOperation(); bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation), - isNestedOp = PartSet_SketcherMgr::isNestedSketchOperation(anOperation, - sketchMgr()->activeSketch()); + isNestedOp = sketchMgr()->isNestedSketchOperation(anOperation); if (isSketchOp || isNestedOp) { // in active sketch operation it is possible to activate operation object in selection // in the edit operation, e.g. points of the line can be moved when the line is edited @@ -754,7 +751,7 @@ ModuleBase_ModelWidget* PartSet_Module::activeWidget() const ModuleBase_Operation* aOperation = myWorkshop->currentOperation(); if (aOperation) { ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel(); - anActiveWidget = aPanel->activeWidget(); + anActiveWidget = aPanel ? aPanel->activeWidget() : 0; } } return anActiveWidget; @@ -771,8 +768,7 @@ bool PartSet_Module::deleteObjects() // 1. check whether the delete should be processed in the module ModuleBase_Operation* anOperation = myWorkshop->currentOperation(); bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation), - isNestedOp = PartSet_SketcherMgr::isNestedSketchOperation(anOperation, - sketchMgr()->activeSketch()); + isNestedOp = sketchMgr()->isNestedSketchOperation(anOperation); if (isSketchOp || isNestedOp) { isProcessed = true; // 2. find selected presentations @@ -839,7 +835,7 @@ void PartSet_Module::onFeatureTriggered() if (aCmd->isCheckable() && aCmd->isChecked()) { // 1. check whether the delete should be processed in the module ModuleBase_Operation* anOperation = myWorkshop->currentOperation(); - bool isNestedOp = PartSet_SketcherMgr::isNestedCreateOperation(anOperation); + bool isNestedOp = myModule->sketchMgr()->isNestedCreateOperation(anOperation); if (isNestedOp) { // in case if in the viewer nothing is displayed, the create operation should not be // comitted even if all values of the feature are initialized @@ -977,6 +973,11 @@ void PartSet_Module::onViewTransformed(int theTrsfType) aDisplayer->updateViewer(); } +bool PartSet_Module::isCustomPrsActivated(const ModuleBase_CustomizeFlag& theFlag) const +{ + return myCustomPrs->isActive(theFlag); +} + void PartSet_Module::activateCustomPrs(const FeaturePtr& theFeature, const ModuleBase_CustomizeFlag& theFlag, const bool theUpdateViewer) { @@ -1323,8 +1324,7 @@ GeomShapePtr PartSet_Module::findShape(const AttributePtr& theAttribute) GeomShapePtr aGeomShape; ModuleBase_Operation* anOperation = myWorkshop->currentOperation(); - if (anOperation && PartSet_SketcherMgr::isNestedSketchOperation(anOperation, - sketchMgr()->activeSketch())) { + if (anOperation && sketchMgr()->isNestedSketchOperation(anOperation)) { aGeomShape = PartSet_Tools::findShapeBy2DPoint(theAttribute, myWorkshop); } return aGeomShape;