EBGeometry  1.0
Public Types | Static Public Member Functions | Static Protected Member Functions | List of all members
Parser::STL< T, Meta > Class Template Reference

Class for reading STL files. More...

#include <EBGeometry_Parser.hpp>

Public Types

using Vec3 = EBGeometry::Vec3T< T >
 Alias for vector type.
 
using Vertex = EBGeometry::DCEL::VertexT< T, Meta >
 Alias for vertex type.
 
using Edge = EBGeometry::DCEL::EdgeT< T, Meta >
 Alias for edge type.
 
using Face = EBGeometry::DCEL::FaceT< T, Meta >
 Alias for face type.
 
using Mesh = EBGeometry::DCEL::MeshT< T, Meta >
 Alias for mesh type.
 
using EdgeIterator = EBGeometry::DCEL::EdgeIteratorT< T, Meta >
 Alias for edge iterator type.
 

Static Public Member Functions

static std::shared_ptr< MeshreadSingle (const std::string a_filename) noexcept
 Read a single STL object from the input file. The file can be binary or ASCII. If the STL file contains multiple solids, this routine returns the first one. More...
 
static std::vector< std::pair< std::shared_ptr< Mesh >, std::string > > readMulti (const std::string a_filename) noexcept
 Read a single STL object from the input file. The file can be binary or ASCII. More...
 

Static Protected Member Functions

static Encoding getEncoding (const std::string a_filename) noexcept
 Check if the input STL file is an ASCII file or a binary. More...
 
static std::vector< std::pair< std::shared_ptr< Mesh >, std::string > > readASCII (const std::string a_filename) noexcept
 ASCII reader STL files, possibly containing multiple objects. Each object becomes a DCEL mesh. More...
 
static std::vector< std::pair< std::shared_ptr< Mesh >, std::string > > readBinary (const std::string a_filename) noexcept
 Binary reader for STL files, possibly containing multiple objects. Each object becomes a DCEL mesh. More...
 
static void readSTLSoupASCII (std::vector< Vec3 > &a_vertices, std::vector< std::vector< size_t >> &a_facets, std::string &a_objectName, const std::vector< std::string > &a_fileContents, const size_t a_firstLine, const size_t a_lastLine) noexcept
 Read an STL object as a triangle soup into a raw vertices and facets. More...
 

Detailed Description

template<typename T, typename Meta>
class Parser::STL< T, Meta >

Class for reading STL files.

Note
T is the precision used when storing the mesh.

Member Function Documentation

◆ getEncoding()

template<typename T , typename Meta >
static Encoding Parser::STL< T, Meta >::getEncoding ( const std::string  a_filename)
inlinestaticprotectednoexcept

Check if the input STL file is an ASCII file or a binary.

Parameters
[in]a_filenameFile name
Returns
Returns Encoding::ASCII or Encoding::Binary,

◆ readASCII()

template<typename T , typename Meta >
static std::vector<std::pair<std::shared_ptr<Mesh>, std::string> > Parser::STL< T, Meta >::readASCII ( const std::string  a_filename)
inlinestaticprotectednoexcept

ASCII reader STL files, possibly containing multiple objects. Each object becomes a DCEL mesh.

Parameters
[in]a_filenameInput filename

◆ readBinary()

template<typename T , typename Meta >
static std::vector<std::pair<std::shared_ptr<Mesh>, std::string> > Parser::STL< T, Meta >::readBinary ( const std::string  a_filename)
inlinestaticprotectednoexcept

Binary reader for STL files, possibly containing multiple objects. Each object becomes a DCEL mesh.

Parameters
[in]a_filenameInput filename

◆ readMulti()

template<typename T , typename Meta >
static std::vector<std::pair<std::shared_ptr<Mesh>, std::string> > Parser::STL< T, Meta >::readMulti ( const std::string  a_filename)
inlinestaticnoexcept

Read a single STL object from the input file. The file can be binary or ASCII.

Parameters
[in]a_filenameSTL file name.

◆ readSingle()

template<typename T , typename Meta >
static std::shared_ptr<Mesh> Parser::STL< T, Meta >::readSingle ( const std::string  a_filename)
inlinestaticnoexcept

Read a single STL object from the input file. The file can be binary or ASCII. If the STL file contains multiple solids, this routine returns the first one.

Parameters
[in]a_filenameSTL file name.

◆ readSTLSoupASCII()

template<typename T , typename Meta >
static void Parser::STL< T, Meta >::readSTLSoupASCII ( std::vector< Vec3 > &  a_vertices,
std::vector< std::vector< size_t >> &  a_facets,
std::string &  a_objectName,
const std::vector< std::string > &  a_fileContents,
const size_t  a_firstLine,
const size_t  a_lastLine 
)
inlinestaticprotectednoexcept

Read an STL object as a triangle soup into a raw vertices and facets.

Parameters
[out]a_verticesVertices
[out]a_facetsSTL facets
[out]a_objectNameObject name
[out]a_fileContentsFile contents
[out]a_firstLineLine number in a_filename containing the 'solid' identifier.
[out]a_lastLineLine number in a_filename containing the 'endsolid' identifier.

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