]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Building Names. First part (to be debugged). Dev_0.6
authorszy <szy@opencascade.com>
Thu, 18 Dec 2014 16:16:26 +0000 (19:16 +0300)
committerszy <szy@opencascade.com>
Thu, 18 Dec 2014 16:16:26 +0000 (19:16 +0300)
src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp
src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp
src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp
src/FeaturesPlugin/FeaturesPlugin_Placement.cpp
src/Model/Model_ResultBody.cpp
src/Model/Model_ResultBody.h
src/ModelAPI/ModelAPI_ResultBody.h

index 5a31c28f98eb19b82d795910601432a7b576c2e4..c0c00ca9b7ca872a3ff1707de029562432e74783 100644 (file)
@@ -127,10 +127,14 @@ void ExchangePlugin_ImportFeature::loadNamingDS(
 {  
   //load result
   theResultBody->store(theGeomShape);
+  std::string aPrefix =  data()->name() + "/";
   int aTag(1);
-  theResultBody->loadFirstLevel(theGeomShape, aTag);
-  theResultBody->loadDisconnectedEdges(theGeomShape, aTag);
-  theResultBody->loadDisconnectedVertexes(theGeomShape, aTag); 
+  std::string aNameMS = aPrefix + "Shape";
+  theResultBody->loadFirstLevel(theGeomShape, aNameMS, aTag);
+  std::string aNameDE = aPrefix + "DiscEdges";
+  theResultBody->loadDisconnectedEdges(theGeomShape, aNameDE, aTag);
+  std::string aNameDV = aPrefix + "DiscVertexes";
+  theResultBody->loadDisconnectedVertexes(theGeomShape, aNameDV, aTag); 
 }
 
 LibHandle ExchangePlugin_ImportFeature::loadImportPlugin(const std::string& theFormatName)
index 025f63babad152cdba50d96665f366cd3ae9d81f..cf64b0935a2ec6aef22f1b7effda69831385e3a9 100644 (file)
@@ -101,10 +101,10 @@ void FeaturesPlugin_Boolean::LoadNamingDS(GeomAlgoAPI_Boolean* theFeature,
 
   GeomAPI_DataMapOfShapeShape* aSubShapes = new GeomAPI_DataMapOfShapeShape();
   theFeature->mapOfShapes(*aSubShapes);
-
+  std::string aPrefix =  data()->name() + "/";
   // Put in DF modified faces
-  theResultBody->loadAndOrientModifiedShapes(theFeature->makeShape(), theObject, FACE, _MODIFY_TAG, *aSubShapes);
-  theResultBody->loadAndOrientModifiedShapes(theFeature->makeShape(), theTool,   FACE, _MODIFY_TAG, *aSubShapes);
+  theResultBody->loadAndOrientModifiedShapes(theFeature->makeShape(), theObject, FACE, _MODIFY_TAG, aPrefix, *aSubShapes);
+  theResultBody->loadAndOrientModifiedShapes(theFeature->makeShape(), theTool,   FACE, _MODIFY_TAG, aPrefix, *aSubShapes);
 
   //Put in DF deleted faces
   theResultBody->loadDeletedShapes(theFeature->makeShape(), theObject, FACE, _DELETED_TAG);
index cebc0bb44cd024e123d796b13681fa978eba2570..1c5e57e5553e5d44be2bea61f5678fd8b75a036c 100644 (file)
@@ -101,17 +101,17 @@ void FeaturesPlugin_Extrusion::LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature,
 
   GeomAPI_DataMapOfShapeShape* aSubShapes = new GeomAPI_DataMapOfShapeShape();
   theFeature.mapOfShapes(*aSubShapes);
-
+  std::string aPrefix =  data()->name() + "/";
     //Insert lateral face : Face from Edge
-  theResultBody->loadAndOrientGeneratedShapes(theFeature.makeShape(), theBasis, EDGE,_LATERAL_TAG, *aSubShapes);
+  theResultBody->loadAndOrientGeneratedShapes(theFeature.makeShape(), theBasis, EDGE,_LATERAL_TAG, aPrefix, *aSubShapes);
 
   //Insert bottom face
   std::shared_ptr<GeomAPI_Shape> aBottomFace = theFeature.firstShape();  
   if (!aBottomFace->isNull()) {
        if (aSubShapes->isBound(aBottomFace)) {  
                aBottomFace = aSubShapes->find(aBottomFace);            
-    }    
-    theResultBody->generated(aBottomFace, _FIRST_TAG);
+    }     
+    theResultBody->generated(aBottomFace, aPrefix, _FIRST_TAG);
   }
 
 
@@ -122,7 +122,7 @@ void FeaturesPlugin_Extrusion::LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature,
     if (aSubShapes->isBound(aTopFace)) {        
       aTopFace = aSubShapes->find(aTopFace);   
     }
-    theResultBody->generated(aTopFace, _LAST_TAG);
+    theResultBody->generated(aTopFace, aPrefix, _LAST_TAG);
   }
 
   
