GB_GenericData Class Reference

#include <GB_GenericData.h>

List of all members.

Public Member Functions

 GB_GenericData ()
 ~GB_GenericData ()
void setData (GB_Attribute *attrib, GB_AttributeStorage storage, int vectorsize, void *data=NULL, bool readonly=false)
void copyDefinition (const GB_GenericData &src)
void setDataPointer (void *data, bool readonly)
void setDataPointer (const void *)
bool isValid () const
 Returns true if this object contains valid data.
int entries () const
 Returns the size of this data.
void setF (fpreal val, int index=0)
 Accessors.
fpreal getF (int index=0) const
void setI (int val, int index=0)
int getI (int index=0) const
void setV2 (const UT_Vector2 &val, int idx=0)
UT_Vector2 getV2 (int idx=0) const
void setV3 (const UT_Vector3 &val, int index=0)
UT_Vector3 getV3 (int index=0) const
void setV4 (const UT_Vector4 &val, int index=0)
UT_Vector4 getV4 (int index=0) const
void setP4 (const UT_Vector4 &val, int index=0)
 p4 will return a 4th component of 1 if it does not exist
UT_Vector4 getP4 (int index=0) const
void setQ (const UT_Quaternion &val, int index=0)
UT_Quaternion getQ (int index=0) const
void setM3 (const UT_Matrix3 &m, int index=0)
UT_Matrix3 getM3 (int index=0) const
void setM4 (const UT_Matrix4 &m, int index=0)
UT_Matrix4 getM4 (int index=0) const
template<typename T >
T * getPointer (int index=0)
template<typename T >
const T * getPointer (int index=0) const
bool setString (const UT_String &str, int index=0)
bool getString (UT_String &str, int index=0, bool harden=true) const
GB_GenericDataIndex beginIterator () const
GB_GenericDataIndex beginIterator ()
void multiply (fpreal val)
 Unary arithmetic operations.
void setValue (fpreal val)
void transform (const UT_Matrix4 &xform, const UT_Matrix4 &inverse, bool keep_lengths=false)
void addScale (const GB_GenericData &d, fpreal scale)
 Binary arithmetic operations.
void multiply (const GB_GenericData &d)
 Multiply/Divide data by the other data.
void divide (const GB_GenericData &d)
void lerp (const GB_GenericData &d, fpreal w)
 Performs the operation: this = SYSlerp(this, d, w).
void lerp (const GB_GenericData &d0, const GB_GenericData &d1, fpreal weight)
template<typename T >
bool import (T &result) const
bool equalData (const GB_GenericData &src, fpreal64 tol) const
 Data manipulation.
void copyDataFrom (const GB_GenericData &src)
void copyDataFrom (const void *src)
void copyDataTo (void *dest) const
void resetData ()
void flush () const
const GB_AttributegetAttribute () const
GB_AttributegetAttribute ()

Protected Member Functions

int64 sizeInBytes () const
 Returns our size in bytes.


Detailed Description

Definition at line 40 of file GB_GenericData.h.


Constructor & Destructor Documentation

GB_GenericData::GB_GenericData (  ) 

GB_GenericData::~GB_GenericData (  ) 


Member Function Documentation

void GB_GenericData::addScale ( const GB_GenericData d,
fpreal  scale 
)

Binary arithmetic operations.

GB_GenericDataIndex GB_GenericData::beginIterator (  ) 

GB_GenericDataIndex GB_GenericData::beginIterator (  )  const

The beginIterator() methods return an index type that you can use to access components in this data sequentially.

void GB_GenericData::copyDataFrom ( const void *  src  ) 

void GB_GenericData::copyDataFrom ( const GB_GenericData src  ) 

The following copyData methods assume that the supplied data pointers exactly match the configuration of our data.

void GB_GenericData::copyDataTo ( void *  dest  )  const

void GB_GenericData::copyDefinition ( const GB_GenericData src  ) 

Sets the storage type and size of this data to match that of src. The data pointer will not be copied over however. Any data will be flushed in this object before it is no longer referenced.

void GB_GenericData::divide ( const GB_GenericData d  ) 

int GB_GenericData::entries (  )  const [inline]

Returns the size of this data.

Definition at line 72 of file GB_GenericData.h.

bool GB_GenericData::equalData ( const GB_GenericData src,
fpreal64  tol 
) const

Data manipulation.

void GB_GenericData::flush (  )  const

Writes out the changes to the attribute data. Calling this unnecessarily will have a significant impact on performance.

