#include <ps_attrib_maker_bin_op.h>
Inheritance diagram for NL3D::CPSAttribMakerBinOp< T >:
Nevrax France
Definition at line 63 of file ps_attrib_maker_bin_op.h.
Input properties of the attribute maker | |
virtual bool | getClamping (void) const |
virtual CPSInputType | getInput (void) const |
float | getNbCycles (void) const |
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 | |
virtual bool | isClampingSupported (void) const |
virtual void | setClamping (bool enable=true) |
virtual void | setInput (const CPSInputType &input) |
void | setNbCycles (float nbCycles) |
Public Member Functions | |
virtual CPSAttribMakerBase * | clone () const=0 |
virtual std::string | getClassName ()=0 |
virtual T | getMaxValue (void) const |
get the min value, or an evalution that is guaranteed to be < to it (meaningful for ordered set only) | |
virtual T | getMinValue (void) const |
get the max value, or an evalution that is guaranteed to be > to it (meaningful for ordered set only) | |
Object | |
CPSAttribMakerBinOp (const CPSAttribMakerBinOp &other) | |
copy ctor | |
CPSAttribMakerBinOp () | |
virtual | ~CPSAttribMakerBinOp () |
dtor | |
Protected Member Functions | |
void | clean (void) |
void | make4Private (T *buf1, T *buf2, CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, uint32 srcStep=(1<< 16)) const |
void | makeNPrivate (T *buf1, T *buf2, CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, uint32 nbReplicate, uint32 srcStep=(1<< 16)) const |
void * | makePrivate (T *buf1, T *buf2, CPSLocated *loc, uint32 startIndex, void *tab, uint32 stride, uint32 numAttrib, bool allowNoCopy=false, uint32 srcStep=(1<< 16)) const |
Protected Attributes | |
CPSAttribMaker< T > * | _Arg [2] |
bool | _HasMemory |
uint32 | _MaxSize |
float | _NbCycles |
CPSBinOp::BinOp | _Op |
uint32 | _Size |
|
default ctor It construct an selectArg1 operator. The 2 argument are set to NULL, Which mean that an assertion will happen if get, make ... are called before setArg is called Definition at line 299 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::_Arg.
|
|
copy ctor
Definition at line 286 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::_Arg, NL3D::CPSAttribMakerBinOp< T >::_MaxSize, NL3D::CPSAttribMakerBinOp< T >::_Op, and NL3D::CPSAttribMakerBinOp< T >::_Size.
00286 : CPSAttribMaker<T>(other) // parent copy ctor 00287 { 00288 std::auto_ptr<CPSAttribMaker<T> > a0(NLMISC::safe_cast<CPSAttribMaker<T> *>(other._Arg[0]->clone())) 00289 , a1(NLMISC::safe_cast<CPSAttribMaker<T> *>(other._Arg[1]->clone())); 00290 this->_Op = other._Op; 00291 this->_Size = other._Size; 00292 this->_MaxSize = other._MaxSize; 00293 this->_Arg[0] = a0.release(); 00294 this->_Arg[1] = a1.release(); 00295 } |
|
dtor
Definition at line 315 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::clean().
00316 { 00317 clean(); 00318 } |
|
Definition at line 307 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::_Arg. Referenced by NL3D::CPSAttribMakerBinOp< T >::~CPSAttribMakerBinOp().
|
|
|
delete an element, given its index. this must be called only if memory management is used.
Reimplemented from NL3D::CPSAttribMaker< T >. Definition at line 719 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::_Arg, index, nlassert, and uint32.
|
|
|
compute one value of the attribute from the given located at the given index
Implements NL3D::CPSAttribMaker< T >. Definition at line 330 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::_Arg, NL3D::CPSAttribMakerBinOp< T >::_Op, index, nlstop, NL3D::PSBinOpAdd(), NL3D::PSBinOpModulate(), NL3D::PSBinOpSubtract(), and uint32.
00331 { 00332 switch (_Op) 00333 { 00334 case CPSBinOp::selectArg1: 00335 return _Arg[0]->get(loc, index); 00336 break; 00337 case CPSBinOp::selectArg2: 00338 return _Arg[1]->get(loc, index); 00339 break; 00340 case CPSBinOp::modulate: 00341 return PSBinOpModulate(_Arg[0]->get(loc, index), _Arg[1]->get(loc, index)); 00342 break; 00343 case CPSBinOp::add: 00344 return PSBinOpAdd(_Arg[0]->get(loc, index), _Arg[1]->get(loc, index)); 00345 break; 00346 case CPSBinOp::subtract: 00347 return PSBinOpSubtract(_Arg[0]->get(loc, index), _Arg[1]->get(loc, index)); 00348 break; 00349 default: break; 00350 } 00351 00352 nlstop; 00353 return T(); 00354 } |
|
get an argument, const version
Definition at line 148 of file ps_attrib_maker_bin_op.h.
|
|
get an argument
Definition at line 139 of file ps_attrib_maker_bin_op.h.
|
|
|
Implemented in NLAIAGENT::CNumericIndex, NLAIC::IPointerGestion, NLAIC::CIdentType, and CAutomataDesc. Referenced by NLMISC::CClassRegistry::checkObject(), and NL3D::GetTextureSize(). |
|
|
get the min value, or an evalution that is guaranteed to be < to it (meaningful for ordered set only)
Reimplemented from NL3D::CPSAttribMaker< T >. Definition at line 175 of file ps_attrib_maker_bin_op.h.
00175 { return T() ; /* no mean by default */ } |
|
get the max value, or an evalution that is guaranteed to be > to it (meaningful for ordered set only)
Reimplemented from NL3D::CPSAttribMaker< T >. Definition at line 174 of file ps_attrib_maker_bin_op.h.
00174 { return T() ; /* no mean by default */ } |
|
Retrieve the number of cycles
Definition at line 236 of file ps_attrib_maker.h.
00236 { return _NbCycles ; } |
|
get the current operator
Definition at line 170 of file ps_attrib_maker_bin_op.h.
00170 { return _Op; } |
|
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"; } |
|
|
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::CPSLocated::setLifeScheme(), and NL3D::CPSLocated::setMassScheme().
00282 { return _HasMemory ; } |
|
|
Fill tab with an attribute by using the given stride. It fills numAttrib attributes.
Implements NL3D::CPSAttribMaker< T >. Definition at line 439 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::makePrivate(), NL3D::PSBinOpBufSize, stride, uint32, and uint8.
00447 { 00452 uint8 tab1[PSBinOpBufSize * sizeof(T)]; 00453 uint8 tab2[PSBinOpBufSize * sizeof(T)]; 00454 return makePrivate((T *) &tab1[0], (T *) &tab2[0], loc, startIndex, tab, stride, numAttrib, allowNoCopy, srcStep); 00455 } |
|
The same as make, but it replicate each attribute 4 times, thus filling 4*numAttrib. Useful for facelookat and the like
Implements NL3D::CPSAttribMaker< T >. Definition at line 552 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::make4Private(), NL3D::PSBinOpBufSize, stride, uint32, and uint8.
00560 { 00565 uint8 tab1[PSBinOpBufSize * sizeof(T)]; 00566 uint8 tab2[PSBinOpBufSize * sizeof(T)]; 00567 make4Private((T *) &tab1[0], (T *) &tab2[0], loc, startIndex, tab, stride, numAttrib, srcStep); 00568 } |
|
Definition at line 512 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::_Arg, NL3D::CPSAttribMakerBinOp< T >::_Op, NL3D::Make4Private(), nlassert, NL3D::PSBinOpBufSize, stride, uint, uint32, and uint8. Referenced by NL3D::CPSAttribMakerBinOp< T >::make4().
00521 { 00522 uint8 *dest = (uint8 *) tab; 00523 uint leftToDo = numAttrib, toProcess; 00524 nlassert(_Arg[0] && _Arg[1]); 00525 switch (_Op) 00526 { 00527 case CPSBinOp::selectArg1: 00528 _Arg[0]->make4(loc, startIndex, tab, stride, numAttrib, srcStep); 00529 return; 00530 break; 00531 case CPSBinOp::selectArg2: 00532 _Arg[1]->make4(loc, startIndex, tab, stride, numAttrib, srcStep); 00533 return; 00534 break; 00535 default: break; 00536 } 00537 00538 while (leftToDo) 00539 { 00540 toProcess = leftToDo > PSBinOpBufSize ? PSBinOpBufSize : leftToDo; 00541 T *src1 = (T *) _Arg[0]->make(loc, startIndex + (numAttrib - leftToDo), &buf1[0], sizeof(T), toProcess, true, srcStep); 00542 T *src2 = (T *) _Arg[1]->make(loc, startIndex + (numAttrib - leftToDo), &buf2[0], sizeof(T), toProcess, true, srcStep); 00543 00544 Make4Private(dest, src1, src2, stride, toProcess, _Op); 00545 leftToDo -= toProcess; 00546 } 00547 } |
|
The same as make4, but with n replication instead of 4
Implements NL3D::CPSAttribMaker< T >. Definition at line 682 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::makeNPrivate(), NL3D::PSBinOpBufSize, stride, uint32, and uint8.
00691 { 00696 uint8 tab1[PSBinOpBufSize * sizeof(T)]; 00697 uint8 tab2[PSBinOpBufSize * sizeof(T)]; 00698 makeNPrivate((T *) &tab1[0], (T *) &tab2[0], loc, startIndex, tab, stride, numAttrib, nbReplicate); 00699 } |
|
Definition at line 642 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::_Arg, NL3D::CPSAttribMakerBinOp< T >::_Op, NL3D::MakeNPrivate(), nlassert, NL3D::PSBinOpBufSize, stride, uint, uint32, and uint8. Referenced by NL3D::CPSAttribMakerBinOp< T >::makeN().
00652 { 00653 uint8 *dest = (uint8 *) tab; 00654 uint leftToDo = numAttrib, toProcess; 00655 nlassert(_Arg[0] && _Arg[1]); 00656 switch (_Op) 00657 { 00658 case CPSBinOp::selectArg1: 00659 _Arg[0]->makeN(loc, startIndex, tab, stride, numAttrib, nbReplicate, srcStep); 00660 return; 00661 break; 00662 case CPSBinOp::selectArg2: 00663 _Arg[1]->makeN(loc, startIndex, tab, stride, numAttrib, nbReplicate, srcStep); 00664 return; 00665 break; 00666 default: break; 00667 } 00668 00669 while (leftToDo) 00670 { 00671 toProcess = leftToDo > PSBinOpBufSize ? PSBinOpBufSize : leftToDo; 00672 T *src1 = (T *) _Arg[0]->make(loc, startIndex + (numAttrib - leftToDo), &buf1[0], sizeof(T), toProcess, true, srcStep); 00673 T *src2 = (T *) _Arg[1]->make(loc, startIndex + (numAttrib - leftToDo), &buf2[0], sizeof(T), toProcess, true, srcStep); 00674 00675 MakeNPrivate(dest, src1, src2, stride, toProcess, _Op, nbReplicate); 00676 leftToDo -= toProcess; 00677 } 00678 } |
|
Definition at line 398 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::_Arg, NL3D::CPSAttribMakerBinOp< T >::_Op, NL3D::MakePrivate(), nlassert, NL3D::PSBinOpBufSize, stride, uint, uint32, and uint8. Referenced by NL3D::CPSAttribMakerBinOp< T >::make().
00408 { 00409 uint8 *dest = (uint8 *) tab; 00410 uint leftToDo = numAttrib, toProcess; 00411 nlassert(_Arg[0] && _Arg[1]); 00412 switch (_Op) 00413 { 00414 case CPSBinOp::selectArg1: 00415 return _Arg[0]->make(loc, startIndex, tab, stride, numAttrib, allowNoCopy, srcStep); 00416 break; 00417 case CPSBinOp::selectArg2: 00418 return _Arg[1]->make(loc, startIndex, tab, stride, numAttrib, allowNoCopy, srcStep); 00419 break; 00420 default: break; 00421 } 00422 00423 00424 00425 while (leftToDo) 00426 { 00427 toProcess = leftToDo > PSBinOpBufSize ? PSBinOpBufSize : leftToDo; 00428 T *src1 = (T *) _Arg[0]->make(loc, startIndex + (numAttrib - leftToDo), &buf1[0], sizeof(T), toProcess, true, srcStep); 00429 T *src2 = (T *) _Arg[1]->make(loc, startIndex + (numAttrib - leftToDo), &buf2[0], sizeof(T), toProcess, true, srcStep); 00430 MakePrivate(dest, src1, src2, stride, toProcess, _Op); 00431 leftToDo -= toProcess; 00432 } 00433 00434 return tab; 00435 } |
|
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< T >. Definition at line 729 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::_Arg, and uint32.
|
|
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< T >. Definition at line 741 of file ps_attrib_maker_bin_op_inline.h. References NL3D::CPSAttribMakerBinOp< T >::_Arg, nlassert, and uint32.
|
|
serialisation of the object. Derivers MUST call this, (if they use the attribute of this class at least)
Reimplemented from NL3D::CPSAttribMaker< T >. Definition at line 703 of file ps_attrib_maker_bin_op_inline.h.
00704 { 00705 if (f.isReading()) 00706 { 00707 clean(); 00708 } 00709 f.serialVersion(1); 00710 f.serialEnum(_Op); 00711 f.serialPolyPtr(_Arg[0]); 00712 f.serialPolyPtr(_Arg[1]); 00713 f.serial(_Size, _MaxSize); 00714 00715 } |
|
set an argument for the operator
Definition at line 125 of file ps_attrib_maker_bin_op.h.
|
|
|
|
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.
|
|
Set the operator to use An assertion is thrown when no available Definition at line 160 of file ps_attrib_maker_bin_op.h.
|
|
return true if an operation is supported. The default support all ops
Definition at line 167 of file ps_attrib_maker_bin_op.h. Referenced by NL3D::CPSAttribMakerBinOp< sint32 >::setOp().
00167 { return true; } |
|
|
Definition at line 304 of file ps_attrib_maker.h. |
|
Definition at line 213 of file ps_attrib_maker_bin_op.h. Referenced by NL3D::CPSAttribMakerBinOp< T >::CPSAttribMakerBinOp(). |
|
Definition at line 301 of file ps_attrib_maker.h. |
|
|
Definition at line 213 of file ps_attrib_maker_bin_op.h. Referenced by NL3D::CPSAttribMakerBinOp< T >::CPSAttribMakerBinOp(). |