index 96d52d77bb31f3676e959582f57436ddd916ce3d..b439a9f1fd8bf21dc52a656e0e8b4b53cfa4937d 100644 (file)
@@ -124,8 +124,8 @@ void FeaturesPlugin_Placement::LoadNamingDS(
 
   GeomAPI_DataMapOfShapeShape* aSubShapes = new GeomAPI_DataMapOfShapeShape();
   theFeature.mapOfShapes(*aSubShapes);
-
+   std::string aPrefix =  data()->name() + "/";
     // put modifed faces in DF
-  theResultBody->loadAndOrientModifiedShapes(theFeature.makeShape(), theSlaveObject, _FACE, _MODIFIEDF_TAG, *aSubShapes); 
+  theResultBody->loadAndOrientModifiedShapes(theFeature.makeShape(), theSlaveObject, _FACE, _MODIFIEDF_TAG, aPrefix, *aSubShapes); 
 
 }
index 13db221085e56ca75a94b9671d0b843520cbd4df..f0e87ba38e7aa15b207d815f8588bce25d19743a 100644 (file)
@@ -6,6 +6,7 @@
 #include <Model_Data.h>
 #include <TNaming_Builder.hxx>
 #include <TNaming_NamedShape.hxx>
+#include <TDataStd_Name.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Face.hxx>
@@ -48,7 +49,7 @@ void Model_ResultBody::store(const std::shared_ptr<GeomAPI_Shape>& theShape)
     if (aShape.IsNull())
       return;  // null shape inside
 
-    aBuilder.Generated(aShape);
+    aBuilder.Generated(aShape);        
   }
 }
 
@@ -142,28 +143,39 @@ TNaming_Builder* Model_ResultBody::builder(const int theTag)
   return myBuilders[theTag];
 }
 
+void Model_ResultBody::buildName(const int theTag, const std::string& theName)
+{
+  std::string aName = data()->name() + "/" + theName;
+  TDataStd_Name::Set(builder(theTag)->NamedShape()->Label(),aName.c_str());
+}
 void Model_ResultBody::generated(
-  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag)
+  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag)
 {
   TopoDS_Shape aShape = theNewShape->impl<TopoDS_Shape>();
   builder(theTag)->Generated(aShape);
+  if(!theName.empty()) 
+    buildName(theTag, theName);
 }
 
 void Model_ResultBody::generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag)
+  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag)
 {
   TopoDS_Shape anOldShape = theOldShape->impl<TopoDS_Shape>();
   TopoDS_Shape aNewShape = theNewShape->impl<TopoDS_Shape>();
   builder(theTag)->Generated(anOldShape, aNewShape);
+  if(!theName.empty()) 
+    buildName(theTag, theName);
 }
 
 
 void Model_ResultBody::modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag)
