AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::quest::STLReader Class Reference

A simple reader for an STL file encoded in the ascii or binary format. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/quest/stl/STLReader.hpp>

Inheritance diagram for axom::quest::STLReader:

Public Member Functions

 STLReader ()
 Constructor. More...
 
virtual ~STLReader ()
 Destructor. More...
 
void setFileName (const std::string &fileName)
 Sets the name of the file to read. More...
 
int getNumNodes () const
 Returns the number of nodes of the surface mesh. More...
 
int getNumFaces () const
 Returns the number of faces of the surface mesh. More...
 
void clear ()
 Clears all internal data-structures. More...
 
virtual int read ()
 Reads in the surface mesh from an STL file. More...
 
void getMesh (mint::UnstructuredMesh< mint::SINGLE_SHAPE > *mesh)
 Stores the STL data in the supplied unstructured mesh object. More...
 

Protected Attributes

std::string m_fileName
 
axom::IndexType m_num_nodes
 
axom::IndexType m_num_faces
 
std::vector< double > m_nodes
 

Detailed Description

A simple reader for an STL file encoded in the ascii or binary format.

STL (STereoLithography) is a common file format for triangle meshes. It encodes a "soup of triangles" by explicitly listing the coordinate positions of the three vertices of each triangle.

Constructor & Destructor Documentation

◆ STLReader()

axom::quest::STLReader::STLReader ( )

Constructor.

◆ ~STLReader()

virtual axom::quest::STLReader::~STLReader ( )
virtual

Destructor.

Member Function Documentation

◆ setFileName()

void axom::quest::STLReader::setFileName ( const std::string &  fileName)
inline

Sets the name of the file to read.

Parameters
[in]fileNamethe name of the file to read.

References m_fileName.

◆ getNumNodes()

int axom::quest::STLReader::getNumNodes ( ) const
inline

Returns the number of nodes of the surface mesh.

Returns
numNodes the number of nodes.

References m_num_nodes.

◆ getNumFaces()

int axom::quest::STLReader::getNumFaces ( ) const
inline

Returns the number of faces of the surface mesh.

Returns
numFaces the number of faces.

References clear(), getMesh(), m_num_faces, and read().

◆ clear()

void axom::quest::STLReader::clear ( )

Clears all internal data-structures.

Referenced by getNumFaces().

◆ read()

virtual int axom::quest::STLReader::read ( )
virtual

Reads in the surface mesh from an STL file.

Precondition
m_fileName != ""
Returns
status set to zero on success; set to a non-zero value otherwise.

Reimplemented in axom::quest::PSTLReader.

Referenced by getNumFaces().

◆ getMesh()

void axom::quest::STLReader::getMesh ( mint::UnstructuredMesh< mint::SINGLE_SHAPE > *  mesh)

Stores the STL data in the supplied unstructured mesh object.

Parameters
[in,out]meshpointer to the unstructured mesh.
Precondition
mesh != nullptr.

Referenced by getNumFaces().

Member Data Documentation

◆ m_fileName

std::string axom::quest::STLReader::m_fileName
protected

Referenced by setFileName().

◆ m_num_nodes

axom::IndexType axom::quest::STLReader::m_num_nodes
protected

Referenced by getNumNodes().

◆ m_num_faces

axom::IndexType axom::quest::STLReader::m_num_faces
protected

Referenced by getNumFaces().

◆ m_nodes

std::vector<double> axom::quest::STLReader::m_nodes
protected

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