ug4
|
convenience mesh class which makes accessing the stl data more easy More...
#include <stl_reader.h>
Public Member Functions | |
size_t | num_solids () const |
returns the number of solids of the mesh More... | |
size_t | num_tris () const |
returns the number of triangles in the mesh More... | |
size_t | num_vrts () const |
returns the number of vertices in the mesh More... | |
const TNumber * | raw_coords () const |
returns a pointer to the coordinate array, containing num_vrts()*3 entries. More... | |
const TNumber * | raw_normals () const |
returns a pointer to the normal array, containing num_tris()*3 entries. More... | |
const TIndex * | raw_solids () const |
returns a pointer to the solids array, containing num_solids()+1 entries. More... | |
const TIndex * | raw_tris () const |
returns a pointer to the triangle array, containing num_tris()*3 entries. More... | |
bool | read_file (const char *filename) |
fills the mesh with the contents of the specified stl-file More... | |
TIndex | solid_tris_begin (const size_t si) const |
returns the index of the first triangle in the given solid More... | |
TIndex | solid_tris_end (const size_t si) const |
returns the index of the triangle behind the last triangle in the given solid More... | |
StlMesh () | |
initializes an empty mesh More... | |
StlMesh (const char *filename) | |
initializes the mesh from the stl-file specified through filename More... | |
const TNumber * | tri_corner_coords (const size_t ti, const size_t ci) const |
returns an array of 3 floating point values, one for each coordinate of the specified corner of the specified tri. More... | |
const TIndex | tri_corner_ind (const size_t ti, const size_t ci) const |
returns the index of the corner with index 0<=ci<3 of triangle ti More... | |
const TIndex * | tri_corner_inds (const size_t ti) const |
returns an array of 3 indices, one for each corner vertex of the triangle More... | |
const TNumber * | tri_normal (const size_t ti) const |
returns an array of 3 floating point values defining the normal of a tri More... | |
const TNumber * | vrt_coords (const size_t vi) const |
returns an array of 3 floating point values, one for each coordinate of the vertex More... | |
Private Attributes | |
std::vector< TNumber > | coords |
std::vector< TNumber > | normals |
std::vector< TIndex > | solids |
std::vector< TIndex > | tris |
convenience mesh class which makes accessing the stl data more easy
|
inline |
initializes an empty mesh
References stl_reader::StlMesh< TNumber, TIndex >::solids.
|
inline |
initializes the mesh from the stl-file specified through filename
References stl_reader::StlMesh< TNumber, TIndex >::read_file().
|
inline |
returns the number of solids of the mesh
solids can be seen as a partitioning of the triangles of a mesh. By iterating consecutively from the index of the first triangle of a solid si
(using solid_tris_begin(si)
) to the index of the last triangle of a solid (using solid_tris_end(...)-1
), one visits all triangles of the solid si
.
References stl_reader::StlMesh< TNumber, TIndex >::solids.
|
inline |
returns the number of triangles in the mesh
References stl_reader::StlMesh< TNumber, TIndex >::tris.
|
inline |
returns the number of vertices in the mesh
References stl_reader::StlMesh< TNumber, TIndex >::coords.
|
inline |
returns a pointer to the coordinate array, containing num_vrts()*3
entries.
Storage layout: x0,y0,z0,x1,y1,z1,...
NULL
if no coords exist. References stl_reader::StlMesh< TNumber, TIndex >::coords.
|
inline |
returns a pointer to the normal array, containing num_tris()*3
entries.
Storage layout: nx0,ny0,nz0,nx1,ny1,nz1,...
NULL
if no normals exist. References stl_reader::StlMesh< TNumber, TIndex >::normals.
|
inline |
returns a pointer to the solids array, containing num_solids()+1
entries.
Storage layout: s0begin, s0end/s1begin, s1end/s2begin, ..., sNend
NULL
if no solids exist. References stl_reader::StlMesh< TNumber, TIndex >::solids.
|
inline |
returns a pointer to the triangle array, containing num_tris()*3
entries.
Storage layout: t0c0,t0c1,t0c2,t1c0,t1c1,t1c2,...
NULL
if no tris exist. References stl_reader::StlMesh< TNumber, TIndex >::tris.
|
inline |
fills the mesh with the contents of the specified stl-file
References stl_reader::StlMesh< TNumber, TIndex >::coords, stl_reader::StlMesh< TNumber, TIndex >::normals, stl_reader::ReadStlFile(), stl_reader::StlMesh< TNumber, TIndex >::solids, STL_READER_THROW, and stl_reader::StlMesh< TNumber, TIndex >::tris.
Referenced by stl_reader::StlMesh< TNumber, TIndex >::StlMesh().
|
inline |
returns the index of the first triangle in the given solid
References stl_reader::StlMesh< TNumber, TIndex >::solids.
|
inline |
returns the index of the triangle behind the last triangle in the given solid
References stl_reader::StlMesh< TNumber, TIndex >::solids.
|
inline |
returns an array of 3 floating point values, one for each coordinate of the specified corner of the specified tri.
StlMesh mesh
: References stl_reader::StlMesh< TNumber, TIndex >::coords, and stl_reader::StlMesh< TNumber, TIndex >::tri_corner_ind().
|
inline |
returns the index of the corner with index 0<=ci<3
of triangle ti
References stl_reader::StlMesh< TNumber, TIndex >::tris.
Referenced by stl_reader::StlMesh< TNumber, TIndex >::tri_corner_coords().
|
inline |
returns an array of 3 indices, one for each corner vertex of the triangle
References stl_reader::StlMesh< TNumber, TIndex >::tris.
|
inline |
returns an array of 3 floating point values defining the normal of a tri
References stl_reader::StlMesh< TNumber, TIndex >::normals.
|
inline |
returns an array of 3 floating point values, one for each coordinate of the vertex
References stl_reader::StlMesh< TNumber, TIndex >::coords.
|
private |
|
private |
|
private |
Referenced by stl_reader::StlMesh< TNumber, TIndex >::num_solids(), stl_reader::StlMesh< TNumber, TIndex >::raw_solids(), stl_reader::StlMesh< TNumber, TIndex >::read_file(), stl_reader::StlMesh< TNumber, TIndex >::solid_tris_begin(), stl_reader::StlMesh< TNumber, TIndex >::solid_tris_end(), and stl_reader::StlMesh< TNumber, TIndex >::StlMesh().
|
private |