MeshCore::MeshOutput Class Reference

The MeshOutput class is able to write a mesh object to an output stream on various formats. More...

#include <MeshIO.h>

Public Member Functions

 MeshOutput (const MeshKernel &rclM)
 
 MeshOutput (const MeshKernel &rclM, const Material *m)
 
bool Save3MF (std::ostream &str) const
 Saves the mesh object into a 3MF file. More...
 
bool SaveAny (const char *FileName, MeshIO::Format f=MeshIO::Undefined) const
 Saves the file, decided by extension if not explicitly given. More...
 
bool SaveAsciiPLY (std::ostream &rstrOut) const
 Saves the mesh object into an ASCII PLY file. More...
 
bool SaveAsciiSTL (std::ostream &rstrOut) const
 Saves the mesh object into an ASCII STL file. More...
 
bool SaveAsymptote (std::ostream &rstrOut) const
 Saves the mesh object into an asymptote file. More...
 
bool SaveBinaryPLY (std::ostream &rstrOut) const
 Saves the mesh object into a binary PLY file. More...
 
bool SaveBinarySTL (std::ostream &rstrOut) const
 Saves the mesh object into a binary STL file. More...
 
bool SaveCadmouldFE (std::ostream &rstrOut) const
 Writes a Cadmould FE file. More...
 
bool SaveFormat (std::ostream &str, MeshIO::Format fmt) const
 Saves to a stream and the given format. More...
 
bool SaveIDTF (std::ostream &rstrOut) const
 Writes an IDTF file. More...
 
bool SaveInventor (std::ostream &rstrOut) const
 Writes an OpenInventor file. More...
 
bool SaveMeshNode (std::ostream &rstrIn)
 Saves a node to an OpenInventor file. More...
 
bool SaveMGL (std::ostream &rstrOut) const
 Writes an MGL file. More...
 
bool SaveMTL (std::ostream &rstrOut) const
 Saves the materials of an OBJ file. More...
 
bool SaveNastran (std::ostream &rstrOut) const
 Writes a Nastran file. More...
 
bool SaveOBJ (std::ostream &rstrOut) const
 Saves the mesh object into an OBJ file. More...
 
bool SaveOFF (std::ostream &rstrOut) const
 Saves the mesh object into an OFF file. More...
 
bool SavePython (std::ostream &rstrOut) const
 Writes a python module which creates a mesh. More...
 
bool SaveSMF (std::ostream &rstrOut) const
 Saves the mesh object into an SMF file. More...
 
bool SaveVRML (std::ostream &rstrOut) const
 Writes a VRML file. More...
 
bool SaveX3D (std::ostream &rstrOut) const
 Writes an X3D file. More...
 
bool SaveX3DOM (std::ostream &rstrOut) const
 Writes an X3dom file. More...
 
void SaveXML (Base::Writer &writer) const
 Saves the mesh object into an XML file. More...
 
void SetGroups (const std::vector< Group > &g)
 
void SetObjectName (const std::string &n)
 
void Transform (const Base::Matrix4D &)
 
virtual ~MeshOutput ()
 

Static Public Member Functions

static MeshIO::Format GetFormat (const char *FileName)
 Determine the mesh format by file extension. More...
 
static void SetAsymptoteSize (const std::string &, const std::string &)
 Change the image size of the asymptote output. More...
 
static void SetSTLHeaderData (const std::string &)
 Set custom data to the header of a binary STL. More...
 
static std::vector< std::string > supportedMeshFormats ()
 

Protected Member Functions

bool Save3MFContent (std::ostream &str) const
 
bool Save3MFModel (std::ostream &str) const
 
bool Save3MFRels (std::ostream &str) const
 
bool SaveX3DContent (std::ostream &rstrOut, bool exportViewpoints) const
 Writes an X3D file. More...
 

Protected Attributes

bool apply_transform
 
std::string objectName
 

Static Protected Attributes

static std::string asyHeight = "500"
 
static std::string asyWidth = "500"
 
static std::string stl_header
 

Detailed Description

The MeshOutput class is able to write a mesh object to an output stream on various formats.

Constructor & Destructor Documentation

◆ MeshOutput() [1/2]

MeshCore::MeshOutput::MeshOutput ( const MeshKernel rclM)

◆ MeshOutput() [2/2]

MeshCore::MeshOutput::MeshOutput ( const MeshKernel rclM,
const Material m 
)

◆ ~MeshOutput()

virtual MeshCore::MeshOutput::~MeshOutput ( )
virtual

Member Function Documentation

◆ GetFormat()

◆ Save3MF()

bool MeshOutput::Save3MF ( std::ostream &  str) const

◆ Save3MFContent()

bool MeshOutput::Save3MFContent ( std::ostream &  str) const
protected

Referenced by Save3MF().

◆ Save3MFModel()

◆ Save3MFRels()

