From: szy Date: Thu, 6 Nov 2014 15:37:24 +0000 (+0300) Subject: Naming DS of ImportFeature redesign. X-Git-Tag: V_0.5~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=793e109980457af9220245a9a9fd1d32efd1fc64;p=modules%2Fshaper.git Naming DS of ImportFeature redesign. --- 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_ */