NL3D::CPSPlaneBasisBinOp Class Reference

#include <ps_plane_basis_maker.h>

Inheritance diagram for NL3D::CPSPlaneBasisBinOp:

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

Detailed Description

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

Definition at line 178 of file ps_plane_basis_maker.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 CPlaneBasis get (float input)
virtual CPlaneBasis get (CPSLocated *loc, uint32 index)
 compute one value of the attribute from the given located at the given index

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

virtual CPlaneBasis 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 (CPSPlaneBasisBinOp)
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< CPlaneBasis > *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)
 cplane basis template specialization for supportOp


Protected Member Functions

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

Protected Attributes

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


Member Function Documentation

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

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

Implements NL3D::CPSAttribMakerBase.

Definition at line 182 of file ps_plane_basis_maker.h.

00182 { return new CPSPlaneBasisBinOp(*this); }

virtual void NL3D::CPSAttribMakerBinOp< CPlaneBasis >::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< CPlaneBasis >.

virtual CPlaneBasis NL3D::CPSAttribMaker< CPlaneBasis >::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< CPlaneBasis, CPSValueBlendFunc< CPlaneBasis > >, NL3D::CPSAttribMakerT< CPlaneBasis, CPSValueGradientFunc< CPlaneBasis > >, and NL3D::CPSAttribMakerT< CPlaneBasis, CSpinnerFunctor >.

Definition at line 161 of file ps_attrib_maker.h.

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

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

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

Implements NL3D::CPSAttribMaker< CPlaneBasis >.

const CPSAttribMaker<CPlaneBasis >* NL3D::CPSAttribMakerBinOp< CPlaneBasis >::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<CPlaneBasis >* NL3D::CPSAttribMakerBinOp< CPlaneBasis >::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< CPlaneBasis >::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< CPlaneBasis, CPSValueBlendFunc< CPlaneBasis > >, NL3D::CPSAttribMakerT< CPlaneBasis, CPSValueGradientFunc< CPlaneBasis > >, and NL3D::CPSAttribMakerT< CPlaneBasis, CSpinnerFunctor >.

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< CPlaneBasis >::getInput void   )  const [inline, virtual, inherited]
 

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

See also:
hasCustomInput()

Reimplemented in NL3D::CPSAttribMakerT< CPlaneBasis, CPSValueBlendFunc< CPlaneBasis > >, NL3D::CPSAttribMakerT< CPlaneBasis, CPSValueGradientFunc< CPlaneBasis > >, and NL3D::CPSAttribMakerT< CPlaneBasis, CSpinnerFunctor >.

Definition at line 251 of file ps_attrib_maker.h.

00251 { return CPSInputType() ; }

virtual CPlaneBasis NL3D::CPSAttribMakerBinOp< CPlaneBasis >::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< CPlaneBasis >.

Definition at line 175 of file ps_attrib_maker_bin_op.h.

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

virtual CPlaneBasis NL3D::CPSAttribMakerBinOp< CPlaneBasis >::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< CPlaneBasis >.

Definition at line 174 of file ps_attrib_maker_bin_op.h.

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

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

Definition at line 239 of file ps_attrib_maker.h.

00239 { return false ; }

bool NL3D::CPSAttribMaker< CPlaneBasis >::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::CPSRotated3DPlaneParticle::deletePlaneBasisElement(), NL3D::CPSRotated3DPlaneParticle::newPlaneBasisElement(), and NL3D::CPSRotated3DPlaneParticle::resizePlaneBasis().

00282 { return _HasMemory ; }

virtual bool NL3D::CPSAttribMaker< CPlaneBasis >::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< CPlaneBasis, CPSValueBlendFunc< CPlaneBasis > >, NL3D::CPSAttribMakerT< CPlaneBasis, CPSValueGradientFunc< CPlaneBasis > >, and NL3D::CPSAttribMakerT< CPlaneBasis, CSpinnerFunctor >.

Definition at line 258 of file ps_attrib_maker.h.

00258 { return false ; }

virtual void* NL3D::CPSAttribMakerBinOp< CPlaneBasis >::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< CPlaneBasis >.

virtual void NL3D::CPSAttribMakerBinOp< CPlaneBasis >::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< CPlaneBasis >.

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

virtual void NL3D::CPSAttribMakerBinOp< CPlaneBasis >::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< CPlaneBasis >.

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

void* NL3D::CPSAttribMakerBinOp< CPlaneBasis >::makePrivate CPlaneBasis buf1,
CPlaneBasis 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< CPlaneBasis >::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< CPlaneBasis >.

NL3D::CPSPlaneBasisBinOp::NLMISC_DECLARE_CLASS CPSPlaneBasisBinOp   ) 
 

virtual void NL3D::CPSAttribMakerBinOp< CPlaneBasis >::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< CPlaneBasis >.

virtual void NL3D::CPSAttribMakerBinOp< CPlaneBasis >::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< CPlaneBasis >.

void NL3D::CPSAttribMakerBinOp< CPlaneBasis >::setArg uint  argNb,
CPSAttribMaker< CPlaneBasis > *  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< CPlaneBasis >::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< CPlaneBasis, CPSValueBlendFunc< CPlaneBasis > >, NL3D::CPSAttribMakerT< CPlaneBasis, CPSValueGradientFunc< CPlaneBasis > >, and NL3D::CPSAttribMakerT< CPlaneBasis, CSpinnerFunctor >.

Definition at line 265 of file ps_attrib_maker.h.

00265 {} ;

virtual void NL3D::CPSAttribMaker< CPlaneBasis >::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< CPlaneBasis, CPSValueBlendFunc< CPlaneBasis > >, NL3D::CPSAttribMakerT< CPlaneBasis, CPSValueGradientFunc< CPlaneBasis > >, and NL3D::CPSAttribMakerT< CPlaneBasis, CSpinnerFunctor >.

Definition at line 245 of file ps_attrib_maker.h.

00245 {}

void NL3D::CPSAttribMaker< CPlaneBasis >::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< CPlaneBasis >::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< CPlaneBasis >::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<CPlaneBasis >* NL3D::CPSAttribMakerBinOp< CPlaneBasis >::_Arg[2] [protected, inherited]
 

Definition at line 211 of file ps_attrib_maker_bin_op.h.

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

Definition at line 304 of file ps_attrib_maker.h.

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

Definition at line 213 of file ps_attrib_maker_bin_op.h.

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

Definition at line 301 of file ps_attrib_maker.h.

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

Definition at line 210 of file ps_attrib_maker_bin_op.h.

uint32 NL3D::CPSAttribMakerBinOp< CPlaneBasis >::_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:19:23 2004 for NeL by doxygen 1.3.6