Logo ROOT   6.14/05
Reference Guide
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Rgl::Mc::TMeshBuilder< DataSource, ValueType > Class Template Reference

template<class DataSource, class ValueType>
class Rgl::Mc::TMeshBuilder< DataSource, ValueType >

Definition at line 426 of file TGLMarchingCubes.h.

Public Member Functions

 TMeshBuilder (Bool_t averagedNormals, ValueType eps=1e-7)
 
void BuildMesh (const DataSource *src, const TGridGeometry< ValueType > &geom, MeshType_t *mesh, ValueType iso)
 Build iso-mesh using marching cubes. More...
 

Private Types

typedef TCell< ElementType_tCellType_t
 
typedef TSourceAdapterSelector< DataSource >::Type_t DataSourceBase_t
 
typedef DataSourceBase_t::ElementType_t ElementType_t
 
typedef TIsoMesh< ValueType > MeshType_t
 
typedef TSlice< ElementType_tSliceType_t
 
typedef TSplitterSelector< DataSource, ValueType >::Type_t SplitterBase_t
 

Private Member Functions

 TMeshBuilder (const TMeshBuilder &rhs)
 
void BuildCol (SliceType_t *slice) const
 "Col" (column) consists of cubes along y axis on the first slice (nx == 0, nz == 0). More...
 
void BuildCol (UInt_t depth, const SliceType_t *prevSlice, SliceType_t *slice) const
 nz == depth, nx == 0, ny : [1, H - 1]. More...
 
void BuildFirstCube (SliceType_t *slice) const
 The first cube in a grid. nx == 0, ny == 0, nz ==0. More...
 
void BuildFirstCube (UInt_t depth, const SliceType_t *prevSlice, SliceType_t *slice) const
 The first cube in a slice with nz == depth. More...
 
void BuildNormals () const
 Build averaged normals using vertices and trinagles. More...
 
void BuildRow (SliceType_t *slice) const
 The first row (along x) in the first slice: ny == 0, nz == 0, nx : [1, W - 1]. More...
 
void BuildRow (UInt_t depth, const SliceType_t *prevSlice, SliceType_t *slice) const
 Row with ny == 0 and nz == depth, nx : [1, W - 1]. More...
 
void BuildSlice (SliceType_t *slice) const
 Slice with nz == 0. More...
 
void BuildSlice (UInt_t depth, const SliceType_t *prevSlice, SliceType_t *slice) const
 nz == depth, nx : [1, W - 1], ny : [1, H - 1]. More...
 
void NextStep (UInt_t depth, const SliceType_t *prevSlice, SliceType_t *curr) const
 Fill slice with vertices and triangles. More...
 
TMeshBuilderoperator= (const TMeshBuilder &rhs)
 

Private Attributes

Bool_t fAvgNormals
 
ValueType fEpsilon
 
ValueType fIso
 
MeshType_tfMesh
 
SliceType_t fSlices [2]
 

#include <TGLMarchingCubes.h>

Inheritance diagram for Rgl::Mc::TMeshBuilder< DataSource, ValueType >:
[legend]

Member Typedef Documentation

◆ CellType_t

template<class DataSource, class ValueType>
typedef TCell<ElementType_t> Rgl::Mc::TMeshBuilder< DataSource, ValueType >::CellType_t
private

Definition at line 443 of file TGLMarchingCubes.h.

◆ DataSourceBase_t

template<class DataSource, class ValueType>
typedef TSourceAdapterSelector<DataSource>::Type_t Rgl::Mc::TMeshBuilder< DataSource, ValueType >::DataSourceBase_t
private

Definition at line 431 of file TGLMarchingCubes.h.

◆ ElementType_t

template<class DataSource, class ValueType>
typedef DataSourceBase_t::ElementType_t Rgl::Mc::TMeshBuilder< DataSource, ValueType >::ElementType_t
private

Definition at line 441 of file TGLMarchingCubes.h.

◆ MeshType_t

template<class DataSource, class ValueType>
typedef TIsoMesh<ValueType> Rgl::Mc::TMeshBuilder< DataSource, ValueType >::MeshType_t
private

Definition at line 445 of file TGLMarchingCubes.h.

◆ SliceType_t

template<class DataSource, class ValueType>
typedef TSlice<ElementType_t> Rgl::Mc::TMeshBuilder< DataSource, ValueType >::SliceType_t
private

Definition at line 444 of file TGLMarchingCubes.h.

◆ SplitterBase_t

template<class DataSource, class ValueType>
typedef TSplitterSelector<DataSource, ValueType>::Type_t Rgl::Mc::TMeshBuilder< DataSource, ValueType >::SplitterBase_t
private

Definition at line 432 of file TGLMarchingCubes.h.

Constructor & Destructor Documentation

◆ TMeshBuilder() [1/2]

template<class DataSource, class ValueType>
Rgl::Mc::TMeshBuilder< DataSource, ValueType >::TMeshBuilder ( Bool_t  averagedNormals,
ValueType  eps = 1e-7 
)
inline

Definition at line 448 of file TGLMarchingCubes.h.

◆ TMeshBuilder() [2/2]

template<class DataSource, class ValueType>
Rgl::Mc::TMeshBuilder< DataSource, ValueType >::TMeshBuilder ( const TMeshBuilder< DataSource, ValueType > &  rhs)
private

Member Function Documentation

◆ BuildCol() [1/2]

template<class D , class V >
void Rgl::Mc::TMeshBuilder< D, V >::BuildCol ( SliceType_t s) const
private

"Col" (column) consists of cubes along y axis on the first slice (nx == 0, nz == 0).

