Salome HOME
Loading of SketchSolver plugin example.
[modules/shaper.git] / src / Config / Config_FeatureReader.cpp
index 229c4cec9871fd61dd101ded68aa6d81bbd022c3..78e485e912d1b5e294d160c57b380e57273aff39 100644 (file)
@@ -28,7 +28,7 @@ Config_FeatureReader::Config_FeatureReader(const std::string& theXmlFile,
                                            const char* theEventGenerated)
     : Config_XMLReader(theXmlFile),
       myLibraryName(theLibraryName),
-      myEventGenerated(theEventGenerated ? theEventGenerated : "FeatureEvent")
+      myEventGenerated(theEventGenerated ? theEventGenerated : EVENT_FEATURE_LOADED)
 {
 }
 
@@ -36,6 +36,11 @@ Config_FeatureReader::~Config_FeatureReader()
 {
 }
 
+std::list<std::string> Config_FeatureReader::features() const
+{
+  return myFeatures;
+}
+
 void Config_FeatureReader::processNode(xmlNodePtr theNode)
 {
   Events_ID aMenuItemEvent = Events_Loop::eventByName(myEventGenerated);
@@ -43,6 +48,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode)
     Events_Loop* aEvLoop = Events_Loop::loop();
     Config_FeatureMessage aMessage(aMenuItemEvent, this);
     fillFeature(theNode, aMessage);
+    myFeatures.push_back(getProperty(theNode, _ID));
     //If a feature has xml definition for it's widget:
     aMessage.setUseInput(hasChild(theNode));
     aEvLoop->send(aMessage);
@@ -54,6 +60,8 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode)
   if (isNode(theNode, NODE_WORKBENCH, NULL)) {
     myLastWorkbench = getProperty(theNode, _ID);
   }
+  //Process SOURCE nodes.
+  Config_XMLReader::processNode(theNode);
 }
 
 bool Config_FeatureReader::processChildren(xmlNodePtr theNode)
@@ -71,4 +79,5 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theRoot, Config_FeatureMessage
   outFtMessage.setGroupId(myLastGroup);
   outFtMessage.setWorkbenchId(myLastWorkbench);
   outFtMessage.setPluginLibrary(myLibraryName);
+  outFtMessage.setNestedFeatures(getProperty(theRoot, FEATURE_NESTED));
 }