NL3D::CPSFloatBinOp Class Reference

#include <ps_float.h>

Inheritance diagram for NL3D::CPSFloatBinOp:

NL3D::CPSAttribMakerBinOp< float > NL3D::CPSAttribMaker< float > NL3D::CPSAttribMakerBase NLMISC::IStreamable NLMISC::IClassable

Detailed Description

An attribute maker whose output if the result of a binary op on floats

Definition at line 97 of file ps_float.h.

Public Member Functions

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

virtual float get (float input)
virtual float get (CPSLocated *loc, uint32 index)
 compute one value of the attribute from the given located at the given index

const CPSAttribMaker< float > * getArg (uint argNb) const
CPSAttribMaker< float > * getArg (uint argNb)
virtual bool getClamping (void) const
virtual std::string getClassName ()=0
virtual CPSInputType getInput (void) const
virtual float getMaxValue (void) const
 get the min value, or an evalution that is guaranteed to be < to it (meaningful for ordered set only)

virtual float getMinValue (void) const
 get the max value, or an evalution that is guaranteed to be > to it (meaningful for ordered set only)

float getNbCycles (void) const
CPSBinOp::BinOp getOp (void) const
 get the current operator

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

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

bool hasMemory (void) const
virtual bool isClampingSupported (void) const
virtual void * make (CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, bool allowNoCopy=false, uint32 srcStep=(1<< 16)) const
virtual void make4 (CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, uint32 srcStep=(1<< 16)) const
virtual void makeN (CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, uint32 nbReplicate, uint32 srcStep=(1<< 16)) const
virtual void newElement (CPSLocated *emitterLocated, uint32 emitterIndex)
 NLMISC_DECLARE_CLASS (CPSFloatBinOp)
virtual void resize (uint32 capacity, uint32 nbPresentElements)
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)

void setArg (uint argNb, CPSAttribMaker< float > *arg)
virtual void setClamping (bool enable=true)
virtual void setInput (const CPSInputType &input)
void setNbCycles (float nbCycles)
void setOp (CPSBinOp::BinOp op)
bool supportOp (CPSBinOp::BinOp op)
 return true if an operation is supported. The default support all ops


Protected Member Functions

void clean (void)
void make4Private (float *buf1, float *buf2, CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, uint32 srcStep=(1<< 16)) const
void makeNPrivate (float *buf1, float *buf2, CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, uint32 nbReplicate, uint32 srcStep=(1<< 16)) const
void * makePrivate (float *buf1, float *buf2, CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, bool allowNoCopy=false, uint32 srcStep=(1<< 16)) const

Protected Attributes

CPSAttribMaker< float > * _Arg [2]
bool _HasMemory
uint32 _MaxSize
float _NbCycles
CPSBinOp::BinOp _Op
uint32 _Size


Member Function Documentation

void NL3D::CPSAttribMakerBinOp< float >::clean void   )  [protected, inherited]
 

CPSAttribMakerBase* NL3D::CPSFloatBinOp::clone  )  const [inline, virtual]
 

Implements NL3D::CPSAttribMakerBase.

Definition at line 101 of file ps_float.h.

00101 { return new CPSFloatBinOp(*this); }

virtual void NL3D::CPSAttribMakerBinOp< float >::deleteElement uint32  index  )  [virtual, inherited]
 

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

Reimplemented from NL3D::CPSAttribMaker< float >.

virtual float NL3D::CPSAttribMaker< float >::get float  input  )  [inline, virtual, inherited]
 

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< float, CPSFloatCurveFunctor >, NL3D::CPSAttribMakerT< float, CPSValueGradientFunc< float > >, and NL3D::CPSAttribMakerT< float, CPSValueBlendFunc< float > >.

Definition at line 161 of file ps_attrib_maker.h.

00161 { nlassert(0); return T(); /* not supported by default */ }

virtual float NL3D::CPSAttribMakerBinOp< float >::get CPSLocated loc,
uint32  index
[virtual, inherited]
 

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

Implements NL3D::CPSAttribMaker< float >.

const CPSAttribMaker<float >* NL3D::CPSAttribMakerBinOp< float >::getArg uint  argNb  )  const [inline, inherited]
 

get an argument, const version

See also:
setArg

Definition at line 148 of file ps_attrib_maker_bin_op.h.

00149                 {
00150                         nlassert(argNb < 2);
00151                         return _Arg[argNb];
00152                 }

