X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_OperationSketchBase.cpp;h=e8f081e4d581d19beab5a3cf4f46dc48dd91e42d;hb=e30796dab1aa68c01201b2b89d4292d3fcbbc4d4;hp=93c1818e14e90c845273844a8c7fc59bd2847637;hpb=c17d4feb4d01000f5e066bd4a23fe3ab94d177a3;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_OperationSketchBase.cpp b/src/PartSet/PartSet_OperationSketchBase.cpp index 93c1818e1..e8f081e4d 100644 --- a/src/PartSet/PartSet_OperationSketchBase.cpp +++ b/src/PartSet/PartSet_OperationSketchBase.cpp @@ -50,20 +50,16 @@ std::list PartSet_OperationSketchBase::subFeatures() const std::list PartSet_OperationSketchBase::getSelectionModes(ObjectPtr theFeature) const { + //TODO: Define position of selection modes definition std::list aModes; - //FeaturePtr aFeature = boost::dynamic_pointer_cast(theFeature); - //if (aFeature) { - // if (PartSet_Tools::isConstraintFeature(aFeature->getKind())) { - // aModes.clear(); - // aModes.push_back(AIS_DSM_Text); - // aModes.push_back(AIS_DSM_Line); - // return aModes; - // } - //} - aModes.push_back(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_VERTEX)); - aModes.push_back(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_EDGE)); - aModes.push_back(AIS_DSM_Text); - aModes.push_back(AIS_DSM_Line); + FeaturePtr aFeature = boost::dynamic_pointer_cast(theFeature); + if (aFeature && PartSet_Tools::isConstraintFeature(aFeature->getKind())) { + aModes.push_back(AIS_DSM_Text); + aModes.push_back(AIS_DSM_Line); + } else { + aModes.push_back(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_VERTEX)); + aModes.push_back(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_EDGE)); + } return aModes; } FeaturePtr PartSet_OperationSketchBase::createFeature(const bool theFlushMessage) @@ -96,38 +92,13 @@ void PartSet_OperationSketchBase::mouseDoubleClick( { } -void PartSet_OperationSketchBase::keyReleased(const int theKey) -{ - switch (theKey) { - case Qt::Key_Escape: { - bool toAbort = true; - if (isModified()) { - int anAnswer = QMessageBox::question( - qApp->activeWindow(), - tr("Cancel operation"), - tr("Do you want to cancel %1 operation?").arg(id()), - QMessageBox::Yes, - QMessageBox::No); - toAbort = (anAnswer == QMessageBox::Yes); - } - if (toAbort) - abort(); - } - break; - default: - break; - } -} - void PartSet_OperationSketchBase::restartOperation(const std::string& theType, ObjectPtr theFeature) { FeaturePtr aFeature = ModelAPI_Feature::feature(theFeature); if (aFeature) { QStringList aNested = this->nestedFeatures(); if (!aNested.isEmpty()) { - if (aNested.contains(QString(aFeature->getKind().c_str()))) - emit restartRequired(theType, theFeature); - else + if (!aNested.contains(QString(aFeature->getKind().c_str()))) return; } }