+  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag)
 {
   TopoDS_Shape anOldShape = theOldShape->impl<TopoDS_Shape>();
   TopoDS_Shape aNewShape = theNewShape->impl<TopoDS_Shape>();
   builder(theTag)->Modify(anOldShape, aNewShape);
+  if(!theName.empty()) 
+    buildName(theTag, theName);
 }
 
 void Model_ResultBody::deleted(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
@@ -197,10 +209,12 @@ void Model_ResultBody::loadAndOrientModifiedShapes (
   std::shared_ptr<GeomAPI_Shape>  theShapeIn,
   const int  theKindOfShape,
   const int  theTag,
+  const std::string& theName,
   GeomAPI_DataMapOfShapeShape& theSubShapes)
 {
   TopoDS_Shape aShapeIn = theShapeIn->impl<TopoDS_Shape>();
   TopTools_MapOfShape aView;
+  bool isBuilt = theName.empty();
   TopExp_Explorer aShapeExplorer (aShapeIn, (TopAbs_ShapeEnum)theKindOfShape);
   for (; aShapeExplorer.More(); aShapeExplorer.Next ()) {
     const TopoDS_Shape& aRoot = aShapeExplorer.Current ();
@@ -216,8 +230,11 @@ void Model_ResultBody::loadAndOrientModifiedShapes (
         std::shared_ptr<GeomAPI_Shape> aMapShape(theSubShapes.find(*anIt));
         aNewShape.Orientation(aMapShape->impl<TopoDS_Shape>().Orientation());
       }
-      if (!aRoot.IsSame (aNewShape)) 
+      if (!aRoot.IsSame (aNewShape)) {
         builder(theTag)->Modify(aRoot,aNewShape);
+               if(!isBuilt) 
+                 buildName(theTag, theName);           
+         }
     }
   }
 }
@@ -227,10 +244,12 @@ void Model_ResultBody::loadAndOrientGeneratedShapes (
   std::shared_ptr<GeomAPI_Shape>  theShapeIn,
   const int  theKindOfShape,
   const int  theTag,
+  const std::string& theName,
   GeomAPI_DataMapOfShapeShape& theSubShapes)
 {
   TopoDS_Shape aShapeIn = theShapeIn->impl<TopoDS_Shape>();
   TopTools_MapOfShape aView;
+  bool isBuilt = theName.empty();
   TopExp_Explorer aShapeExplorer (aShapeIn, (TopAbs_ShapeEnum)theKindOfShape);
   for (; aShapeExplorer.More(); aShapeExplorer.Next ()) {
     const TopoDS_Shape& aRoot = aShapeExplorer.Current ();
@@ -246,8 +265,11 @@ void Model_ResultBody::loadAndOrientGeneratedShapes (
         std::shared_ptr<GeomAPI_Shape> aMapShape(theSubShapes.find(*anIt));
         aNewShape.Orientation(aMapShape->impl<TopoDS_Shape>().Orientation());
       }
-      if (!aRoot.IsSame (aNewShape)) 
+      if (!aRoot.IsSame (aNewShape)) {
         builder(theTag)->Generated(aRoot,aNewShape);
+               if(!isBuilt) 
+                 buildName(theTag, theName);   
+         }
     }
   }
 }
