cgv
Loading...
Searching...
No Matches
cgv::media::mesh::streaming_mesh< T > Class Template Reference

class used to perform the marching cubes algorithm More...

#include <streaming_mesh.h>

Public Types

typedef cgv::math::fvec< T, 3 > pnt_type
 type of vertex locations
 
typedef cgv::math::fvec< T, 3 > vec_type
 type of vertex normals
 

Public Member Functions

 streaming_mesh (streaming_mesh_callback_handler *_smcbh=0)
 construct from callback handler
 
void set_callback_handler (streaming_mesh_callback_handler *_smcbh)
 set a new callback handler
 
unsigned int get_nr_dropped_vertices () const
 return the number of vertices dropped from the front, what is used as index offset into a deque
 
unsigned int get_nr_vertices () const
 return the number of vertices
 
unsigned int get_nr_faces () const
 return the number of faces
 
void drop_vertex ()
 drop the front most vertex from the deque
 
void drop_vertices (unsigned int n)
 drop n vertices from the front of the deque
 
pnt_typevertex_location (unsigned int vi)
 write access to vertex locations
 
const pnt_typevertex_location (unsigned int vi) const
 read access to vertex locations
 
const vec_typevertex_normal (unsigned int vi) const
 read access to vertex normals
 
vec_typevertex_normal (unsigned int vi)
 write access to vertex normals
 
unsigned int new_vertex (const pnt_type &p)
 add a new vertex with the given location and call the callback of the callback handler
 
void new_triangle (unsigned int vi, unsigned int vj, unsigned int vk)
 construct a new triangle by calling the new polygon method of the callback handler
 
void new_quad (unsigned int vi, unsigned int vj, unsigned int vk, unsigned int vl)
 construct a new quad by calling the new polygon method of the callback handler
 
void new_polygon (const std::vector< unsigned int > &vertex_indices)
 construct a new polygon by calling the new polygon method of the callback handler
 

Protected Attributes

int idx_off
 offset used to address vertices in deque
 
unsigned int nr_faces
 count the number of faces
 
std::deque< pnt_typepnts
 store currently used points in deque
 
std::deque< vec_typenmls
 store currently used normals in deque
 
streaming_mesh_callback_handlersmcbh
 store a pointer to the callback handler
 

Detailed Description

template<typename T>
class cgv::media::mesh::streaming_mesh< T >

class used to perform the marching cubes algorithm

Definition at line 24 of file streaming_mesh.h.

Member Typedef Documentation

◆ pnt_type

template<typename T >
typedef cgv::math::fvec<T,3> cgv::media::mesh::streaming_mesh< T >::pnt_type

type of vertex locations

Definition at line 28 of file streaming_mesh.h.

◆ vec_type

template<typename T >
typedef cgv::math::fvec<T,3> cgv::media::mesh::streaming_mesh< T >::vec_type

type of vertex normals

Definition at line 30 of file streaming_mesh.h.

Constructor & Destructor Documentation

◆ streaming_mesh()

template<typename T >
cgv::media::mesh::streaming_mesh< T >::streaming_mesh ( streaming_mesh_callback_handler _smcbh = 0)
inline

construct from callback handler

Definition at line 44 of file streaming_mesh.h.

Member Function Documentation

◆ drop_vertex()

◆ drop_vertices()

template<typename T >
void cgv::media::mesh::streaming_mesh< T >::drop_vertices ( unsigned int  n)
inline

drop n vertices from the front of the deque

Definition at line 67 of file streaming_mesh.h.

References cgv::media::mesh::streaming_mesh< T >::drop_vertex().

◆ get_nr_dropped_vertices()

template<typename T >
unsigned int cgv::media::mesh::streaming_mesh< T >::get_nr_dropped_vertices ( ) const
inline

return the number of vertices dropped from the front, what is used as index offset into a deque

Definition at line 51 of file streaming_mesh.h.

References cgv::media::mesh::streaming_mesh< T >::idx_off.

◆ get_nr_faces()

template<typename T >
unsigned int cgv::media::mesh::streaming_mesh< T >::get_nr_faces ( ) const
inline

◆ get_nr_vertices()

template<typename T >
unsigned int cgv::media::mesh::streaming_mesh< T >::get_nr_vertices ( ) const
inline

◆ new_polygon()

template<typename T >
void cgv::media::mesh::streaming_mesh< T >::new_polygon ( const std::vector< unsigned int > &  vertex_indices)
inline

construct a new polygon by calling the new polygon method of the callback handler

Definition at line 110 of file streaming_mesh.h.

References cgv::media::mesh::streaming_mesh_callback_handler::new_polygon(), cgv::media::mesh::streaming_mesh< T >::nr_faces, and cgv::media::mesh::streaming_mesh< T >::smcbh.

◆ new_quad()

template<typename T >
void cgv::media::mesh::streaming_mesh< T >::new_quad ( unsigned int  vi,
unsigned int  vj,
unsigned int  vk,
unsigned int  vl 
)
inline

construct a new quad by calling the new polygon method of the callback handler

Definition at line 99 of file streaming_mesh.h.

References cgv::media::mesh::streaming_mesh_callback_handler::new_polygon(), cgv::media::mesh::streaming_mesh< T >::nr_faces, and cgv::media::mesh::streaming_mesh< T >::smcbh.

◆ new_triangle()

template<typename T >
void cgv::media::mesh::streaming_mesh< T >::new_triangle ( unsigned int  vi,
unsigned int  vj,
unsigned int  vk 
)
inline

construct a new triangle by calling the new polygon method of the callback handler

Definition at line 89 of file streaming_mesh.h.

References cgv::media::mesh::streaming_mesh_callback_handler::new_polygon(), cgv::media::mesh::streaming_mesh< T >::nr_faces, and cgv::media::mesh::streaming_mesh< T >::smcbh.

◆ new_vertex()

template<typename T >
unsigned int cgv::media::mesh::streaming_mesh< T >::new_vertex ( const pnt_type p)
inline

◆ set_callback_handler()

template<typename T >
void cgv::media::mesh::streaming_mesh< T >::set_callback_handler ( streaming_mesh_callback_handler _smcbh)
inline

set a new callback handler

Definition at line 47 of file streaming_mesh.h.

References cgv::media::mesh::streaming_mesh< T >::smcbh.

◆ vertex_location() [1/2]

◆ vertex_location() [2/2]

template<typename T >
const pnt_type & cgv::media::mesh::streaming_mesh< T >::vertex_location ( unsigned int  vi) const
inline

read access to vertex locations

Definition at line 74 of file streaming_mesh.h.

References cgv::media::mesh::streaming_mesh< T >::idx_off, and cgv::media::mesh::streaming_mesh< T >::pnts.

◆ vertex_normal() [1/2]

template<typename T >
vec_type & cgv::media::mesh::streaming_mesh< T >::vertex_normal ( unsigned int  vi)
inline

write access to vertex normals

Definition at line 78 of file streaming_mesh.h.

References cgv::media::mesh::streaming_mesh< T >::idx_off, and cgv::media::mesh::streaming_mesh< T >::nmls.

◆ vertex_normal() [2/2]

template<typename T >
const vec_type & cgv::media::mesh::streaming_mesh< T >::vertex_normal ( unsigned int  vi) const
inline

Member Data Documentation

◆ idx_off

◆ nmls

◆ nr_faces

◆ pnts

◆ smcbh


The documentation for this class was generated from the following file: