28#ifndef __Ogre_Volume_DualGridGenerator_H__
29#define __Ogre_Volume_DualGridGenerator_H__
56 mC0(c0), mC1(c1), mC2(c2), mC3(c3), mC4(c4), mC5(c5), mC6(c6), mC7(c7)
119 addDualCell(c0, c1, c2, c3, c4, c5, c6, c7, 0);
148 mDualCells.push_back(
DualCell(c0, c1, c2, c3, c4, c5, c6, c7));
163 if (corners[0].z == from.
z && corners[0].
z != mTotalFrom.
z)
167 if (corners[2].z == to.
z && corners[2].
z != mTotalTo.
z)
171 if (corners[0].x == from.
x && corners[0].
x != mTotalFrom.
x)
175 if (corners[1].x == to.
x && corners[1].
x != mTotalTo.
x)
179 if (corners[5].y == to.
y && corners[5].
y != mTotalTo.
y)
183 if (corners[0].y == from.
y && corners[0].
y != mTotalFrom.
y)
336 return mDualCells.size();
347 return mDualCells[i];
#define _OgreVolumeExport
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Defines an instance of a discrete, movable object based on a Mesh.
Manages the organisation and rendering of a 'scene' i.e.
Standard 3-dimensional vector.
4-dimensional homogeneous vector.
Class for the generation of the DualGrid.
void faceProcZY(const OctreeNode *n0, const OctreeNode *n1)
void addDualCell(const Vector3 &c0, const Vector3 &c1, const Vector3 &c2, const Vector3 &c3, const Vector3 &c4, const Vector3 &c5, const Vector3 &c6, const Vector3 &c7)
Adds a dualcell.
DualGridGenerator(void)
Constructor.
Real mMaxMSDistance
The maximum distance where to generate the skirts.
void faceProcXZ(const OctreeNode *n0, const OctreeNode *n1)
void edgeProcX(const OctreeNode *n0, const OctreeNode *n1, const OctreeNode *n2, const OctreeNode *n3)
edgeProc with variing X of the nodes, see the paper for edgeProc().
OctreeNode const * mRoot
Starting node to generate the grid from.
void createBorderCells(const OctreeNode *n0, const OctreeNode *n1, const OctreeNode *n2, const OctreeNode *n3, const OctreeNode *n4, const OctreeNode *n5, const OctreeNode *n6, const OctreeNode *n7)
Entity * getDualGrid(SceneManager *sceneManager)
Gets the lazily created entity of the dualgrid debug visualization.
Entity * mDualGrid
The entity for the debug visualization of the grid.
Vector3 mTotalTo
The total to.
void generateDualGrid(const OctreeNode *root, IsoSurface *is, MeshBuilder *mb, Real maxMSDistance, const Vector3 &totalFrom, const Vector3 &totalTo, bool saveDualCells)
Generates the dualgrid of the given octree root node.
size_t getDualCellCount(void) const
Gets the amount of generated dual cells.
bool mSaveDualCells
Whether to store the dualcells for later visualization.
Vector3 mTotalFrom
The global from.
void addDualCell(const Vector3 &c0, const Vector3 &c1, const Vector3 &c2, const Vector3 &c3, const Vector3 &c4, const Vector3 &c5, const Vector3 &c6, const Vector3 &c7, Vector4 *values)
Adds a dualcell with precalculated values.
void faceProcXY(const OctreeNode *n0, const OctreeNode *n1)
static size_t mDualGridI
To give the debug manual object an unique name.
IsoSurface * mIs
To contour the dualcells.
MeshBuilder * mMb
To store the triangles of the contour.
void edgeProcZ(const OctreeNode *n0, const OctreeNode *n1, const OctreeNode *n2, const OctreeNode *n3)
edgeProc with variing Z of the nodes, see the paper for edgeProc().
void vertProc(const OctreeNode *n0, const OctreeNode *n1, const OctreeNode *n2, const OctreeNode *n3, const OctreeNode *n4, const OctreeNode *n5, const OctreeNode *n6, const OctreeNode *n7)
void nodeProc(const OctreeNode *n)
void edgeProcY(const OctreeNode *n0, const OctreeNode *n1, const OctreeNode *n2, const OctreeNode *n3)
edgeProc with variing Y of the nodes, see the paper for edgeProc().
DualCell getDualCell(size_t i) const
Gets a dual cell.
VecDualCell mDualCells
Holds the generated dual cells of the grid.
virtual void addMarchingCubesTriangles(const Vector3 *corners, const Vector4 *volumeValues, MeshBuilder *mb) const =0
Adds triangles to a MeshBuilder via Marching Cubes.
static const size_t MS_CORNERS_TOP[4]
To call Marching Squares with a cube on its top.
static const size_t MS_CORNERS_FRONT[4]
To call Marching Squares with a cube on its front.
static const size_t MS_CORNERS_BACK[4]
To call Marching Squares with a cube on its back.
virtual void addMarchingSquaresTriangles(const Vector3 *corners, const Vector4 *volumeValues, const size_t *indices, const Real maxDistance, MeshBuilder *mb) const =0
Adds triangles to a MeshBuilder via Marching Squares.
static const size_t MS_CORNERS_LEFT[4]
To call Marching Squares with a cube on its left.
static const size_t MS_CORNERS_BOTTOM[4]
To call Marching Squares with a cube on its bottom.
static const size_t MS_CORNERS_RIGHT[4]
To call Marching Squares with a cube on its right.
Class to build up a mesh with vertices and indices.
A node in the volume octree.
const Vector3 & getTo(void) const
Gets the front upper right corner of the cell.
const Vector3 & getFrom(void) const
Gets the back lower left corner of the cell.
struct _OgreVolumeExport Ogre::Volume::DualCell DualCell
To store the generated dual cells in a vector.
vector< DualCell >::type VecDualCell
To hold dual cells.
float Real
Software floating point type.
To store the generated dual cells in a vector.
DualCell(const Vector3 &c0, const Vector3 &c1, const Vector3 &c2, const Vector3 &c3, const Vector3 &c4, const Vector3 &c5, const Vector3 &c6, const Vector3 &c7)