EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Namespaces | Enumerations | Functions
EBGeometry_Parser.hpp File Reference

Declaration of utilities for reading files into EBGeometry data structures. More...

#include <cstddef>
#include <string>
#include <vector>
#include "EBGeometry_BoundingVolumes.hpp"
#include "EBGeometry_DCEL_Mesh.hpp"
#include "EBGeometry_MeshDistanceFunctions.hpp"
#include "EBGeometry_ParseError.hpp"
#include "EBGeometry_PolygonSoup.hpp"
#include "EBGeometry_Pool.hpp"
#include "EBGeometry_Triangle.hpp"
#include "EBGeometry_TriangleAoSoA.hpp"
#include "EBGeometry_TriangleSoA.hpp"
#include "EBGeometry_ParserImplem.hpp"
Include dependency graph for EBGeometry_Parser.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  EBGeometry
 Namespace containing all of EBGeometry's functionality.
 
namespace  EBGeometry::Parser
 Namespace which encapsulates possible file parsers for building EBGeometry data structures.
 

Enumerations

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

Functions

static Parser::FileType EBGeometry::Parser::getFileType (const std::string &a_filename)
 Determine file type from the file extension.
 
static Parser::Encoding EBGeometry::Parser::getFileEncoding (const std::string &a_filename)
 Determine file encoding (ASCII or binary) by inspecting the file header.
 
template<typename T >
PolygonSoup< T > EBGeometry::Parser::readPLY (const std::string &a_filename)
 Read a Stanford PLY file, ASCII or binary.
 
template<typename T >
std::vector< PolygonSoup< T > > EBGeometry::Parser::readPLY (const std::vector< std::string > &a_filenames)
 Read several Stanford PLY files.
 
template<typename T >
PolygonSoup< T > EBGeometry::Parser::readSTL (const std::string &a_filename)
 Read an STL file, ASCII or binary.
 
template<typename T >
std::vector< PolygonSoup< T > > EBGeometry::Parser::readSTL (const std::vector< std::string > &a_filenames)
 Read several STL files.
 
template<typename T >
PolygonSoup< T > EBGeometry::Parser::readOBJ (const std::string &a_filename)
 Read a Wavefront OBJ file.
 
template<typename T >
std::vector< PolygonSoup< T > > EBGeometry::Parser::readOBJ (const std::vector< std::string > &a_filenames)
 Read several Wavefront OBJ files.
 
template<typename T >
PolygonSoup< T > EBGeometry::Parser::readVTK (const std::string &a_filename)
 Read a legacy VTK POLYDATA file, ASCII or binary.
 
template<typename T >
std::vector< PolygonSoup< T > > EBGeometry::Parser::readVTK (const std::vector< std::string > &a_filenames)
 Read several legacy VTK POLYDATA files.
 
template<typename T >
static PolygonSoup< T > EBGeometry::Parser::readIntoPolygonSoup (const std::string &a_filename)
 Read a file of any supported format, chosen by its extension.
 
template<typename T >
static std::vector< PolygonSoup< T > > EBGeometry::Parser::readIntoPolygonSoup (const std::vector< std::string > &a_files)
 Read several files of any supported format.
 
template<typename T >
static EBGeometry::DCEL::MeshT< T > EBGeometry::Parser::readIntoDCEL (const std::string &a_filename, Pool &a_pool, const OnDefect a_onDefect=OnDefect::Throw)
 Read a file containing a single watertight object and return it as a DCEL mesh.
 
template<typename T >
static std::vector< EBGeometry::DCEL::MeshT< T > > EBGeometry::Parser::readIntoDCEL (const std::vector< std::string > &a_files, Pool &a_pool, const OnDefect a_onDefect=OnDefect::Throw)
 Read several files, each containing a single watertight object, as DCEL meshes.
 
template<typename T >
static FlatMeshSDF< T > EBGeometry::Parser::readIntoFlatMeshSDF (const std::string &a_filename, Pool &a_pool, const OnDefect a_onDefect=OnDefect::Throw)
 Read a file into a FlatMeshSDF: the signed distance to its DCEL mesh by a scan over every face, with no BVH.
 
template<typename T >
static std::vector< FlatMeshSDF< T > > EBGeometry::Parser::readIntoFlatMeshSDF (const std::vector< std::string > &a_files, Pool &a_pool, const OnDefect a_onDefect=OnDefect::Throw)
 Read several files into FlatMeshSDFs.
 
template<typename T , size_t K = BVH::DefaultBranchingRatio<T>()>
static MeshSDF< T, K > EBGeometry::Parser::readIntoMeshSDF (const std::string &a_filename, Pool &a_pool, const BVH::Construction a_construction=BVH::Construction::SAH, const OnDefect a_onDefect=OnDefect::Throw)
 Read a file into a MeshSDF: its DCEL mesh with a packed K-ary BVH over the faces.
 
template<typename T , size_t K = BVH::DefaultBranchingRatio<T>()>
static MeshSDF< T, K > EBGeometry::Parser::readIntoMeshSDF (const std::string &a_filename, Pool &a_pool, const BVH::Construction a_construction, const BVH::ConstructionOptions &a_options, const OnDefect a_onDefect=OnDefect::Throw)
 Read a file into a MeshSDF, with leaf-size settings.
 
template<typename T , size_t K = BVH::DefaultBranchingRatio<T>()>
static std::vector< MeshSDF< T, K > > EBGeometry::Parser::readIntoMeshSDF (const std::vector< std::string > &a_files, Pool &a_pool, const BVH::Construction a_construction=BVH::Construction::SAH, const OnDefect a_onDefect=OnDefect::Throw)
 Read several files into MeshSDFs.
 
template<typename T , size_t K = BVH::DefaultBranchingRatio<T>()>
static std::vector< MeshSDF< T, K > > EBGeometry::Parser::readIntoMeshSDF (const std::vector< std::string > &a_files, Pool &a_pool, const BVH::Construction a_construction, const BVH::ConstructionOptions &a_options, const OnDefect a_onDefect=OnDefect::Throw)
 Read several files into MeshSDFs, with leaf-size settings.
 
template<typename T , size_t K = BVH::DefaultBranchingRatio<T>(), size_t W = TriangleSoA::DefaultWidth<T>()>
static TriMeshSDF< T, K, W > EBGeometry::Parser::readIntoTriMeshSDF (const std::string &a_filename, Pool &a_pool, const BVH::Construction a_construction=BVH::Construction::SAH, const OnDefect a_onDefect=OnDefect::Throw)
 Read a file into a TriMeshSDF: its faces as triangles, in SIMD groups of W, under a packed K-ary BVH.
 
template<typename T , size_t K = BVH::DefaultBranchingRatio<T>(), size_t W = TriangleSoA::DefaultWidth<T>()>
static TriMeshSDF< T, K, W > EBGeometry::Parser::readIntoTriMeshSDF (const std::string &a_filename, Pool &a_pool, const BVH::Construction a_construction, const BVH::ConstructionOptions &a_options, const OnDefect a_onDefect=OnDefect::Throw)
 Read a file into a TriMeshSDF, with leaf-size settings.
 
template<typename T , size_t K = BVH::DefaultBranchingRatio<T>(), size_t W = TriangleSoA::DefaultWidth<T>()>
static std::vector< TriMeshSDF< T, K, W > > EBGeometry::Parser::readIntoTriMeshSDF (const std::vector< std::string > &a_files, Pool &a_pool, const BVH::Construction a_construction=BVH::Construction::SAH, const OnDefect a_onDefect=OnDefect::Throw)
 Read several files into TriMeshSDFs.
 
template<typename T , size_t K = BVH::DefaultBranchingRatio<T>(), size_t W = TriangleSoA::DefaultWidth<T>()>
static std::vector< TriMeshSDF< T, K, W > > EBGeometry::Parser::readIntoTriMeshSDF (const std::vector< std::string > &a_files, Pool &a_pool, const BVH::Construction a_construction, const BVH::ConstructionOptions &a_options, const OnDefect a_onDefect=OnDefect::Throw)
 Read several files into TriMeshSDFs, with leaf-size settings.
 
template<typename T >
static std::vector< Triangle< T > > EBGeometry::Parser::readIntoTriangles (const std::string &a_filename, const OnDefect a_onDefect=OnDefect::Throw)
 Read a file and return its faces as flat triangles.
 
template<typename T >
static std::vector< std::vector< Triangle< T > > > EBGeometry::Parser::readIntoTriangles (const std::vector< std::string > &a_files, const OnDefect a_onDefect=OnDefect::Throw)
 Read several files and return each one's faces as flat triangles.
 

Detailed Description

Declaration of utilities for reading files into EBGeometry data structures.

Author
Robert Marskar