cgv
Loading...
Searching...
No Matches
cgv::media::mesh::dual_contouring< X, T > Class Template Reference

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

#include <dual_contouring.h>

Inheritance diagram for cgv::media::mesh::dual_contouring< X, T >:
cgv::media::mesh::streaming_mesh< X >

Public Types

typedef streaming_mesh< X > base_type
 
typedef cgv::math::fvec< X, 3 > pnt_type
 points must have three components
 
typedef cgv::math::fvec< X, 3 > vec_type
 vectors must have three components
 
typedef cgv::math::qem< X > qem_type
 qem type must have dimension three
 
typedef cell_info< X > cell_info_type
 qem type must have dimension three
 
- Public Types inherited from cgv::media::mesh::streaming_mesh< X >
typedef cgv::math::fvec< X, 3 > pnt_type
 type of vertex locations
 
typedef cgv::math::fvec< X, 3 > vec_type
 type of vertex normals
 

Public Member Functions

 dual_contouring (const cgv::math::v3_func< X, T > &_func, streaming_mesh_callback_handler *_smcbh, const X &_consistency_threshold=0.01f, unsigned int _max_nr_iters=10, const X &_epsilon=1e-6f)
 construct dual contouring object
 
void compute_cell_vertex (dc_slice_info< T > *info_ptr, int i, int j)
 construct a new vertex on an edge
 
void generate_quad (unsigned int vi, unsigned int vj, unsigned int vk, unsigned int vl, bool reorient)
 construct a quadrilateral
 
void compute_edge_point (const T &_v_1, const T &_v_2, int e, const pnt_type &p, const vec_type &d, pnt_type &q, vec_type &n)
 
void process_edge_plane (const T &v_1, const T &v_2, int e, cell_info_type *C1, cell_info_type *C2, cell_info_type *C3, cell_info_type *C4)
 construct plane through edge and add it to the incident qems
 
void process_slice (dc_slice_info< T > *prev_info_ptr, dc_slice_info< T > *info_ptr)
 process a slice
 
void process_slab (dc_slice_info< T > *info_ptr_1, dc_slice_info< T > *info_ptr_2)
 
void generate_slice_quads (dc_slice_info< T > *info_ptr_1, dc_slice_info< T > *info_ptr_2)
 
void extract (const T &_iso_value, const axis_aligned_box< X, 3 > &box, unsigned int _resx, unsigned int _resy, unsigned int _resz, bool show_progress=false)
 extract iso surface and send quads to dual contouring handler
 
- Public Member Functions inherited from cgv::media::mesh::streaming_mesh< X >
 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

const cgv::math::v3_func< X, T > & func
 
epsilon
 
unsigned int max_nr_iters
 
consistency_threshold
 
- Protected Attributes inherited from cgv::media::mesh::streaming_mesh< X >
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 X, typename T>
class cgv::media::mesh::dual_contouring< X, T >

class used to perform the marching cubes algorithm

Definition at line 83 of file dual_contouring.h.

Member Typedef Documentation

◆ base_type

template<typename X , typename T >
typedef streaming_mesh<X> cgv::media::mesh::dual_contouring< X, T >::base_type

Definition at line 86 of file dual_contouring.h.

◆ cell_info_type

template<typename X , typename T >
typedef cell_info<X> cgv::media::mesh::dual_contouring< X, T >::cell_info_type

qem type must have dimension three

Definition at line 94 of file dual_contouring.h.

◆ pnt_type

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

points must have three components

Definition at line 88 of file dual_contouring.h.

◆ qem_type

template<typename X , typename T >
typedef cgv::math::qem<X> cgv::media::mesh::dual_contouring< X, T >::qem_type

qem type must have dimension three

Definition at line 92 of file dual_contouring.h.

◆ vec_type

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

vectors must have three components

Definition at line 90 of file dual_contouring.h.

Constructor & Destructor Documentation

◆ dual_contouring()

