]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModuleBase/ModuleBase_Tools.cpp
Salome HOME
Merge remote-tracking branch 'remotes/origin/EDF_2020_Lot2'
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.cpp
index ed9717c1009b1a373e61bfdffaf9944c1545b464..3037eceac9245fca4ac21a6bb21d8ca398656968 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -412,7 +412,7 @@ void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFe
       hasCompositeOwner |= (ModelAPI_Tools::bodyOwner(aResult) != NULL);
 
     if (!hasResultInHistory && aResult.get()) {
-      FeaturePtr aFeature = ModelAPI_Feature::feature(aResult);
+      aFeature = ModelAPI_Feature::feature(aResult);
       hasResultInHistory = aFeature.get() && aFeature->isInHistory();
     }
 
@@ -1011,8 +1011,6 @@ bool askToDelete(const std::set<FeaturePtr> theFeatures,
   aPartFeatureNames.sort();
   anOtherFeatureNames.sort();
 
-  bool aCanReplaceParameters = !aFeaturesRefsToParameterOnly.empty();
-
   QMessageBox aMessageBox(theParent);
   aMessageBox.setWindowTitle(QObject::tr("Delete features"));
   aMessageBox.setIcon(QMessageBox::Warning);
@@ -1041,7 +1039,9 @@ bool askToDelete(const std::set<FeaturePtr> theFeatures,
                        "be deleted.\nOr parameters could be replaced by their values.\n";
     aText += QString(QObject::tr(aMsg))
                      .arg(aParamFeatureNames.join(aSep));
+#ifdef _DEBUG
     QPushButton *aReplaceButton =
+#endif
       aMessageBox.addButton(QObject::tr("Replace"), QMessageBox::ActionRole);
   }
 
@@ -1126,7 +1126,7 @@ QString translate(const std::string& theContext, const std::string& theMessage)
   return aMessage;
 }
 
-void setPointBallHighlighting(AIS_Shape* theAIS)
+void setPointBallHighlighting(AIS_InteractiveObject* theAIS)
 {
   static Handle(Image_AlienPixMap) aPixMap;
   if(aPixMap.IsNull()) {
@@ -1208,7 +1208,7 @@ FeaturePtr createParameter(const QString& theText)
   SessionPtr aMgr = ModelAPI_Session::get();
   std::shared_ptr<ModelAPI_Document> aDoc = aMgr->activeDocument();
 
-  aParameter = aDoc->addFeature("Parameter");
+  aParameter = aDoc->addFeature("Parameter", false);
   if (aParameter.get()) {
     AttributeStringPtr aNameAttr = aParameter->string("variable");
     aNameAttr->setValue(aParamName.toStdString());
@@ -1287,8 +1287,6 @@ std::wstring generateName(const AttributePtr& theAttribute,
 {
   std::wstring aName;
   if (theAttribute.get() != NULL) {
-    ModuleBase_Operation* anOperation = theWorkshop->currentOperation();
-
     FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner());
     if (aFeature.get()) {
       std::string aXmlCfg, aDescription;