# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CPSAttribMaker Class Template Reference

This is a base class for any attrib maker. More...

#include <ps_attrib_maker.h>

Inheritance diagram for NL3D::CPSAttribMaker:

NL3D::CPSAttribMakerBase NLMISC::IStreamable NLMISC::IClassable NL3D::CPSAttribMakerBinOp NL3D::CPSAttribMakerMemory NL3D::CPSAttribMakerT NL3D::CPSAttribMakerT< T, CPSValueBlendFunc< T > > NL3D::CPSAttribMakerT< T, CPSValueBlendSampleFunc< T, n > > NL3D::CPSAttribMakerT< T, CPSValueGradientFunc< T > > NL3D::CPSValueBlender NL3D::CPSValueBlenderSample NL3D::CPSValueGradient List of all members.

Public Methods

virtual T getMaxValue (void) const
 get the max value (meaningful for ordered set only). More...

Object
 CPSAttribMaker (float nbCycles=1.f)
 construct the attrib maker specifying the number of cycles to do. More...

virtual void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 serialisation of the object. Derivers MUST call this, (if they use the attribute of this class at least). More...

virtual const char * getType ()
 inherited from CPSAttribMakerBase. Template specialization will do the job. More...

virtual ~CPSAttribMaker ()
 dtor. More...

Production of attribute
virtual T get (CPSLocated *loc, uint32 index)=0
 compute one value of the attribute from the given located at the given index. More...

virtual T get (float input)
 Direct lookup of the result value from a float input (if it makes sense). More...

virtual void * make (CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, bool allowNoCopy=false, uint32 srcStep=(1<< 16)) const=0
 Fill tab with an attribute by using the given stride. More...

virtual void make4 (CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, uint32 srcStep=(1<< 16)) const=0
 The same as make, but it replicate each attribute 4 times, thus filling 4*numAttrib. More...

virtual void makeN (CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, uint32 nbReplicate, uint32 srcStep=(1<< 16)) const=0
 The same as make4, but with n replication instead of 4. More...

Input properties of the attribute maker
void setNbCycles (float nbCycles)
 Set the number of cycles that must be done during the life of a particle, or the number of cycle per second for a particle that has no life limit. More...

float getNbCycles (void) const
 Retrieve the number of cycles. More...

virtual bool hasCustomInput (void)
 tells wether one may choose one attribute from a CPSLocated to use as an input. If false, the input(s) is fixed. More...

virtual void setInput (const CPSInputType &input)
 set a new input type (if supported). More...

virtual CPSInputType getInput (void) const
 get the type of input (if supported). More...

