NL3D::CPSSizedParticle Class Reference

#include <ps_particle_basic.h>

Inheritance diagram for NL3D::CPSSizedParticle:

NL3D::CPSConstraintMesh NL3D::CPSFaceLookAt::CSecondSize NL3D::CPSFanLight NL3D::CPSMesh NL3D::CPSQuad NL3D::CPSRibbon NL3D::CPSRibbonLookAt NL3D::CPSShockWave

Detailed Description

this class adds tunable size to a particle. Can be added using public multiple inheritance

Definition at line 252 of file ps_particle_basic.h.

Public Member Functions

 CPSSizedParticle ()
 ctor : default are 0.1f sized particles

float getSize (void) const
 get the constant size

const CPSAttribMaker< float > * getSizeScheme (void) const
 get the size scheme (NULL if none) const version

CPSAttribMaker< float > * getSizeScheme (void)
 get the size scheme (NULL if none)

void serialSizeScheme (NLMISC::IStream &f) throw (NLMISC::EStream)
 serialization. We choose a different name because of multiple-inheritance

void setSize (float size)
 Set a constant size for the particles.

void setSizeScheme (CPSAttribMaker< float > *size)
virtual ~CPSSizedParticle ()
 dtor


Protected Member Functions

void deleteSizeElement (uint32 index)
virtual CPSLocatedgetSizeOwner (void)=0
 deriver must return their owner there

void newSizeElement (CPSLocated *emitterLocated, uint32 emitterIndex)
void resizeSize (uint32 size)

Protected Attributes

float _ParticleSize
CPSAttribMaker< float > * _SizeScheme


Constructor & Destructor Documentation

NL3D::CPSSizedParticle::CPSSizedParticle  ) 
 

ctor : default are 0.1f sized particles

Definition at line 200 of file ps_particle_basic.cpp.

00200                                    : _ParticleSize(0.3f), _SizeScheme(NULL)
00201 {
00202 }

NL3D::CPSSizedParticle::~CPSSizedParticle  )  [virtual]
 

dtor

Definition at line 205 of file ps_particle_basic.cpp.

References _SizeScheme.

00206 {       
00207         delete _SizeScheme;     
00208 }


Member Function Documentation

void NL3D::CPSSizedParticle::deleteSizeElement uint32  index  )  [inline, protected]
 

Definition at line 295 of file ps_particle_basic.h.

References _SizeScheme, NL3D::CPSAttribMaker< float >::deleteElement(), NL3D::CPSAttribMaker< float >::hasMemory(), index, and uint32.

Referenced by NL3D::CPSShockWave::deleteElement(), NL3D::CPSRibbonLookAt::deleteElement(), NL3D::CPSRibbon::deleteElement(), NL3D::CPSQuad::deleteElement(), NL3D::CPSConstraintMesh::deleteElement(), NL3D::CPSMesh::deleteElement(), and NL3D::CPSFanLight::deleteElement().

00296                 {
00297                         if (_SizeScheme && _SizeScheme->hasMemory()) _SizeScheme->deleteElement(index);
00298                 }

float NL3D::CPSSizedParticle::getSize void   )  const [inline]
 

get the constant size

Definition at line 274 of file ps_particle_basic.h.

References _ParticleSize.

Referenced by NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), resizeSize(), and setSizeScheme().

00274 { return _ParticleSize; }

virtual CPSLocated* NL3D::CPSSizedParticle::getSizeOwner void   )  [protected, pure virtual]
 

deriver must return their owner there

Implemented in NL3D::CPSFaceLookAt::CSecondSize, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSShockWave.

Referenced by resizeSize(), and setSizeScheme().

const CPSAttribMaker<float>* NL3D::CPSSizedParticle::getSizeScheme void   )  const [inline]
 

get the size scheme (NULL if none) const version

Definition at line 268 of file ps_particle_basic.h.

References _SizeScheme.

00268 { return _SizeScheme; }

CPSAttribMaker<float>* NL3D::CPSSizedParticle::getSizeScheme void   )  [inline]
 

get the size scheme (NULL if none)

Definition at line 265 of file ps_particle_basic.h.

References _SizeScheme.

Referenced by NL3D::CPSFaceLookAtHelper::drawLookAt(), and NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion().

00265 { return _SizeScheme; }

void NL3D::CPSSizedParticle::newSizeElement CPSLocated emitterLocated,
uint32  emitterIndex
[inline, protected]
 

