X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FSauvWriter.hxx;h=31efd1ab4cdb54956da6ab95dbe189c9e15b3830;hb=8d65b3fe9fcfb3f41dadfe696f3853bfcc2d1cdf;hp=e27c54551a418804f0a8c97e4fad18634093c334;hpb=887d0e1efce4f46f68d2596dcd801f02f5c1f99e;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/SauvWriter.hxx b/src/MEDLoader/SauvWriter.hxx index e27c54551..31efd1ab4 100644 --- a/src/MEDLoader/SauvWriter.hxx +++ b/src/MEDLoader/SauvWriter.hxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D +// Copyright (C) 2007-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -27,13 +27,14 @@ #include "MEDCouplingRefCountObject.hxx" #include "NormalizedUnstructuredMesh.hxx" #include "SauvUtilities.hxx" -#include "MEDCouplingAutoRefCountObjectPtr.hxx" +#include "MCAuto.hxx" +#include "MCType.hxx" #include #include #include -namespace ParaMEDMEM +namespace MEDCoupling { class MEDFileData; class MEDFileMesh; @@ -43,15 +44,18 @@ namespace ParaMEDMEM /*! * \brief Class to write a MEDFileData into a SAUVE format file */ - class MEDLOADER_EXPORT SauvWriter : public ParaMEDMEM::RefCountObject + class SauvWriter : public MEDCoupling::RefCountObject { public: - static SauvWriter * New(); - void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0); - void write(const char* fileName); - + MEDLOADER_EXPORT static SauvWriter *New(); + MEDLOADER_EXPORT void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0); + MEDLOADER_EXPORT void write(const std::string& fileName); + MEDLOADER_EXPORT void setCpyGrpIfOnASingleFamilyStatus(bool status); + MEDLOADER_EXPORT bool getCpyGrpIfOnASingleFamilyStatus() const; private: - std::size_t getHeapMemorySize() const { return 0; } + SauvWriter(); + std::size_t getHeapMemorySizeWithoutChildren() const; + std::vector getDirectChildrenWithNull() const; /*! * \brief Class representing a GIBI sub-mesh (described in the pile 1 of the SAUVE file). * It stands for a named med sub-mesh (family, etc) and contains either cell IDs or other sub-meshes. @@ -94,9 +98,9 @@ namespace ParaMEDMEM private: - MEDCouplingAutoRefCountObjectPtr< MEDFileMesh > _fileMesh; - std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldMultiTS > > _nodeFields; - std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldMultiTS > > _cellFields; + MCAuto< MEDFileMesh > _fileMesh; + std::vector< MCAuto< MEDFileFieldMultiTS > > _nodeFields; + std::vector< MCAuto< MEDFileFieldMultiTS > > _cellFields; std::vector _subs; std::map< int, SubMesh* > _famIDs2Sub; @@ -108,6 +112,7 @@ namespace ParaMEDMEM std::vector _longNames[ LN_NB ]; std::fstream* _sauvFile; + bool _cpy_grp_if_on_single_family; }; }