#include <PartSet_Module.h>
#include <PartSet_OperationSketch.h>
#include <PartSet_OperationFeatureCreate.h>
-#include <PartSet_OperationFeatureEditMulti.h>
#include <PartSet_OperationFeatureEdit.h>
#include <PartSet_Listener.h>
#include <PartSet_TestOCC.h>
void PartSet_Module::onPlaneSelected(double theX, double theY, double theZ)
{
myWorkshop->viewer()->setViewProjection(theX, theY, theZ);
+}
+
+void PartSet_Module::onSketchLaunched()
+{
xWorkshop()->actionsMgr()->update();
// Set working plane
ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
ModuleBase_ISelection* aSelection = workshop()->selection();
// Initialise operation with preliminary selection
aSketchOp->initSelection(aSelection, myWorkshop->viewer());
- } //else if (aFeature) {
- //anOperation->setFeature(aFeature);
+ } else if (aFeature) { // In case of edit operation: set the previously created feature to the operation
+ anOperation->setFeature(aFeature);
////Deactivate result of current feature in order to avoid its selection
- //XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
- //std::list<ResultPtr> aResults = aFeature->results();
- //std::list<ResultPtr>::const_iterator aIt;
- //for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
- // aDisplayer->deactivate(*aIt);
- //}
- //}
+ XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
+ std::list<ResultPtr> aResults = aFeature->results();
+ std::list<ResultPtr>::const_iterator aIt;
+ for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
+ aDisplayer->deactivate(*aIt);
+ }
+ }
sendOperation(anOperation);
xWorkshop()->actionsMgr()->updateCheckState();
}
}
if (PartSet_OperationFeatureCreate::canProcessKind(theCmdId)) {
anOperation = new PartSet_OperationFeatureCreate(theCmdId.c_str(), this, aSketch);
- } else if (theCmdId == PartSet_OperationFeatureEditMulti::Type()) {
- anOperation = new PartSet_OperationFeatureEditMulti(theCmdId.c_str(), this, aSketch);
} else if (theCmdId == PartSet_OperationFeatureEdit::Type()) {
anOperation = new PartSet_OperationFeatureEdit(theCmdId.c_str(), this, aSketch);
}
connect(aSketchOp, SIGNAL(planeSelected(double, double, double)), this,
SLOT(onPlaneSelected(double, double, double)));
connect(aSketchOp, SIGNAL(fitAllView()), this, SLOT(onFitAllView()));
+ connect(aSketchOp, SIGNAL(launchSketch()), this, SLOT(onSketchLaunched()));
}
}
QList<ModuleBase_ViewerPrs> aSelected = aSelect->getSelected();
// We need to stop edit operation if selection is cleared
if (aSelected.size() == 0) {
- PartSet_OperationFeatureEdit* anEditOp =
+ // do not perform commit of the current edit operation here, because
+ // this functionality is realized inside this operation
+ /*PartSet_OperationFeatureEdit* anEditOp =
dynamic_cast<PartSet_OperationFeatureEdit*>(myWorkshop->currentOperation());
if (!anEditOp)
return;
- anEditOp->commit();
+ anEditOp->commit();*/
} else {
PartSet_OperationSketchBase* aSketchOp =
dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop->currentOperation());