Fluxus::PDataContainer Class Reference

#include <PDataContainer.h>

Inheritance diagram for Fluxus::PDataContainer:

Inheritance graph
[legend]

Public Member Functions

 PDataContainer ()
 PDataContainer (const PDataContainer &other)
virtual ~PDataContainer ()
virtual PDataContainerClone () 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>
GetData (const string &name, unsigned int index)
template<class T>
PDataDataOp (const string &op, const string &name, T operand)
 Runs a pdata operation on the given pdata array.
PDataGetDataRaw (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>
PDataFindOperate (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

Detailed Description

The base pdata container class. Primitive data (pdata) means vertex data, colours, positions, etc etc which are not generated internally and need to be accessed by users. All primitive data should be stored using pdata arrays, with the following caviats:

Definition at line 43 of file PDataContainer.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

virtual PDataContainer* Fluxus::PDataContainer::Clone (  )  const [pure virtual]

Implemented in Fluxus::BlobbyPrimitive, Fluxus::LinePrimitive, Fluxus::LocatorPrimitive, Fluxus::NURBSPrimitive, Fluxus::ParticlePrimitive, Fluxus::PixelPrimitive, Fluxus::PolyPrimitive, Fluxus::Primitive, and Fluxus::TextPrimitive.

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.

template<class T>
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  ) 

Destroys a pdata array.

Definition at line 131 of file PDataContainer.cpp.

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.

template<class T>
void Fluxus::PDataContainer::SetData ( const string &  name,
unsigned int  index,
s 
)

Sets an element of the array. Not checked, for speed - use GetDataInfo() to check

Definition at line 112 of file PDataContainer.h.

template<class T>
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.

template<class T>
PData * Fluxus::PDataContainer::DataOp ( const string &  op,
const string &  name,
operand 
)

Runs a pdata operation on the given pdata array.

Definition at line 144 of file PDataContainer.h.

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 
)

Sets the whole pdata array.

Definition at line 155 of file PDataContainer.cpp.

template<class S, class T>
PData * Fluxus::PDataContainer::FindOperate ( const string &  name,
TypedPData< S > *  a,
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  ) 

Erases all current data!

Definition at line 48 of file PDataContainer.cpp.

unsigned int PDataContainer::Size (  ) 

Returns the size of pdata for this object.

Definition at line 57 of file PDataContainer.cpp.

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.


Field Documentation

map<string,PData*> Fluxus::PDataContainer::m_PData [protected]

Todo:
replace with a hashmap?

Definition at line 107 of file PDataContainer.h.


The documentation for this class was generated from the following files:
Generated on Mon Feb 11 06:54:50 2008 for The Fluxus Renderer (libfluxus) by  doxygen 1.5.1