|
My Project
|
building triangles from 3d grid data. More...
#include <IsoSurfaceBuilder.h>
Classes | |
| struct | GridCell |
| Grid cell. More... | |
| struct | IsoTriangle |
| Definition of a triangle in an iso surface. More... | |
Public Types | |
| enum | SurfaceFlags { GEN_NORMALS = 0x01, GEN_VERTEX_COLOURS = 0x02, GEN_TEX_COORDS = 0x04 } |
| Flags describing what data is generated for rendering the iso surface. More... | |
| enum | NormalType { NORMAL_WEIGHTED_AVERAGE, NORMAL_AVERAGE, NORMAL_GRADIENT } |
Public Member Functions | |
| IsoSurfaceBuilder () | |
| Constructor. | |
| virtual | ~IsoSurfaceBuilder () |
| Virtual Destructor. | |
| virtual void | initialize (DataGrid *dg, int flags) |
| Initializes the iso surface. More... | |
| void | update (IsoSurfaceRenderable *isr) |
| Rebuilds the iso surface, and updates the IsoSurfaceRenderable. | |
| DataGrid * | getDataGrid () |
| Returns the pointer to the data grid. | |
| float | getIsoValue () const |
| Returns the iso value of the surface. | |
| void | setIsoValue (float isoValue) |
| Sets the iso value of the surface. | |
| bool | getFlipNormals () const |
| Returns whether normals are flipped. | |
| void | setFlipNormals (bool flipNormals) |
| Sets whether to flip normals. More... | |
| NormalType | getNormalType () const |
| Gets the method used for normal generation. | |
| void | setNormalType (NormalType normalType) |
| Sets the method used for normal generation. | |
| virtual int | getNumIsoVertices () |
| Returns the total number of iso vertices to be allocated. | |
| virtual void | createGridCellIsoVertices () |
| Creates and initializes the iso vertex index arrays of all grid cells. | |
| virtual void | buildIsoSurface () |
| Builds the iso surface by looping through all grid cells generating triangles. | |
Public Attributes | |
| int | mNumIsoVertices |
| The number of iso vertices, calculated on first call of getNumIsoVertices(). | |
| int | isoVertexGroupOffsets [3] |
| Array with offsets to the different iso vertex groups. | |
Protected Types | |
| typedef std::vector< int > | IsoVertexVector |
| typedef std::vector< IsoTriangle > | IsoTriangleVector |
Protected Member Functions | |
| void | createIsoVertices () |
| Creates the iso vertex arrays. More... | |
| void | createGridCells () |
| Creates and initializes the grid cells. More... | |
| void | destroyGridCells () |
| Destroys the grid cells, including their iso vertex index arrays. | |
| int | useIsoVertex (int isoVertex, int corner0, int corner1) |
| Calculates properties of the iso vertex. More... | |
| void | addIsoTriangle (const IsoTriangle &isoTriangle) |
| ... | |
Protected Attributes | |
| DataGridPtr | mDataGrid |
| Reference-counted shared pointer to the data grid associated with this iso surface. | |
| int | mSurfaceFlags |
| Flags describing what data is generated for rendering the iso surface (see IsoSurface::SurfaceFlags). | |
| float | mIsoValue |
| Iso value of the surface, the default is 1.0. | |
| bool | mFlipNormals |
| Flip normals of the surface, the default is false. | |
| NormalType | mNormalType |
| The method used for normal generation. | |
| int * | mIsoVertexIndices |
| Hardware vertex buffer indices for all iso vertices. More... | |
| Vector3 * | mIsoVertexPositions |
| Positions of all iso vertices. More... | |
| Vector3 * | mIsoVertexNormals |
| Normals for all iso vertices. More... | |
| Color * | mIsoVertexColours |
| Vertex colours for all iso vertices. More... | |
| Vector2 * | mIsoVertexTexCoords |
| Texture coordinates for all iso vertices. More... | |
| GridCell * | mGridCells |
| Array of grid cells. | |
| IsoVertexVector | mIsoVertices |
| Vector to which the indices of all used iso vertices are added. More... | |
| IsoTriangleVector | mIsoTriangles |
| Vector to which all generated iso triangles are added. More... | |
Static Protected Attributes | |
| static const int | msEdgeTable [256] |
| ... More... | |
| static const int | msTriangleTable [256][16] |
| ... | |
Friends | |
| class | IsoSurfaceRenderable |
building triangles from 3d grid data.
It uses the matching cubes algorithm.
Flags describing what data is generated for rendering the iso surface.
|
protected |
Creates and initializes the grid cells.
|
protected |
Creates the iso vertex arrays.
|
virtual |
Initializes the iso surface.
| dataGridPtr | Pointer to the data grid to use for iso surface generation. |
| flags | Flags describing what data is generated for rendering the iso surface (see IsoSurface::SurfaceFlags). |
|
inline |
Sets whether to flip normals.
|
protected |
Calculates properties of the iso vertex.
| isoVertex | Index of the iso vertex to use. |
| corner0 | Index of the first data grid value associated with the iso vertex. |
| corner1 | Index of the second data grid value associated with the iso vertex. |
|
protected |
Vector to which all generated iso triangles are added.
|
protected |
Vertex colours for all iso vertices.
|
protected |
Hardware vertex buffer indices for all iso vertices.
|
protected |
Normals for all iso vertices.
|
protected |
Positions of all iso vertices.
|
protected |
Texture coordinates for all iso vertices.
|
protected |
Vector to which the indices of all used iso vertices are added.
|
staticprotected |
...
the predefined values in the matching cube algorithm.
1.8.12