Mantid
|
Class to contain functionality for writing out STL files for SaveShapeAndEnvironment. More...
#include <SaveStl.h>
Public Member Functions | |
SaveStl (const std::string &filename, const std::vector< uint32_t > &triangle, std::vector< Kernel::V3D > vertices, ScaleUnits scaleType) | |
void | writeStl () |
Function to write out the full mesh to an stl binary file. More... | |
Public Member Functions inherited from Mantid::DataHandling::MeshFileIO | |
Kernel::V3D | createScaledV3D (double xVal, double yVal, double zVal) |
scales a 3D point according the units defined in the MeshFileIO class More... | |
ScaleUnits | getScaleType () |
std::shared_ptr< Geometry::MeshObject > | rotate (std::shared_ptr< Geometry::MeshObject > environmentMesh, double xRotation, double yRotation, double zRotation) |
Rotates the environment by a generated matrix. More... | |
std::shared_ptr< Geometry::MeshObject > | translate (std::shared_ptr< Geometry::MeshObject > environmentMesh, const std::vector< double > &translationVector) |
translates the environment by a provided matrix More... | |
Private Member Functions | |
void | writeHeader (Kernel::BinaryStreamWriter streamWriter) |
Function to write the header of the STL file, the header has no requirements other than it being 80 bytes long and not being a valid ascii stl header, so store creation info and scale here. More... | |
void | writeTriangle (Kernel::BinaryStreamWriter streamWriter, uint32_t triangle) |
Function to write out an individual triangle with the scale removed. More... | |
Private Attributes | |
const std::string | m_filename |
Additional Inherited Members | |
Protected Member Functions inherited from Mantid::DataHandling::MeshFileIO | |
MeshFileIO (ScaleUnits scaleType) | |
MeshFileIO (ScaleUnits scaleType, std::vector< uint32_t > triangles, std::vector< Kernel::V3D > vertices) | |
float | removeScale (double value) |
double | scaleValue (double val) |
void | setScaleType (const ScaleUnits scaleType) |
Protected Attributes inherited from Mantid::DataHandling::MeshFileIO | |
ScaleUnits | m_scaleType |
std::vector< uint32_t > | m_triangle |
std::vector< Kernel::V3D > | m_vertices |
Class to contain functionality for writing out STL files for SaveShapeAndEnvironment.
handles actual writing to file, creating the header, and removing the scale applied when loading.
|
inline |
|
private |
Function to write the header of the STL file, the header has no requirements other than it being 80 bytes long and not being a valid ascii stl header, so store creation info and scale here.
streamWriter | The binary stream to write to. |
Definition at line 52 of file SaveStl.cpp.
References Mantid::DataHandling::centimetres, Mantid::DataHandling::MeshFileIO::m_scaleType, Mantid::DataHandling::metres, and Mantid::DataHandling::millimetres.
Referenced by writeStl().
void Mantid::DataHandling::SaveStl::writeStl | ( | ) |
Function to write out the full mesh to an stl binary file.
Handles the format of the file e.g. Header->NumberOfTriangles->Normal->Triangle->attribute->Next Normal...
Definition at line 79 of file SaveStl.cpp.
References m_filename, Mantid::DataHandling::MeshFileIO::m_triangle, writeHeader(), and writeTriangle().
Referenced by Mantid::DataHandling::SaveSampleEnvironmentAndShape::exec().
|
private |
Function to write out an individual triangle with the scale removed.
streamWriter | The binary stream to write to. |
triangle | the first index of the triangles in the m_triangles vector. |
Definition at line 104 of file SaveStl.cpp.
References index, Mantid::DataHandling::MeshFileIO::m_triangle, Mantid::DataHandling::MeshFileIO::m_vertices, Mantid::DataHandling::MeshFileIO::removeScale(), Mantid::Kernel::V3D::X(), Mantid::Kernel::V3D::Y(), and Mantid::Kernel::V3D::Z().
Referenced by writeStl().
|
private |
Definition at line 39 of file SaveStl.h.
Referenced by writeStl().