CPSAttribMaker<float >* NL3D::CPSAttribMakerBinOp< float >::getArg uint  argNb  )  [inline, inherited]
 

get an argument

See also:
setArg

Definition at line 139 of file ps_attrib_maker_bin_op.h.

00140                 {
00141                         nlassert(argNb < 2);
00142                         return _Arg[argNb];
00143                 }

virtual bool NL3D::CPSAttribMaker< float >::getClamping void   )  const [inline, virtual, inherited]
 

Test if the clamping is enabled. The default is false (clamping unsupported)

See also:
isClampingSupported()

Reimplemented in NL3D::CPSAttribMakerT< float, CPSFloatCurveFunctor >, NL3D::CPSAttribMakerT< float, CPSValueGradientFunc< float > >, and NL3D::CPSAttribMakerT< float, CPSValueBlendFunc< float > >.

Definition at line 272 of file ps_attrib_maker.h.

00272 { return false  ; }

virtual std::string NLMISC::IClassable::getClassName  )  [pure virtual, inherited]
 

Implemented in NLAIAGENT::CNumericIndex, NLAIC::IPointerGestion, NLAIC::CIdentType, and CAutomataDesc.

Referenced by NLMISC::CClassRegistry::checkObject(), and NL3D::GetTextureSize().

virtual CPSInputType NL3D::CPSAttribMaker< float >::getInput void   )  const [inline, virtual, inherited]
 

get the type of input (if supported). The default return attrDate

See also:
hasCustomInput()

Reimplemented in NL3D::CPSAttribMakerT< float, CPSFloatCurveFunctor >, NL3D::CPSAttribMakerT< float, CPSValueGradientFunc< float > >, and NL3D::CPSAttribMakerT< float, CPSValueBlendFunc< float > >.

Definition at line 251 of file ps_attrib_maker.h.

00251 { return CPSInputType() ; }

float NL3D::CPSAttribMakerBinOp< float >::getMaxValue void   )  const [inline, virtual, inherited]
 

get the min value, or an evalution that is guaranteed to be < to it (meaningful for ordered set only)

Reimplemented from NL3D::CPSAttribMaker< float >.

Definition at line 175 of file ps_attrib_maker_bin_op.h.

00175 { return T() ; /* no mean by default */ }

float NL3D::CPSAttribMakerBinOp< float >::getMinValue void   )  const [inline, virtual, inherited]
 

get the max value, or an evalution that is guaranteed to be > to it (meaningful for ordered set only)

Reimplemented from NL3D::CPSAttribMaker< float >.

Definition at line 174 of file ps_attrib_maker_bin_op.h.

00174 { return T() ; /* no mean by default */ }       

float NL3D::CPSAttribMaker< float >::getNbCycles void   )  const [inline, inherited]
 

Retrieve the number of cycles

See also:
setNbCycles()

Definition at line 236 of file ps_attrib_maker.h.

00236 { return _NbCycles ; }

CPSBinOp::BinOp NL3D::CPSAttribMakerBinOp< float >::getOp void   )  const [inline, inherited]
 

get the current operator

Definition at line 170 of file ps_attrib_maker_bin_op.h.

00170 { return _Op; }

const char * NL3D::CPSAttribMaker< float >::getType void   )  [inline, virtual, inherited]
 

inherited from CPSAttribMakerBase. Template specialization will do the job

Implements NL3D::CPSAttribMakerBase.

Definition at line 147 of file ps_attrib_maker.h.

00147 { return "UNKNOWN"; }

virtual bool NL3D::CPSAttribMaker< float >::hasCustomInput void   )  [inline, virtual, inherited]
 

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< float, CPSFloatCurveFunctor >, NL3D::CPSAttribMakerT< float, CPSValueGradientFunc< float > >, and NL3D::CPSAttribMakerT< float, CPSValueBlendFunc< float > >.

Definition at line 239 of file ps_attrib_maker.h.

00239 { return false ; }

bool NL3D::CPSAttribMaker< float >::hasMemory void   )  const [inline, inherited]
 

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 282 of file ps_attrib_maker.h.

Referenced by NL3D::CPSRotated2DParticle::deleteAngle2DElement(), NL3D::CPSSound::deleteElement(), NL3D::CPSConstraintMesh::deleteElement(), NL3D::CPSLight::deleteElement(), NL3D::CPSEmitter::deleteElement(), NL3D::CPSModulatedEmitter::deleteEmitteeSpeedElement(), NL3D::CPSForceIntensity::deleteForceIntensityElement(), NL3D::CPSSizedParticle::deleteSizeElement(), NL3D::CPSRotated2DParticle::newAngle2DElement(), NL3D::CPSSound::newElement(), NL3D::CPSConstraintMesh::newElement(), NL3D::CPSLight::newElement(), NL3D::CPSEmitter::newElement(), NL3D::CPSModulatedEmitter::newEmitteeSpeedElement(), NL3D::CPSForceIntensity::newForceIntensityElement(), NL3D::CPSSizedParticle::newSizeElement(), NL3D::CPSSound::resize(), NL3D::CPSConstraintMesh::resize(), NL3D::CPSLight::resize(), NL3D::CPSEmitter::resize(), NL3D::CPSRotated2DParticle::resizeAngle2D(), NL3D::CPSModulatedEmitter::resizeEmitteeSpeed(), NL3D::CPSForceIntensity::resizeForceIntensity(), NL3D::CPSSizedParticle::resizeSize(), NL3D::CPSLight::setAttenEndScheme(), NL3D::CPSLight::setAttenStartScheme(), NL3D::CPSSound::setGainScheme(), NL3D::CPSConstraintMesh::setMorphScheme(), and NL3D::CPSSound::setPitchScheme().

00282 { return _HasMemory ; }

virtual bool NL3D::CPSAttribMaker< float >::isClampingSupported void   )  const [inline, virtual, inherited]
 

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

Reimplemented in NL3D::CPSAttribMakerT< float, CPSFloatCurveFunctor >, NL3D::CPSAttribMakerT< float, CPSValueGradientFunc< float > >, and NL3D::CPSAttribMakerT< float, CPSValueBlendFunc< float > >.

Definition at line 258 of file ps_attrib_maker.h.

00258 { return false ; }

virtual void* NL3D::CPSAttribMakerBinOp< float >::make CPSLocated loc,
uint32  startIndex,
void *  tab,
uint32  stride,
uint32  numAttrib,
bool  allowNoCopy = false,
uint32  srcStep = (1 << 16)
const [virtual, inherited]
 

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

Implements NL3D::CPSAttribMaker< float >.

virtual void NL3D::CPSAttribMakerBinOp< float >::make4 CPSLocated loc,
uint32  startIndex,
void *  tab,
uint32  stride,
uint32  numAttrib,
uint32  srcStep = (1 << 16)
const [virtual, inherited]
 

The same as make, but it replicate each attribute 4 times, thus filling 4*numAttrib. Useful for facelookat and the like

See also:
make()

Implements NL3D::CPSAttribMaker< float >.

void NL3D::CPSAttribMakerBinOp< float >::make4Private float *  buf1,
float *  buf2,
CPSLocated loc,
uint32  startIndex,
void *  tab,
uint32  stride,
uint32  numAttrib,
uint32  srcStep = (1 << 16)
const [protected, inherited]
 

virtual void NL3D::CPSAttribMakerBinOp< float >::makeN CPSLocated loc,
uint32  startIndex,
void *  tab,
uint32  stride,
uint32  numAttrib,
uint32  nbReplicate,
uint32  srcStep = (1 << 16)
const [virtual, inherited]
 

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

See also:
make4

Implements NL3D::CPSAttribMaker< float >.

void NL3D::CPSAttribMakerBinOp< float >::makeNPrivate float *  buf1,
float *  buf2,
CPSLocated loc,
uint32  startIndex,
void *  tab,
uint32  stride,
uint32  numAttrib,
uint32  nbReplicate,
uint32  srcStep = (1 << 16)
const [protected, inherited]
 

void* NL3D::CPSAttribMakerBinOp< float >::makePrivate float *  buf1,
float *  buf2,
CPSLocated loc,
uint32  startIndex,
void *  tab,
uint32  stride,
uint32  numAttrib,
bool  allowNoCopy = false,
uint32  srcStep = (1 << 16)
const [protected, inherited]
 

virtual void NL3D::CPSAttribMakerBinOp< float >::newElement CPSLocated emitterLocated,
uint32  emitterIndex
[virtual, inherited]
 

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

Reimplemented from NL3D::CPSAttribMaker< float >.

NL3D::CPSFloatBinOp::NLMISC_DECLARE_CLASS CPSFloatBinOp   ) 
 