Definition at line 291 of file ps_particle_basic.h.

References _SizeScheme, NL3D::CPSAttribMaker< float >::hasMemory(), NL3D::CPSAttribMaker< float >::newElement(), and uint32.

Referenced by NL3D::CPSShockWave::newElement(), NL3D::CPSRibbonLookAt::newElement(), NL3D::CPSRibbon::newElement(), NL3D::CPSQuad::newElement(), NL3D::CPSConstraintMesh::newElement(), NL3D::CPSMesh::newElement(), and NL3D::CPSFanLight::newElement().

00292                 {
00293                         if (_SizeScheme && _SizeScheme->hasMemory()) _SizeScheme->newElement(emitterLocated, emitterIndex);
00294                 }       

void NL3D::CPSSizedParticle::resizeSize uint32  size  )  [inline, protected]
 

Definition at line 299 of file ps_particle_basic.h.

References _SizeScheme, getSize(), getSizeOwner(), NL3D::CPSAttribMaker< float >::hasMemory(), nlassert, NL3D::CPSAttribMaker< float >::resize(), size, and uint32.

Referenced by NL3D::CPSShockWave::resize(), NL3D::CPSRibbonLookAt::resize(), NL3D::CPSRibbon::resize(), NL3D::CPSQuad::resize(), NL3D::CPSConstraintMesh::resize(), NL3D::CPSMesh::resize(), and NL3D::CPSFanLight::resize().

00300                 {
00301                         nlassert(size < (1 << 16));
00302                         if (_SizeScheme && _SizeScheme->hasMemory()) _SizeScheme->resize(size, getSizeOwner()->getSize());
00303                 }

void NL3D::CPSSizedParticle::serialSizeScheme NLMISC::IStream f  )  throw (NLMISC::EStream)
 

serialization. We choose a different name because of multiple-inheritance

Definition at line 211 of file ps_particle_basic.cpp.

00212 {
00213         f.serialVersion(1);     
00214         if (f.isReading())
00215         {
00216                 if (_SizeScheme)
00217                 {
00218                         delete _SizeScheme;
00219                         _SizeScheme = NULL;
00220                 }
00221         }
00222         bool useSizeScheme = _SizeScheme != NULL;
00223         f.serial(useSizeScheme);
00224         if (useSizeScheme)
00225         {               
00226                 f.serialPolyPtr(_SizeScheme);
00227         }
00228         else
00229         {
00230                 f.serial(_ParticleSize);
00231         }       
00232 };

void NL3D::CPSSizedParticle::setSize float  size  ) 
 

Set a constant size for the particles.

Definition at line 192 of file ps_particle_basic.cpp.

References _ParticleSize, _SizeScheme, and size.

00193 {       
00194         delete _SizeScheme;
00195         _SizeScheme = NULL;     
00196         _ParticleSize = size;
00197 }

void NL3D::CPSSizedParticle::setSizeScheme CPSAttribMaker< float > *  size  ) 
 

Set an attribute maker that produce a size It must have been allocated by new It will be deleted by this object

Definition at line 183 of file ps_particle_basic.cpp.

References _SizeScheme, getSize(), getSizeOwner(), nlassert, and size.

00184 {       
00185         nlassert(size != NULL);
00186         delete _SizeScheme;     
00187         _SizeScheme = size;
00188         if (getSizeOwner() && size->hasMemory()) size->resize(getSizeOwner()->getMaxSize(), getSizeOwner()->getSize());
00189 }


Field Documentation

float NL3D::CPSSizedParticle::_ParticleSize [protected]
 

Definition at line 289 of file ps_particle_basic.h.

Referenced by NL3D::CPSFaceHelper::drawFaces(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CPSConstraintMeshHelper::drawMeshs(), NL3D::CPSConstraintMeshHelper::drawPrerotatedMeshs(), getSize(), and setSize().

CPSAttribMaker<float>* NL3D::CPSSizedParticle::_SizeScheme [protected]
 

Definition at line 290 of file ps_particle_basic.h.

Referenced by deleteSizeElement(), NL3D::CPSFaceHelper::drawFaces(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CPSConstraintMeshHelper::drawMeshs(), NL3D::CPSConstraintMeshHelper::drawPrerotatedMeshs(), getSizeScheme(), newSizeElement(), resizeSize(), setSize(), setSizeScheme(), and ~CPSSizedParticle().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 07:25:18 2004 for NeL by doxygen 1.3.6