#include <ps_force.h>
Inheritance diagram for NL3D::CPSForceIntensity:
Definition at line 160 of file ps_force.h.
Public Member Functions | |
CPSForceIntensity () | |
float | getIntensity (void) const |
get the constant intensity that was set for the force | |
const CPSAttribMaker< float > * | getIntensityScheme (void) const |
CPSAttribMaker< float > * | getIntensityScheme (void) |
get the attribute maker for a non constant intensity | |
void | serialForceIntensity (NLMISC::IStream &f) throw (NLMISC::EStream) |
virtual void | setIntensity (float value) |
set a constant intensity for the force. this discard any previous call to setIntensityScheme | |
virtual void | setIntensityScheme (CPSAttribMaker< float > *scheme) |
set a non-constant intensity | |
virtual void | setupFunctor (uint32 indexInLocated) |
virtual | ~CPSForceIntensity () |
Protected Member Functions | |
void | deleteForceIntensityElement (uint32 index) |
virtual CPSLocated * | getForceIntensityOwner (void)=0 |
deriver must return the located that own them here | |
void | newForceIntensityElement (CPSLocated *emitterLocated, uint32 emitterIndex) |
void | resizeForceIntensity (uint32 size) |
Protected Attributes | |
CPSAttribMaker< float > * | _IntensityScheme |
float | _K |
|
Definition at line 165 of file ps_force.h. References _IntensityScheme.
00165 : _IntensityScheme(NULL) 00166 { 00167 } |
|
Definition at line 177 of file ps_force.cpp. References _IntensityScheme.
00178 { 00179 delete _IntensityScheme; 00180 } |
|
Definition at line 203 of file ps_force.h. References _IntensityScheme, NL3D::CPSAttribMaker< float >::deleteElement(), NL3D::CPSAttribMaker< float >::hasMemory(), index, and uint32. Referenced by NL3D::CPSTurbul::deleteElement(), NL3D::CPSBrownianForce::deleteElement(), NL3D::CPSFluidFriction::deleteElement(), and NL3D::CPSForceIntensityHelper::deleteElement().
00204 { 00205 if (_IntensityScheme && _IntensityScheme->hasMemory()) _IntensityScheme->deleteElement(index); 00206 } |
|
deriver must return the located that own them here
Implemented in NL3D::CPSForceIntensityHelper, NL3D::CPSFluidFriction, NL3D::CPSBrownianForce, NL3D::CPSTurbul, and NL3D::CPSCylindricVortex. Referenced by resizeForceIntensity(), and setIntensityScheme(). |
|
get the constant intensity that was set for the force
Definition at line 173 of file ps_force.h. References _K.
00173 { return _K; } |
|
Definition at line 186 of file ps_force.h. References _IntensityScheme.
00186 { return _IntensityScheme; } |
|
get the attribute maker for a non constant intensity
Definition at line 185 of file ps_force.h. References _IntensityScheme.
00185 { return _IntensityScheme; } |
|
Definition at line 199 of file ps_force.h. References _IntensityScheme, NL3D::CPSAttribMaker< float >::hasMemory(), NL3D::CPSAttribMaker< float >::newElement(), and uint32. Referenced by NL3D::CPSTurbul::newElement(), NL3D::CPSBrownianForce::newElement(), NL3D::CPSFluidFriction::newElement(), and NL3D::CPSForceIntensityHelper::newElement().
00200 { 00201 if (_IntensityScheme && _IntensityScheme->hasMemory()) _IntensityScheme->newElement(emitterLocated, emitterIndex); 00202 } |
|
Definition at line 207 of file ps_force.h. References _IntensityScheme, getForceIntensityOwner(), NL3D::CPSAttribMaker< float >::hasMemory(), NL3D::CPSAttribMaker< float >::resize(), size, and uint32. Referenced by NL3D::CPSTurbul::resize(), NL3D::CPSBrownianForce::resize(), NL3D::CPSFluidFriction::resize(), and NL3D::CPSForceIntensityHelper::resize().
00208 { 00209 if (_IntensityScheme && _IntensityScheme->hasMemory()) _IntensityScheme->resize(size, getForceIntensityOwner()->getSize()); 00210 } |
|
Definition at line 190 of file ps_force.cpp. Referenced by NL3D::CPSTurbul::NLMISC_DECLARE_CLASS(), and NL3D::CPSFluidFriction::NLMISC_DECLARE_CLASS().
00191 { 00192 f.serialVersion(1); 00193 if (!f.isReading()) 00194 { 00195 if (_IntensityScheme) 00196 { 00197 bool bFalse = false; 00198 f.serial(bFalse); 00199 f.serialPolyPtr(_IntensityScheme); 00200 } 00201 else 00202 { 00203 bool bTrue = true; 00204 f.serial(bTrue); 00205 f.serial(_K); 00206 } 00207 } 00208 else 00209 { 00210 bool constantIntensity; 00211 f.serial(constantIntensity); 00212 if (constantIntensity) 00213 { 00214 f.serial(_K); 00215 } 00216 else 00217 { 00218 f.serialPolyPtr(_IntensityScheme); 00219 } 00220 } 00221 } |
|
set a constant intensity for the force. this discard any previous call to setIntensityScheme
Reimplemented in NL3D::CPSGravity, and NL3D::CPSBrownianForce. Definition at line 166 of file ps_force.cpp. References _IntensityScheme, _K, and value. Referenced by NL3D::CPSCentralGravity::CPSCentralGravity(), NL3D::CPSCylindricVortex::CPSCylindricVortex(), NL3D::CPSDirectionnalForce::CPSDirectionnalForce(), NL3D::CPSFluidFriction::CPSFluidFriction(), and NL3D::CPSSpring::CPSSpring().
00167 { 00168 if (_IntensityScheme) 00169 { 00170 delete _IntensityScheme; 00171 _IntensityScheme = NULL; 00172 } 00173 _K = value; 00174 00175 } |
|
set a non-constant intensity
Reimplemented in NL3D::CPSGravity, and NL3D::CPSBrownianForce. Definition at line 182 of file ps_force.cpp. References _IntensityScheme, getForceIntensityOwner(), nlassert, and NL3D::CPSAttribMaker< T >::resize().
00183 { 00184 nlassert(scheme); 00185 delete _IntensityScheme; 00186 _IntensityScheme = scheme; 00187 if (getForceIntensityOwner() && scheme->hasMemory()) scheme->resize(getForceIntensityOwner()->getMaxSize(), getForceIntensityOwner()->getSize()); 00188 } |
|
Reimplemented in NL3D::CPSFluidFriction, and NL3D::CPSTurbul. Definition at line 182 of file ps_force.h. References uint32.
00182 { } |
|
Definition at line 197 of file ps_force.h. Referenced by CPSForceIntensity(), deleteForceIntensityElement(), getIntensityScheme(), newForceIntensityElement(), resizeForceIntensity(), setIntensity(), setIntensityScheme(), and ~CPSForceIntensity(). |
|
Definition at line 196 of file ps_force.h. Referenced by getIntensity(), and setIntensity(). |