1 // Copyright (C) 2007-2015 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 (CEA/DEN)
21 #include "MEDCouplingFieldTemplateServant.hxx"
22 #include "MEDCouplingFieldTemplate.hxx"
24 #include "MEDCouplingMemArray.hxx"
26 using namespace ParaMEDMEM;
28 MEDCouplingFieldTemplateServant::MEDCouplingFieldTemplateServant(const MEDCouplingFieldTemplate *cppPointerOfMesh):MEDCouplingFieldServant(cppPointerOfMesh)
32 void MEDCouplingFieldTemplateServant::getTinyInfo(SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfDouble_out da, SALOME_TYPES::ListOfString_out sa)
34 la=new SALOME_TYPES::ListOfLong;
35 std::vector<int> tinyInfo;
36 getPointer()->getTinySerializationIntInformation(tinyInfo);
37 la->length(tinyInfo.size());
38 for(int i=0;i<(int)tinyInfo.size();i++)
41 da=new SALOME_TYPES::ListOfDouble;
42 std::vector<double> tinyInfo2;
43 getPointer()->getTinySerializationDbleInformation(tinyInfo2);
44 da->length(tinyInfo2.size());
45 for(int i=0;i<(int)tinyInfo2.size();i++)
46 (*da)[i]=tinyInfo2[i];
48 sa=new SALOME_TYPES::ListOfString;
49 std::vector<std::string> tinyInfo3;
50 getPointer()->getTinySerializationStrInformation(tinyInfo3);
51 sa->length(tinyInfo3.size());
52 for(int i=0;i<(int)tinyInfo3.size();i++)
53 (*sa)[i]=CORBA::string_dup(tinyInfo3[i].c_str());
56 void MEDCouplingFieldTemplateServant::getSerialisationData(SALOME_TYPES::ListOfLong_out la)
58 DataArrayInt *dataInt;
59 getPointer()->serialize(dataInt);
61 la=new SALOME_TYPES::ListOfLong;
64 int lgth=dataInt->getNbOfElems();
65 const int *ptr=dataInt->getConstPointer();
67 for(int i=0;i<lgth;i++)
74 CORBA::Boolean MEDCouplingFieldTemplateServant::ExportDataAs(const char *format, SALOME::GenericObj_out exporter)
76 std::string frmCpp(format);
77 if(frmCpp=="MEDCorba")