Blender V2.61 - r43446
|
A whole particle array. More...
#include <particletracer.h>
Public Member Functions | |
ParticleTracer () | |
Standard constructor. | |
~ParticleTracer () | |
Destructor. | |
void | addParticle (float x, float y, float z) |
add a particle at this position | |
void | addFullParticle (ParticleObject &np) |
add/copy a particle from inited struct | |
void | draw () |
draw the particle array | |
void | parseAttrList (AttributeList *att) |
parse settings from attributes (dont use own list!) | |
void | adaptPartTimestep (float factor) |
adapt time step by rescaling velocities | |
int | getNumParticles () |
get the number of particles | |
void | setNumInitialParticles (int set) |
set/get the number of particles | |
int | getNumInitialParticles () |
vector< ParticleObject >::iterator | getParticlesBegin () |
iterate over all newest particles (for advancing positions) | |
vector< ParticleObject >::iterator | getParticlesEnd () |
end iterator for newest particles | |
ParticleObject * | getLast () |
end iterator for newest particles | |
void | setStart (ntlVec3Gfx set) |
void | setEnd (ntlVec3Gfx set) |
ntlVec3Gfx | getStart () |
ntlVec3Gfx | getEnd () |
void | setSimStart (ntlVec3Gfx set) |
void | setSimEnd (ntlVec3Gfx set) |
void | setDumpParts (bool set) |
bool | getDumpParts () |
void | setDumpTextFile (string set) |
string | getDumpTextFile () |
void | setDumpTextInterval (float set) |
float | getDumpTextInterval () |
void | setInitStart (float set) |
float | getInitStart () |
void | setInitEnd (float set) |
float | getInitEnd () |
void | setPartScale (float set) |
set the particle scaling factor | |
void | checkDumpTextPositions (double simtime) |
called after each frame to check if positions should be dumped | |
virtual void | getTriangles (double t, vector< ntlTriangle > *triangles, vector< ntlVec3Gfx > *vertices, vector< ntlVec3Gfx > *normals, int objectId) |
virtual void | notifyOfDump (int dumptype, int frameNr, char *frameNrStr, string outfilename, double simtime) |
void | checkTrails (double time) |
void | cleanup () |
Protected Member Functions | |
void | initTrafoMatrix () |
Protected Attributes | |
vector< ParticleObject > | mParts |
float | mPartSize |
ntlVec3Gfx | mStart |
ntlVec3Gfx | mEnd |
ntlVec3Gfx | mSimStart |
ntlVec3Gfx | mSimEnd |
float | mPartScale |
float | mPartHeadDist |
float | mPartTailDist |
int | mPartSegments |
int | mValueScale |
float | mValueCutoffTop |
float | mValueCutoffBottom |
int | mDumpParts |
string | mDumpTextFile |
float | mDumpTextInterval |
float | mDumpTextLastTime |
int | mDumpTextCount |
int | mShowOnly |
int | mNumInitialParts |
ntlMatrix4x4< gfxReal > * | mpTrafo |
transform matrix | |
float | mInitStart |
init time distribution start/end | |
float | mInitEnd |
vector< vector< ParticleObject > > | mPrevs |
float | mTrailTimeLast |
float | mTrailInterval |
int | mTrailLength |
A whole particle array.
Definition at line 138 of file particletracer.h.
ParticleTracer::ParticleTracer | ( | ) |
Standard constructor.
Definition at line 32 of file particletracer.cpp.
ParticleTracer::~ParticleTracer | ( | ) |
void ParticleTracer::adaptPartTimestep | ( | float | factor | ) |
adapt time step by rescaling velocities
Definition at line 124 of file particletracer.cpp.
Referenced by LbmFsgrSolver::adaptTimestep().
void ParticleTracer::addFullParticle | ( | ParticleObject & | np | ) |
add/copy a particle from inited struct
Definition at line 139 of file particletracer.cpp.
References mParts.
void ParticleTracer::addParticle | ( | float | x, |
float | y, | ||
float | z | ||
) |
add a particle at this position
Definition at line 134 of file particletracer.cpp.
Referenced by LbmFsgrSolver::initParticles().
void ParticleTracer::checkDumpTextPositions | ( | double | simtime | ) |
called after each frame to check if positions should be dumped
Definition at line 225 of file particletracer.cpp.
References debMsgStd, DM_MSG, ntlGeometryClass::getName(), ParticleObject::getPos(), ParticleObject::getSize(), ParticleObject::getVel(), i, mDumpTextCount, mDumpTextFile, mDumpTextInterval, mDumpTextLastTime, mParts, mpTrafo, p, size(), and ntlMatrix4x4< Scalar >::value.
Referenced by LbmFsgrSolver::stepMain().
void ParticleTracer::checkTrails | ( | double | time | ) |
Definition at line 304 of file particletracer.cpp.
References i, mParts, mPrevs, mTrailInterval, mTrailLength, and mTrailTimeLast.
Referenced by LbmFsgrSolver::stepMain().
void ParticleTracer::cleanup | ( | void | ) |
Definition at line 144 of file particletracer.cpp.
References errMsg, i, mDumpTextInterval, mParts, and p.
Referenced by LbmFsgrSolver::advanceParticles().
void ParticleTracer::draw | ( | ) |
draw the particle array
Definition at line 101 of file particletracer.cpp.
bool ParticleTracer::getDumpParts | ( | ) | [inline] |
Definition at line 192 of file particletracer.h.
References mDumpParts.
string ParticleTracer::getDumpTextFile | ( | ) | [inline] |
Definition at line 195 of file particletracer.h.
References mDumpTextFile.
float ParticleTracer::getDumpTextInterval | ( | ) | [inline] |
Definition at line 198 of file particletracer.h.
References mDumpTextInterval.
Referenced by LbmFsgrSolver::initCpdata().
ntlVec3Gfx ParticleTracer::getEnd | ( | void | ) | [inline] |
float ParticleTracer::getInitEnd | ( | ) | [inline] |
Definition at line 203 of file particletracer.h.
References mInitEnd.
Referenced by LbmFsgrSolver::initParticles().
float ParticleTracer::getInitStart | ( | ) | [inline] |
Definition at line 201 of file particletracer.h.
References mInitStart.
Referenced by LbmFsgrSolver::initParticles().
ParticleObject* ParticleTracer::getLast | ( | ) | [inline] |
end iterator for newest particles
Definition at line 174 of file particletracer.h.
References mParts.
Referenced by LbmFsgrSolver::initParticles().
int ParticleTracer::getNumInitialParticles | ( | ) | [inline] |
Definition at line 167 of file particletracer.h.
References mNumInitialParts.
Referenced by LbmFsgrSolver::initCpdata().
int ParticleTracer::getNumParticles | ( | ) | [inline] |
get the number of particles
Definition at line 164 of file particletracer.h.
References mParts.
Referenced by LbmFsgrSolver::advanceParticles(), LbmFsgrSolver::initCpdata(), LbmFsgrSolver::initParticles(), and IsoSurface::triangulate().
vector<ParticleObject>::iterator ParticleTracer::getParticlesBegin | ( | ) | [inline] |
iterate over all newest particles (for advancing positions)
Definition at line 170 of file particletracer.h.
References mParts.
Referenced by LbmFsgrSolver::advanceParticles(), and IsoSurface::triangulate().
vector<ParticleObject>::iterator ParticleTracer::getParticlesEnd | ( | ) | [inline] |
end iterator for newest particles
Definition at line 172 of file particletracer.h.
References mParts.
Referenced by LbmFsgrSolver::advanceParticles(), and IsoSurface::triangulate().
ntlVec3Gfx ParticleTracer::getStart | ( | void | ) | [inline] |
void ParticleTracer::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 323 of file particletracer.cpp.
References cos(), cross(), debMsgStd, DM_MSG, credits_svn_gen::e, errMsg, ParticleObject::getActive(), ParticleObject::getPos(), ParticleObject::getSize(), ParticleObject::getStatus(), ParticleObject::getType(), ParticleObject::getVel(), i, ntlMatrix4x4< Scalar >::initId(), M_PI, mDumpParts, mEnd, mPartHeadDist, mParts, mPartScale, mPartSegments, mPartTailDist, mPrevs, mShowOnly, mSimEnd, mSimStart, mStart, mValueCutoffBottom, mValueCutoffTop, mValueScale, normalize(), NULL, p, PART_BUBBLE, PART_DROP, PART_FLOAT, PART_IN, PART_INTER, PART_TRACER, ntlGeometryObject::sceneAddTriangle(), and sin().
void ParticleTracer::initTrafoMatrix | ( | ) | [protected] |
init sim/pos transformation
Definition at line 108 of file particletracer.cpp.
References i, ntlMatrix4x4< Scalar >::initId(), mEnd, mpTrafo, mSimEnd, mSimStart, mStart, and ntlMatrix4x4< Scalar >::value.
Referenced by setEnd(), setSimEnd(), setSimStart(), and setStart().
void ParticleTracer::notifyOfDump | ( | int | dumtp, |
int | frameNr, | ||
char * | frameNrStr, | ||
string | outfilename, | ||
double | simtime | ||
) | [virtual] |
notify object that dump is in progress (e.g. for particles)
Reimplemented from ntlGeometryObject.
Definition at line 164 of file particletracer.cpp.
References debMsgStd, DM_MSG, DUMP_FULLGEOMETRY, errMsg, ParticleObject::getFlags(), ntlGeometryClass::getName(), ParticleObject::getPos(), ParticleObject::getSize(), ParticleObject::getVel(), glob_mpactive, glob_mpindex, i, mDumpParts, mParts, mpTrafo, p, PART_FLOAT, size(), and ntlMatrix4x4< Scalar >::value.
void ParticleTracer::parseAttrList | ( | AttributeList * | att | ) |
parse settings from attributes (dont use own list!)
Definition at line 60 of file particletracer.cpp.
References mDumpParts, mDumpTextFile, mDumpTextInterval, mInitEnd, mInitStart, mNumInitialParts, mPartHeadDist, mPartScale, mPartSegments, mPartTailDist, ntlGeometryClass::mpAttrs, mShowOnly, mTrailInterval, mTrailLength, mValueCutoffBottom, mValueCutoffTop, mValueScale, AttributeList::readFloat(), AttributeList::readInt(), AttributeList::readString(), and ntlGeometryObject::setMaterialName().
void ParticleTracer::setDumpParts | ( | bool | set | ) | [inline] |
set/get dump flag
Definition at line 191 of file particletracer.h.
References mDumpParts.
Referenced by LbmFsgrSolver::initCpdata().
void ParticleTracer::setDumpTextFile | ( | string | set | ) | [inline] |
set/get dump text file
Definition at line 194 of file particletracer.h.
References mDumpTextFile.
Referenced by LbmFsgrSolver::initCpdata().
void ParticleTracer::setDumpTextInterval | ( | float | set | ) | [inline] |
set/get dump text interval
Definition at line 197 of file particletracer.h.
References mDumpTextInterval.
Referenced by LbmFsgrSolver::initCpdata().
void ParticleTracer::setEnd | ( | ntlVec3Gfx | set | ) | [inline] |
set geometry end (for renderer)
Definition at line 179 of file particletracer.h.
References initTrafoMatrix(), and mEnd.
Referenced by LbmFsgrSolver::initParticles().
void ParticleTracer::setInitEnd | ( | float | set | ) | [inline] |
Definition at line 202 of file particletracer.h.
References mInitEnd.
void ParticleTracer::setInitStart | ( | float | set | ) | [inline] |
void ParticleTracer::setNumInitialParticles | ( | int | set | ) | [inline] |
set/get the number of particles
Definition at line 166 of file particletracer.h.
References mNumInitialParts.
Referenced by LbmFsgrSolver::initCpdata().
void ParticleTracer::setPartScale | ( | float | set | ) | [inline] |
set the particle scaling factor
Definition at line 206 of file particletracer.h.
References mPartScale.
void ParticleTracer::setSimEnd | ( | ntlVec3Gfx | set | ) | [inline] |
set simulation domain end
Definition at line 188 of file particletracer.h.
References initTrafoMatrix(), and mSimEnd.
Referenced by LbmFsgrSolver::initParticles().
void ParticleTracer::setSimStart | ( | ntlVec3Gfx | set | ) | [inline] |
set simulation domain start
Definition at line 186 of file particletracer.h.
References initTrafoMatrix(), and mSimStart.
Referenced by LbmFsgrSolver::initParticles().
void ParticleTracer::setStart | ( | ntlVec3Gfx | set | ) | [inline] |
set geometry start (for renderer)
Definition at line 177 of file particletracer.h.
References initTrafoMatrix(), and mStart.
Referenced by LbmFsgrSolver::initParticles().
int ParticleTracer::mDumpParts [protected] |
dump particles (or certain types of) to disk?
Definition at line 252 of file particletracer.h.
Referenced by getDumpParts(), getTriangles(), notifyOfDump(), parseAttrList(), and setDumpParts().
int ParticleTracer::mDumpTextCount [protected] |
Definition at line 258 of file particletracer.h.
Referenced by checkDumpTextPositions().
string ParticleTracer::mDumpTextFile [protected] |
text dump output file
Definition at line 254 of file particletracer.h.
Referenced by checkDumpTextPositions(), getDumpTextFile(), parseAttrList(), and setDumpTextFile().
float ParticleTracer::mDumpTextInterval [protected] |
text dump interval, start at t=0, dumping active if >0
Definition at line 256 of file particletracer.h.
Referenced by checkDumpTextPositions(), cleanup(), getDumpTextInterval(), parseAttrList(), and setDumpTextInterval().
float ParticleTracer::mDumpTextLastTime [protected] |
Definition at line 257 of file particletracer.h.
Referenced by checkDumpTextPositions().
ntlVec3Gfx ParticleTracer::mEnd [protected] |
Definition at line 233 of file particletracer.h.
Referenced by getEnd(), getTriangles(), initTrafoMatrix(), and setEnd().
float ParticleTracer::mInitEnd [protected] |
Definition at line 270 of file particletracer.h.
Referenced by getInitEnd(), parseAttrList(), and setInitEnd().
float ParticleTracer::mInitStart [protected] |
init time distribution start/end
Definition at line 270 of file particletracer.h.
Referenced by getInitStart(), parseAttrList(), and setInitStart().
int ParticleTracer::mNumInitialParts [protected] |
no. of particles to init
Definition at line 262 of file particletracer.h.
Referenced by getNumInitialParticles(), parseAttrList(), and setNumInitialParticles().
float ParticleTracer::mPartHeadDist [protected] |
head and tail distance for particle shapes
Definition at line 241 of file particletracer.h.
Referenced by getTriangles(), and parseAttrList().
vector<ParticleObject> ParticleTracer::mParts [protected] |
the particle array (for multiple timesteps)
Definition at line 227 of file particletracer.h.
Referenced by adaptPartTimestep(), addFullParticle(), addParticle(), checkDumpTextPositions(), checkTrails(), cleanup(), getLast(), getNumParticles(), getParticlesBegin(), getParticlesEnd(), getTriangles(), and notifyOfDump().
float ParticleTracer::mPartScale [protected] |
scaling param for particles
Definition at line 239 of file particletracer.h.
Referenced by getTriangles(), parseAttrList(), and setPartScale().
int ParticleTracer::mPartSegments [protected] |
no of segments for particle cone
Definition at line 243 of file particletracer.h.
Referenced by getTriangles(), and parseAttrList().
float ParticleTracer::mPartSize [protected] |
size of the particles to display
Definition at line 230 of file particletracer.h.
float ParticleTracer::mPartTailDist [protected] |
Definition at line 241 of file particletracer.h.
Referenced by getTriangles(), and parseAttrList().
vector< vector<ParticleObject> > ParticleTracer::mPrevs [protected] |
the particle array (for multiple timesteps)
Definition at line 273 of file particletracer.h.
Referenced by checkTrails(), and getTriangles().
ntlMatrix4x4<gfxReal>* ParticleTracer::mpTrafo [protected] |
transform matrix
Definition at line 265 of file particletracer.h.
Referenced by checkDumpTextPositions(), initTrafoMatrix(), and notifyOfDump().
int ParticleTracer::mShowOnly [protected] |
show only a certain type (debugging)
Definition at line 260 of file particletracer.h.
Referenced by getTriangles(), and parseAttrList().
ntlVec3Gfx ParticleTracer::mSimEnd [protected] |
Definition at line 236 of file particletracer.h.
Referenced by getTriangles(), initTrafoMatrix(), and setSimEnd().
ntlVec3Gfx ParticleTracer::mSimStart [protected] |
start and end vectors of the simulation domain
Definition at line 236 of file particletracer.h.
Referenced by getTriangles(), initTrafoMatrix(), and setSimStart().
ntlVec3Gfx ParticleTracer::mStart [protected] |
start and end vectors for the triangulation region to create particles in
Definition at line 233 of file particletracer.h.
Referenced by getStart(), getTriangles(), initTrafoMatrix(), and setStart().
float ParticleTracer::mTrailInterval [protected] |
Definition at line 275 of file particletracer.h.
Referenced by checkTrails(), and parseAttrList().
int ParticleTracer::mTrailLength [protected] |
Definition at line 276 of file particletracer.h.
Referenced by checkTrails(), and parseAttrList().
float ParticleTracer::mTrailTimeLast [protected] |
Definition at line 275 of file particletracer.h.
Referenced by checkTrails().
float ParticleTracer::mValueCutoffBottom [protected] |
value length minimal cutoff value, for mValueScale==2
Definition at line 249 of file particletracer.h.
Referenced by getTriangles(), and parseAttrList().
float ParticleTracer::mValueCutoffTop [protected] |
value length maximal cutoff value, for mValueScale==2
Definition at line 247 of file particletracer.h.
Referenced by getTriangles(), and parseAttrList().
int ParticleTracer::mValueScale [protected] |
use length/absval of values to scale particles?
Definition at line 245 of file particletracer.h.
Referenced by getTriangles(), and parseAttrList().