#include <PDataContainer.h>
Inheritance diagram for Fluxus::PDataContainer:
Public Member Functions | |
PDataContainer () | |
PDataContainer (const PDataContainer &other) | |
virtual | ~PDataContainer () |
virtual PDataContainer * | Clone () const=0 |
void | Clear () |
Clear all pdata, leaves the container empty. | |
void | AddData (const string &name, PData *pd) |
void | CopyData (const string &name, string newname) |
template<class T> | |
vector< T > * | GetDataVec (const string &name) |
void | RemoveDataVec (const string &name) |
Destroys a pdata array. | |
bool | GetDataInfo (const string &name, char &type, unsigned int &size) |
template<class T> | |
void | SetData (const string &name, unsigned int index, T s) |
template<class T> | |
T | GetData (const string &name, unsigned int index) |
template<class T> | |
PData * | DataOp (const string &op, const string &name, T operand) |
Runs a pdata operation on the given pdata array. | |
PData * | GetDataRaw (const string &name) |
Gets the whole pdata array, returns NULL if it doesn't exist. | |
void | SetDataRaw (const string &name, PData *pd) |
Sets the whole pdata array. | |
template<class S, class T> | |
PData * | FindOperate (const string &name, TypedPData< S > *a, T b) |
void | Resize (unsigned int size) |
Erases all current data! | |
unsigned int | Size () |
Returns the size of pdata for this object. | |
Protected Member Functions | |
virtual void | PDataDirty ()=0 |
Called when a named pdata mapping changes. | |
Protected Attributes | |
map< string, PData * > | m_PData |
Definition at line 43 of file PDataContainer.h.
PDataContainer::PDataContainer | ( | ) |
Definition at line 21 of file PDataContainer.cpp.
PDataContainer::PDataContainer | ( | const PDataContainer & | other | ) |
Definition at line 25 of file PDataContainer.cpp.
PDataContainer::~PDataContainer | ( | ) | [virtual] |
Definition at line 35 of file PDataContainer.cpp.
virtual PDataContainer* Fluxus::PDataContainer::Clone | ( | ) | const [pure virtual] |
void PDataContainer::Clear | ( | ) |
Clear all pdata, leaves the container empty.
Reimplemented in Fluxus::PolyPrimitive.
Definition at line 40 of file PDataContainer.cpp.
void PDataContainer::AddData | ( | const string & | name, | |
PData * | pd | |||
) |
Make a new pdata array, fails if one already exists with this name
Definition at line 98 of file PDataContainer.cpp.
void PDataContainer::CopyData | ( | const string & | name, | |
string | newname | |||
) |
Copy data from one array to another - deletes the old one if it exists
Definition at line 110 of file PDataContainer.cpp.
vector< T > * Fluxus::PDataContainer::GetDataVec | ( | const string & | name | ) |
Retrieves a pointer to the internal vector by name Returns NULL if it doesn't exist, or is not the type given in the template call.
Definition at line 124 of file PDataContainer.h.
void PDataContainer::RemoveDataVec | ( | const string & | name | ) |
bool PDataContainer::GetDataInfo | ( | const string & | name, | |
char & | type, | |||
unsigned int & | size | |||
) |
From the supplied name, fills in information about this pdata, returns false if it doesn't actually exist
Definition at line 67 of file PDataContainer.cpp.
void Fluxus::PDataContainer::SetData | ( | const string & | name, | |
unsigned int | index, | |||
T | s | |||
) |
Sets an element of the array. Not checked, for speed - use GetDataInfo() to check
Definition at line 112 of file PDataContainer.h.
T Fluxus::PDataContainer::GetData | ( | const string & | name, | |
unsigned int | index | |||
) |
Gets an element of the array. Not checked, for speed - use GetDataInfo() to check
Definition at line 118 of file PDataContainer.h.
PData * Fluxus::PDataContainer::DataOp | ( | const string & | op, | |
const string & | name, | |||
T | operand | |||
) |
PData * PDataContainer::GetDataRaw | ( | const string & | name | ) |
Gets the whole pdata array, returns NULL if it doesn't exist.
Definition at line 144 of file PDataContainer.cpp.
void PDataContainer::SetDataRaw | ( | const string & | name, | |
PData * | pd | |||
) |
PData * Fluxus::PDataContainer::FindOperate | ( | const string & | name, | |
TypedPData< S > * | a, | |||
T | b | |||
) |
Maps the name of a pdata operator to the actual object, all pdata ops need to be registered inside this function (see below)
Definition at line 175 of file PDataContainer.h.
void PDataContainer::Resize | ( | unsigned int | size | ) |
unsigned int PDataContainer::Size | ( | ) |
virtual void Fluxus::PDataContainer::PDataDirty | ( | ) | [protected, pure virtual] |
Called when a named pdata mapping changes.
Implemented in Fluxus::BlobbyPrimitive, Fluxus::LinePrimitive, Fluxus::LocatorPrimitive, Fluxus::NURBSPrimitive, Fluxus::ParticlePrimitive, Fluxus::PixelPrimitive, and Fluxus::PolyPrimitive.
map<string,PData*> Fluxus::PDataContainer::m_PData [protected] |