From 793e109980457af9220245a9a9fd1d32efd1fc64 Mon Sep 17 00:00:00 2001 From: szy Date: Thu, 6 Nov 2014 18:37:24 +0300 Subject: [PATCH] Naming DS of ImportFeature redesign. --- .../ExchangePlugin_ImportFeature.cpp | 24 +++++++++++++++---- .../ExchangePlugin_ImportFeature.h | 6 ++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index a0c659805..13a61e546 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -15,7 +15,6 @@ #include #include #include - #include #include #include @@ -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 aResult = document()->createBody(data()); + boost::shared_ptr aResultBody = document()->createBody(data()); boost::shared_ptr 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 theGeomShape, + boost::shared_ptr 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()); diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.h b/src/ExchangePlugin/ExchangePlugin_ImportFeature.h index f57478072..6a90bf0b9 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.h +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.h @@ -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 theGeomShape, + boost::shared_ptr theResultBody); }; #endif /* IMPORT_IMPORTFEATURE_H_ */ -- 2.39.2