Blender V2.61 - r43446
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions

Attribute Class Reference

#include <attribute.h>

List of all members.

Public Types

enum  Element { VERTEX, FACE, CORNER }
enum  Standard {
  STD_NONE = 0, STD_VERTEX_NORMAL, STD_FACE_NORMAL, STD_UV,
  STD_GENERATED, STD_POSITION_UNDEFORMED, STD_POSITION_UNDISPLACED, STD_NUM
}

Public Member Functions

 Attribute ()
void set (ustring name, TypeDesc type, Element element)
void reserve (int numverts, int numfaces)
size_t data_sizeof ()
size_t element_size (int numverts, int numfaces)
size_t buffer_size (int numverts, int numfaces)
char * data ()
float3data_float3 ()
float * data_float ()
const char * data () const
const float3data_float3 () const
const float * data_float () const
 Attribute (string mn, vector< string > &value, int setline, bool channel)
 Attribute (Attribute &a)
 ~Attribute ()
void setUsed (bool set)
bool getUsed ()
void setIsChannel (bool set)
bool getIsChannel ()
string getAsString (bool debug=false)
int getAsInt ()
bool getAsBool ()
double getAsFloat ()
ntlVec3d getAsVec3d ()
void getAsMat4Gfx (ntlMatrix4x4< gfxReal > *mat)
AnimChannel< int > getChannelInt ()
AnimChannel< double > getChannelFloat ()
AnimChannel< ntlVec3dgetChannelVec3d ()
AnimChannel< ntlSetVec3fgetChannelSetVec3f ()
string getCompleteString ()
void print ()
 debug function, prints value

Static Public Member Functions

static bool same_storage (TypeDesc a, TypeDesc b)
static ustring standard_name (Attribute::Standard std)

Public Attributes

ustring name
Standard std
TypeDesc type
vector< char > buffer
Element element

Protected Member Functions

bool initChannel (int elemSize)

Detailed Description

Definition at line 42 of file attribute.h.


Member Enumeration Documentation

Enumerator:
VERTEX 
FACE 
CORNER 

Definition at line 44 of file attribute.h.

Enumerator:
STD_NONE 
STD_VERTEX_NORMAL 
STD_FACE_NORMAL 
STD_UV 
STD_GENERATED 
STD_POSITION_UNDEFORMED 
STD_POSITION_UNDISPLACED 
STD_NUM 

Definition at line 50 of file attribute.h.


Constructor & Destructor Documentation

Attribute::Attribute ( ) [inline]

Definition at line 68 of file attribute.h.

Attribute::Attribute ( string  mn,
vector< string > &  value,
int  setline,
bool  channel 
) [inline]

Definition at line 137 of file attributes.h.

Attribute::Attribute ( Attribute a) [inline]

Definition at line 140 of file attributes.h.

References getCompleteString().

Attribute::~Attribute ( ) [inline]

Definition at line 141 of file attributes.h.


Member Function Documentation

size_t Attribute::buffer_size ( int  numverts,
int  numfaces 
)

Definition at line 65 of file attribute.cpp.

References data_sizeof(), and element_size().

Referenced by reserve().

const char* Attribute::data ( ) const [inline]

Definition at line 80 of file attribute.h.

References buffer, and NULL.

char* Attribute::data ( ) [inline]

Definition at line 76 of file attribute.h.

References buffer, and NULL.

Referenced by data_float(), and data_float3().

float* Attribute::data_float ( ) [inline]

Definition at line 78 of file attribute.h.

References data().

Referenced by MeshManager::device_update_attributes().

const float* Attribute::data_float ( ) const [inline]

Definition at line 82 of file attribute.h.

References data().

const float3* Attribute::data_float3 ( ) const [inline]

Definition at line 81 of file attribute.h.

References data().

float3* Attribute::data_float3 ( ) [inline]
size_t Attribute::data_sizeof ( )

Definition at line 47 of file attribute.cpp.

References type.

Referenced by buffer_size().

size_t Attribute::element_size ( int  numverts,
int  numfaces 
)

Definition at line 55 of file attribute.cpp.

References element, and FACE.

Referenced by buffer_size(), and MeshManager::device_update_attributes().

bool Attribute::getAsBool ( )

Definition at line 34 of file attributes.cpp.

double Attribute::getAsFloat ( )

Definition at line 37 of file attributes.cpp.

int Attribute::getAsInt ( )

Definition at line 31 of file attributes.cpp.

void Attribute::getAsMat4Gfx ( ntlMatrix4x4< gfxReal > *  mat)

Definition at line 43 of file attributes.cpp.

References NULL.

string Attribute::getAsString ( bool  debug = false)

Definition at line 27 of file attributes.cpp.

ntlVec3d Attribute::getAsVec3d ( )

Definition at line 40 of file attributes.cpp.

AnimChannel< double > Attribute::getChannelFloat ( )

Definition at line 55 of file attributes.cpp.

AnimChannel< int > Attribute::getChannelInt ( )

Definition at line 58 of file attributes.cpp.

AnimChannel< ntlSetVec3f > Attribute::getChannelSetVec3f ( )

Definition at line 65 of file attributes.cpp.

AnimChannel< ntlVec3d > Attribute::getChannelVec3d ( )

Definition at line 61 of file attributes.cpp.

string Attribute::getCompleteString ( )

Definition at line 46 of file attributes.cpp.

Referenced by Attribute().

bool Attribute::getIsChannel ( ) [inline]

Definition at line 146 of file attributes.h.

bool Attribute::getUsed ( ) [inline]

Definition at line 144 of file attributes.h.

bool Attribute::initChannel ( int  elemSize) [protected]

Definition at line 23 of file attributes.cpp.

void Attribute::print ( )

debug function, prints value

Definition at line 151 of file attributes.cpp.

void Attribute::reserve ( int  numverts,
int  numfaces 
)

Definition at line 42 of file attribute.cpp.

References buffer, and buffer_size().

Referenced by AttributeSet::add(), and AttributeSet::reserve().

bool Attribute::same_storage ( TypeDesc  a,
TypeDesc  b 
) [static]

Definition at line 70 of file attribute.cpp.

CCL_NAMESPACE_BEGIN void Attribute::set ( ustring  name,
TypeDesc  type,
Element  element 
)

Definition at line 29 of file attribute.cpp.

References assert, element, name, std, STD_NONE, and type.

Referenced by AttributeSet::add().

void Attribute::setIsChannel ( bool  set) [inline]

Definition at line 145 of file attributes.h.

void Attribute::setUsed ( bool  set) [inline]

Definition at line 143 of file attributes.h.

ustring Attribute::standard_name ( Attribute::Standard  std) [static]

Member Data Documentation

vector<char> Attribute::buffer

Definition at line 65 of file attribute.h.

Referenced by data(), and reserve().

ustring Attribute::name

Definition at line 61 of file attribute.h.

Referenced by AttributeSet::find(), and set().

Definition at line 62 of file attribute.h.

Referenced by AttributeSet::add(), AttributeSet::find(), and set().

TypeDesc Attribute::type

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