libjbt

jbt_attribute Class Reference

Base class for BlobTree attributes. More...

Inherited by jbt_colour and jbt_scalar.

List of all members.

Public Members

Static Public Members

Protected Members


Detailed Description

Base class for BlobTree attributes.

Author(s):
Mark Tigges

This class is the abstract base class for all attributes in a jbt_blobtree BlobTree. It allows the definition of virtually any kind of data for association with primitives. As long as the data type can be linearly combined it is suitable for use as an attribute. Use the jbt_blobtree::attribute() function to query a BlobTree for the value of an attribute for a point in space. To see how to implement your own types of attributes see the code for the jbt_colour class and its sub classes.

When sub classing this class to create a new attribute type, you must overload jbt_attribute::type(), jbt_attribute::add() jbt_attribute::reset(). You must also supply a constructor that intializes the data in the attribute to 0, whatever that may be. For instance for a jbt_colour attribute initialization to 0 means that the colour starts as black, and during a query we end up with black + c0*clr0 + c1*clr1 + ...


Member Typedef Documentation

typedef unsigned long jbt_attribute::Type


Member Function Documentation

virtual jbt_attribute::~jbt_attribute() [virtual]

virtual void jbt_attribute::reset() [virtual]

This function must be called between successive uses in querying a BlobTree. This function should zero out the data and then call the base class reset.

Reimplemented in jbt_scalar and jbt_colour.

Type jbt_attribute::type() const [virtual]

Returns the type of the jbt_attribute. This number must be unique for all attribute types used in a BlobTree. If two different types use the same identifier your program will likely crash.

Reimplemented in jbt_scalar and jbt_colour.

bool jbt_attribute::valid() const

Returns true if there is any data in the attribute. When querying an BlobTree for an attribute, you call jbt_blobtree::attribute() and pass a default attribute of the type that you are interested. If the query fails (ie. the attribute is not defined on the surface at the current query point) this function return false.

void jbt_attribute::add( jbt_attribute* attr, jbt_attributenode* n )

For internal use only.

void jbt_attribute::setScale( jFlt _C )

For internal use only.

jFlt jbt_attribute::getScale() const

For internal use only.

jbt_attribute::jbt_attribute() [protected]


Member Data Documentation

const Type jbt_attribute::User [static]

This value is guaranteed to be greater than all built in jbt_attribute derivatives.

const Type jbt_attribute::DiffuseClr [static]

const Type jbt_attribute::SpecularClr [static]

const Type jbt_attribute::DiffuseCoeff [static]

const Type jbt_attribute::SpecularCoeff [static]

const Type jbt_attribute::AmbientCoeff [static]

const Type jbt_attribute::ReflectionCoeff [static]

const Type jbt_attribute::TransmissionCoeff [static]

const Type jbt_attribute::SpecularExp [static]


The documentation for this class was generated from the following file:
JSP / libjbt v0.1 mtigges@cpsc.ucalgary.ca