Blender V2.61 - r43446
|
#include <simulation_object.h>
interface for different simluation models to visualize
Definition at line 47 of file simulation_object.h.
SimulationObject::SimulationObject | ( | ) |
SimulationObject::~SimulationObject | ( | ) | [virtual] |
Destructor
Definition at line 59 of file simulation_object.cpp.
References debMsgStd, DM_MSG, mpElbeemSettings, mpGiTree, mpLbm, mpParam, and mpParts.
int SimulationObject::checkCallerStatus | ( | int | status, |
int | frame | ||
) |
check status (e.g. stop/abort) from calling program, returns !=0 if sth. happened...
Definition at line 441 of file simulation_object.cpp.
References debMsgStd, DM_NOTIFY, errFatal, errMsg, FLUIDSIM_CBRET_ABORT, FLUIDSIM_CBRET_CONTINUE, FLUIDSIM_CBRET_STOP, isSimworldOk(), mPanic, mpElbeemSettings, elbeemSimulationSettings::runsimCallback, elbeemSimulationSettings::runsimUserData, setElbeemState(), SIMWORLD_GENERICERROR, and SIMWORLD_STOP.
Referenced by initializeLbmSimulation(), notifyShaderOfDump(), and step().
void SimulationObject::copyElbeemSettings | ( | elbeemSimulationSettings * | settings | ) |
for init from API
Definition at line 100 of file simulation_object.cpp.
References debMsgStd, DM_MSG, elbeemSimulationSettings::domainId, ntlGeometryClass::mGeoInitId, and mpElbeemSettings.
Referenced by ntlWorld::addDomain().
virtual void SimulationObject::draw | ( | void | ) | [inline, virtual] |
simluation interface: draw the simulation with OpenGL
Definition at line 95 of file simulation_object.h.
void SimulationObject::drawDebugDisplay | ( | ) | [virtual] |
GUI - display debug info
Reimplemented from ntlGeometryClass.
Definition at line 377 of file simulation_object.cpp.
References LbmSolverInterface::debugDisplay(), ntlGeometryClass::getVisible(), LbmSolverInterface::lbmMarkedCellDisplay(), mDebugType, and mpLbm.
void SimulationObject::drawInteractiveDisplay | ( | ) | [virtual] |
GUI - display interactive info
Reimplemented from ntlGeometryClass.
Definition at line 392 of file simulation_object.cpp.
References LbmSolverInterface::debugDisplayNode(), FLUIDDISPGrid, ntlGeometryClass::getVisible(), mpLbm, and mSelectedCid.
void SimulationObject::freeGeoTree | ( | ) |
destroy tree etc. when geometry init done
Definition at line 93 of file simulation_object.cpp.
bool SimulationObject::geoInitCheckPointInside | ( | ntlVec3Gfx | org, |
int | flags, | ||
int & | OId | ||
) |
check for a certain flag type at position org
int SimulationObject::geoInitGetPointType | ( | ntlVec3Gfx | org, |
int & | OId | ||
) |
get fluid init type at certain position
virtual ntlVec3Gfx* SimulationObject::getBBEnd | ( | ) | [inline, virtual] |
Reimplemented from ntlGeometryClass.
Definition at line 189 of file simulation_object.h.
References mGeoEnd.
virtual ntlVec3Gfx* SimulationObject::getBBStart | ( | ) | [inline, virtual] |
get bounding box of fluid for GUI
Reimplemented from ntlGeometryClass.
Definition at line 188 of file simulation_object.h.
References mGeoStart.
double SimulationObject::getCurrentTime | ( | void | ) | [inline] |
get current (max) simulation time
Definition at line 72 of file simulation_object.h.
References mTime.
Referenced by ntlWorld::singleStepSims().
int SimulationObject::getDebugDisplay | ( | ) | [inline] |
Definition at line 174 of file simulation_object.h.
References mDebugType.
double SimulationObject::getFrameTime | ( | int | frame | ) |
get time for a single animation frame
Definition at line 345 of file simulation_object.cpp.
References Parametrizer::getAniFrameTime(), and mpParam.
vector< ntlGeometryObject * >::iterator SimulationObject::getObjectsBegin | ( | ) | [virtual] |
Get start iterator for all objects
Reimplemented from ntlGeometryShader.
Definition at line 359 of file simulation_object.cpp.
References ntlGeometryShader::mObjects.
vector< ntlGeometryObject * >::iterator SimulationObject::getObjectsEnd | ( | ) | [virtual] |
Get end iterator for all objects
Reimplemented from ntlGeometryShader.
Definition at line 364 of file simulation_object.cpp.
References ntlGeometryShader::mObjects.
bool SimulationObject::getPanic | ( | void | ) | [inline] |
get sim panic flag
Definition at line 81 of file simulation_object.h.
References mPanic.
Referenced by ntlWorld::advanceSims(), and ntlWorld::singleStepSims().
Parametrizer* SimulationObject::getParametrizer | ( | ) | [inline] |
init parametrizer for anim step length
Definition at line 181 of file simulation_object.h.
References mpParam.
Referenced by ntlWorld::addDomain().
LbmSolverInterface* SimulationObject::getSolver | ( | ) | [inline] |
access solver
Definition at line 121 of file simulation_object.h.
References mpLbm.
Referenced by ntlBlenderDumper::renderScene().
double SimulationObject::getStartTime | ( | void | ) |
get current start simulation time
Definition at line 340 of file simulation_object.cpp.
References Parametrizer::getAniStart(), and mpParam.
double SimulationObject::getTimestep | ( | void | ) |
get time for a single time step in the simulation
Definition at line 349 of file simulation_object.cpp.
References Parametrizer::getTimestep(), and mpParam.
Referenced by ntlWorld::singleStepSims().
void SimulationObject::initGeoTree | ( | ) |
init tree for certain geometry init
Definition at line 74 of file simulation_object.cpp.
References errFatal, ntlScene::getObjects(), ntlRenderGlobals::getSimScene(), ntlGeometryClass::mGeoInitId, mpGiObjects, mpGiTree, mpGlob, NULL, and SIMWORLD_INITERROR.
int SimulationObject::initializeLbmSimulation | ( | ntlRenderGlobals * | glob | ) |
simluation interface: initialize simulation
Definition at line 112 of file simulation_object.cpp.
References LbmSolverInterface::advanceCell(), CellFlagType, checkBoundingBox(), checkCallerStatus(), convertCellFlagType2String(), createSolver(), debMsgStd, debugOutNnl, LbmSolverInterface::deleteCellIterator(), DM_MSG, DM_NOTIFY, elbeemSimulationSettings::domainobsPartslip, elbeemSimulationSettings::domainobsType, errFatal, errMsg, elbeemSimulationSettings::farFieldSize, FLUIDSIM_CBSTATUS_STEP, FLUIDSIM_OBSTACLE_FREESLIP, FLUIDSIM_OBSTACLE_PARTSLIP, elbeemSimulationSettings::generateParticles, elbeemSimulationSettings::generateVertexVectors, ntlGeometryClass::getAttributeList(), LbmSolverInterface::getCellFlag(), LbmSolverInterface::getDebugObjects(), LbmSolverInterface::getDumpVelocities(), LbmSolverInterface::getFirstCell(), LbmSolverInterface::getGenerateParticles(), LbmSolverInterface::getGeoEnd(), LbmSolverInterface::getGeoStart(), LbmSolverInterface::getIdString(), ntlRenderGlobals::getMaterials(), ntlGeometryClass::getName(), LbmSolverInterface::getSurfaceGeoObj(), ntlGeometryClass::getSwsAttributeList(), ntlGeometryClass::getVisible(), glob_mpnum, i, LbmSolverInterface::initDomainTrafo(), LbmSolverInterface::initializeSolverGrids(), LbmSolverInterface::initializeSolverMemory(), LbmSolverInterface::initializeSolverPostinit(), isSimworldOk(), elbeemSimulationSettings::maxRefine, elbeemSimulationSettings::mFsSurfGenSetting, mGeoEnd, ntlGeometryClass::mGeoInitId, mGeoStart, ntlGeometryShader::mObjects, ntlGeometryShader::mOutFilename, mPanic, ntlGeometryClass::mpAttrs, mpElbeemSettings, mpGlob, mpLbm, mpParam, mpParts, mShowParticles, mShowSurface, LbmSolverInterface::noEndCell(), NULL, elbeemSimulationSettings::numTracerParticles, elbeemSimulationSettings::outputPath, LbmSolverInterface::parseAttrList(), Parametrizer::parseAttrList(), elbeemSimulationSettings::previewresxyz, AttributeList::readInt(), AttributeList::readString(), elbeemSimulationSettings::resolutionxyz, ntlGeometryObject::searchMaterial(), AttributeList::setAllUsed(), LbmSolverInterface::setAttrList(), Parametrizer::setAttrList(), ntlGeometryObject::setCastShadows(), LbmSolverInterface::setDomainBound(), LbmSolverInterface::setDomainPartSlip(), LbmSolverInterface::setDumpVelocities(), LbmSolverInterface::setFarFieldSize(), LbmSolverInterface::setGenerateParticles(), LbmSolverInterface::setGeoEnd(), LbmSolverInterface::setGeoStart(), LbmSolverInterface::setIsoSubdivs(), LbmSolverInterface::setLbmInitId(), ntlGeometryClass::setName(), LbmSolverInterface::setName(), LbmSolverInterface::setParametrizer(), LbmSolverInterface::setParticleTracer(), LbmSolverInterface::setPreviewSize(), ntlGeometryObject::setReceiveShadows(), LbmSolverInterface::setRefinementDesired(), LbmSolverInterface::setRenderGlobals(), LbmSolverInterface::setSizeX(), LbmSolverInterface::setSizeY(), LbmSolverInterface::setSizeZ(), LbmSolverInterface::setSmoothing(), LbmSolverInterface::setSurfGenSettings(), LbmSolverInterface::setSwsAttrList(), SIMWORLD_INITERROR, elbeemSimulationSettings::surfaceSmoothing, elbeemSimulationSettings::surfaceSubdivs, and elbeemSimulationSettings::surfaceTrafo.
Referenced by postGeoConstrInit().
virtual int SimulationObject::initializeShader | ( | ) | [inline, virtual] |
Initialize object, should return !=0 upon error
Implements ntlGeometryShader.
Definition at line 91 of file simulation_object.h.
void SimulationObject::initParametrizer | ( | Parametrizer * | set | ) | [inline] |
init parametrizer for anim step length
Definition at line 179 of file simulation_object.h.
References mpParam.
void SimulationObject::notifyShaderOfDump | ( | int | dumptype, |
int | frameNr, | ||
char * | frameNrStr, | ||
string | outfilename | ||
) | [virtual] |
notify object that dump is in progress (e.g. for field dump)
Implements ntlGeometryShader.
Definition at line 433 of file simulation_object.cpp.
References checkCallerStatus(), FLUIDSIM_CBSTATUS_NEWFRAME, mpLbm, and LbmSolverInterface::notifySolverOfDump().
virtual int SimulationObject::postGeoConstrInit | ( | ntlRenderGlobals * | glob | ) | [inline, virtual] |
Do geo etc. init
Reimplemented from ntlGeometryShader.
Definition at line 90 of file simulation_object.h.
References initializeLbmSimulation().
void SimulationObject::prepareVisualization | ( | void | ) | [virtual] |
prepare visualization of simulation for e.g. raytracing
Definition at line 332 of file simulation_object.cpp.
References mPanic, mpLbm, and LbmSolverInterface::prepareVisualization().
Referenced by ntlWorld::advanceSims().
void SimulationObject::setDebugDisplay | ( | int | disp | ) | [inline] |
set type of info to display
Definition at line 173 of file simulation_object.h.
References mDebugType.
void SimulationObject::setFrameNum | ( | int | num | ) |
set current frame
Definition at line 306 of file simulation_object.cpp.
References mpParam, and Parametrizer::setFrameNum().
virtual void SimulationObject::setGeoEnd | ( | ntlVec3Gfx | set | ) | [inline, virtual] |
set geometry generation end point
Definition at line 76 of file simulation_object.h.
References mGeoEnd.
Referenced by ntlWorld::addDomain().
virtual void SimulationObject::setGeoStart | ( | ntlVec3Gfx | set | ) | [inline, virtual] |
set geometry generation start point
Definition at line 74 of file simulation_object.h.
References mGeoStart.
Referenced by ntlWorld::addDomain().
void SimulationObject::setMouseClick | ( | ) | [virtual] |
GUI - notify object that mouse was clicked at last pos
Reimplemented from ntlGeometryClass.
Definition at line 424 of file simulation_object.cpp.
References LbmSolverInterface::debugPrintNodeInfo(), mpLbm, and mSelectedCid.
void SimulationObject::setMousePos | ( | int | x, |
int | y, | ||
ntlVec3Gfx | org, | ||
ntlVec3Gfx | dir | ||
) | [virtual] |
GUI - handle mouse movement for selection
Reimplemented from ntlGeometryClass.
Definition at line 407 of file simulation_object.cpp.
References LbmSolverInterface::getCellAt(), mGeoEnd, mGeoStart, mpLbm, mSelectedCid, and normalize().
void SimulationObject::setPanic | ( | bool | set | ) | [inline] |
void SimulationObject::step | ( | void | ) | [virtual] |
simluation interface: advance simulation another step (whatever delta time that might be)
Definition at line 314 of file simulation_object.cpp.
References checkCallerStatus(), FLUIDSIM_CBSTATUS_STEP, Parametrizer::getCurrentAniFrameTime(), LbmSolverInterface::getPanic(), Parametrizer::getTimestep(), mPanic, mpLbm, mpParam, mTime, and LbmSolverInterface::step().
Referenced by ntlWorld::singleStepSims().
int SimulationObject::mDebDispSetting [protected] |
debug display settings
Definition at line 160 of file simulation_object.h.
int SimulationObject::mDebugType [protected] |
debug info to display
Definition at line 144 of file simulation_object.h.
Referenced by drawDebugDisplay(), getDebugDisplay(), and setDebugDisplay().
ntlVec3Gfx SimulationObject::mGeoEnd [protected] |
Definition at line 129 of file simulation_object.h.
Referenced by getBBEnd(), initializeLbmSimulation(), setGeoEnd(), and setMousePos().
ntlVec3Gfx SimulationObject::mGeoStart [protected] |
for display - start and end vectors for geometry
Definition at line 129 of file simulation_object.h.
Referenced by getBBStart(), initializeLbmSimulation(), setGeoStart(), and setMousePos().
bool SimulationObject::mPanic [protected] |
simulation panic on/off
Definition at line 141 of file simulation_object.h.
Referenced by checkCallerStatus(), getPanic(), initializeLbmSimulation(), prepareVisualization(), setPanic(), and step().
storage of API settings
Definition at line 166 of file simulation_object.h.
Referenced by checkCallerStatus(), copyElbeemSettings(), initializeLbmSimulation(), and ~SimulationObject().
vector<ntlGeometryObject*>* SimulationObject::mpGiObjects [protected] |
object vector for geo init
Definition at line 136 of file simulation_object.h.
Referenced by initGeoTree().
ntlTree* SimulationObject::mpGiTree [protected] |
geometry init id
tree object for geomerty initialization
Definition at line 134 of file simulation_object.h.
Referenced by freeGeoTree(), initGeoTree(), and ~SimulationObject().
ntlRenderGlobals* SimulationObject::mpGlob [protected] |
remember globals
Definition at line 138 of file simulation_object.h.
Referenced by initGeoTree(), and initializeLbmSimulation().
LbmSolverInterface* SimulationObject::mpLbm [protected] |
pointer to the lbm solver
Definition at line 147 of file simulation_object.h.
Referenced by drawDebugDisplay(), drawInteractiveDisplay(), getSolver(), initializeLbmSimulation(), notifyShaderOfDump(), prepareVisualization(), setMouseClick(), setMousePos(), step(), and ~SimulationObject().
Parametrizer* SimulationObject::mpParam [protected] |
parametrizer for lbm solver
Definition at line 150 of file simulation_object.h.
Referenced by getFrameTime(), getParametrizer(), getStartTime(), getTimestep(), initializeLbmSimulation(), initParametrizer(), setFrameNum(), SimulationObject(), step(), and ~SimulationObject().
ParticleTracer* SimulationObject::mpParts [protected] |
particle tracing object
Definition at line 153 of file simulation_object.h.
Referenced by initializeLbmSimulation(), and ~SimulationObject().
CellIdentifierInterface* SimulationObject::mSelectedCid [protected] |
pointer to identifier of selected node
Definition at line 163 of file simulation_object.h.
Referenced by drawInteractiveDisplay(), setMouseClick(), and setMousePos().
bool SimulationObject::mShowParticles [protected] |
Definition at line 157 of file simulation_object.h.
Referenced by initializeLbmSimulation().
bool SimulationObject::mShowSurface [protected] |
show parts of the simulation toggles
Definition at line 156 of file simulation_object.h.
Referenced by initializeLbmSimulation().
double SimulationObject::mTime [protected] |
current time in the simulation
Definition at line 126 of file simulation_object.h.
Referenced by getCurrentTime(), SimulationObject(), and step().