1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
39 // A file study.hdf with 2 groups : MESH and GEOM
40 hdf_file = new HDFfile("study.hdf");
42 hdf_file->CreateOnDisk();
44 hdf_group = new HDFgroup("GEOM",hdf_file);
46 hdf_group->CreateOnDisk();
48 hdf_group->CloseOnDisk();
52 hdf_group = new HDFgroup("MESH",hdf_file);
54 hdf_group->CreateOnDisk();
56 hdf_group->CloseOnDisk();
60 hdf_file->CloseOnDisk();
64 // a file mesh.hdf with 2 groups MESH_1 and MESH_2
65 hdf_file = new HDFfile("mesh.hdf");
67 hdf_file->CreateOnDisk();
69 hdf_group = new HDFgroup("MESH_1",hdf_file);
71 hdf_group->CreateOnDisk();
73 hdf_group->CloseOnDisk();
77 hdf_group = new HDFgroup("MESH_2",hdf_file);
79 hdf_group->CreateOnDisk();
81 hdf_group->CloseOnDisk();
85 hdf_file->CloseOnDisk();
89 // a file geom.hdf with 2 groups GEOM_1 and GEOM_2
90 hdf_file = new HDFfile("geom.hdf");
92 hdf_file->CreateOnDisk();
94 hdf_group = new HDFgroup("GEOM_1",hdf_file);
96 hdf_group->CreateOnDisk();
98 hdf_group->CloseOnDisk();
102 hdf_group = new HDFgroup("GEOM_2",hdf_file);
104 hdf_group->CreateOnDisk();
106 hdf_group->CloseOnDisk();
110 hdf_file->CloseOnDisk();
116 MESSAGE( "!!!! HDFexception !!!" )