GB_Attribute* GB_GenericData::getAttribute (  )  [inline]

Definition at line 187 of file GB_GenericData.h.

const GB_Attribute* GB_GenericData::getAttribute (  )  const [inline]

This accessor to the GB_Attribute is not to be used. It's only purpose is backwards compatibility with functions that have not yet been converted to use GB_AttributeHandle instead of GB_Attribute.

Definition at line 186 of file GB_GenericData.h.

fpreal GB_GenericData::getF ( int  index = 0  )  const

int GB_GenericData::getI ( int  index = 0  )  const

UT_Matrix3 GB_GenericData::getM3 ( int  index = 0  )  const

UT_Matrix4 GB_GenericData::getM4 ( int  index = 0  )  const

UT_Vector4 GB_GenericData::getP4 ( int  index = 0  )  const

template<typename T >
const T* GB_GenericData::getPointer ( int  index = 0  )  const [inline]

Definition at line 113 of file GB_GenericData.h.

template<typename T >
T* GB_GenericData::getPointer ( int  index = 0  )  [inline]

Definition at line 105 of file GB_GenericData.h.

UT_Quaternion GB_GenericData::getQ ( int  index = 0  )  const

bool GB_GenericData::getString ( UT_String str,
int  index = 0,
bool  harden = true 
) const

UT_Vector2 GB_GenericData::getV2 ( int  idx = 0  )  const

UT_Vector3 GB_GenericData::getV3 ( int  index = 0  )  const

UT_Vector4 GB_GenericData::getV4 ( int  index = 0  )  const

template<typename T >
bool GB_GenericData::import ( T &  result  )  const [inline]

Definition at line 162 of file GB_GenericData.h.

bool GB_GenericData::isValid (  )  const

Returns true if this object contains valid data.

void GB_GenericData::lerp ( const GB_GenericData d0,
const GB_GenericData d1,
fpreal  weight 
)

void GB_GenericData::lerp ( const GB_GenericData d,
fpreal  w 
)

Performs the operation: this = SYSlerp(this, d, w).

void GB_GenericData::multiply ( const GB_GenericData d  ) 

Multiply/Divide data by the other data.

void GB_GenericData::multiply ( fpreal  val  ) 

Unary arithmetic operations.

void GB_GenericData::resetData (  ) 

Resets the value of the data to 'uninitialized'. For most types of attributes, this is zero, for others it is -1.

void GB_GenericData::setData ( GB_Attribute attrib,
GB_AttributeStorage  storage,
int  vectorsize,
void *  data = NULL,
bool  readonly = false 
)

Sets the storage type and size of this data. A pointer to an initial chunk of data can also optionally be set.

void GB_GenericData::setDataPointer ( const void *   ) 

Sets the pointer to the raw const data (and sets it read only). The const is cast away internally when we perform this set. But the data is flagged as read-only.

void GB_GenericData::setDataPointer ( void *  data,
bool  readonly 
)

Sets the pointer to the raw data, you must set the size and storage type before you can call this.

void GB_GenericData::setF ( fpreal  val,
int  index = 0 
)

Accessors.

void GB_GenericData::setI ( int  val,
int  index = 0 
)

void GB_GenericData::setM3 ( const UT_Matrix3 m,
int  index = 0 
)

void GB_GenericData::setM4 ( const UT_Matrix4 m,
int  index = 0 
)

void GB_GenericData::setP4 ( const UT_Vector4 val,
int  index = 0 
)

p4 will return a 4th component of 1 if it does not exist

void GB_GenericData::setQ ( const UT_Quaternion val,
int  index = 0 
)

bool GB_GenericData::setString ( const UT_String str,
int  index = 0 
)

The {get,set}String methods return true if the attribute represents a valid string attribute, and false otherwise.

void GB_GenericData::setV2 ( const UT_Vector2 val,
int  idx = 0 
)

void GB_GenericData::setV3 ( const UT_Vector3 val,
int  index = 0 
)

void GB_GenericData::setV4 ( const UT_Vector4 val,
int  index = 0 
)

void GB_GenericData::setValue ( fpreal  val  ) 

int64 GB_GenericData::sizeInBytes (  )  const [protected]

Returns our size in bytes.

void GB_GenericData::transform ( const UT_Matrix4 xform,
const UT_Matrix4 inverse,
bool  keep_lengths = false 
)

Transforming data by matrices. This uses the type information on the attribute to do the right kind of transform.


The documentation for this class was generated from the following file:

Generated on Thu May 24 00:09:36 2012 for HDK by  doxygen 1.5.9