template<typename X , typename T >
cgv::media::mesh::dual_contouring< X, T >::dual_contouring ( const cgv::math::v3_func< X, T > &  _func,
streaming_mesh_callback_handler _smcbh,
const X &  _consistency_threshold = 0.01f,
unsigned int  _max_nr_iters = 10,
const X &  _epsilon = 1e-6f 
)
inline

construct dual contouring object

Definition at line 107 of file dual_contouring.h.

References cgv::media::mesh::streaming_mesh< X >::set_callback_handler().

Member Function Documentation

◆ compute_cell_vertex()

template<typename X , typename T >
void cgv::media::mesh::dual_contouring< X, T >::compute_cell_vertex ( dc_slice_info< T > *  info_ptr,
int  i,
int  j 
)
inline

◆ compute_edge_point()

template<typename X , typename T >
void cgv::media::mesh::dual_contouring< X, T >::compute_edge_point ( const T &  _v_1,
const T &  _v_2,
int  e,
const pnt_type p,
const vec_type d,
pnt_type q,
vec_type n 
)
inline

Definition at line 136 of file dual_contouring.h.

◆ extract()

template<typename X , typename T >
void cgv::media::mesh::dual_contouring< X, T >::extract ( const T &  _iso_value,
const axis_aligned_box< X, 3 > &  box,
unsigned int  _resx,
unsigned int  _resy,
unsigned int  _resz,
bool  show_progress = false 
)
inline

◆ generate_quad()

template<typename X , typename T >
void cgv::media::mesh::dual_contouring< X, T >::generate_quad ( unsigned int  vi,
unsigned int  vj,
unsigned int  vk,
unsigned int  vl,
bool  reorient 
)
inline

construct a quadrilateral

Definition at line 128 of file dual_contouring.h.

References cgv::media::mesh::streaming_mesh< X >::new_quad().

◆ generate_slice_quads()

template<typename X , typename T >
void cgv::media::mesh::dual_contouring< X, T >::generate_slice_quads ( dc_slice_info< T > *  info_ptr_1,
dc_slice_info< T > *  info_ptr_2 
)
inline

Definition at line 271 of file dual_contouring.h.

◆ process_edge_plane()

template<typename X , typename T >
void cgv::media::mesh::dual_contouring< X, T >::process_edge_plane ( const T &  v_1,
const T &  v_2,
int  e,
cell_info_type C1,
cell_info_type C2,
cell_info_type C3,
cell_info_type C4 
)
inline

construct plane through edge and add it to the incident qems

Definition at line 202 of file dual_contouring.h.

References cgv::math::fvec< T, N >::to_vec().

Referenced by cgv::media::mesh::dual_contouring< X, T >::process_slice().

◆ process_slab()

template<typename X , typename T >
void cgv::media::mesh::dual_contouring< X, T >::process_slab ( dc_slice_info< T > *  info_ptr_1,
dc_slice_info< T > *  info_ptr_2 
)
inline

Definition at line 243 of file dual_contouring.h.

◆ process_slice()

template<typename X , typename T >
void cgv::media::mesh::dual_contouring< X, T >::process_slice ( dc_slice_info< T > *  prev_info_ptr,
dc_slice_info< T > *  info_ptr 
)
inline

Member Data Documentation

◆ consistency_threshold

template<typename X , typename T >
X cgv::media::mesh::dual_contouring< X, T >::consistency_threshold
protected

Definition at line 104 of file dual_contouring.h.

◆ epsilon

template<typename X , typename T >
X cgv::media::mesh::dual_contouring< X, T >::epsilon
protected

Definition at line 102 of file dual_contouring.h.

◆ func

template<typename X , typename T >
const cgv::math::v3_func<X,T>& cgv::media::mesh::dual_contouring< X, T >::func
protected

Definition at line 101 of file dual_contouring.h.

◆ max_nr_iters

template<typename X , typename T >
unsigned int cgv::media::mesh::dual_contouring< X, T >::max_nr_iters
protected

Definition at line 103 of file dual_contouring.h.


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