virtual bool isClampingSupported (void) const
 tells wether clamping is supported for the input (value can't go above MaxInputValue) The default is false. More...

virtual void setClamping (bool enable=true)
 Enable, disable the clamping of input values. More...

virtual bool getClamping (void) const
 Test if the clamping is enabled. More...

Memory managment
bool hasMemory (void) const
 Some attribute makers may hold memory. More...

virtual void deleteElement (uint32 index)
 delete an element, given its index. this must be called only if memory management is used. More...

virtual void newElement (CPSLocated *emitterLocated, uint32 emitterIndex)
 create a new element, and provides the emitter, this must be called only if this attribute maker has its own memory. More...

virtual void resize (uint32 capacity, uint32 nbPresentElements)
 set a new capacity for the memorized attribute, and a number of used element. More...


Protected Attributes

float _NbCycles
bool _HasMemory

Detailed Description

template<typename T>
class NL3D::CPSAttribMaker< T >

This is a base class for any attrib maker.

It produce an attribute used in a particle system. It can be used to fill a vertex buffer, or a table.

Author:
Nicolas Vizerie , Nevrax France
Date:
2001

Definition at line 122 of file ps_attrib_maker.h.


Constructor & Destructor Documentation

template<typename T>
NL3D::CPSAttribMaker< T >::CPSAttribMaker float    nbCycles = 1.f [inline]
 

construct the attrib maker specifying the number of cycles to do.

See also:
setNbCycles()

Definition at line 130 of file ps_attrib_maker.h.

Referenced by NL3D::CPSAttribMakerMemory< sint32 >::CPSAttribMakerMemory, and NL3D::CPSAttribMakerT< uint32, CPSValueBlendFunc< uint32 > >::CPSAttribMakerT.

template<typename T>
virtual NL3D::CPSAttribMaker< T >::~CPSAttribMaker   [inline, virtual]
 

dtor.

Definition at line 145 of file ps_attrib_maker.h.


Member Function Documentation

template<typename T>
virtual void NL3D::CPSAttribMaker< T >::deleteElement uint32    index [inline, virtual]
 

delete an element, given its index. this must be called only if memory management is used.

Reimplemented in NL3D::CPSAttribMakerBinOp.

Definition at line 278 of file ps_attrib_maker.h.

template<typename T>
virtual T NL3D::CPSAttribMaker< T >::get float    input [inline, virtual]
 

Direct lookup of the result value from a float input (if it makes sense).

This bypass what was set with setInput The input must be in [0, 1[

Reimplemented in NL3D::CPSAttribMakerT.

Definition at line 156 of file ps_attrib_maker.h.

template<typename T>
virtual T NL3D::CPSAttribMaker< T >::get CPSLocated   loc,
uint32    index
[pure virtual]
 

compute one value of the attribute from the given located at the given index.

Implemented in NL3D::CPSAttribMakerBinOp.

template<typename T>
virtual bool NL3D::CPSAttribMaker< T >::getClamping void    const [inline, virtual]
 

Test if the clamping is enabled.

The default is false (clamping unsupported)

See also:
isClampingSupported()

Reimplemented in NL3D::CPSAttribMakerT.

Definition at line 265 of file ps_attrib_maker.h.

template<typename T>
virtual CPSInputType NL3D::CPSAttribMaker< T >::getInput void    const [inline, virtual]
 

get the type of input (if supported).

The default return attrDate

See also:
hasCustomInput()

Reimplemented in NL3D::CPSAttribMakerT.

Definition at line 244 of file ps_attrib_maker.h.

template<typename T>
virtual T NL3D::CPSAttribMaker< T >::getMaxValue void    const [inline, virtual]
 

get the max value (meaningful for ordered set only).

Reimplemented in NL3D::CPSValueBlender.

Definition at line 210 of file ps_attrib_maker.h.

template<typename T>
float NL3D::CPSAttribMaker< T >::getNbCycles void    const [inline]
 

Retrieve the number of cycles.

See also:
setNbCycles()

Definition at line 229 of file ps_attrib_maker.h.

template<typename T>
virtual const char* NL3D::CPSAttribMaker< T >::getType void    [inline, virtual]
 

inherited from CPSAttribMakerBase. Template specialization will do the job.

Implements NL3D::CPSAttribMakerBase.

Definition at line 142 of file ps_attrib_maker.h.

template<typename T>
virtual bool NL3D::CPSAttribMaker< T >::hasCustomInput void    [inline, virtual]
 

tells wether one may choose one attribute from a CPSLocated to use as an input. If false, the input(s) is fixed.

Reimplemented in NL3D::CPSAttribMakerT.

Definition at line 232 of file ps_attrib_maker.h.

template<typename T>
bool NL3D::CPSAttribMaker< T >::hasMemory void    const [inline]
 

Some attribute makers may hold memory.

this return true when this is the case. This also mean that you must call newElement, deleteElement, and resize, when it is called for the owning object (which is likely to be a CPSLocatedBindable)

Definition at line 275 of file ps_attrib_maker.h.

template<typename T>
virtual bool NL3D::CPSAttribMaker< T >::isClampingSupported void    const [inline, virtual]
 

tells wether clamping is supported for the input (value can't go above MaxInputValue) The default is false.

Reimplemented in NL3D::CPSAttribMakerT.

Definition at line 251 of file ps_attrib_maker.h.

template<typename T>
virtual void* NL3D::CPSAttribMaker< T >::make CPSLocated   loc,
uint32    startIndex,
void *    tab,
uint32    stride,
uint32    numAttrib,
bool    allowNoCopy = false,
uint32    srcStep = (1<< 16)
const [pure virtual]
 

Fill tab with an attribute by using the given stride.

It fills numAttrib attributes.

Parameters:
loc  the 'located' that hold the 'located bindable' that need an attribute to be filled
startIndex  usually 0, it gives the index of the first element in the located (is it multiplied by the step)
tab  where the data will be written
stride  the stride, in byte, between each value to write
numAttrib  the number of attributes to compute
allowNoCopy  data may be already present in memory, and may not need computation. When set to true, this allow no computation to be made the return parameter is then le location of the datas. this may be tab (if recomputation where needed), or another value for this to work, the stride must most of the time be sizeof(T). This is intended to be used with derivers of CPSAttribMaker that store values that do not depend on the input. The make method then just copy the data, we is sometime useless
srcStep  A fixed-point 16:16 value that gives the step for the source iterator
Returns:
where the data have been copied, this is always tab, unless allowNoCopy is set to true, in which case this may be different

Implemented in NL3D::CPSAttribMakerBinOp.

template<typename T>
virtual void NL3D::CPSAttribMaker< T >::make4 CPSLocated   loc,
uint32    startIndex,
void *    tab,
uint32    stride,
uint32    numAttrib,
uint32    srcStep = (1<< 16)
const [pure virtual]
 

The same as make, but it replicate each attribute 4 times, thus filling 4*numAttrib.

Useful for facelookat and the like

See also:
make()

Implemented in NL3D::CPSAttribMakerBinOp.

template<typename T>
virtual void NL3D::CPSAttribMaker< T >::makeN CPSLocated   loc,
uint32    startIndex,
void *    tab,
uint32    stride,
uint32    numAttrib,
uint32    nbReplicate,
uint32    srcStep = (1<< 16)
const [pure virtual]
 

The same as make4, but with n replication instead of 4.

See also:
make4

Implemented in NL3D::CPSAttribMakerBinOp.

template<typename T>
virtual void NL3D::CPSAttribMaker< T >::newElement CPSLocated   emitterLocated,
uint32    emitterIndex
[inline, virtual]
 

create a new element, and provides the emitter, this must be called only if this attribute maker has its own memory.

Reimplemented in NL3D::CPSAttribMakerBinOp.

Definition at line 283 of file ps_attrib_maker.h.

template<typename T>
virtual void NL3D::CPSAttribMaker< T >::resize uint32    capacity,
uint32    nbPresentElements
[inline, virtual]
 

set a new capacity for the memorized attribute, and a number of used element.

This usually is 0 , but during edition, this may not be ... so new element are created. this must be called only if this attribute maker has its own memory

Reimplemented in NL3D::CPSAttribMakerBinOp.

Definition at line 289 of file ps_attrib_maker.h.

template<typename T>
virtual void NL3D::CPSAttribMaker< T >::serial NLMISC::IStream   f throw (NLMISC::EStream) [inline, virtual]
 

serialisation of the object. Derivers MUST call this, (if they use the attribute of this class at least).

Implements NLMISC::IStreamable.

Reimplemented in NL3D::CPSAttribMakerBinOp.

Definition at line 135 of file ps_attrib_maker.h.

template<typename T>
virtual void NL3D::CPSAttribMaker< T >::setClamping bool    enable = true [inline, virtual]
 

Enable, disable the clamping of input values.

The default does nothing (clamping unsupported)

See also:
isClampingSupported()

Reimplemented in NL3D::CPSAttribMakerT.

Definition at line 258 of file ps_attrib_maker.h.

template<typename T>
virtual void NL3D::CPSAttribMaker< T >::setInput const CPSInputType   input [inline, virtual]
 

set a new input type (if supported).

The default does nothing

See also:
hasCustomInput()

Reimplemented in NL3D::CPSAttribMakerT.

Definition at line 238 of file ps_attrib_maker.h.

template<typename T>
void NL3D::CPSAttribMaker< T >::setNbCycles float    nbCycles [inline]
 

Set the number of cycles that must be done during the life of a particle, or the number of cycle per second for a particle that has no life limit.

It is used to multiply the input used by this attribute maker It must be >= 0

Definition at line 220 of file ps_attrib_maker.h.


Member Data Documentation

template<typename T>
bool NL3D::CPSAttribMaker::_HasMemory [protected]
 

Definition at line 297 of file ps_attrib_maker.h.

Referenced by NL3D::CPSAttribMaker< sint32 >::CPSAttribMaker, NL3D::CPSAttribMakerBinOp::CPSAttribMakerBinOp, NL3D::CPSAttribMakerMemory< sint32 >::CPSAttribMakerMemory, and NL3D::CPSAttribMaker< sint32 >::hasMemory.

template<typename T>
float NL3D::CPSAttribMaker::_NbCycles [protected]
 

Definition at line 294 of file ps_attrib_maker.h.

Referenced by NL3D::CPSAttribMaker< sint32 >::CPSAttribMaker, NL3D::CPSAttribMakerT::get, NL3D::CPSAttribMaker< sint32 >::getNbCycles, NL3D::CPSAttribMakerT< uint32, CPSValueBlendFunc< uint32 > >::make4ByIterator, NL3D::CPSAttribMakerT< uint32, CPSValueBlendFunc< uint32 > >::makeByIterator, NL3D::CPSAttribMakerT< uint32, CPSValueBlendFunc< uint32 > >::makeNByIterator, NL3D::CPSAttribMaker< sint32 >::serial, and NL3D::CPSAttribMaker< sint32 >::setNbCycles.


The documentation for this class was generated from the following file: