1 // Copyright (C) 2017-2023 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
21 #ifndef __VTKTOMEDMEM_HXX__
22 #define __VTKTOMEDMEM_HXX__
24 #include "vtkSystemIncludes.h" //needed for exports
26 #include "MEDCouplingRefCountObject.hxx"
27 #include "MEDCouplingMemArray.hxx"
28 #include "MEDCouplingFieldDouble.hxx"
29 #include "MEDCouplingFieldFloat.hxx"
30 #include "MEDCouplingFieldInt.hxx"
31 #include "MEDCouplingFieldInt64.hxx"
32 #include "MEDFileData.hxx"
33 #include "MEDFileField.hxx"
34 #include "MEDFileMesh.hxx"
35 #include "MEDLoaderTraits.hxx"
44 class VTK_EXPORT MZCException : public std::exception
47 MZCException(const std::string& s):_reason(s) { }
48 virtual const char *what() const noexcept { return _reason.c_str(); }
49 virtual ~MZCException() noexcept { }
54 namespace VTKToMEDMemWriter
59 Grp(const std::string& name):_name(name) { }
60 void setFamilies(const std::vector<std::string>& fams) { _fams=fams; }
61 std::string getName() const { return _name; }
62 std::vector<std::string> getFamilies() const { return _fams; }
65 std::vector<std::string> _fams;
71 Fam(const std::string& name);
72 std::string getName() const { return _name; }
73 int getID() const { return _id; }
81 namespace VTKToMEDMemWriter
83 void VTK_EXPORT WriteMEDFileFromVTKDataSet(MEDCoupling::MEDFileData *mfd, vtkDataSet *ds, const std::vector<int>& context, double timeStep, int tsId);
85 void VTK_EXPORT WriteMEDFileFromVTKGDS(MEDCoupling::MEDFileData *mfd, vtkDataObject *input, double timeStep, int tsId);
87 void VTK_EXPORT PutFamGrpInfoIfAny(MEDCoupling::MEDFileData *mfd, const std::string& meshName, const std::vector<VTKToMEDMemWriter::Grp>& groups, const std::vector<VTKToMEDMemWriter::Fam>& fams);