1 // Copyright (C) 2007-2017 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 __MEDFILESTRUCTUREELEMENT_HXX__
22 #define __MEDFILESTRUCTUREELEMENT_HXX__
24 #include "MEDLoaderDefines.hxx"
25 #include "MEDFileUtilities.txx"
26 #include "MEDFileMesh.hxx"
28 #include "MEDCouplingRefCountObject.hxx"
32 class MEDFileStructureElement;
33 class MEDFileMeshSupports;
39 MEDFileSEHolder(MEDFileStructureElement *father):_father(father) { }
40 std::string getModelName() const;
41 void setName(const std::string& name);
42 std::size_t getHeapMemorySizeLoc() const;
44 MEDFileStructureElement *_father;
48 class MEDFileSEConstAtt : public RefCountObject, public MEDFileWritableStandAlone, public MEDFileSEHolder
51 static MEDFileSEConstAtt *New(med_idt fid, MEDFileStructureElement *father, int idCstAtt, const MEDFileUMesh *mesh);
53 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
54 std::size_t getHeapMemorySizeWithoutChildren() const;
55 void writeLL(med_idt fid) const;
56 void setProfile(const std::string& name);
57 std::string getProfile() const;
59 MEDFileSEConstAtt(med_idt fid, MEDFileStructureElement *father, int idCstAtt, const MEDFileUMesh *mesh);
63 MCAuto<DataArray> _val;
66 class MEDFileSEVarAtt : public RefCountObject, public MEDFileWritableStandAlone, public MEDFileSEHolder
69 static MEDFileSEVarAtt *New(med_idt fid, MEDFileStructureElement *father, int idVarAtt);
71 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
72 std::size_t getHeapMemorySizeWithoutChildren() const;
73 void writeLL(med_idt fid) const;
75 MEDFileSEVarAtt(med_idt fid, MEDFileStructureElement *father, int idVarAtt);
78 MCAuto<DataArray> _gen;
81 class MEDFileStructureElement : public RefCountObject, public MEDFileWritableStandAlone
84 MEDLOADER_EXPORT static MEDFileStructureElement *New(med_idt fid, int idSE, const MEDFileMeshSupports *ms);
85 MEDLOADER_EXPORT std::string getName() const;
86 MEDLOADER_EXPORT int getDynGT() const;
88 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
89 std::size_t getHeapMemorySizeWithoutChildren() const;
90 void writeLL(med_idt fid) const;
92 static MCAuto<DataArray> BuildFrom(med_attribute_type mat);
93 static int EffectiveNbCompo(med_attribute_type mat, int nbCompo);
95 MEDFileStructureElement(med_idt fid, int idSE, const MEDFileMeshSupports *ms);
99 std::string _sup_mesh_name;
100 INTERP_KERNEL::NormalizedCellType _geo_type;
102 std::vector< MCAuto<MEDFileSEConstAtt> > _cst_att;
103 std::vector< MCAuto<MEDFileSEVarAtt> > _var_att;
106 class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone
109 MEDLOADER_EXPORT static MEDFileStructureElements *New(med_idt fid, const MEDFileMeshSupports *ms);
110 MEDLOADER_EXPORT static MEDFileStructureElements *New();
111 MEDLOADER_EXPORT int getNumberOf() const;
112 MEDLOADER_EXPORT std::vector<int> getDynGTAvail() const;
114 std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
115 std::size_t getHeapMemorySizeWithoutChildren() const;
116 void writeLL(med_idt fid) const;
118 MEDFileStructureElements(med_idt fid, const MEDFileMeshSupports *ms);
119 MEDFileStructureElements();
120 ~MEDFileStructureElements();
122 std::vector< MCAuto<MEDFileStructureElement> > _elems;