diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt index 75c4ccbe..1de41062 100644 --- a/src/Core/CMakeLists.txt +++ b/src/Core/CMakeLists.txt @@ -106,7 +106,7 @@ endif() if (SEPA3D) target_include_directories (Core PUBLIC ${SEPARATRICE3D_INCLUDE_DIR}) endif (SEPA3D) -target_link_libraries (Core PUBLIC ${CORE_OPTIONAL_LIBRARIES_LIST} Mesquite::Mesquite cgns::cgns PkgConfig::GTS GMDSIg GMDSIo) +target_link_libraries (Core PUBLIC ${CORE_OPTIONAL_LIBRARIES_LIST} Mesquite::Mesquite cgns::cgns PkgConfig::GTS GMDSIg GMDSIo GMDSAero) # Etre capable une fois installée de retrouver vtk*, ... : # (Rem : en son absence on a Set runtime path of "/tmp/pignerol/install/lib/libCore.so.5.0.0" to "") ... set_target_properties (Core PROPERTIES INSTALL_RPATH_USE_LINK_PATH 1) diff --git a/src/Core/Mesh/ExportBlocksCGNSImplementation.cpp b/src/Core/Mesh/ExportBlocksCGNSImplementation.cpp index d8987c73..068b1fb8 100644 --- a/src/Core/Mesh/ExportBlocksCGNSImplementation.cpp +++ b/src/Core/Mesh/ExportBlocksCGNSImplementation.cpp @@ -7,16 +7,13 @@ */ /*----------------------------------------------------------------------------*/ #include "Mesh/ExportBlocksCGNSImplementation.h" -#include "Geom/Volume.h" -#include "Geom/Surface.h" -#include "Geom/Curve.h" -#include "Geom/Vertex.h" #include "Mesh/MeshItf.h" #include "Mesh/Surface.h" /*----------------------------------------------------------------------------*/ #include #include #include +#include /*----------------------------------------------------------------------------*/ #include #include @@ -26,8 +23,8 @@ namespace Mgx3D { namespace Mesh { /*----------------------------------------------------------------------------*/ ExportBlocksCGNSImplementation:: - ExportBlocksCGNSImplementation(Internal::Context& c, const std::string& n) - : m_context(c), m_filename(n) + ExportBlocksCGNSImplementation(Internal::Context& c, const std::string& filename) + : m_context(c), m_filename(filename) {} /*----------------------------------------------------------------------------*/ @@ -43,7 +40,7 @@ namespace Mgx3D { std::map n2v; - gmds::Mesh mesh(gmds::MeshModel(gmds::DIM3 | gmds::N | gmds::R | gmds::R2N | gmds::N2R)); + gmds::Mesh mesh(gmds::MeshModel(gmds::DIM3 | gmds::N | gmds::F | gmds::R | gmds::R2N | gmds::N2R | gmds::R2F | gmds::F2R | gmds::F2N | gmds::N2F)); gmds::Mesh localMesh = m_context.getMeshManager().getMesh()->getGMDSMesh(); @@ -150,11 +147,15 @@ namespace Mgx3D { } } - gmds::IGMeshIOService ioService(&mesh); - gmds::VTKWriter writer(&ioService); - writer.setCellOptions(gmds::N|gmds::R); - writer.setDataOptions(gmds::N|gmds::R); - writer.write(m_filename); + int position = m_filename.find_last_of('/'); + + m_basename = m_filename.substr(position+1, m_filename.length()-position+1); + + m_path = m_filename.substr(0, position+1); + + gmds::aero::CGNSWriter3D writer3D(&mesh); + writer3D.write("",m_basename,m_path); + } /*----------------------------------------------------------------------------*/ } // end namespace Topo diff --git a/src/Core/protected/Mesh/ExportBlocksCGNSImplementation.h b/src/Core/protected/Mesh/ExportBlocksCGNSImplementation.h index ad0c6359..85698481 100644 --- a/src/Core/protected/Mesh/ExportBlocksCGNSImplementation.h +++ b/src/Core/protected/Mesh/ExportBlocksCGNSImplementation.h @@ -27,7 +27,7 @@ namespace Mgx3D { * \param c le contexte * \param n le nom du fichier dans lequel se fait l'exportation */ - ExportBlocksCGNSImplementation(Internal::Context& c, const std::string& n); + ExportBlocksCGNSImplementation(Internal::Context& c, const std::string& filename); /*------------------------------------------------------------------------*/ /** \brief Destructeur @@ -45,8 +45,12 @@ namespace Mgx3D { /// contexte d'exécution Internal::Context& m_context; + std::string m_path; + /// fichier dans lequel on exporte std::string m_filename; + + std::string m_basename; }; /*----------------------------------------------------------------------------*/