cgv
|
convenience mesh class which makes accessing the stl data more easy More...
#include <stl_reader.h>
Public Member Functions | |
StlMesh () | |
initializes an empty mesh | |
size_t | num_vrts () const |
returns the number of vertices in the mesh | |
const TNumber * | vrt_coords (const size_t vi) const |
returns an array of 3 floating point values, one for each coordinate of the vertex | |
size_t | num_tris () const |
returns the number of triangles in the mesh | |
const TIndex * | tri_corner_inds (const size_t ti) const |
returns an array of 3 indices, one for each corner vertex of the triangle | |
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 | |
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. | |
const TNumber * | tri_normal (const size_t ti) const |
returns an array of 3 floating point values defining the normal of a tri | |
size_t | num_solids () const |
returns the number of solids of the mesh | |
TIndex | solid_tris_begin (const size_t si) const |
returns the index of the first triangle in the given solid | |
TIndex | solid_tris_end (const size_t si) const |
returns the index of the triangle behind the last triangle in the given solid | |
const TNumber * | raw_coords () const |
returns a pointer to the coordinate array, containing num_vrts()*3 entries. | |
const TNumber * | raw_normals () const |
returns a pointer to the normal array, containing num_tris()*3 entries. | |
const TIndex * | raw_tris () const |
returns a pointer to the triangle array, containing num_tris()*3 entries. | |
const TIndex * | raw_solids () const |
returns a pointer to the solids array, containing num_solids()+1 entries. | |
StlMesh (const char *filename) | |
initializes the mesh from the stl-file specified through filename | |
StlMesh (const std::string &filename) | |
bool | read_file (const char *filename) |
fills the mesh with the contents of the specified stl-file | |
bool | read_file (const std::string &filename) |
convenience mesh class which makes accessing the stl data more easy
Definition at line 235 of file stl_reader.h.
|
inline |
initializes an empty mesh
Definition at line 238 of file stl_reader.h.
|
inline |
initializes the mesh from the stl-file specified through filename
Definition at line 245 of file stl_reader.h.
References stl_reader::StlMesh< TNumber, TIndex >::read_file().
|
inline |
Definition at line 250 of file stl_reader.h.
|
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
.
Definition at line 344 of file stl_reader.h.
|
inline |
returns the number of triangles in the mesh
Definition at line 303 of file stl_reader.h.
Referenced by cgv::media::mesh::simple_mesh< T >::read().
|
inline |
returns the number of vertices in the mesh
Definition at line 291 of file stl_reader.h.
Referenced by cgv::media::mesh::simple_mesh< T >::read().
|
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. Definition at line 366 of file stl_reader.h.
|
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. Definition at line 376 of file stl_reader.h.
Referenced by cgv::media::mesh::simple_mesh< T >::read().
|
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. Definition at line 396 of file stl_reader.h.
|
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. Definition at line 386 of file stl_reader.h.
|
inline |
fills the mesh with the contents of the specified stl-file
Definition at line 258 of file stl_reader.h.
References stl_reader::StlMesh< TNumber, TIndex >::read_file(), stl_reader::ReadStlFile(), and STL_READER_THROW.
Referenced by stl_reader::StlMesh< TNumber, TIndex >::read_file(), and stl_reader::StlMesh< TNumber, TIndex >::StlMesh().
|
inline |
Definition at line 284 of file stl_reader.h.
|
inline |
returns the index of the first triangle in the given solid
Definition at line 352 of file stl_reader.h.
|
inline |
returns the index of the triangle behind the last triangle in the given solid
Definition at line 358 of file stl_reader.h.
|
inline |
returns an array of 3 floating point values, one for each coordinate of the specified corner of the specified tri.
StlMesh mesh
: Definition at line 327 of file stl_reader.h.
References stl_reader::StlMesh< TNumber, TIndex >::tri_corner_ind().
|
inline |
returns the index of the corner with index 0<=ci<3
of triangle ti
Definition at line 315 of file stl_reader.h.
Referenced by cgv::media::mesh::simple_mesh< T >::read(), and stl_reader::StlMesh< TNumber, TIndex >::tri_corner_coords().
|
inline |
returns an array of 3 indices, one for each corner vertex of the triangle
Definition at line 309 of file stl_reader.h.
|
inline |
returns an array of 3 floating point values defining the normal of a tri
Definition at line 333 of file stl_reader.h.
Referenced by cgv::media::mesh::simple_mesh< T >::read().
|
inline |
returns an array of 3 floating point values, one for each coordinate of the vertex
Definition at line 297 of file stl_reader.h.
Referenced by cgv::media::mesh::simple_mesh< T >::read().