Each cube has a previous cube and shares values: 0, 1, 4, 5 (in prev.: 3, 2, 7, 6); and edges: 0, 4, 8, 9 (in prev.: 2, 6, 10, 11).

Definition at line 336 of file TGLMarchingCubes.cxx.

◆ BuildCol() [2/2]

template<class D , class V >
void Rgl::Mc::TMeshBuilder< D, V >::BuildCol ( UInt_t  depth,
const SliceType_t prevSlice,
SliceType_t slice 
) const
private

nz == depth, nx == 0, ny : [1, H - 1].

Two neighbours - from previous slice ("bottom" cube) and previous cube in a column.

Definition at line 623 of file TGLMarchingCubes.cxx.

◆ BuildFirstCube() [1/2]

template<class D , class V >
void Rgl::Mc::TMeshBuilder< D, V >::BuildFirstCube ( SliceType_t slice) const
private

The first cube in a grid. nx == 0, ny == 0, nz ==0.

Definition at line 238 of file TGLMarchingCubes.cxx.

◆ BuildFirstCube() [2/2]

template<class D , class V >
void Rgl::Mc::TMeshBuilder< D, V >::BuildFirstCube ( UInt_t  depth,
const SliceType_t prevSlice,
SliceType_t slice 
) const
private

The first cube in a slice with nz == depth.

Neighbour is the first cube in the previous slice. Four values and four edges come from the previous cube.

Definition at line 480 of file TGLMarchingCubes.cxx.

◆ BuildMesh()

template<class D, class V>
void Rgl::Mc::TMeshBuilder< D, V >::BuildMesh ( const D *  src,
const TGridGeometry< V > &  geom,
MeshType_t mesh,
iso 
)

Build iso-mesh using marching cubes.

Definition at line 177 of file TGLMarchingCubes.cxx.

◆ BuildNormals()

template<class D , class V >
void Rgl::Mc::TMeshBuilder< D, V >::BuildNormals ( ) const
private

Build averaged normals using vertices and trinagles.

Definition at line 772 of file TGLMarchingCubes.cxx.

◆ BuildRow() [1/2]

template<class D , class V >
void Rgl::Mc::TMeshBuilder< D, V >::BuildRow ( SliceType_t s) const
private

The first row (along x) in the first slice: ny == 0, nz == 0, nx : [1, W - 1].

Each cube has previous cube. Values 0, 3, 4, 7 are taken from the previous cube. Edges 3, 7, 8, 11 are taken from the previous cube.

Definition at line 272 of file TGLMarchingCubes.cxx.

◆ BuildRow() [2/2]

template<class D , class V >
void Rgl::Mc::TMeshBuilder< D, V >::BuildRow ( UInt_t  depth,
const SliceType_t prevSlice,
SliceType_t slice 
) const
private

Row with ny == 0 and nz == depth, nx : [1, W - 1].

Two neighbours: one from previous slice (called bottom cube here), the second is the previous cube in a row.

Definition at line 546 of file TGLMarchingCubes.cxx.

◆ BuildSlice() [1/2]

template<class D , class V >
void Rgl::Mc::TMeshBuilder< D, V >::BuildSlice ( SliceType_t s) const
private

Slice with nz == 0.

nx : [1, W - 1], ny : [1, H - 1]. nx increased inside inner loop, ny - enclosing loop. Each cube has two neighbours: ny - 1 => "left", nx - 1 => "right".

Definition at line 404 of file TGLMarchingCubes.cxx.

◆ BuildSlice() [2/2]

template<class D , class V >
void Rgl::Mc::TMeshBuilder< D, V >::BuildSlice ( UInt_t  depth,
const SliceType_t prevSlice,
SliceType_t slice 
) const
private

nz == depth, nx : [1, W - 1], ny : [1, H - 1].

Each cube has 3 neighbours, "bottom" cube from the previous slice, "left" and "right" from the current slice.

Definition at line 697 of file TGLMarchingCubes.cxx.

◆ NextStep()

template<class D , class V >
void Rgl::Mc::TMeshBuilder< D, V >::NextStep ( UInt_t  depth,
const SliceType_t prevSlice,
SliceType_t curr 
) const
private

Fill slice with vertices and triangles.

Definition at line 217 of file TGLMarchingCubes.cxx.

◆ operator=()

template<class DataSource, class ValueType>
TMeshBuilder& Rgl::Mc::TMeshBuilder< DataSource, ValueType >::operator= ( const TMeshBuilder< DataSource, ValueType > &  rhs)
private

Member Data Documentation

◆ fAvgNormals

template<class DataSource, class ValueType>
Bool_t Rgl::Mc::TMeshBuilder< DataSource, ValueType >::fAvgNormals
private

Definition at line 458 of file TGLMarchingCubes.h.

◆ fEpsilon

template<class DataSource, class ValueType>
ValueType Rgl::Mc::TMeshBuilder< DataSource, ValueType >::fEpsilon
private

Definition at line 462 of file TGLMarchingCubes.h.

◆ fIso

template<class DataSource, class ValueType>
ValueType Rgl::Mc::TMeshBuilder< DataSource, ValueType >::fIso
private

Definition at line 461 of file TGLMarchingCubes.h.

◆ fMesh

template<class DataSource, class ValueType>
MeshType_t* Rgl::Mc::TMeshBuilder< DataSource, ValueType >::fMesh
private

Definition at line 460 of file TGLMarchingCubes.h.

◆ fSlices

template<class DataSource, class ValueType>
SliceType_t Rgl::Mc::TMeshBuilder< DataSource, ValueType >::fSlices[2]
private

Definition at line 459 of file TGLMarchingCubes.h.

Libraries for Rgl::Mc::TMeshBuilder< DataSource, ValueType >:
[legend]

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