Blender V2.61 - r43446
|
class to triangulate a scalar field, e.g. for More...
#include <isosurface.h>
Public Member Functions | |
IsoSurface (double iso) | |
virtual | ~IsoSurface () |
virtual void | initializeIsosurface (int setx, int sety, int setz, ntlVec3Gfx extent) |
void | resetAll (gfxReal val) |
void | triangulate (void) |
void | setParticles (ParticleTracer *pnt, float psize) |
void | setSubdivs (int s) |
int | getSubdivs () |
void | setUseFulledgeArrays (bool set) |
void | setStart (ntlVec3Gfx set) |
set geometry start (for renderer) | |
ntlVec3Gfx | getStart () |
void | setEnd (ntlVec3Gfx set) |
set geometry end (for renderer) | |
ntlVec3Gfx | getEnd () |
void | setIsolevel (double set) |
set iso level value for surface reconstruction | |
void | setSmoothSurface (float set) |
set loop subdiv num | |
void | setSmoothNormals (float set) |
float | getSmoothSurface () |
float | getSmoothNormals () |
virtual void | getTriangles (double t, vector< ntlTriangle > *triangles, vector< ntlVec3Gfx > *vertices, vector< ntlVec3Gfx > *normals, int objectId) |
virtual ntlVec3Gfx * | getBBStart () |
for easy GUI detection get start of axis aligned bounding box, return NULL of no BB | |
virtual ntlVec3Gfx * | getBBEnd () |
float * | getData () |
access data array | |
float * | getData (int ii, int jj, int kk) |
float * | lbmGetData (int ii, int jj, int kk) |
void | setCutoff (int set) |
set cut off border | |
void | setCutArray (int *set) |
set cut off border | |
unsigned int | getIsoVertexCount () |
OpenGL viz "interface". | |
unsigned int | getIsoIndexCount () |
char * | getIsoVertexArray () |
unsigned int * | getIsoIndexArray () |
void | setSmoothRad (float radi1, float radi2, ntlVec3Gfx mscc) |
void | smoothSurface (float val, bool smoothNorm) |
void | smoothNormals (float val) |
void | computeNormals () |
Protected Member Functions | |
ntlVec3Gfx | getNormal (int i, int j, int k) |
compute normal | |
bool | diffuseVertexField (ntlVec3Gfx *field, int pointerScale, int v, float invsigma2, ntlVec3Gfx &flt) |
smoothing helper function | |
Protected Attributes | |
int | mSizex |
size | |
int | mSizey |
int | mSizez |
float * | mpData |
data pointer | |
double | mIsoValue |
Level of the iso surface. | |
vector< IsoLevelVertex > | mPoints |
Store all the triangles vertices. | |
bool | mUseFullEdgeArrays |
use full arrays? (not for farfield) | |
int * | mpEdgeVerticesX |
Store indices of calculated points along the cubie edges. | |
int * | mpEdgeVerticesY |
int * | mpEdgeVerticesZ |
int | mEdgeArSize |
vector< unsigned int > | mIndices |
vector for all the triangles (stored as 3 indices) | |
ntlVec3Gfx | mStart |
start and end vectors for the triangulation region to create triangles in | |
ntlVec3Gfx | mEnd |
ntlVec3Gfx | mDomainExtent |
normalized domain extent from parametrizer/visualizer | |
bool | mInitDone |
initialized? | |
float | mSmoothSurface |
amount of surface smoothing | |
float | mSmoothNormals |
amount of normal smoothing | |
vector< int > | mAcrossEdge |
grid data | |
vector< vector< int > > | mAdjacentFaces |
int | mCutoff |
cutoff border area | |
int * | mCutArray |
cutoff heigh values | |
ParticleTracer * | mpIsoParts |
particle pointer | |
float | mPartSize |
particle size | |
int | mSubdivs |
no of subdivisions | |
vector< int > | flags |
trimesh vars | |
int | mFlagCnt |
vector< ntlVec3Gfx > | cornerareas |
vector< float > | pointareas |
vector< vector< int > > | neighbors |
vector< int > | mDboundary |
float | mSCrad1 |
float | mSCrad2 |
ntlVec3Gfx | mSCcenter |
class to triangulate a scalar field, e.g. for
Definition at line 41 of file isosurface.h.
IsoSurface::IsoSurface | ( | double | iso | ) |
Constructor
Definition at line 31 of file isosurface.cpp.
IsoSurface::~IsoSurface | ( | void | ) | [virtual] |
Destructor
Definition at line 123 of file isosurface.cpp.
References mpData, mpEdgeVerticesX, mpEdgeVerticesY, and mpEdgeVerticesZ.
void IsoSurface::computeNormals | ( | ) |
Definition at line 768 of file isosurface.cpp.
References cross(), i, mIndices, mPoints, norm(), normalize(), and normNoSqrt().
Referenced by triangulate().
bool IsoSurface::diffuseVertexField | ( | ntlVec3Gfx * | field, |
int | pointerScale, | ||
int | v, | ||
float | invsigma2, | ||
ntlVec3Gfx & | flt | ||
) | [protected] |
smoothing helper function
Definition at line 799 of file isosurface.cpp.
References dot(), flags, i, mDboundary, mFlagCnt, mPoints, mSCcenter, mSCrad1, mSCrad2, neighbors, normNoSqrt(), pointareas, size(), and sqrt().
Referenced by smoothNormals(), and smoothSurface().
virtual ntlVec3Gfx* IsoSurface::getBBEnd | ( | ) | [inline, virtual] |
virtual ntlVec3Gfx* IsoSurface::getBBStart | ( | ) | [inline, virtual] |
for easy GUI detection get start of axis aligned bounding box, return NULL of no BB
Reimplemented from ntlGeometryClass.
Definition at line 161 of file isosurface.h.
References mStart.
float* IsoSurface::getData | ( | ) | [inline] |
access data array
Definition at line 165 of file isosurface.h.
References mpData.
Referenced by getNormal(), LbmFsgrSolver::initializeSolverMemory(), and triangulate().
float* IsoSurface::getData | ( | int | ii, |
int | jj, | ||
int | kk | ||
) | [inline] |
Definition at line 166 of file isosurface.h.
References errMsg, ISOLEVEL_INDEX, ISOSTRICT_EXIT, mpData, mSizex, mSizey, and mSizez.
ntlVec3Gfx IsoSurface::getEnd | ( | ) | [inline] |
Definition at line 146 of file isosurface.h.
References mEnd.
unsigned int* IsoSurface::getIsoIndexArray | ( | ) | [inline] |
Definition at line 208 of file isosurface.h.
References mIndices.
Referenced by LbmSolverInterface::getIsoIndexArray().
unsigned int IsoSurface::getIsoIndexCount | ( | ) | [inline] |
Definition at line 202 of file isosurface.h.
References mIndices.
Referenced by LbmSolverInterface::getIsoIndexCount().
char* IsoSurface::getIsoVertexArray | ( | ) | [inline] |
Definition at line 205 of file isosurface.h.
References mPoints.
Referenced by LbmSolverInterface::getIsoVertexArray().
unsigned int IsoSurface::getIsoVertexCount | ( | ) | [inline] |
OpenGL viz "interface".
Definition at line 199 of file isosurface.h.
References mPoints.
Referenced by LbmSolverInterface::getIsoVertexCount().
ntlVec3Gfx IsoSurface::getNormal | ( | int | i, |
int | j, | ||
int | k | ||
) | [inline, protected] |
compute normal
Definition at line 739 of file isosurface.cpp.
References getData().
Referenced by triangulate().
float IsoSurface::getSmoothNormals | ( | ) | [inline] |
Definition at line 153 of file isosurface.h.
References mSmoothNormals.
Referenced by LbmFsgrSolver::initializeSolverPostinit().
float IsoSurface::getSmoothSurface | ( | ) | [inline] |
Definition at line 152 of file isosurface.h.
References mSmoothSurface.
Referenced by LbmFsgrSolver::initializeSolverPostinit().
ntlVec3Gfx IsoSurface::getStart | ( | ) | [inline] |
Definition at line 143 of file isosurface.h.
References mStart.
int IsoSurface::getSubdivs | ( | ) | [inline] |
Definition at line 68 of file isosurface.h.
References mSubdivs.
Referenced by LbmFsgrSolver::initializeSolverPostinit().
void IsoSurface::getTriangles | ( | double | t, |
vector< ntlTriangle > * | triangles, | ||
vector< ntlVec3Gfx > * | vertices, | ||
vector< ntlVec3Gfx > * | normals, | ||
int | objectId | ||
) | [virtual] |
Get the triangles from this object
Implements ntlGeometryObject.
Definition at line 664 of file isosurface.cpp.
References debugOut, errFatal, ntlGeometryObject::getCastShadows(), ntlGeometryClass::getGeoInitId(), ntlTriangle::getPoints(), ntlGeometryClass::getVisible(), i, ntlGeometryObject::mGeoInitType, mIndices, mInitDone, ntlGeometryClass::mName, mPoints, ntlTriangle::setFlags(), ntlTriangle::setNormal(), ntlTriangle::setObjectId(), ntlTriangle::setSmoothNormals(), SIMWORLD_GENERICERROR, smooth(), TRI_CASTSHADOWS, TRI_GEOMETRY, and triangulate().
void IsoSurface::initializeIsosurface | ( | int | setx, |
int | sety, | ||
int | setz, | ||
ntlVec3Gfx | extent | ||
) | [virtual] |
Init ararys etc.
Definition at line 57 of file isosurface.cpp.
References debMsgStd, DM_MSG, i, mDomainExtent, mEdgeArSize, mEnd, mIndices, mInitDone, mpData, mpEdgeVerticesX, mpEdgeVerticesY, mpEdgeVerticesZ, mPoints, mSizex, mSizey, mSizez, mStart, mSubdivs, mUseFullEdgeArrays, and nodes.
Referenced by LbmFsgrSolver::initializeSolverMemory().
float* IsoSurface::lbmGetData | ( | int | ii, |
int | jj, | ||
int | kk | ||
) | [inline] |
Definition at line 179 of file isosurface.h.
References errMsg, ISOLEVEL_INDEX, ISOSTRICT_EXIT, mpData, mSizex, mSizey, and mSizez.
Referenced by LbmFsgrSolver::notifySolverOfDump(), and LbmFsgrSolver::prepareVisualization().
void IsoSurface::resetAll | ( | gfxReal | val | ) |
Reset all values
Definition at line 114 of file isosurface.cpp.
References i, mpData, mSizex, mSizey, mSizez, nodes, and simple_enum_gen::val.
Referenced by LbmFsgrSolver::prepareVisualization().
void IsoSurface::setCutArray | ( | int * | set | ) | [inline] |
void IsoSurface::setCutoff | ( | int | set | ) | [inline] |
void IsoSurface::setEnd | ( | ntlVec3Gfx | set | ) | [inline] |
set geometry end (for renderer)
Definition at line 145 of file isosurface.h.
References mEnd.
Referenced by LbmFsgrSolver::initializeSolverMemory().
void IsoSurface::setIsolevel | ( | double | set | ) | [inline] |
set iso level value for surface reconstruction
Definition at line 148 of file isosurface.h.
References mIsoValue.
Referenced by LbmFsgrSolver::initializeSolverMemory().
void IsoSurface::setParticles | ( | ParticleTracer * | pnt, |
float | psize | ||
) | [inline] |
set particle pointer
Definition at line 62 of file isosurface.h.
References mPartSize, and mpIsoParts.
Referenced by LbmFsgrSolver::initializeSolverPostinit().
void IsoSurface::setSmoothNormals | ( | float | set | ) | [inline] |
Definition at line 151 of file isosurface.h.
References mSmoothNormals.
Referenced by LbmFsgrSolver::initializeSolverMemory().
void IsoSurface::setSmoothRad | ( | float | radi1, |
float | radi2, | ||
ntlVec3Gfx | mscc | ||
) |
Definition at line 761 of file isosurface.cpp.
void IsoSurface::setSmoothSurface | ( | float | set | ) | [inline] |
set loop subdiv num
Definition at line 150 of file isosurface.h.
References mSmoothSurface.
Referenced by LbmFsgrSolver::initializeSolverMemory().
void IsoSurface::setStart | ( | ntlVec3Gfx | set | ) | [inline] |
set geometry start (for renderer)
Definition at line 142 of file isosurface.h.
References mStart.
Referenced by LbmFsgrSolver::initializeSolverMemory().
void IsoSurface::setSubdivs | ( | int | s | ) | [inline] |
set # of subdivisions, this has to be done before init!
Definition at line 64 of file isosurface.h.
References errFatal, mInitDone, mSubdivs, and SIMWORLD_INITERROR.
Referenced by LbmFsgrSolver::initializeSolverMemory().
void IsoSurface::setUseFulledgeArrays | ( | bool | set | ) | [inline] |
set full edge settings, this has to be done before init!
Definition at line 70 of file isosurface.h.
References errFatal, mInitDone, mUseFullEdgeArrays, and SIMWORLD_INITERROR.
Referenced by LbmFsgrSolver::initializeSolverMemory().
void IsoSurface::smoothNormals | ( | float | val | ) |
Definition at line 1019 of file isosurface.cpp.
References cornerareas, cross(), diffuseVertexField(), dot(), credits_svn_gen::e, find(), flags, i, mIndices, mPoints, neighbors, norm(), normalize(), normNoSqrt(), and pointareas.
Referenced by triangulate().
void IsoSurface::smoothSurface | ( | float | val, |
bool | smoothNorm | ||
) |
Definition at line 858 of file isosurface.cpp.
References cornerareas, cross(), simple_enum_gen::d, diffuseVertexField(), dot(), credits_svn_gen::e, KDL::exp(), find(), flags, i, mIndices, mPoints, neighbors, norm(), normalize(), normNoSqrt(), and pointareas.
Referenced by triangulate().
void IsoSurface::triangulate | ( | void | ) |
triangulate the scalar field given by pointer
Definition at line 138 of file isosurface.cpp.
References computeNormals(), debMsgStd, DM_MSG, credits_svn_gen::e, EDGEAR_INDEX, errFatal, errMsg, getData(), ParticleObject::getNext(), getNormal(), ParticleTracer::getNumParticles(), ParticleTracer::getParticlesBegin(), ParticleTracer::getParticlesEnd(), ParticleObject::getPos(), ParticleObject::getSize(), getTime(), getTimeString(), i, ISOLEVEL_INDEX, ISOTRILININT, len(), mcEdgeTable, mcTriTable, mCutArray, mCutoff, mEdgeArSize, mEnd, mIndices, mIsoValue, mPartSize, mpData, mpEdgeVerticesX, mpEdgeVerticesY, mpEdgeVerticesZ, mpIsoParts, mPoints, mSizex, mSizey, mSizez, mSmoothNormals, mSmoothSurface, mStart, mSubdivs, mUseFullEdgeArrays, IsoLevelVertex::n, norm(), normalize(), NULL, p, PART_DROP, pow(), round, ParticleObject::setNext(), si, SIMWORLD_INITERROR, smoothNormals(), smoothSurface(), and IsoLevelVertex::v.
Referenced by getTriangles(), and LbmSolverInterface::triangulateSurface().
vector<ntlVec3Gfx> IsoSurface::cornerareas [protected] |
Definition at line 134 of file isosurface.h.
Referenced by smoothNormals(), and smoothSurface().
vector<int> IsoSurface::flags [protected] |
trimesh vars
Definition at line 132 of file isosurface.h.
Referenced by diffuseVertexField(), smoothNormals(), and smoothSurface().
vector<int> IsoSurface::mAcrossEdge [protected] |
grid data
Definition at line 117 of file isosurface.h.
vector< vector<int> > IsoSurface::mAdjacentFaces [protected] |
Definition at line 118 of file isosurface.h.
int* IsoSurface::mCutArray [protected] |
cutoff heigh values
Definition at line 123 of file isosurface.h.
Referenced by setCutArray(), and triangulate().
int IsoSurface::mCutoff [protected] |
cutoff border area
Definition at line 121 of file isosurface.h.
Referenced by setCutoff(), and triangulate().
vector<int> IsoSurface::mDboundary [protected] |
Definition at line 224 of file isosurface.h.
Referenced by diffuseVertexField().
ntlVec3Gfx IsoSurface::mDomainExtent [protected] |
normalized domain extent from parametrizer/visualizer
Definition at line 106 of file isosurface.h.
Referenced by initializeIsosurface().
int IsoSurface::mEdgeArSize [protected] |
Definition at line 96 of file isosurface.h.
Referenced by initializeIsosurface(), and triangulate().
ntlVec3Gfx IsoSurface::mEnd [protected] |
Definition at line 103 of file isosurface.h.
Referenced by getBBEnd(), getEnd(), initializeIsosurface(), setEnd(), and triangulate().
int IsoSurface::mFlagCnt [protected] |
Definition at line 133 of file isosurface.h.
Referenced by diffuseVertexField().
vector<unsigned int> IsoSurface::mIndices [protected] |
vector for all the triangles (stored as 3 indices)
Definition at line 100 of file isosurface.h.
Referenced by computeNormals(), getIsoIndexArray(), getIsoIndexCount(), getTriangles(), initializeIsosurface(), smoothNormals(), smoothSurface(), and triangulate().
bool IsoSurface::mInitDone [protected] |
initialized?
Definition at line 109 of file isosurface.h.
Referenced by getTriangles(), initializeIsosurface(), setSubdivs(), and setUseFulledgeArrays().
double IsoSurface::mIsoValue [protected] |
Level of the iso surface.
Definition at line 85 of file isosurface.h.
Referenced by setIsolevel(), and triangulate().
float IsoSurface::mPartSize [protected] |
particle size
Definition at line 127 of file isosurface.h.
Referenced by setParticles(), and triangulate().
float* IsoSurface::mpData [protected] |
data pointer
Definition at line 82 of file isosurface.h.
Referenced by getData(), initializeIsosurface(), lbmGetData(), resetAll(), triangulate(), and ~IsoSurface().
int* IsoSurface::mpEdgeVerticesX [protected] |
Store indices of calculated points along the cubie edges.
Definition at line 93 of file isosurface.h.
Referenced by initializeIsosurface(), triangulate(), and ~IsoSurface().
int* IsoSurface::mpEdgeVerticesY [protected] |
Definition at line 94 of file isosurface.h.
Referenced by initializeIsosurface(), triangulate(), and ~IsoSurface().
int* IsoSurface::mpEdgeVerticesZ [protected] |
Definition at line 95 of file isosurface.h.
Referenced by initializeIsosurface(), triangulate(), and ~IsoSurface().
ParticleTracer* IsoSurface::mpIsoParts [protected] |
particle pointer
Definition at line 125 of file isosurface.h.
Referenced by setParticles(), and triangulate().
vector<IsoLevelVertex> IsoSurface::mPoints [protected] |
Store all the triangles vertices.
Definition at line 88 of file isosurface.h.
Referenced by computeNormals(), diffuseVertexField(), getIsoVertexArray(), getIsoVertexCount(), getTriangles(), initializeIsosurface(), smoothNormals(), smoothSurface(), and triangulate().
ntlVec3Gfx IsoSurface::mSCcenter [protected] |
Definition at line 226 of file isosurface.h.
Referenced by diffuseVertexField(), and setSmoothRad().
float IsoSurface::mSCrad1 [protected] |
Definition at line 225 of file isosurface.h.
Referenced by diffuseVertexField(), and setSmoothRad().
float IsoSurface::mSCrad2 [protected] |
Definition at line 225 of file isosurface.h.
Referenced by diffuseVertexField(), and setSmoothRad().
int IsoSurface::mSizex [protected] |
size
Definition at line 79 of file isosurface.h.
Referenced by getData(), initializeIsosurface(), lbmGetData(), resetAll(), and triangulate().
int IsoSurface::mSizey [protected] |
Definition at line 79 of file isosurface.h.
Referenced by getData(), initializeIsosurface(), lbmGetData(), resetAll(), and triangulate().
int IsoSurface::mSizez [protected] |
Definition at line 79 of file isosurface.h.
Referenced by getData(), initializeIsosurface(), lbmGetData(), resetAll(), and triangulate().
float IsoSurface::mSmoothNormals [protected] |
amount of normal smoothing
Definition at line 114 of file isosurface.h.
Referenced by getSmoothNormals(), setSmoothNormals(), and triangulate().
float IsoSurface::mSmoothSurface [protected] |
amount of surface smoothing
Definition at line 112 of file isosurface.h.
Referenced by getSmoothSurface(), setSmoothSurface(), and triangulate().
ntlVec3Gfx IsoSurface::mStart [protected] |
start and end vectors for the triangulation region to create triangles in
Definition at line 103 of file isosurface.h.
Referenced by getBBStart(), getStart(), initializeIsosurface(), setStart(), and triangulate().
int IsoSurface::mSubdivs [protected] |
no of subdivisions
Definition at line 129 of file isosurface.h.
Referenced by getSubdivs(), initializeIsosurface(), setSubdivs(), and triangulate().
bool IsoSurface::mUseFullEdgeArrays [protected] |
use full arrays? (not for farfield)
Definition at line 91 of file isosurface.h.
Referenced by initializeIsosurface(), setUseFulledgeArrays(), and triangulate().
vector< vector<int> > IsoSurface::neighbors [protected] |
Definition at line 136 of file isosurface.h.
Referenced by diffuseVertexField(), smoothNormals(), and smoothSurface().
vector<float> IsoSurface::pointareas [protected] |
Definition at line 135 of file isosurface.h.
Referenced by diffuseVertexField(), smoothNormals(), and smoothSurface().