Version: 9.12.0
DriverSTL_W_SMDS_Mesh Class Reference

Writer of a mesh in STL (STereoLithography) file format. More...

#include <DriverSTL_W_SMDS_Mesh.h>

Inheritance diagram for DriverSTL_W_SMDS_Mesh:

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_MeshmyMesh
 
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
 

Detailed Description

Writer of a mesh in STL (STereoLithography) file format.

Member Enumeration Documentation

◆ Status

enum Driver_Mesh::Status
inherited
Enumerator
DRS_OK 
DRS_EMPTY 
DRS_WARN_RENUMBER 
DRS_WARN_SKIP_ELEM 
DRS_WARN_DESCENDING 
DRS_FAIL 
DRS_TOO_LARGE_MESH 

Constructor & Destructor Documentation

◆ DriverSTL_W_SMDS_Mesh()

DriverSTL_W_SMDS_Mesh::DriverSTL_W_SMDS_Mesh ( )

References myIsAscii.

◆ ~DriverSTL_W_SMDS_Mesh()

DriverSTL_W_SMDS_Mesh::~DriverSTL_W_SMDS_Mesh ( )

Destructor deletes temporary faces.

References myVolumeFacets.

Member Function Documentation

◆ addMessage()

Driver_Mesh::Status Driver_Mesh::addMessage ( const std::string &  msg,
const bool  isFatal = false 
)
protectedinherited

◆ findVolumeTriangles()

◆ fixUTF8()

std::string Driver_Mesh::fixUTF8 ( const std::string &  s)
staticprotectedinherited

Assure a string is UTF-8 valid by replacing invalid chars.

◆ GetError()

◆ getFaces()

SMDS_ElemIteratorPtr DriverSTL_W_SMDS_Mesh::getFaces ( ) const
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().

◆ GetMeshName()

std::string Driver_Mesh::GetMeshName ( ) const
virtualinherited

◆ IsMeshTooLarge()

template<typename IDTYPE >
static bool Driver_Mesh::IsMeshTooLarge ( const SMDS_Mesh mesh,
bool  checkIDs 
)
staticinherited

◆ Perform()

◆ SetFile()

◆ SetIsAscii()

void DriverSTL_W_SMDS_Mesh::SetIsAscii ( const bool  theIsAscii = false)

References myIsAscii.

Referenced by SMESH_Mesh::ExportSTL().

◆ SetMesh()

void Driver_SMDS_Mesh::SetMesh ( SMDS_Mesh theMesh)
inherited

◆ SetMeshId()

◆ SetMeshName()

void Driver_Mesh::SetMeshName ( const std::string &  theMeshName)
virtualinherited

◆ SetName()

void DriverSTL_W_SMDS_Mesh::SetName ( const std::string  name)

Referenced by SMESH_Mesh::ExportSTL().

◆ SetOption()

virtual void Driver_Mesh::SetOption ( const std::string &  ,
const std::string &   
)
virtualinherited

◆ writeAscii()

◆ writeBinary()

Field Documentation

◆ myErrorMessages

std::vector< std::string > Driver_Mesh::myErrorMessages
protectedinherited

◆ myFile

◆ myIsAscii

bool DriverSTL_W_SMDS_Mesh::myIsAscii
private

◆ myMesh

◆ myMeshId

int Driver_Mesh::myMeshId
protectedinherited

◆ myMeshName

◆ myName

std::string DriverSTL_W_SMDS_Mesh::myName
private

Referenced by writeAscii(), and writeBinary().

◆ myNbVolumeTrias

int DriverSTL_W_SMDS_Mesh::myNbVolumeTrias
private

Referenced by findVolumeTriangles(), and writeBinary().

◆ myStatus

Status Driver_Mesh::myStatus
protectedinherited

◆ myVolumeFacets

std::vector<const SMDS_MeshElement*> DriverSTL_W_SMDS_Mesh::myVolumeFacets
private