]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Naming DS of ImportFeature redesign.
authorszy <szy@opencascade.com>
Thu, 6 Nov 2014 15:37:24 +0000 (18:37 +0300)
committerszy <szy@opencascade.com>
Thu, 6 Nov 2014 15:37:24 +0000 (18:37 +0300)
src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp
src/ExchangePlugin/ExchangePlugin_ImportFeature.h

index a0c659805f2f72c7a7ad9441c91a3fad5107f316..13a61e5469ce0c4e152e4415f9c09f38b525976d 100644 (file)
@@ -15,7 +15,6 @@
 #include <ModelAPI_Document.h>
 #include <ModelAPI_Object.h>
 #include <ModelAPI_ResultBody.h>
-
 #include <TCollection_AsciiString.hxx>
 #include <TDF_Label.hxx>
 #include <TopoDS_Shape.hxx>
@@ -109,18 +108,35 @@ bool ExchangePlugin_ImportFeature::importFile(const std::string& theFileName)
  #endif
      return false;
    }
+  //
    // Pass the results into the model
    std::string anObjectName = aPath.Name().ToCString();
    data()->setName(anObjectName);
-   boost::shared_ptr<ModelAPI_ResultBody> aResult = document()->createBody(data());
+   boost::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data());
    boost::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
    aGeomShape->setImpl(new TopoDS_Shape(aShape));
-   aResult->store(aGeomShape);
-   setResult(aResult);
+
+   //LoadNamingDS of the imported shape
+   loadNamingDS(aGeomShape, aResultBody);
+
+   setResult(aResultBody);
 
    return true;
 }
 
+//============================================================================
+void ExchangePlugin_ImportFeature::loadNamingDS(
+                                   boost::shared_ptr<GeomAPI_Shape> theGeomShape, 
+                                            boost::shared_ptr<ModelAPI_ResultBody> theResultBody)
+{  
+  //load result
+  theResultBody->store(theGeomShape);
+  int aTag(1);
+  theResultBody->loadFirstLevel(theGeomShape, aTag);
+  theResultBody->loadDisconnectedEdges(theGeomShape, aTag);
+  theResultBody->loadDisconnectedVertexes(theGeomShape, aTag); 
+}
+
 LibHandle ExchangePlugin_ImportFeature::loadImportPlugin(const std::string& theFormatName)
 {
   std::string aLibName = library(theFormatName + ID());
index f5747807267792edae667eea97e399c0c32cc6b6..6a90bf0b9014b11c8c568113a9eac2c005a46270 100644 (file)
@@ -63,7 +63,11 @@ class ExchangePlugin_ImportFeature : public ModelAPI_Feature
  protected:
   EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName);
   EXCHANGEPLUGIN_EXPORT LibHandle loadImportPlugin(const std::string& theFormatName);
-  
+
+private:
+  /// Loads Naming data structure to the document
+  void loadNamingDS(boost::shared_ptr<GeomAPI_Shape> theGeomShape, 
+                                       boost::shared_ptr<ModelAPI_ResultBody> theResultBody);
 };
 
 #endif /* IMPORT_IMPORTFEATURE_H_ */