bool MeshOutput::Save3MFRels ( std::ostream &  str) const
protected

Referenced by Save3MF().

◆ SaveAny()

◆ SaveAsciiPLY()

bool MeshOutput::SaveAsciiPLY ( std::ostream &  rstrOut) const

◆ SaveAsciiSTL()

bool MeshOutput::SaveAsciiSTL ( std::ostream &  rstrOut) const

◆ SaveAsymptote()

◆ SaveBinaryPLY()

bool MeshOutput::SaveBinaryPLY ( std::ostream &  rstrOut) const

◆ SaveBinarySTL()

bool MeshOutput::SaveBinarySTL ( std::ostream &  rstrOut) const

◆ SaveCadmouldFE()

bool MeshOutput::SaveCadmouldFE ( std::ostream &  rstrOut) const

Writes a Cadmould FE file.

◆ SaveFormat()

◆ SaveIDTF()

bool MeshOutput::SaveIDTF ( std::ostream &  rstrOut) const

◆ SaveInventor()

◆ SaveMeshNode()

bool MeshOutput::SaveMeshNode ( std::ostream &  rstrIn)

◆ SaveMGL()

bool MeshOutput::SaveMGL ( std::ostream &  rstrOut) const

Writes an MGL file.

Referenced by SaveAny(), and SaveFormat().

◆ SaveMTL()

bool MeshOutput::SaveMTL ( std::ostream &  rstrOut) const

Saves the materials of an OBJ file.

References MeshCore::MeshIO::PER_FACE.

Referenced by Mesh::MeshObject::save().

◆ SaveNastran()

◆ SaveOBJ()

◆ SaveOFF()

◆ SavePython()

bool MeshOutput::SavePython ( std::ostream &  rstrOut) const

Writes a python module which creates a mesh.

Writes a Python module.

References MeshCore::MeshFacetIterator::Init(), MeshCore::MeshFacetIterator::More(), MeshCore::MeshFacetIterator::Next(), and MeshCore::MeshFacetIterator::Transform().

Referenced by SaveAny(), and SaveFormat().

◆ SaveSMF()

bool MeshOutput::SaveSMF ( std::ostream &  rstrOut) const

◆ SaveVRML()

◆ SaveX3D()

bool MeshOutput::SaveX3D ( std::ostream &  rstrOut) const

Writes an X3D file.

References SaveX3DContent().

Referenced by SaveAny(), and SaveFormat().

◆ SaveX3DContent()

◆ SaveX3DOM()

bool MeshOutput::SaveX3DOM ( std::ostream &  rstrOut) const

Writes an X3dom file.

Writes an X3DOM file.

References SaveX3DContent().

Referenced by SaveAny(), and SaveFormat().

◆ SaveXML()

◆ SetAsymptoteSize()

void MeshOutput::SetAsymptoteSize ( const std::string &  w,
const std::string &  h 
)
static

Change the image size of the asymptote output.

References asyHeight, and asyWidth.

Referenced by MeshGui::DlgSettingsImportExport::saveSettings().

◆ SetGroups()

void MeshCore::MeshOutput::SetGroups ( const std::vector< Group > &  g)

Referenced by Mesh::MeshObject::save().

◆ SetObjectName()

void MeshCore::MeshOutput::SetObjectName ( const std::string &  n)

Referenced by Mesh::MeshObject::save(), and SaveAny().

◆ SetSTLHeaderData()

void MeshOutput::SetSTLHeaderData ( const std::string &  header)
static

Set custom data to the header of a binary STL.

If the data exceeds 80 characters then the characters too much are ignored. If the data has less than 80 characters they are automatically filled up with spaces.

References stl_header.

◆ supportedMeshFormats()

std::vector< std::string > MeshOutput::supportedMeshFormats ( )
static

◆ Transform()

void MeshOutput::Transform ( const Base::Matrix4D mat)

References apply_transform.

Referenced by Mesh::MeshObject::save(), and SaveAny().

Member Data Documentation

◆ apply_transform

bool MeshCore::MeshOutput::apply_transform
protected

◆ asyHeight

std::string MeshOutput::asyHeight = "500"
staticprotected

Referenced by SaveAsymptote(), and SetAsymptoteSize().

◆ asyWidth

std::string MeshOutput::asyWidth = "500"
staticprotected

Referenced by SaveAsymptote(), and SetAsymptoteSize().

◆ objectName

std::string MeshCore::MeshOutput::objectName
protected

Referenced by SaveAny(), SaveAsciiSTL(), and SaveIDTF().

◆ stl_header

std::string MeshOutput::stl_header
staticprotected
Initial value:
= "MESH-MESH-MESH-MESH-MESH-MESH-MESH-MESH-"
"MESH-MESH-MESH-MESH-MESH-MESH-MESH-MESH\n"

Referenced by SaveBinarySTL(), and SetSTLHeaderData().


The documentation for this class was generated from the following files: