Namespace which encapsulates possible file parsers for building EBGeometry data structures.
More...
|
| template<typename T > |
| PolygonSoup< T > | readPLY (const std::string &a_filename) |
| | Read a Stanford PLY file, ASCII or binary.
|
| |
| template<typename T > |
| std::vector< PolygonSoup< T > > | readPLY (const std::vector< std::string > &a_filenames) |
| | Read several Stanford PLY files.
|
| |
| template<typename T > |
| PolygonSoup< T > | readSTL (const std::string &a_filename) |
| | Read an STL file, ASCII or binary.
|
| |
| template<typename T > |
| std::vector< PolygonSoup< T > > | readSTL (const std::vector< std::string > &a_filenames) |
| | Read several STL files.
|
| |
| template<typename T > |
| PolygonSoup< T > | readOBJ (const std::string &a_filename) |
| | Read a Wavefront OBJ file.
|
| |
| template<typename T > |
| std::vector< PolygonSoup< T > > | readOBJ (const std::vector< std::string > &a_filenames) |
| | Read several Wavefront OBJ files.
|
| |
| template<typename T > |
| PolygonSoup< T > | readVTK (const std::string &a_filename) |
| | Read a legacy VTK POLYDATA file, ASCII or binary.
|
| |
| template<typename T > |
| std::vector< PolygonSoup< T > > | readVTK (const std::vector< std::string > &a_filenames) |
| | Read several legacy VTK POLYDATA files.
|
| |
Namespace which encapsulates possible file parsers for building EBGeometry data structures.
◆ 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 | Legacy VTK polydata format (.vtk)
|
| OBJ | Wavefront OBJ format (.obj)
|
| Unsupported | File type is not recognized.
|
◆ OnDefect
What a file reader does with a mesh whose faces do not form a clean, closed surface.
Covers the defects a reader can survive: neighboring faces oriented inconsistently, an edge shared by three or more faces, and faces that fold back onto each other. Such a mesh loads and gives correct distances, but the sign of the distance near the defect is unreliable. Faults that would corrupt the half-edge mesh itself (an index out of range, a non-finite coordinate, a face that visits a vertex twice) always throw. Holes are never a defect.
| Enumerator |
|---|
| Throw | Throw a ParseError naming the defect. The default.
|
| Warn | Print a warning to std::cerr and load the mesh anyway.
|
◆ readOBJ() [1/2]
template<typename T >
| PolygonSoup< T > EBGeometry::Parser::readOBJ |
( |
const std::string & |
a_filename | ) |
|
Read a Wavefront OBJ file.
Only the vertices and faces are read; texture coordinates, normals, groups and materials are ignored. A face record with fewer than three vertices is not a face.
- Template Parameters
-
| T | Floating-point precision for vertex coordinates. |
- Parameters
-
| [in] | a_filename | OBJ file name. |
- Returns
- The soup, cleaned (see PolygonSoup::clean()).
- Exceptions
-
| ParseError | if the file cannot be read or is malformed. |
◆ readOBJ() [2/2]
template<typename T >
| std::vector< PolygonSoup< T > > EBGeometry::Parser::readOBJ |
( |
const std::vector< std::string > & |
a_filenames | ) |
|
Read several Wavefront OBJ files.
- Template Parameters
-
| T | Floating-point precision for vertex coordinates. |
- Parameters
-
| [in] | a_filenames | OBJ file names. |
- Returns
- One cleaned soup per file.
- Exceptions
-
| ParseError | if any of the files cannot be read or is malformed. |
◆ readPLY() [1/2]
template<typename T >
| PolygonSoup< T > EBGeometry::Parser::readPLY |
( |
const std::string & |
a_filename | ) |
|
Read a Stanford PLY file, ASCII or binary.
The scalar vertex properties other than x, y and z, and the scalar face properties, are kept as the soup's properties.
- Template Parameters
-
| T | Floating-point precision for vertex coordinates and properties. |
- Parameters
-
| [in] | a_filename | PLY file name. |
- Returns
- The soup, cleaned (see PolygonSoup::clean()).
- Exceptions
-
| ParseError | if the file cannot be read or is malformed. |
◆ readPLY() [2/2]
template<typename T >
| std::vector< PolygonSoup< T > > EBGeometry::Parser::readPLY |
( |
const std::vector< std::string > & |
a_filenames | ) |
|
Read several Stanford PLY files.
- Template Parameters
-
| T | Floating-point precision for vertex coordinates and properties. |
- Parameters
-
| [in] | a_filenames | PLY file names. |
- Returns
- One cleaned soup per file.
- Exceptions
-
| ParseError | if any of the files cannot be read or is malformed. |
◆ readSTL() [1/2]
template<typename T >
| PolygonSoup< T > EBGeometry::Parser::readSTL |
( |
const std::string & |
a_filename | ) |
|
Read an STL file, ASCII or binary.
The facet normals in the file are ignored. If the file holds several solids (uncommon, but allowed), only the first is read.
- Template Parameters
-
| T | Floating-point precision for vertex coordinates. |
- Parameters
-
| [in] | a_filename | STL file name. |
- Returns
- The soup, cleaned (see PolygonSoup::clean()).
- Exceptions
-
| ParseError | if the file cannot be read or is malformed. |
◆ readSTL() [2/2]
template<typename T >
| std::vector< PolygonSoup< T > > EBGeometry::Parser::readSTL |
( |
const std::vector< std::string > & |
a_filenames | ) |
|
Read several STL files.
- Template Parameters
-
| T | Floating-point precision for vertex coordinates. |
- Parameters
-
| [in] | a_filenames | STL file names. |
- Returns
- One cleaned soup per file.
- Exceptions
-
| ParseError | if any of the files cannot be read or is malformed. |
◆ readVTK() [1/2]
template<typename T >
| PolygonSoup< T > EBGeometry::Parser::readVTK |
( |
const std::string & |
a_filename | ) |
|
Read a legacy VTK POLYDATA file, ASCII or binary.
The first component of each POINT_DATA and CELL_DATA scalar array is kept as a vertex or face property. An array with a different number of values than there are points or polygons (as when CELL_DATA also covers lines or vertices) is dropped with a warning.
- Template Parameters
-
| T | Floating-point precision for vertex coordinates and properties. |
- Parameters
-
| [in] | a_filename | VTK file name. |
- Returns
- The soup, cleaned (see PolygonSoup::clean()).
- Exceptions
-
| ParseError | if the file cannot be read or is malformed. |
◆ readVTK() [2/2]
template<typename T >
| std::vector< PolygonSoup< T > > EBGeometry::Parser::readVTK |
( |
const std::vector< std::string > & |
a_filenames | ) |
|
Read several legacy VTK POLYDATA files.
- Template Parameters
-
| T | Floating-point precision for vertex coordinates and properties. |
- Parameters
-
| [in] | a_filenames | VTK file names. |
- Returns
- One cleaned soup per file.
- Exceptions
-
| ParseError | if any of the files cannot be read or is malformed. |