The MeshInput class is able to read a mesh object from an input stream in various formats. More...
#include <MeshIO.h>
Public Member Functions | |
const std::vector< std::string > & | GetGroupNames () const |
bool | LoadAny (const char *FileName) |
Loads the file, decided by extension. More... | |
bool | LoadAsciiSTL (std::istream &rstrIn) |
Loads an ASCII STL file. More... | |
bool | LoadBinarySTL (std::istream &rstrIn) |
Loads a binary STL file. More... | |
bool | LoadCadmouldFE (std::ifstream &rstrIn) |
Loads a Cadmould FE file. More... | |
bool | LoadFormat (std::istream &str, MeshIO::Format fmt) |
Loads from a stream and the given format. More... | |
bool | LoadInventor (std::istream &rstrIn) |
Loads an OpenInventor file. More... | |
bool | LoadMeshNode (std::istream &rstrIn) |
Loads a node from an OpenInventor file. More... | |
bool | LoadMTL (std::istream &rstrIn) |
Loads the materials of an OBJ file. More... | |
bool | LoadNastran (std::istream &rstrIn) |
Loads a Nastran file. More... | |
bool | LoadOBJ (std::istream &rstrIn) |
Loads an OBJ Mesh file. More... | |
bool | LoadOFF (std::istream &rstrIn) |
Loads an OFF Mesh file. More... | |
bool | LoadPLY (std::istream &rstrIn) |
Loads a PLY Mesh file. More... | |
bool | LoadSMF (std::istream &rstrIn) |
Loads an SMF Mesh file. More... | |
bool | LoadSTL (std::istream &rstrIn) |
Loads an STL file either in binary or ASCII format. More... | |
void | LoadXML (Base::XMLReader &reader) |
Loads the mesh object from an XML file. More... | |
MeshInput (MeshKernel &rclM) | |
MeshInput (MeshKernel &rclM, Material *m) | |
virtual | ~MeshInput () |
Static Public Member Functions | |
static MeshIO::Format | getFormat (const char *FileName) |
static std::vector< std::string > | supportedMeshFormats () |
The MeshInput class is able to read a mesh object from an input stream in various formats.
MeshCore::MeshInput::MeshInput | ( | MeshKernel & | rclM | ) |
MeshCore::MeshInput::MeshInput | ( | MeshKernel & | rclM, |
Material * | m | ||
) |
|
virtual |
|
static |
References Base::FileInfo::hasExtension().
const std::vector< std::string > & MeshCore::MeshInput::GetGroupNames | ( | ) | const |
Referenced by Mesh::MeshObject::load().
bool MeshInput::LoadAny | ( | const char * | FileName | ) |
Loads the file, decided by extension.
References Base::Console(), Base::FileInfo::exists(), Base::FileInfo::hasExtension(), Base::FileInfo::isFile(), Base::FileInfo::isReadable(), LoadInventor(), LoadNastran(), LoadOBJ(), LoadOFF(), LoadPLY(), LoadSMF(), LoadSTL(), and Base::ConsoleSingleton::Warning().
Referenced by Mesh::MeshObject::load().
bool MeshInput::LoadAsciiSTL | ( | std::istream & | rstrIn | ) |
Loads an ASCII STL file.
References MeshCore::MeshBuilder::AddFacet(), MeshCore::MeshBuilder::Finish(), MeshCore::MeshBuilder::Initialize(), and MeshCore::MeshGeomFacet::SetNormal().
Referenced by LoadFormat(), and LoadSTL().
bool MeshInput::LoadBinarySTL | ( | std::istream & | rstrIn | ) |
Loads a binary STL file.
References MeshCore::MeshBuilder::AddFacet(), MeshCore::MeshBuilder::Finish(), and MeshCore::MeshBuilder::Initialize().
Referenced by LoadFormat(), and LoadSTL().
bool MeshInput::LoadCadmouldFE | ( | std::ifstream & | rstrIn | ) |
Loads a Cadmould FE file.
bool MeshInput::LoadFormat | ( | std::istream & | str, |
MeshIO::Format | fmt | ||
) |
Loads from a stream and the given format.
References MeshCore::MeshIO::APLY, MeshCore::MeshIO::ASTL, MeshCore::MeshIO::BMS, MeshCore::MeshIO::BSTL, MeshCore::MeshIO::IV, LoadAsciiSTL(), LoadBinarySTL(), LoadInventor(), LoadNastran(), LoadOBJ(), LoadOFF(), LoadPLY(), LoadSMF(), LoadSTL(), MeshCore::MeshIO::NAS, MeshCore::MeshIO::OBJ, MeshCore::MeshIO::OFF, MeshCore::MeshIO::PLY, MeshCore::MeshIO::SMF, and MeshCore::MeshIO::STL.
Referenced by Mesh::MeshObject::load().
bool MeshInput::LoadInventor | ( | std::istream & | rstrIn | ) |
Loads an OpenInventor file.
References Base::SequencerLauncher::next(), MeshCore::MeshGeomFacet::SetNormal(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by LoadAny(), and LoadFormat().
bool MeshInput::LoadMeshNode | ( | std::istream & | rstrIn | ) |
Loads a node from an OpenInventor file.
References MeshCore::MeshCleanup::RemoveInvalids(), and MeshCore::MeshPointFacetAdjacency::SetFacetNeighbourhood().
bool MeshInput::LoadMTL | ( | std::istream & | rstrIn | ) |
Loads the materials of an OBJ file.
References Base::Tools::escapedUnicodeToUtf8(), MeshCore::MeshIO::OVERALL, and MeshCore::MeshIO::PER_FACE.
Referenced by Mesh::MeshObject::load().
bool MeshInput::LoadNastran | ( | std::istream & | rstrIn | ) |
Loads a Nastran file.
References Base::Console(), Base::ConsoleSingleton::Error(), MeshCore::ltrim(), and Base::ConsoleSingleton::Warning().
Referenced by LoadAny(), and LoadFormat().
bool MeshInput::LoadOBJ | ( | std::istream & | rstrIn | ) |
Loads an OBJ Mesh file.
Loads an OBJ file.
References Base::Tools::escapedUnicodeToUtf8(), MeshCore::MeshIO::OVERALL, MeshCore::MeshIO::PER_FACE, MeshCore::MeshIO::PER_VERTEX, MeshCore::MeshCleanup::RemoveInvalids(), MeshCore::MeshPointFacetAdjacency::SetFacetNeighbourhood(), MeshCore::MeshCleanup::SetMaterial(), App::Color::setPackedValue(), MeshCore::MeshPointArray::SetProperty(), MeshCore::MeshFacet::SetProperty(), and MeshCore::MeshFacet::SetVertices().
Referenced by LoadAny(), and LoadFormat().
bool MeshInput::LoadOFF | ( | std::istream & | rstrIn | ) |
Loads an OFF Mesh file.
Loads an OFF file.
References MeshCore::MeshIO::PER_FACE, MeshCore::MeshIO::PER_VERTEX, MeshCore::MeshCleanup::RemoveInvalids(), MeshCore::MeshPointFacetAdjacency::SetFacetNeighbourhood(), MeshCore::MeshCleanup::SetMaterial(), and MeshCore::MeshFacet::SetVertices().
Referenced by LoadAny(), and LoadFormat().
bool MeshInput::LoadPLY | ( | std::istream & | rstrIn | ) |
Loads a PLY Mesh file.
str || !str.eof() ||
str || !str.eof() ||
References Base::Stream::BigEndian, MeshCore::Ply::float32, MeshCore::Ply::float64, MeshCore::Ply::int16, MeshCore::Ply::int32, MeshCore::Ply::int8, Base::Stream::LittleEndian, MeshCore::MeshIO::OVERALL, MeshCore::MeshIO::PER_VERTEX, MeshCore::MeshCleanup::RemoveInvalids(), Base::Stream::setByteOrder(), MeshCore::MeshPointFacetAdjacency::SetFacetNeighbourhood(), MeshCore::MeshCleanup::SetMaterial(), MeshCore::Ply::uint8, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by LoadAny(), and LoadFormat().
bool MeshInput::LoadSMF | ( | std::istream & | rstrIn | ) |
Loads an SMF Mesh file.
Loads an SMF file.
References MeshCore::MeshCleanup::RemoveInvalids(), MeshCore::MeshPointFacetAdjacency::SetFacetNeighbourhood(), MeshCore::MeshFacet::SetProperty(), and MeshCore::MeshFacet::SetVertices().
Referenced by LoadAny(), and LoadFormat().
bool MeshInput::LoadSTL | ( | std::istream & | rstrIn | ) |
Loads an STL file either in binary or ASCII format.
Therefore the file header gets checked to decide if the file is binary or not.
References LoadAsciiSTL(), and LoadBinarySTL().
Referenced by LoadAny(), and LoadFormat().
void MeshInput::LoadXML | ( | Base::XMLReader & | reader | ) |
Loads the mesh object from an XML file.
References Base::XMLReader::getAttributeAsFloat(), Base::XMLReader::getAttributeAsInteger(), Base::XMLReader::readElement(), and Base::XMLReader::readEndElement().
Referenced by Mesh::PropertyMeshKernel::Restore().
|
static |