EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Enumerations | Functions
EBGeometry::Parser Namespace Reference

Namespace which encapsulates possible file parsers for building EBGeometry data structures. More...

Enumerations

enum class  Encoding { ASCII , Binary , Unknown }
 Simple enum for separating ASCII and binary files. More...
 
enum class  FileType {
  STL , PLY , VTK , OBJ ,
  Unsupported
}
 Various supported file types. More...
 

Functions

template<typename T >
PLY< T > readPLY (const std::string &a_filename)
 Read a single PLY file into a raw PLY data structure.
 
template<typename T >
std::vector< PLY< T > > readPLY (const std::vector< std::string > &a_filenames)
 Read multiple PLY files into raw PLY data structures.
 
template<typename T >
STL< T > readSTL (const std::string &a_filename)
 Read a single STL file into a raw STL data structure.
 
template<typename T >
std::vector< STL< T > > readSTL (const std::vector< std::string > &a_filenames)
 Read multiple STL files into raw STL data structures.
 
template<typename T >
OBJ< T > readOBJ (const std::string &a_filename)
 Read a single Wavefront OBJ file into a raw OBJ data structure.
 
template<typename T >
std::vector< OBJ< T > > readOBJ (const std::vector< std::string > &a_filenames)
 Read multiple Wavefront OBJ files into raw OBJ data structures.
 
template<typename T >
VTK< T > readVTK (const std::string &a_filename)
 Read a single VTK legacy polydata file into a raw VTK data structure.
 
template<typename T >
std::vector< VTK< T > > readVTK (const std::vector< std::string > &a_filenames)
 Read multiple VTK legacy polydata files into raw VTK data structures.
 

Detailed Description

Namespace which encapsulates possible file parsers for building EBGeometry data structures.

Enumeration Type Documentation

◆ Encoding

Simple enum for separating ASCII and binary files.

Enumerator
ASCII 

File is plain text.

Binary 

File is binary-encoded.

Unknown 

Encoding could not be determined.

◆ FileType

Various supported file types.

Enumerator
STL 

Stereolithography format (.stl)

PLY 

Polygon File Format (.ply)

VTK 

VTK legacy or XML polydata format (.vtk)

OBJ 

Wavefront OBJ format (.obj)

Unsupported 

File type is not recognised.

Function Documentation

◆ readOBJ() [1/2]

template<typename T >
OBJ< T > EBGeometry::Parser::readOBJ ( const std::string &  a_filename)

Read a single Wavefront OBJ file into a raw OBJ data structure.

Template Parameters
TFloating-point precision used for vertex coordinates.
Parameters
[in]a_filenameOBJ file name.
Returns
Populated OBJ<T> object containing vertex coordinates and face indices.

◆ readOBJ() [2/2]

template<typename T >
std::vector< OBJ< T > > EBGeometry::Parser::readOBJ ( const std::vector< std::string > &  a_filenames)

Read multiple Wavefront OBJ files into raw OBJ data structures.

Template Parameters
TFloating-point precision used for vertex coordinates.
Parameters
[in]a_filenamesList of OBJ file names.
Returns
Vector of populated OBJ<T> objects, one per file.

◆ readPLY() [1/2]

template<typename T >
PLY< T > EBGeometry::Parser::readPLY ( const std::string &  a_filename)

Read a single PLY file into a raw PLY data structure.

Template Parameters
TFloating-point precision used for vertex coordinates.
Parameters
[in]a_filenamePLY file name.
Returns
Populated PLY<T> object containing vertex coordinates and face indices.

◆ readPLY() [2/2]

template<typename T >
std::vector< PLY< T > > EBGeometry::Parser::readPLY ( const std::vector< std::string > &  a_filenames)

Read multiple PLY files into raw PLY data structures.

Template Parameters
TFloating-point precision used for vertex coordinates.
Parameters
[in]a_filenamesList of PLY file names.
Returns
Vector of populated PLY<T> objects, one per file.

◆ readSTL() [1/2]

template<typename T >
STL< T > EBGeometry::Parser::readSTL ( const std::string &  a_filename)

Read a single STL file into a raw STL data structure.

Template Parameters
TFloating-point precision used for vertex coordinates.
Parameters
[in]a_filenameSTL file name.
Returns
Populated STL<T> object containing vertex coordinates and face indices.
Note
If the STL file contains multiple solids (which is uncommon but technically supported), this routine will only read the first one.

◆ readSTL() [2/2]

template<typename T >
std::vector< STL< T > > EBGeometry::Parser::readSTL ( const std::vector< std::string > &  a_filenames)

Read multiple STL files into raw STL data structures.

Template Parameters
TFloating-point precision used for vertex coordinates.
Parameters
[in]a_filenamesList of STL file names.
Returns
Vector of populated STL<T> objects, one per file.
Note
If the STL file contains multiple solids (which is uncommon but technically supported), this routine will only read the first one.

◆ readVTK() [1/2]

template<typename T >
VTK< T > EBGeometry::Parser::readVTK ( const std::string &  a_filename)

Read a single VTK legacy polydata file into a raw VTK data structure.

Template Parameters
TFloating-point precision used for vertex coordinates.
Parameters
[in]a_filenameVTK file name.
Returns
Populated VTK<T> object containing vertex coordinates and face indices.

◆ readVTK() [2/2]

template<typename T >
std::vector< VTK< T > > EBGeometry::Parser::readVTK ( const std::vector< std::string > &  a_filenames)

Read multiple VTK legacy polydata files into raw VTK data structures.

Template Parameters
TFloating-point precision used for vertex coordinates.
Parameters
[in]a_filenamesList of VTK file names.
Returns
Vector of populated VTK<T> objects, one per file.