Writer of a mesh in STL (STereoLithography) file format. More...
#include <DriverSTL_W_SMDS_Mesh.h>
Public Types | |
enum | Status { DRS_OK , DRS_EMPTY , DRS_WARN_RENUMBER , DRS_WARN_SKIP_ELEM , DRS_WARN_DESCENDING , DRS_FAIL , DRS_TOO_LARGE_MESH } |
Public Member Functions | |
DriverSTL_W_SMDS_Mesh () | |
~DriverSTL_W_SMDS_Mesh () | |
Destructor deletes temporary faces. More... | |
virtual Status | Perform () |
void | SetIsAscii (const bool theIsAscii=false) |
void | SetName (const std::string name) |
void | SetMesh (SMDS_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 &, const std::string &) |
virtual SMESH_ComputeErrorPtr | GetError () |
Return a structure containing description of errors. More... | |
Static Public Member Functions | |
template<typename IDTYPE > | |
static bool | IsMeshTooLarge (const SMDS_Mesh *mesh, bool checkIDs) |
Protected Member Functions | |
Status | addMessage (const std::string &msg, const bool isFatal=false) |
Stores an error message. More... | |
Static Protected Member Functions | |
static std::string | fixUTF8 (const std::string &s) |
Assure a string is UTF-8 valid by replacing invalid chars. More... | |
Protected Attributes | |
SMDS_Mesh * | myMesh |
std::string | myFile |
std::string | myMeshName |
int | myMeshId |
std::vector< std::string > | myErrorMessages |
Status | myStatus |
Private Member Functions | |
Status | writeAscii () const |
Status | writeBinary () const |
Writes all triangles in binary format. More... | |
void | findVolumeTriangles () |
Finds free facets of volumes for which faces are missing in the mesh. More... | |
SMDS_ElemIteratorPtr | getFaces () const |
Return iterator on both faces in the mesh and on temporary faces. More... | |
Private Attributes | |
bool | myIsAscii |
std::string | myName |
int | myNbVolumeTrias |
std::vector< const SMDS_MeshElement * > | myVolumeFacets |
Writer of a mesh in STL (STereoLithography) file format.
|
inherited |
DriverSTL_W_SMDS_Mesh::DriverSTL_W_SMDS_Mesh | ( | ) |
References myIsAscii.
DriverSTL_W_SMDS_Mesh::~DriverSTL_W_SMDS_Mesh | ( | ) |
Destructor deletes temporary faces.
References myVolumeFacets.
|
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_Read::Perform(), DriverGMF_Write::Perform(), DriverMED_W_Field::Perform(), DriverMED_W_Field::PerformInternal(), and DriverGMF_Read::storeBadNodeIds().
|
private |
Finds free facets of volumes for which faces are missing in the mesh.
References SMDS_Mesh::FindElement(), SMDS_VolumeTool::GetFaceNodes(), SMDS_VolumeTool::IsFreeFace(), SMDS_VolumeTool::IsPoly(), Driver_SMDS_Mesh::myMesh, myNbVolumeTrias, myVolumeFacets, SMDS_VolumeTool::NbFaceNodes(), SMDS_VolumeTool::NbFaces(), SMDS_VolumeTool::Set(), SMDSAbs_Face, and SMDS_Mesh::volumesIterator().
Referenced by Perform().
|
staticprotectedinherited |
Assure a string is UTF-8 valid by replacing invalid chars.
|
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::ExportCGNS(), SMESH_Mesh_i::exportMEDFields(), SMESH_Mesh::GMFToMesh(), and SMESH_Mesh::MEDToMesh().
|
private |
Return iterator on both faces in the mesh and on temporary faces.
References SMDS_Mesh::elementsIterator(), Driver_SMDS_Mesh::myMesh, myVolumeFacets, and SMDSAbs_Face.
Referenced by writeAscii(), and writeBinary().
|
virtualinherited |
References Driver_Mesh::myMeshName.
Referenced by SMESH_Mesh::CGNSToMesh().
|
staticinherited |
|
virtual |
Implements Driver_Mesh.
References Driver_Mesh::DRS_FAIL, Driver_Mesh::DRS_OK, findVolumeTriangles(), myIsAscii, Driver_SMDS_Mesh::myMesh, writeAscii(), and writeBinary().
Referenced by SMESH_Mesh::ExportSTL().
|
virtualinherited |
References Driver_Mesh::myFile.
Referenced by SMESH_Mesh::CGNSToMesh(), SMESH_Gen_i::CreateMeshesFromCGNS(), SMESH_Gen_i::CreateMeshesFromMED(), SMESH_Mesh::ExportCGNS(), SMESH_Mesh::ExportDAT(), MEDFileSpeCls::exportField(), SMESH_Mesh::ExportGMF(), SMESH_Mesh::ExportSTL(), SMESH_Mesh::ExportUNV(), SMESH_PreMeshInfo::FullLoadFromFile(), MG_ADAPT::MgAdapt::getCommandToRun(), GetMGLicenseKeyImpl(), SMESH_Mesh::GMFToMesh(), SMESH_Mesh::MEDToMesh(), DriverMED_W_SMESHDS_Mesh::SetFile(), SMESH_Mesh::STLToMesh(), and SMESH_Mesh::UNVToMesh().
void DriverSTL_W_SMDS_Mesh::SetIsAscii | ( | const bool | theIsAscii = false | ) |
References myIsAscii.
Referenced by SMESH_Mesh::ExportSTL().
|
inherited |
References Driver_SMDS_Mesh::myMesh.
Referenced by SMESH_Mesh::ExportDAT(), SMESH_Mesh::ExportSTL(), SMESH_Mesh::ExportUNV(), SMESH_Mesh::STLToMesh(), and SMESH_Mesh::UNVToMesh().
|
inherited |
References Driver_Mesh::myMeshId.
Referenced by SMESH_Mesh::CGNSToMesh(), SMESH_Gen_i::CreateMeshesFromMED(), SMESH_Mesh::ExportDAT(), SMESH_Mesh::exportMEDCommmon(), SMESH_Mesh::ExportSTL(), SMESH_Mesh::ExportUNV(), SMESH_PreMeshInfo::FullLoadFromFile(), SMESH_Mesh::MEDToMesh(), SMESH_Gen_i::Save(), SMESH_Mesh::STLToMesh(), and SMESH_Mesh::UNVToMesh().
|
virtualinherited |
References Driver_Mesh::myMeshName.
Referenced by SMESH_Mesh::ExportCGNS(), MEDFileSpeCls::exportField(), MEDFileMemSpeCls::exportField(), and SMESH_Mesh::exportMEDCommmon().
void DriverSTL_W_SMDS_Mesh::SetName | ( | const std::string | name | ) |
Referenced by SMESH_Mesh::ExportSTL().
|
virtualinherited |
|
private |
|
private |
Writes all triangles in binary format.
References Driver_Mesh::DRS_FAIL, Driver_Mesh::DRS_OK, SMDS_Mesh::facesIterator(), getFaces(), SMESH_MeshAlgos::Triangulate::GetNbTriangles(), getNormale(), SMESH_MeshAlgos::Triangulate::GetTriangles(), LABEL_SIZE, Driver_Mesh::myFile, Driver_SMDS_Mesh::myMesh, myName, myNbVolumeTrias, MESHCUT::normale, SMESH_File::openForWriting(), SMESH_File::write(), writeFloat(), writeInteger(), SMESH_File::writeRaw(), SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().
Referenced by Perform().
|
protectedinherited |
Referenced by Driver_Mesh::addMessage(), and Driver_Mesh::GetError().
|
protectedinherited |
Referenced by DriverGMF_Read::GetMeshInfo(), DriverGMF_Read::Perform(), DriverGMF_Write::Perform(), DriverSTL_R_SMDS_Mesh::Perform(), DriverMED_W_Field::Perform(), DriverMED_W_Field_Mem::Perform(), DriverMED_W_SMESHDS_Mesh::Perform(), DriverMED_W_SMESHDS_Mesh_Mem::Perform(), DriverSTL_R_SMDS_Mesh::readAscii(), Driver_Mesh::SetFile(), writeAscii(), and writeBinary().
|
private |
Referenced by DriverSTL_W_SMDS_Mesh(), Perform(), and SetIsAscii().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
private |
Referenced by writeAscii(), and writeBinary().
|
private |
Referenced by findVolumeTriangles(), and writeBinary().
|
protectedinherited |
Referenced by Driver_Mesh::addMessage(), Driver_Mesh::GetError(), and DriverGMF_Read::storeBadNodeIds().
|
private |
Referenced by findVolumeTriangles(), getFaces(), and ~DriverSTL_W_SMDS_Mesh().