virtual void NL3D::CPSAttribMakerBinOp< float >::resize uint32  capacity,
uint32  nbPresentElements
[virtual, inherited]
 

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 from NL3D::CPSAttribMaker< float >.

virtual void NL3D::CPSAttribMakerBinOp< float >::serial NLMISC::IStream f  )  throw (NLMISC::EStream) [virtual, inherited]
 

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

Reimplemented from NL3D::CPSAttribMaker< float >.

void NL3D::CPSAttribMakerBinOp< float >::setArg uint  argNb,
CPSAttribMaker< float > *  arg
[inline, inherited]
 

set an argument for the operator

Parameters:
argNb must be 0 or 1 for the first and second argument
arg The argument. Must have been allocated by new, and is then owned by this object

Definition at line 125 of file ps_attrib_maker_bin_op.h.

00126                 {
00127                         nlassert(argNb < 2);
00128                         delete _Arg[argNb];
00129                         _Arg[argNb] = arg;
00130                         if (arg->hasMemory())
00131                         {
00132                                 arg->resize(_MaxSize, _Size);
00133                         }               
00134                 }

virtual void NL3D::CPSAttribMaker< float >::setClamping bool  enable = true  )  [inline, virtual, inherited]
 

Enable, disable the clamping of input values. The default does nothing (clamping unsupported)

See also:
isClampingSupported()

Reimplemented in NL3D::CPSAttribMakerT< float, CPSFloatCurveFunctor >, NL3D::CPSAttribMakerT< float, CPSValueGradientFunc< float > >, and NL3D::CPSAttribMakerT< float, CPSValueBlendFunc< float > >.

Definition at line 265 of file ps_attrib_maker.h.

00265 {} ;

virtual void NL3D::CPSAttribMaker< float >::setInput const CPSInputType input  )  [inline, virtual, inherited]
 

set a new input type (if supported). The default does nothing

See also:
hasCustomInput()

Reimplemented in NL3D::CPSAttribMakerT< float, CPSFloatCurveFunctor >, NL3D::CPSAttribMakerT< float, CPSValueGradientFunc< float > >, and NL3D::CPSAttribMakerT< float, CPSValueBlendFunc< float > >.

Definition at line 245 of file ps_attrib_maker.h.

00245 {}

void NL3D::CPSAttribMaker< float >::setNbCycles float  nbCycles  )  [inline, inherited]
 

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 227 of file ps_attrib_maker.h.

00228                 { 
00229                         nlassert(nbCycles >= 0) ;
00230                         _NbCycles = nbCycles ; 
00231                 }

void NL3D::CPSAttribMakerBinOp< float >::setOp CPSBinOp::BinOp  op  )  [inline, inherited]
 

Set the operator to use An assertion is thrown when no available

Definition at line 160 of file ps_attrib_maker_bin_op.h.

00161                 {
00162                         nlassert(supportOp(op));
00163                         _Op = op;
00164                 }

bool NL3D::CPSAttribMakerBinOp< float >::supportOp CPSBinOp::BinOp  op  )  [inline, inherited]
 

return true if an operation is supported. The default support all ops

Definition at line 167 of file ps_attrib_maker_bin_op.h.

00167 { return true; }


Field Documentation

CPSAttribMaker<float >* NL3D::CPSAttribMakerBinOp< float >::_Arg[2] [protected, inherited]
 

Definition at line 211 of file ps_attrib_maker_bin_op.h.

bool NL3D::CPSAttribMaker< float >::_HasMemory [protected, inherited]
 

Definition at line 304 of file ps_attrib_maker.h.

uint32 NL3D::CPSAttribMakerBinOp< float >::_MaxSize [protected, inherited]
 

Definition at line 213 of file ps_attrib_maker_bin_op.h.

float NL3D::CPSAttribMaker< float >::_NbCycles [protected, inherited]
 

Definition at line 301 of file ps_attrib_maker.h.

CPSBinOp::BinOp NL3D::CPSAttribMakerBinOp< float >::_Op [protected, inherited]
 

Definition at line 210 of file ps_attrib_maker_bin_op.h.

uint32 NL3D::CPSAttribMakerBinOp< float >::_Size [protected, inherited]
 

Definition at line 213 of file ps_attrib_maker_bin_op.h.


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 07:13:12 2004 for NeL by doxygen 1.3.6