Salome HOME
Building Names. First part (to be debugged).
[modules/shaper.git] / src / Model / Model_Document.cpp
index 557ee00e59e6fc53e2e96ee73eccc9793c3df541..c4fb2e7aaa8c1003d46b2782231fad0ed83f5ae3 100644 (file)
@@ -50,6 +50,11 @@ static const int TAG_HISTORY = 3;  // tag of the history sub-tree (python dump)
 static const int TAG_FEATURE_ARGUMENTS = 1;  ///< where the arguments are located
 static const int TAG_FEATURE_RESULTS = 2;  ///< where the results are located
 
+///
+/// 0:1:2 - where features are located
+/// 0:1:2:N:1 - data of the feature N
+/// 0:1:2:N:2:K:1 - data of the K result of the feature N
+
 Model_Document::Model_Document(const std::string theID, const std::string theKind)
     : myID(theID), myKind(theKind),
       myDoc(new TDocStd_Document("BinOcaf"))  // binary OCAF format
@@ -221,6 +226,7 @@ bool Model_Document::save(const char* theFileName, std::list<std::string>& theRe
               TCollection_AsciiString aDestinationDir(DocFileName(theFileName, aDocName));
               OSD_Path aDestination(aDestinationDir);
               aFile.Copy(aDestination);
+              theResults.push_back(aDestinationDir.ToCString());
             } else {
               Events_Error::send(
                 std::string("Can not open file ") + aSubPath.ToCString() + " for saving");
@@ -1089,3 +1095,16 @@ Standard_Boolean IsEqual(const TDF_Label& theLab1, const TDF_Label& theLab2)
 {
   return TDF_LabelMapHasher::IsEqual(theLab1, theLab2);
 }
+
+void Model_Document::addNamingName(const TDF_Label theLabel, std::string theName)
+{
+  myNamingNames[theName] = theLabel;
+}
+
+TDF_Label Model_Document::findNamingName(std::string theName)
+{
+  std::map<std::string, TDF_Label>::iterator aFind = myNamingNames.find(theName);
+  if (aFind == myNamingNames.end())
+    return TDF_Label(); // not found
+  return aFind->second;
+}