ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 432 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 TSourceAdapterSelector
< DataSource >::Type_t 
DataSourceBase_t
 
typedef TSplitterSelector
< DataSource, ValueType >
::Type_t 
SplitterBase_t
 
typedef
DataSourceBase_t::ElementType_t 
ElementType_t
 
typedef TCell< ElementType_tCellType_t
 
typedef TSlice< ElementType_tSliceType_t
 
typedef TIsoMesh< ValueType > MeshType_t
 

Private Member Functions

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

Private Attributes

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

#include <TGLMarchingCubes.h>

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

Member Typedef Documentation

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

Definition at line 449 of file TGLMarchingCubes.h.

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

Definition at line 437 of file TGLMarchingCubes.h.

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

Definition at line 447 of file TGLMarchingCubes.h.

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

Definition at line 451 of file TGLMarchingCubes.h.

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

Definition at line 450 of file TGLMarchingCubes.h.

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

Definition at line 438 of file TGLMarchingCubes.h.

Constructor & Destructor Documentation

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

Definition at line 454 of file TGLMarchingCubes.h.

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

Member Function Documentation

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.

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.

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.

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.

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.

Referenced by TGL5DPainter::AddSurface(), TGLTF3Painter::InitGeometry(), TGL5DPainter::ResetGeometryRanges(), and TGLIsoPainter::SetMesh().

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.

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.

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.

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.

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.

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.

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

Member Data Documentation

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

Definition at line 464 of file TGLMarchingCubes.h.

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

Definition at line 468 of file TGLMarchingCubes.h.

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

Definition at line 467 of file TGLMarchingCubes.h.

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

Definition at line 466 of file TGLMarchingCubes.h.

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

Definition at line 465 of file TGLMarchingCubes.h.

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

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