12 #ifndef ROOT_TGLMarchingCubes
13 #define ROOT_TGLMarchingCubes
21 #ifndef ROOT_TGLIsoMesh
24 #ifndef ROOT_TKDEAdapter
172 template<
class H,
class E>
200 fSrc = hist->GetArray();
201 fW = hist->GetNbinsX() + 2;
202 fH = hist->GetNbinsY() + 2;
203 fD = hist->GetNbinsZ() + 2;
321 template<
class E,
class V>
324 const V delta = val2 - val1;
327 return (iso - val1) / delta;
330 template<
class H,
class E,
class V>
337 V
x, V
y, V z, V iso)
const
341 cell.
fVals[eConn[i][1]],
343 v[0] = x + (vOff[eConn[i][0]][0] + offset * eDir[i][0]) * this->
fStepX;
344 v[1] = y + (vOff[eConn[i][0]][1] + offset * eDir[i][1]) * this->
fStepY;
345 v[2] = z + (vOff[eConn[i][0]][2] + offset * eDir[i][2]) * this->
fStepZ;
431 template<
class DataSource,
class ValueType>
441 using DataSourceBase_t::GetW;
442 using DataSourceBase_t::GetH;
443 using DataSourceBase_t::GetD;
445 using SplitterBase_t::SplitEdge;
460 MeshType_t *mesh, ValueType iso);
471 SliceType_t *curr)
const;
474 void BuildRow(SliceType_t *slice)
const;
475 void BuildCol(SliceType_t *slice)
const;
478 SliceType_t *slice)
const;
480 SliceType_t *slice)
const;
482 SliceType_t *slice)
const;
484 SliceType_t *slice)
const;
TH3Adapter< TH3D, Double_t > Type_t
TSlice< ElementType_t > SliceType_t
void ResizeSlice(UInt_t w, UInt_t h)
TDefaultSplitter< TH3C, Char_t, V > Type_t
3-D histogram with a float per channel (see TH1 documentation)}
TH3Adapter< TH3C, Char_t > Type_t
void BuildRow(SliceType_t *slice) const
The first row (along x) in the first slice: ny == 0, nz == 0, nx : [1, W - 1].
TH3Adapter< TH3S, Short_t > Type_t
void SetDataSource(const TF3 *f)
void SplitEdge(TCell< Double_t > &cell, TIsoMesh< Double_t > *mesh, UInt_t i, Double_t x, Double_t y, Double_t z, Double_t iso) const
Split the edge and find normal in a new vertex.
void SetNormalEvaluator(const H *)
TDefaultSplitter< TH3F, Float_t, V > Type_t
TMeshBuilder(Bool_t averagedNormals, ValueType eps=1e-7)
const Float_t eDir[12][3]
TDefaultSplitter< TH3D, Double_t, V > Type_t
void BuildFirstCube(SliceType_t *slice) const
The first cube in a grid. nx == 0, ny == 0, nz ==0.
V GetOffset(E val1, E val2, V iso)
UInt_t AddVertex(const V *v)
void BuildCol(SliceType_t *slice) const
"Col" (column) consists of cubes along y axis on the first slice (nx == 0, nz == 0).
TH3Adapter< TH3F, Float_t > Type_t
TDefaultSplitter< TKDEFGT, Float_t, Float_t > Type_t
TSourceAdapterSelector< DataSource >::Type_t DataSourceBase_t
const Int_t conTbl[256][16]
TDefaultSplitter< TH3S, Short_t, V > Type_t
3-D histogram with a int per channel (see TH1 documentation)}
void BuildSlice(SliceType_t *slice) const
Slice with nz == 0.
3-D histogram with a short per channel (see TH1 documentation)
Double_t GetData(UInt_t i, UInt_t j, UInt_t k) const
const ElementType_t * fSrc
TDefaultSplitter< TH3I, Int_t, V > Type_t
TMeshBuilder & operator=(const TMeshBuilder &rhs)
void SetNormalEvaluator(const TF3 *tf3)
3-D histogram with a double per channel (see TH1 documentation)}
A 3-Dim function with parameters.
void SplitEdge(TCell< E > &cell, TIsoMesh< V > *mesh, UInt_t i, V x, V y, V z, V iso) const
TSplitterSelector< DataSource, ValueType >::Type_t SplitterBase_t
void SetDataSource(const H *hist)
TSlice & operator=(const TSlice &rhs)
void NextStep(UInt_t depth, const SliceType_t *prevSlice, SliceType_t *curr) const
Fill slice with vertices and triangles.
std::vector< TCell< V > > fCells
void FetchDensities() const
3-D histogram with a bype per channel (see TH1 documentation)
TCell< ElementType_t > CellType_t
const UChar_t eConn[12][2]
void FetchDensities() const
void BuildMesh(const DataSource *src, const TGridGeometry< ValueType > &geom, MeshType_t *mesh, ValueType iso)
Build iso-mesh using marching cubes.
TIsoMesh< ValueType > MeshType_t
ElementType_t GetData(UInt_t i, UInt_t j, UInt_t k) const
DataSourceBase_t::ElementType_t ElementType_t
void GetData(std::string s, double *x, double *y, double *ey)
TH3Adapter< TH3I, Int_t > Type_t
void BuildNormals() const
Build averaged normals using vertices and trinagles.