X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2FMEDMEM%2FMEDMEM_InvokingDriverByAttachingItToAnObject.cxx;h=9293b2309a322ad9b6d232ff92f2e2315a762f2d;hb=f1a947b32a36d8dc8e3079b25305bb50e8cb59a0;hp=d02b07c7467a1dc5096991e34cdcded7f6ce0410;hpb=7b31dae4a98f70eefe76927a14dc8b09cc275f54;p=tools%2Fmedcoupling.git diff --git a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx index d02b07c74..9293b2309 100644 --- a/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx +++ b/doc/MEDMEM/MEDMEM_InvokingDriverByAttachingItToAnObject.cxx @@ -1,29 +1,30 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// // 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 +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #include "MEDMEM_Exception.hxx" #include "MEDMEM_define.hxx" #include "MEDMEM_Field.hxx" #include "MEDMEM_Mesh.hxx" -#include "MEDMEM_Med.hxx" -#include "MEDMEM_MedMedDriver.hxx" #include "MEDMEM_MedMeshDriver.hxx" using namespace MEDMEM ; @@ -34,7 +35,7 @@ main () { const char * fileName = "pointe.med"; const char * fileName2 = "Field&MeshGeneratedPointe.med"; const char * fileName3 = "MedGeneratedPointe.med"; - const char * fieldName = "fieldcelldouble"; + const char * fieldName = "fieldcelldoublescalar"; const char * meshName = "maa1"; try { @@ -44,14 +45,12 @@ main () { MED_FIELD_RDONLY_DRIVER myRdOnlyDriver(fileName,myField); myRdOnlyDriver.setFieldName(fieldName); myRdOnlyDriver.open(); - //This test failed due to inadequate Support implementation - // myRdOnlyDriver.read(); + myRdOnlyDriver.read(); // try { myRdOnlyDriver.write(); } catch (MEDEXCEPTION& ex) // { MESSAGE(ex.what()); } MED_FIELD_WRONLY_DRIVER myWrOnlyDriver(fileName2,myField); myWrOnlyDriver.open(); - //This test failed due to inadequate Support implementation - // myWrOnlyDriver.write(); + myWrOnlyDriver.write(); // try myWrOnlyDriver.read(); catch (MEDEXCEPTION& ex) // { MESSAGE(ex.what()); } myRdOnlyDriver.close(); @@ -74,32 +73,14 @@ main () { myWrOnlyDriver.write(); // try myWrOnlyDriver.read(); catch (MEDEXCEPTION& ex) // { MESSAGE(ex.what()); } - // myRdOnlyDriver.close(); - //While we use H5close() in the MESH/FIELD drivers, the next - //line will fail, because all files are previously closed ! + myRdOnlyDriver.close(); myWrOnlyDriver.close(); delete myMesh; } - { - MED * myMed = new MED(); - MED_MED_RDONLY_DRIVER myRdOnlyDriver(fileName,myMed); - myRdOnlyDriver.open(); - myRdOnlyDriver.readFileStruct(); - myRdOnlyDriver.close(); - myMed->updateSupport(); // DOIT ETRE SUPPRIMEE - // myRdOnlyDriver.read(); - // try { myRdOnlyDriver.write(); } catch (MEDEXCEPTION& ex) - // { MESSAGE(ex.what()); } - //MED_MED_WRONLY_DRIVER myWrOnlyDriver(fileName3,myMed); - //myWrOnlyDriver.open(); - //myWrOnlyDriver.write(); // Not implemented yet. - //myWrOnlyDriver.close(); - delete myMed; - } } catch (MEDEXCEPTION& ex){ cout << "MAIN BLOCK EXCEPTION" << endl; - MESSAGE(ex.what()) ; + MESSAGE_MED(ex.what()) ; } }