The MeshOutput class is able to write a mesh object to an ouput stream on various formats. More...
#include <MeshIO.h>
Public Member Functions | |
MeshOutput (const MeshKernel &rclM, const Material *m) | |
MeshOutput (const MeshKernel &rclM) | |
bool | SaveAny (const char *FileName, MeshIO::Format f=MeshIO::Undefined) const |
Saves the file, decided by extension if not explicitly given. | |
bool | SaveAsciiSTL (std::ostream &rstrOut) const |
Saves the mesh object into an ASCII STL file. | |
bool | SaveBinarySTL (std::ostream &rstrOut) const |
Saves the mesh object into a binary STL file. | |
bool | SaveCadmouldFE (std::ostream &rstrOut) const |
Writes a Cadmould FE file. | |
bool | SaveInventor (std::ostream &rstrOut) const |
Writes an OpenInventor file. | |
bool | SaveMeshNode (std::ostream &rstrIn) |
Saves a node to an OpenInventor file. | |
bool | SaveNastran (std::ostream &rstrOut) const |
Writes a Nastran file. | |
bool | SaveOBJ (std::ostream &rstrOut) const |
Saves the mesh object into an OBJ file. | |
bool | SaveOFF (std::ostream &rstrOut) const |
Saves the mesh object into an OFF file. | |
bool | SavePLY (std::ostream &rstrOut) const |
Saves the mesh object into a PLY file. | |
bool | SavePython (std::ostream &rstrOut) const |
Writes a python module which creates a mesh. | |
bool | SaveVRML (std::ostream &rstrOut, const App::Material &rclMat) const |
Writes a VRML file. | |
void | SaveXML (Base::Writer &writer) const |
Saves the mesh object into an XML file. | |
void | Transform (const Base::Matrix4D &) |
virtual | ~MeshOutput (void) |
Static Public Member Functions | |
static void | SetSTLHeaderData (const std::string &) |
Set custom data to the header of a binary STL. | |
Protected Attributes | |
const Material * | _material |
const MeshKernel & | _rclMesh |
reference to mesh data structure | |
Base::Matrix4D | _transform |
bool | apply_transform |
Static Protected Attributes | |
static std::string | stl_header |
The MeshOutput class is able to write a mesh object to an ouput stream on various formats.
Definition at line 113 of file MeshIO.h.
MeshCore::MeshOutput::MeshOutput | ( | const MeshKernel & | rclM | ) | [inline] |
MeshCore::MeshOutput::MeshOutput | ( | const MeshKernel & | rclM, | |
const Material * | m | |||
) | [inline] |
virtual MeshCore::MeshOutput::~MeshOutput | ( | void | ) | [inline, virtual] |
bool MeshOutput::SaveAny | ( | const char * | FileName, | |
MeshIO::Format | f = MeshIO::Undefined | |||
) | const |
Saves the file, decided by extension if not explicitly given.
Save in a file, format is decided by the extension if not explicitly given.
Definition at line 1225 of file MeshIO.cpp.
References _rclMesh, _transform, MeshCore::MeshIO::ASTL, MeshCore::MeshIO::BMS, MeshCore::MeshIO::BSTL, Base::FileInfo::dirPath(), Base::FileInfo::exists(), Base::FileInfo::hasExtension(), Base::FileInfo::isWritable(), MeshCore::MeshIO::IV, MeshCore::MeshIO::NAS, MeshCore::MeshIO::OBJ, MeshCore::MeshIO::OFF, MeshCore::MeshIO::PLY, MeshCore::MeshIO::PY, SaveAsciiSTL(), SaveBinarySTL(), SaveInventor(), SaveNastran(), SaveOBJ(), SaveOFF(), SavePLY(), SavePython(), SaveVRML(), Transform(), MeshCore::MeshIO::Undefined, MeshCore::MeshIO::VRML, MeshCore::MeshKernel::Write(), and MeshCore::MeshIO::WRZ.
Referenced by Mesh::MeshObject::save().
bool MeshOutput::SaveAsciiSTL | ( | std::ostream & | rstrOut | ) | const |
Saves the mesh object into an ASCII STL file.
Saves the mesh object into an ASCII file.
Definition at line 1354 of file MeshIO.cpp.
References MeshCore::MeshGeomFacet::_aclPoints, _rclMesh, _transform, MeshCore::MeshKernel::CountFacets(), MeshCore::MeshFacetIterator::End(), MeshCore::MeshGeomFacet::GetNormal(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by SaveAny().
bool MeshOutput::SaveBinarySTL | ( | std::ostream & | rstrOut | ) | const |
Saves the mesh object into a binary STL file.
Saves the mesh object into a binary file.
Definition at line 1401 of file MeshIO.cpp.
References MeshCore::MeshGeomFacet::_aclPoints, _rclMesh, _transform, MeshCore::MeshKernel::CountFacets(), MeshCore::MeshFacetIterator::End(), MeshCore::MeshGeomFacet::GetNormal(), stl_header, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by SaveAny().
bool MeshOutput::SaveCadmouldFE | ( | std::ostream & | rstrOut | ) | const |
Writes a Cadmould FE file.
Definition at line 1837 of file MeshIO.cpp.
bool MeshOutput::SaveInventor | ( | std::ostream & | rstrOut | ) | const |
Writes an OpenInventor file.
Definition at line 1677 of file MeshIO.cpp.
References MeshCore::MeshFacet::_aulPoints, _rclMesh, _transform, MeshCore::MeshKernel::CountFacets(), MeshCore::MeshKernel::CountPoints(), MeshCore::MeshPointIterator::End(), MeshCore::MeshFacetIterator::End(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshGeomFacet::GetNormal(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by SaveAny().
bool MeshOutput::SaveMeshNode | ( | std::ostream & | rstrIn | ) |
Saves a node to an OpenInventor file.
Definition at line 1587 of file MeshIO.cpp.
References _rclMesh, _transform, apply_transform, MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
bool MeshOutput::SaveNastran | ( | std::ostream & | rstrOut | ) | const |
Writes a Nastran file.
Definition at line 1785 of file MeshIO.cpp.
References MeshCore::MeshFacet::_aulPoints, _rclMesh, _transform, MeshCore::MeshKernel::CountFacets(), MeshCore::MeshFacetIterator::GetIndices(), MeshCore::MeshFacetIterator::Init(), MeshCore::MeshPointIterator::Init(), Py::int, MeshCore::MeshFacetIterator::More(), MeshCore::MeshPointIterator::More(), MeshCore::MeshFacetIterator::Next(), MeshCore::MeshPointIterator::Next(), MeshCore::MeshPointIterator::Transform(), MovieTool::x, and MovieTool::y.
Referenced by SaveAny().
bool MeshOutput::SaveOBJ | ( | std::ostream & | rstrOut | ) | const |
Saves the mesh object into an OBJ file.
Saves an OBJ file.
Definition at line 1450 of file MeshIO.cpp.
References _rclMesh, _transform, apply_transform, MeshCore::MeshKernel::CountFacets(), MeshCore::MeshKernel::CountPoints(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by SaveAny().
bool MeshOutput::SaveOFF | ( | std::ostream & | out | ) | const |
Saves the mesh object into an OFF file.
Saves an OFF file.
Definition at line 1487 of file MeshIO.cpp.
References _rclMesh, _transform, apply_transform, MeshCore::MeshKernel::CountFacets(), MeshCore::MeshKernel::CountPoints(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by SaveAny().
bool MeshOutput::SavePLY | ( | std::ostream & | rstrOut | ) | const |
Saves the mesh object into a PLY file.
Definition at line 1527 of file MeshIO.cpp.
References MeshCore::MeshFacet::_aulPoints, _material, _rclMesh, _transform, apply_transform, App::Color::b, FemExample::b, MeshCore::Material::binding, MeshCore::Material::diffuseColor, SketcherExample::f, App::Color::g, MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), Py::int, Base::Stream::LittleEndian, draftTools::p, MeshCore::MeshIO::PER_VERTEX, App::Color::r, Base::Stream::setByteOrder(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by SaveAny().
bool MeshOutput::SavePython | ( | std::ostream & | rstrOut | ) | const |
Writes a python module which creates a mesh.
Writes a Python module.
Definition at line 1843 of file MeshIO.cpp.
References MeshCore::MeshGeomFacet::_aclPoints, _rclMesh, _transform, MeshCore::MeshKernel::CountFacets(), MeshCore::MeshFacetIterator::Init(), MeshCore::MeshFacetIterator::More(), MeshCore::MeshFacetIterator::Next(), MeshCore::MeshFacetIterator::Transform(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by SaveAny().
bool MeshOutput::SaveVRML | ( | std::ostream & | rstrOut, | |
const App::Material & | rclMat | |||
) | const |
Writes a VRML file.
Definition at line 1894 of file MeshIO.cpp.
References _rclMesh, and _transform.
Referenced by SaveAny().
void MeshOutput::SaveXML | ( | Base::Writer & | writer | ) | const |
Saves the mesh object into an XML file.
Definition at line 1621 of file MeshIO.cpp.
References _rclMesh, _transform, apply_transform, MeshCore::MeshKernel::CountFacets(), MeshCore::MeshKernel::CountPoints(), Base::Writer::decInd(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), Base::Writer::incInd(), Base::Writer::ind(), Base::Writer::Stream(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
void MeshOutput::SetSTLHeaderData | ( | const std::string & | header | ) | [static] |
Set custom data to the header of a binary STL.
If the data exceeds 80 characters the the characters too much are ignored. If the data has less than 80 characters they are automatically filled up with spaces.
Definition at line 1203 of file MeshIO.cpp.
References draftlibs::dxfLibrary::copy, and stl_header.
void MeshOutput::Transform | ( | const Base::Matrix4D & | mat | ) |
Definition at line 1217 of file MeshIO.cpp.
References _transform, and apply_transform.
Referenced by Mesh::MeshObject::save(), and SaveAny().
const Material* MeshCore::MeshOutput::_material [protected] |
const MeshKernel& MeshCore::MeshOutput::_rclMesh [protected] |
reference to mesh data structure
Definition at line 157 of file MeshIO.h.
Referenced by SaveAny(), SaveAsciiSTL(), SaveBinarySTL(), SaveInventor(), SaveMeshNode(), SaveNastran(), SaveOBJ(), SaveOFF(), SavePLY(), SavePython(), SaveVRML(), and SaveXML().
Base::Matrix4D MeshCore::MeshOutput::_transform [protected] |
Definition at line 159 of file MeshIO.h.
Referenced by SaveAny(), SaveAsciiSTL(), SaveBinarySTL(), SaveInventor(), SaveMeshNode(), SaveNastran(), SaveOBJ(), SaveOFF(), SavePLY(), SavePython(), SaveVRML(), SaveXML(), and Transform().
bool MeshCore::MeshOutput::apply_transform [protected] |
Definition at line 160 of file MeshIO.h.
Referenced by SaveMeshNode(), SaveOBJ(), SaveOFF(), SavePLY(), SaveXML(), and Transform().
std::string MeshOutput::stl_header [static, protected] |
"MESH-MESH-MESH-MESH-MESH-MESH-MESH-MESH-" "MESH-MESH-MESH-MESH-MESH-MESH-MESH-MESH\n"
Definition at line 161 of file MeshIO.h.
Referenced by SaveBinarySTL(), and SetSTLHeaderData().