Salome HOME
bos #20661 EDF 22847 - Move to the end
[modules/shaper.git] / src / Config / Config_FeatureReader.cpp
index c76aee821d60836bd77ae48a502ba3171e86d4f1..61c2ec179c8aa9f08260d99c9b6ea7138c8fb5e9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  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
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Config_Keywords.h>
@@ -89,6 +88,9 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode)
         aMessage->setConcealment(isConcealment);
         bool isMainArg = isConcealment && getBooleanAttribute(theNode, ATTR_MAIN_ARG, false);
         aMessage->setMainArgument(isMainArg);
+        aMessage->setGeometricalSelection(getBooleanAttribute(theNode,
+                                                              ATTR_GEOMETRICAL_SELECTION,
+                                                              false));
 
         std::list<std::pair<std::string, std::string> > aCases;
         xmlNodePtr aCaseNode = hasParentRecursive(theNode,
@@ -97,7 +99,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode)
           std::string aCaseNodeID = getProperty(aCaseNode, _ID);
           std::string aSwitchNodeID = "";
           const xmlChar* aName = aCaseNode->name;
-          xmlNodePtr aSwitchNode;
+          xmlNodePtr aSwitchNode = 0;
           if (!xmlStrcmp(aName, (const xmlChar *) WDG_SWITCH_CASE)) {
             aSwitchNode = hasParentRecursive(aCaseNode, WDG_SWITCH, NULL);
           }
@@ -172,18 +174,31 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theFeatureNode,
 
   bool isInternal = getBooleanAttribute(theFeatureNode, ATTR_INTERNAL, false);
   outFeatureMessage->setInternal(isInternal);
-  if (isInternal) {
-    //Internal feature has no visual representation.
-    return;
-  }
+
+  std::string aHelpFile = getProperty(theFeatureNode, HELP_FILE);
+  if (!aHelpFile.empty())
+    outFeatureMessage->setHelpFileName(myLibraryName + "/" + aHelpFile);
+
+  bool isHideFaces = getBooleanAttribute(theFeatureNode, HIDEFACES_PANEL, false);
+  outFeatureMessage->setHideFacesPanel(isHideFaces);
+
+  bool isConfirmAbort = getBooleanAttribute(theFeatureNode, ABORT_CONFIRMATION, true);
+  outFeatureMessage->setAbortConfirmation(isConfirmAbort);
+
+  //if (isInternal) {
+  //  //Internal feature has no visual representation.
+  //  return;
+  //}
 
   std::string aText = Config_Translator::translate(anId, getProperty(theFeatureNode, FEATURE_TEXT));
   outFeatureMessage->setText(aText);
-  std::string aToolTip = Config_Translator::translate(anId,
-                                                      getProperty(theFeatureNode, FEATURE_TOOLTIP));
+  bool isTitleInToolbar = getBooleanAttribute(theFeatureNode, FEATURE_TITLE_IN_TOOLBAR, true);
+  outFeatureMessage->setTitleInToolbar(isTitleInToolbar);
+  std::string aToolTip = Config_Translator::translate(
+    anId, getProperty(theFeatureNode, FEATURE_TOOLTIP));
+  outFeatureMessage->setTooltip(aToolTip);
   outFeatureMessage->setIcon(getProperty(theFeatureNode, FEATURE_ICON));
   outFeatureMessage->setKeysequence(getProperty(theFeatureNode, FEATURE_KEYSEQUENCE));
-  outFeatureMessage->setHelpFileName(getProperty(theFeatureNode, HELP_FILE));
 
   std::string aGroupName = restoreAttribute(NODE_GROUP, _ID);
   std::string aWBNName = restoreAttribute(NODE_WORKBENCH, _ID);