@@ -287,14 +309,18 @@ void loadGeneratedDangleShapes(
 
 //=======================================================================
 void Model_ResultBody::loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape, 
-                                         int&  theTag)
+                                         const std::string& theName, int&  theTag)
 {
   if(theShape->isNull()) return;
   TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();    
+  std::string aName;
   if (aShape.ShapeType() == TopAbs_SOLID) {                
     TopExp_Explorer expl(aShape, TopAbs_FACE);
     for (; expl.More(); expl.Next())      
-         builder(++theTag)->Generated(expl.Current());     
+         builder(++theTag)->Generated(expl.Current()); 
+         TCollection_AsciiString aStr(theTag);
+         aName = theName + aStr.ToCString();
+         buildName(theTag, aName);
   }
   else if (aShape.ShapeType() == TopAbs_SHELL || aShape.ShapeType() == TopAbs_FACE) {
     // load faces and all the free edges
@@ -302,8 +328,12 @@ void Model_ResultBody::loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape,
     TopExp::MapShapes(aShape, TopAbs_FACE, Faces);
     if (Faces.Extent() > 1 || (aShape.ShapeType() == TopAbs_SHELL && Faces.Extent() == 1)) {
       TopExp_Explorer expl(aShape, TopAbs_FACE);
-      for (; expl.More(); expl.Next()) 
+      for (; expl.More(); expl.Next()) {
                  builder(++theTag)->Generated(expl.Current());          
+                 TCollection_AsciiString aStr(theTag);
+             aName = theName + aStr.ToCString();
+             buildName(theTag, aName);
+         }
        }
     TopTools_IndexedDataMapOfShapeListOfShape anEdgeAndNeighbourFaces;
     TopExp::MapShapesAndAncestors(aShape, TopAbs_EDGE, TopAbs_FACE, anEdgeAndNeighbourFaces);
@@ -311,13 +341,19 @@ void Model_ResultBody::loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape,
        {
       const TopTools_ListOfShape& aLL = anEdgeAndNeighbourFaces.FindFromIndex(i);
       if (aLL.Extent() < 2) {
-           builder(++theTag)->Generated(anEdgeAndNeighbourFaces.FindKey(i));    
+           builder(++theTag)->Generated(anEdgeAndNeighbourFaces.FindKey(i));
+               TCollection_AsciiString aStr(theTag);
+           aName = theName + aStr.ToCString();
+           buildName(theTag, aName);
       } else {
          TopTools_ListIteratorOfListOfShape anIter(aLL);
          const TopoDS_Face& aFace = TopoDS::Face(anIter.Value());
          anIter.Next();
          if(aFace.IsEqual(anIter.Value())) {
                builder(++theTag)->Generated(anEdgeAndNeighbourFaces.FindKey(i));
+               TCollection_AsciiString aStr(theTag);
+           aName = theName + aStr.ToCString();
+           buildName(theTag, aName);
          }
          }
        }
@@ -329,11 +365,17 @@ void Model_ResultBody::loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape,
       TopExp_Explorer expl(aShape, TopAbs_VERTEX);
       for (; expl.More(); expl.Next()) {
            builder(++theTag)->Generated(expl.Current());
+               TCollection_AsciiString aStr(theTag);
+           aName = theName + aStr.ToCString();
+           buildName(theTag, aName);
          }
        } else {
       TopExp_Explorer expl(aShape, TopAbs_EDGE); 
       for (; expl.More(); expl.Next()) {       
                builder(++theTag)->Generated(expl.Current());
+               TCollection_AsciiString aStr(theTag);
+           aName = theName + aStr.ToCString();
+           buildName(theTag, aName);
          }   
       // and load generated vertices.
       TopTools_DataMapOfShapeShape generated;
@@ -347,41 +389,49 @@ void Model_ResultBody::loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape,
     TopExp_Explorer expl(aShape, TopAbs_VERTEX);
     for (; expl.More(); expl.Next()) {      
                builder(++theTag)->Generated(expl.Current());
+               TCollection_AsciiString aStr(theTag);
+           aName = theName + aStr.ToCString();
+           buildName(theTag, aName);
        }
   }
 }
 //=======================================================================
 void Model_ResultBody::loadFirstLevel(
-                    std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag)
+                    std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag)
 {
- if(theShape->isNull()) return;
- TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();    
+  if(theShape->isNull()) return;
+  TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>(); 
+  std::string aName;
   if (aShape.ShapeType() == TopAbs_COMPOUND || aShape.ShapeType() == TopAbs_COMPSOLID) {
     TopoDS_Iterator itr(aShape);
     for (; itr.More(); itr.Next()) {
-         builder(++theTag)->Generated(itr.Value());     
+         builder(++theTag)->Generated(itr.Value());
+         TCollection_AsciiString aStr(theTag);
+         aName = theName + aStr.ToCString();
+         buildName(theTag, aName);
+         if(!theName.empty()) buildName(theTag, aName);
       if (itr.Value().ShapeType() == TopAbs_COMPOUND || 
                  itr.Value().ShapeType() == TopAbs_COMPSOLID) 
          {
                std::shared_ptr<GeomAPI_Shape> itrShape(new GeomAPI_Shape());
         itrShape->setImpl(new TopoDS_Shape(itr.Value()));
-           loadFirstLevel(itrShape, theTag);
+           loadFirstLevel(itrShape, theName, theTag);
       } else {
                std::shared_ptr<GeomAPI_Shape> itrShape(new GeomAPI_Shape());
-        itrShape->setImpl(new TopoDS_Shape(itr.Value()));
-               loadNextLevels(itrShape, theTag);
+        itrShape->setImpl(new TopoDS_Shape(itr.Value()));              
+               loadNextLevels(itrShape, theName, theTag);
          }
     }
   } else {
     std::shared_ptr<GeomAPI_Shape> itrShape(new GeomAPI_Shape());
     itrShape->setImpl(new TopoDS_Shape(aShape));
-       loadNextLevels(itrShape, theTag); 
+       loadNextLevels(itrShape, theName, theTag); 
   }
 }
 
 //=======================================================================
 void Model_ResultBody::loadDisconnectedEdges(
-                    std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag)
+                    std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag)
 {
   if(theShape->isNull()) return;
   TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();  
@@ -409,6 +459,7 @@ void Model_ResultBody::loadDisconnectedEdges(
   
   TopTools_MapOfShape anEdgesToDelete;
   TopExp_Explorer anEx(aShape,TopAbs_EDGE); 
+  std::string aName;
   for(;anEx.More();anEx.Next()) {
     Standard_Boolean aC0 = Standard_False;
     TopoDS_Shape anEdge1 = anEx.Current();
@@ -429,8 +480,11 @@ void Model_ResultBody::loadDisconnectedEdges(
                if (aLIter1.Value().IsSame(aLIter2.Value())) aMatches++;
                if (aMatches == aList1.Extent()) {
                  aC0=Standard_True;
-                         builder(++theTag)->Generated(anEdge2);              
+                         builder(++theTag)->Generated(anEdge2);
                  anEdgesToDelete.Add(anEdge2);
+                         TCollection_AsciiString aStr(theTag);
+                         aName = theName + aStr.ToCString();
+                 buildName(theTag, aName);
                        }
                }
          }      
@@ -439,12 +493,16 @@ void Model_ResultBody::loadDisconnectedEdges(
            edgeNaborFaces.UnBind(itDelete.Key());      
       edgeNaborFaces.UnBind(anEdge1);
        }
-    if (aC0) 
-         builder(++theTag)->Generated(anEdge1);                  
+    if (aC0) {
+         builder(++theTag)->Generated(anEdge1);
+         TCollection_AsciiString aStr(theTag);
+         aName = theName + aStr.ToCString();
+         buildName(theTag, aName);      
+       }
   }
 }
 
-void Model_ResultBody::loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag)
+void Model_ResultBody::loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag)
 {
   if(theShape->isNull()) return;
   TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();  
@@ -470,11 +528,15 @@ void Model_ResultBody::loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> t
       }
     }
   }
-
+  std::string aName;
   TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itr(vertexNaborFaces);
   for (; itr.More(); itr.Next()) {
     const TopTools_ListOfShape& naborFaces = itr.Value();
-    if (naborFaces.Extent() < 3) 
-               builder(++theTag)->Generated(itr.Key());         
+    if (naborFaces.Extent() < 3) {
+               builder(++theTag)->Generated(itr.Key());
+               TCollection_AsciiString aStr(theTag);
+           aName = theName + aStr.ToCString();
+           buildName(theTag, aName);    
+       }
   }
 }
\ No newline at end of file
index 28f268d83d1204d0da7f4d90d9b0e206cf91822a..c1ac0b7cd092e033ad65b39c75a30888bb63f7f0 100644 (file)
@@ -44,19 +44,19 @@ public:
   /// Records the subshape newShape which was generated during a topological construction.
   /// As an example, consider the case of a face generated in construction of a box.
   MODEL_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theNewShape, 
-    const int theTag = 1);
+    const std::string& theName, const int theTag = 1);
 
   /// Records the shape newShape which was generated from the shape oldShape during a topological 
   /// construction. As an example, consider the case of a face generated from an edge in 
   /// construction of a prism.
   MODEL_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag = 1);
+    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1);
 
 
   /// Records the shape newShape which is a modification of the shape oldShape.
   /// As an example, consider the case of a face split or merged in a Boolean operation.
   MODEL_EXPORT virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag = 1);
+    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1);
 
   /// Records the shape oldShape which was deleted from the current label.
   /// As an example, consider the case of a face removed by a Boolean operation.
@@ -74,6 +74,7 @@ public:
                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
                                                const int  theKindOfShape,
                                                const int  theTag,
+                                                                                          const std::string& theName,
                                                GeomAPI_DataMapOfShapeShape& theSubShapes);
    /// load and orient generated shapes
   MODEL_EXPORT virtual void loadAndOrientGeneratedShapes (
@@ -81,16 +82,17 @@ public:
                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
                                                const int  theKindOfShape,
                                                const int  theTag,
+                                                                                          const std::string& theName,
                                                GeomAPI_DataMapOfShapeShape& theSubShapes);
   
   /// Loads shapes of the first level (to be used during shape import)
-  MODEL_EXPORT virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag);
+  MODEL_EXPORT virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag);
   
   /// Loads disconnected edges
-  MODEL_EXPORT virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag);
+  MODEL_EXPORT virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag);
 
   /// Loads disconnected vetexes
-  MODEL_EXPORT virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag);
+  MODEL_EXPORT virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag);
 
   /// Removes the stored builders
   MODEL_EXPORT virtual ~Model_ResultBody();
@@ -107,7 +109,10 @@ protected:
 
 private:
   /// Loads shapes of the next level (to be used during shape import)
-  void loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag);
+  void loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag);
+
+  /// builds name for the shape kept at the specified tag 
+  void buildName(const int theTag, const std::string& theName);
 
   friend class Model_Document;
 };
index 98350ce37d57e9335c1272ed5eb41b06eb68c2b3..6ffae24d6785d91f0968823ce6d45ea90c5bdd44 100644 (file)
@@ -50,18 +50,18 @@ public:
   /// Records the subshape newShape which was generated during a topological construction.
   /// As an example, consider the case of a face generated in construction of a box.
   virtual void generated(
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag = 1) = 0;
+    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
 
   /// Records the shape newShape which was generated from the shape oldShape during a topological 
   /// construction. As an example, consider the case of a face generated from an edge in 
   /// construction of a prism.
   virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag = 1) = 0;
+    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
 
   /// Records the shape newShape which is a modification of the shape oldShape.
   /// As an example, consider the case of a face split or merged in a Boolean operation.
   virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag = 1) = 0;
+    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
 
   /// Records the shape oldShape which was deleted from the current label.
   /// As an example, consider the case of a face removed by a Boolean operation.
@@ -79,6 +79,7 @@ public:
                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
                                                const int  theKindOfShape,
                                                const int  theTag,
+                                                                                          const std::string& theName,
                                                GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
   /// load and orient generated shapes
   virtual void loadAndOrientGeneratedShapes (
@@ -86,16 +87,17 @@ public:
                                                std::shared_ptr<GeomAPI_Shape>  theShapeIn,
                                                const int  theKindOfShape,
                                                const int  theTag,
+                                                                                          const std::string& theName,
                                                GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
 
   /// load shapes of the first level (to be used during shape import)
-  virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag) = 0;
+  virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag) = 0;
   
   /// load disconnected edges
-  virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag) = 0;
+  virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag) = 0;
 
   /// load disconnected vetexes
-  virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, int&  theTag) = 0;
+  virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName,int&  theTag) = 0;
 
 protected:
 };