#include <DriverMED_W_Field.h>
Public Types | |
enum | Status { DRS_OK, DRS_EMPTY, DRS_WARN_RENUMBER, DRS_WARN_SKIP_ELEM, DRS_WARN_DESCENDING, DRS_FAIL } |
Public Member Functions | |
DriverMED_W_Field () | |
Constructor. More... | |
void | AddODOnVertices (bool toAdd) |
bool | Set (SMESHDS_Mesh *mesh, const std::string &fieldName, SMDSAbs_ElementType type, const int nbComps, const bool isIntData) |
Sets basic data. More... | |
void | SetCompName (const int iComp, const char *name) |
Set a name of a component countered from zero. More... | |
void | SetDtIt (const int dt, const int it) |
Sets numdt and numit field features. More... | |
void | AddValue (double val) |
Adds a float field value. More... | |
void | AddValue (int val) |
Adds an integer field value. More... | |
SMDS_ElemIteratorPtr | GetOrderedElems () |
Returns elements in the order they are written in MED file. More... | |
virtual Status | Perform () |
Writes a field to the file. More... | |
void | SetMesh (SMESHDS_Mesh *theMesh) |
void | SetMeshId (int theMeshId) |
virtual void | SetFile (const std::string &theFileName) |
virtual void | SetMeshName (const std::string &theMeshName) |
virtual std::string | GetMeshName () const |
virtual void | SetOption (const std::string &optionName, const std::string &optionValue) |
virtual SMESH_ComputeErrorPtr | GetError () |
Return a structure containing description of errors. More... | |
Protected Member Functions | |
Status | addMessage (const std::string &msg, const bool isFatal=false) |
Stores an error message. More... | |
Protected Attributes | |
SMESHDS_Mesh * | myMesh |
std::string | myFile |
std::string | myMeshName |
int | myMeshId |
std::vector< std::string > | myErrorMessages |
Status | myStatus |
Private Attributes | |
std::string | _fieldName |
SMDSAbs_ElementType | _elemType |
std::vector< std::string > | _compNames |
std::vector< double > | _dblValues |
std::vector< int > | _intValues |
int | _dt |
int | _it |
bool | _addODOnVertices |
std::vector< const SMDS_MeshElement * > | _elemsByGeom [SMDSEntity_Last] |
std::vector< std::pair < SMDSAbs_EntityType, int > > | _nbElemsByGeom |
|
inherited |
DriverMED_W_Field::DriverMED_W_Field | ( | ) |
Constructor.
|
protectedinherited |
Stores an error message.
We consider an error fatal if none mesh can be read
References Driver_Mesh::DRS_FAIL, Driver_Mesh::DRS_WARN_SKIP_ELEM, MESSAGE, Driver_Mesh::myErrorMessages, and Driver_Mesh::myStatus.
Referenced by DriverGMF_Write::Perform(), DriverGMF_Read::Perform(), Perform(), and DriverGMF_Read::storeBadNodeIds().
void DriverMED_W_Field::AddODOnVertices | ( | bool | toAdd | ) |
Referenced by SMESH_Mesh_i::ExportPartToMED().
void DriverMED_W_Field::AddValue | ( | double | val | ) |
void DriverMED_W_Field::AddValue | ( | int | val | ) |
Adds an integer field value.
References _intValues.
|
virtualinherited |
Return a structure containing description of errors.
References COMPERR_OK, Driver_Mesh::DRS_OK, Driver_Mesh::myErrorMessages, Driver_Mesh::myStatus, and SMESH_ComputeError::New().
Referenced by SMESH_Mesh_i::exportMEDFields(), SMESH_Mesh::GMFToMesh(), and SMESH_Mesh::MEDToMesh().
|
virtualinherited |
References Driver_Mesh::myMeshName.
Referenced by SMESH_Mesh::CGNSToMesh().
SMDS_ElemIteratorPtr DriverMED_W_Field::GetOrderedElems | ( | ) |
Returns elements in the order they are written in MED file.
References _elemsByGeom, _elemType, _nbElemsByGeom, SMDS_Mesh::elementsIterator(), and Driver_SMESHDS_Mesh::myMesh.
Referenced by SMESH_Mesh_i::exportMEDFields().
|
virtual |
Writes a field to the file.
Implements Driver_Mesh.
References _compNames, _dblValues, _dt, _elemType, _fieldName, _intValues, _it, _nbElemsByGeom, Driver_Mesh::addMessage(), MED::CrWrapper(), Driver_Mesh::DRS_OK, MED::eFLOAT64, MED::eINT, MED::eMAILLE, MED::eNOEUD, MED::eV2_2, DriverMED::GetMedGeoType(), Driver_Mesh::myFile, Driver_SMESHDS_Mesh::myMesh, Driver_Mesh::myMeshId, Driver_Mesh::myMeshName, SMDSAbs_Node, and SMDSEntity_0D.
Referenced by SMESH_Mesh_i::exportMEDFields().
bool DriverMED_W_Field::Set | ( | SMESHDS_Mesh * | mesh, |
const std::string & | fieldName, | ||
SMDSAbs_ElementType | type, | ||
const int | nbComps, | ||
const bool | isIntData | ||
) |
Sets basic data.
[in] | mesh | - supporting mesh |
[in] | fieldName | - name of a field |
[in] | type | - type of supporting elements |
[in] | nbComps | - number of components |
[in] | isIntData | - type of data: double or integer |
References _addODOnVertices, _compNames, _dblValues, _elemsByGeom, _elemType, _fieldName, _intValues, _nbElemsByGeom, SMDS_Mesh::elementsIterator(), SMDS_MeshElement::GetEntityType(), SMDS_Mesh::GetMeshInfo(), DriverMED_W_SMESHDS_Mesh::getNodesOfMissing0DOnVert(), Driver_SMESHDS_Mesh::myMesh, SMDS_Mesh::NbEdges(), SMDS_MeshInfo::NbElements(), SMDS_Mesh::NbFaces(), SMDS_Mesh::NbVolumes(), Driver_SMESHDS_Mesh::SetMesh(), SMDSAbs_0DElement, SMDSAbs_All, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, SMDSAbs_Volume, SMDSEntity_0D, SMDSEntity_Last, SMDSEntity_Node, and SMDS_MeshCell::toSmdsType().
Referenced by SMESH_Mesh_i::exportMEDFields().
void DriverMED_W_Field::SetCompName | ( | const int | iComp, |
const char * | name | ||
) |
Set a name of a component countered from zero.
References _compNames.
Referenced by SMESH_Mesh_i::exportMEDFields().
Sets numdt and numit field features.
Call this fun before AddValue()!
References _dblValues, _dt, _intValues, and _it.
Referenced by SMESH_Mesh_i::exportMEDFields().
|
virtualinherited |
Reimplemented in DriverMED_W_SMESHDS_Mesh.
References Driver_Mesh::myFile.
Referenced by SMESH_Mesh::CGNSToMesh(), SMESH_Gen_i::CreateMeshesFromCGNS(), SMESH_Gen_i::CreateMeshesFromMEDorSAUV(), SMESH_Mesh_i::ExportPartToMED(), SMESH_PreMeshInfo::FullLoadFromFile(), SMESH_Mesh::GMFToMesh(), SMESH_Mesh::MEDToMesh(), DriverMED_W_SMESHDS_Mesh::SetFile(), SMESH_Mesh::STLToMesh(), and SMESH_Mesh::UNVToMesh().
|
inherited |
References Driver_SMESHDS_Mesh::myMesh.
Referenced by SMESH_Mesh::CGNSToMesh(), SMESH_PreMeshInfo::FullLoadFromFile(), SMESH_Mesh::GMFToMesh(), SMESH_Mesh::MEDToMesh(), and Set().
|
inherited |
|
virtualinherited |
References Driver_Mesh::myMeshName.
Referenced by SMESH_Mesh_i::ExportPartToMED().
|
virtualinherited |
|
private |
Referenced by Perform(), Set(), and SetCompName().
|
private |
Referenced by AddValue(), Perform(), Set(), and SetDtIt().
|
private |
Referenced by GetOrderedElems(), and Set().
|
private |
Referenced by GetOrderedElems(), Perform(), and Set().
|
private |
Referenced by AddValue(), Perform(), Set(), and SetDtIt().
|
private |
Referenced by GetOrderedElems(), Perform(), and Set().
|
protectedinherited |
Referenced by Driver_Mesh::addMessage(), and Driver_Mesh::GetError().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Referenced by Perform(), DriverMED_W_SMESHDS_Mesh::Perform(), and Driver_Mesh::SetMeshId().
|
protectedinherited |
Referenced by Driver_Mesh::GetMeshName(), Perform(), DriverMED_W_SMESHDS_Mesh::Perform(), and Driver_Mesh::SetMeshName().
|
protectedinherited |
Referenced by Driver_Mesh::addMessage(), Driver_Mesh::GetError(), and DriverGMF_Read::storeBadNodeIds().