Salome HOME
projects
/
tools
/
medcoupling.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from V6_main 28/02/2013
[tools/medcoupling.git]
/
src
/
MEDLoader
/
MEDFileData.cxx
diff --git
a/src/MEDLoader/MEDFileData.cxx
b/src/MEDLoader/MEDFileData.cxx
index fbabd4709e1fb50064f3bba2aaa411de901aadad..e5493423a44c989933bc9ac3946180a10cc48a82 100644
(file)
--- a/
src/MEDLoader/MEDFileData.cxx
+++ b/
src/MEDLoader/MEDFileData.cxx
@@
-40,8
+40,11
@@
MEDFileData *MEDFileData::deepCpy() const throw(INTERP_KERNEL::Exception)
MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> meshes;
if((const MEDFileMeshes *)_meshes)
meshes=_meshes->deepCpy();
MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> meshes;
if((const MEDFileMeshes *)_meshes)
meshes=_meshes->deepCpy();
+ MEDCouplingAutoRefCountObjectPtr<MEDFileParameters> params;
+ if((const MEDFileParameters *)_params)
+ params=_params->deepCpy();
MEDCouplingAutoRefCountObjectPtr<MEDFileData> ret=MEDFileData::New();
MEDCouplingAutoRefCountObjectPtr<MEDFileData> ret=MEDFileData::New();
- ret->_fields=fields; ret->_meshes=meshes;
+ ret->_fields=fields; ret->_meshes=meshes;
ret->_params=params;
return ret.retn();
}
return ret.retn();
}
@@
-52,6
+55,8
@@
std::size_t MEDFileData::getHeapMemorySize() const
ret+=_fields->getHeapMemorySize();
if((const MEDFileMeshes *)_meshes)
ret+=_meshes->getHeapMemorySize();
ret+=_fields->getHeapMemorySize();
if((const MEDFileMeshes *)_meshes)
ret+=_meshes->getHeapMemorySize();
+ if((const MEDFileParameters *)_params)
+ ret+=_params->getHeapMemorySize();
return ret;
}
return ret;
}
@@
-65,22
+70,32
@@
MEDFileMeshes *MEDFileData::getMeshes() const
return const_cast<MEDFileMeshes *>(static_cast<const MEDFileMeshes *>(_meshes));
}
return const_cast<MEDFileMeshes *>(static_cast<const MEDFileMeshes *>(_meshes));
}
+MEDFileParameters *MEDFileData::getParams() const
+{
+ return const_cast<MEDFileParameters *>(static_cast<const MEDFileParameters *>(_params));
+}
+
void MEDFileData::setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception)
{
void MEDFileData::setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception)
{
- if(!fields)
- throw INTERP_KERNEL::Exception("MEDFileData::setFields : input pointer is null !");
- fields->incrRef();
+ if(fields)
+ fields->incrRef();
_fields=fields;
}
void MEDFileData::setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception)
{
_fields=fields;
}
void MEDFileData::setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception)
{
- if(!meshes)
- throw INTERP_KERNEL::Exception("MEDFileData::setMeshes : input pointer is null !");
- meshes->incrRef();
+ if(meshes)
+ meshes->incrRef();
_meshes=meshes;
}
_meshes=meshes;
}
+void MEDFileData::setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception)
+{
+ if(params)
+ params->incrRef();
+ _params=params;
+}
+
int MEDFileData::getNumberOfFields() const throw(INTERP_KERNEL::Exception)
{
const MEDFileFields *f=_fields;
int MEDFileData::getNumberOfFields() const throw(INTERP_KERNEL::Exception)
{
const MEDFileFields *f=_fields;
@@
-97,6
+112,14
@@
int MEDFileData::getNumberOfMeshes() const throw(INTERP_KERNEL::Exception)
return m->getNumberOfMeshes();
}
return m->getNumberOfMeshes();
}
+int MEDFileData::getNumberOfParams() const throw(INTERP_KERNEL::Exception)
+{
+ const MEDFileParameters *p=_params;
+ if(!p)
+ throw INTERP_KERNEL::Exception("MEDFileData::getNumberOfParams : no params set !");
+ return p->getNumberOfParams();
+}
+
std::string MEDFileData::simpleRepr() const
{
std::ostringstream oss;
std::string MEDFileData::simpleRepr() const
{
std::ostringstream oss;
@@
-116,7
+139,15
@@
std::string MEDFileData::simpleRepr() const
tmp2->simpleReprWithoutHeader(oss);
}
else
tmp2->simpleReprWithoutHeader(oss);
}
else
- oss << "No meshes set !!!\n";
+ oss << "No meshes set !!!\n\n";
+ oss << "Params part :\n*************\n\n";
+ const MEDFileParameters *tmp3=_params;
+ if(tmp3)
+ {
+ tmp3->simpleReprWithoutHeader(oss);
+ }
+ else
+ oss << "params set !!!\n";
return oss.str();
}
return oss.str();
}
@@
-191,6
+222,7
@@
try
{
_fields=MEDFileFields::New(fileName);
_meshes=MEDFileMeshes::New(fileName);
{
_fields=MEDFileFields::New(fileName);
_meshes=MEDFileMeshes::New(fileName);
+ _params=MEDFileParameters::New(fileName);
}
catch(INTERP_KERNEL::Exception& e)
{
}
catch(INTERP_KERNEL::Exception& e)
{
@@
-207,4
+239,7
@@
void MEDFileData::write(const char *fileName, int mode) const throw(INTERP_KERNE
const MEDFileFields *fs=_fields;
if(fs)
fs->writeLL(fid);
const MEDFileFields *fs=_fields;
if(fs)
fs->writeLL(fid);
+ const MEDFileParameters *ps=_params;
+ if(ps)
+ ps->writeLL(fid);
}
}