return _meshes[i]->getOneTimeStep();
}
+std::vector<std::string> MEDFileMeshes::getMeshesNames() const throw(INTERP_KERNEL::Exception)
+{
+ std::vector<std::string> ret(_meshes.size());
+ int i=0;
+ for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++,i++)
+ {
+ const MEDFileMeshMultiTS *f=(*it);
+ if(f)
+ {
+ ret[i]=f->getName();
+ }
+ else
+ {
+ std::ostringstream oss; oss << "MEDFileMeshes::getMeshesNames : At rank #" << i << " mesh is not defined !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ }
+ return ret;
+}
+
void MEDFileMeshes::resize(int newSize) throw(INTERP_KERNEL::Exception)
{
_meshes.resize(newSize);
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
MEDFileMesh *getMeshAtPos(int i) const throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
//
void resize(int newSize) throw(INTERP_KERNEL::Exception);
void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
%newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
%newobject ParaMEDMEM::MEDFileData::New;
+%newobject ParaMEDMEM::MEDFileData::getMeshes;
+%newobject ParaMEDMEM::MEDFileData::getFields;
%feature("unref") MEDFileMesh "$this->decrRef();"
%feature("unref") MEDFileUMesh "$this->decrRef();"
%feature("unref") MEDFileField1TS "$this->decrRef();"
%feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
%feature("unref") MEDFileFields "$this->decrRef();"
+%feature("unref") MEDFileData "$this->decrRef();"
class MEDLoader
{
static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
//
void resize(int newSize) throw(INTERP_KERNEL::Exception);
void pushMesh(MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception);
public:
static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
static MEDFileData *New();
- MEDFileFields *getFields() const;
- MEDFileMeshes *getMeshes() const;
void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
int getNumberOfFields() const throw(INTERP_KERNEL::Exception);
int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
//
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
+ %extend
+ {
+ MEDFileMeshes *getMeshes() const
+ {
+ MEDFileMeshes *ret=self->getMeshes();
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ MEDFileFields *getFields() const
+ {
+ MEDFileFields *ret=self->getFields();
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+ }
};
}
mmm2=MEDFileMeshMultiTS.New() ; mmm2.setOneTimeStep(mm2)
ms=MEDFileMeshes.New(); ms.setMeshAtPos(0,mm1) ; ms.setMeshAtPos(1,mm2)
d.setMeshes(ms)
+ self.assertEqual(('1DMesh_1', '2DCurveMesh_1'),d.getMeshes().getMeshesNames())
#
ff1=MEDFileFieldMultiTS.New()
ff21=MEDFileFieldMultiTS.New()