Boolean Class Reference
[Advanced]

Combines shapes in different ways to create a new one. More...

#include <Boolean.hpp>

Inheritance diagram for Boolean:
Hexahedron Shape SimpleDrawable SimpleTransformable Drawable Node Transformable NodeListener Identifiable BooleanAnd BooleanXor

List of all members.

Public Member Functions

 Boolean (const Tag &tag, ShapeTraits traits)
virtual ~Boolean ()
virtual void associate ()
virtual void draw () const
virtual void finalize ()
virtual void onNodeEvent (NodeEvent &event)
virtual string toString () const

Protected Member Functions

void applyUniforms () const
void applyUniforms (int i) const
void associateUniforms ()
void calculate ()
void calculateExtents ()
void calculateExtents (Node *node)
void calculateOverlap ()
virtual void calculateTangible ()=0
void finalizeUniforms ()
void findGroup ()
void findShapes ()
void findTransforms ()
void findUniforms ()
bool isOverlapped () const
virtual void updateBuffer ()

Static Protected Member Functions

static bool isSubstantial (const Extent &extent)

Protected Attributes

bool tangible
Extent overlap
Groupgroup
vector< Shape * > shapes
vector< Extent > extents
list< Uniform * > uniforms [2]
Matrix mvm
string of
string operation
Suppressor suppressor

Static Protected Attributes

static float FLT_INF

Detailed Description

Combines shapes in different ways to create a new one.

To create a concrete operation, subclass Boolean and implement isTangible() and updateAttributes(). Of course, make sure to pass the right number of vertices and all the attribute names in the constructor.


Constructor & Destructor Documentation

Boolean ( const Tag tag,
ShapeTraits  traits 
)

Creates a new Boolean node.

Exceptions:
Exception if of attribute not present
Exception if operation attribute not present
NodeException if float is not signed
~Boolean (  )  [virtual]

Deletes all the uniforms stored.


Member Function Documentation

void applyUniforms ( int  i  )  const [protected]

Applies all the uniforms for one of the shapes.

void applyUniforms (  )  const [protected]

Applies all the uniforms for all of the shapes.

void associate (  )  [virtual]

Finds the group, shapes, transforms, and uniforms needed by the operation.

Exceptions:
NodeException from Shape::associate()

Reimplemented from Shape.

Reimplemented in BooleanAnd.

void associateUniforms (  )  [protected]

Associates all the uniforms.

void calculate (  )  [protected]

Boolean shape is not correct and must be recalculated.

Reimplemented in BooleanXor.

void calculateExtents ( Node node  )  [protected]

Traverse a subtree and calculate extents for each shape.

void calculateExtents (  )  [protected]

Traverse the group and calculate extents for each shape.

void calculateOverlap (  )  [protected]

Find where the shapes overlap.

void draw (  )  const [virtual]

Only draw the boolean operation if its output is tangible.

Reimplemented from Shape.

Reimplemented in BooleanAnd, and BooleanXor.

void finalize (  )  [virtual]

Creates the shape and finalizes all the uniforms.

Reimplemented from Shape.

void finalizeUniforms (  )  [protected]

Suppresses then finalizes all the stored uniforms.

void findGroup (  )  [protected]

Finds the group the Boolean should look for shapes in.

Exceptions:
NodeException if the group named by of cannot be found.
void findShapes (  )  [protected]
Exceptions:
NodeException if no shapes are in group.
void findTransforms (  )  [protected]

Finds transforms in the group and listens for changes from them.

void findUniforms (  )  [protected]

Finds uniforms of the shapes, then copies and stores them.

bool isOverlapped (  )  const [protected]

Determines if the shapes intersect each other using overlap attribute.

bool isSubstantial ( const Extent &  extent  )  [static, protected]

Determines if an extent is three dimensional.

void onNodeEvent ( NodeEvent event  )  [virtual]

Redo the operation when a Transformation has changed.

Reimplemented from SimpleTransformable.

string toString (  )  const [virtual]
Returns:
string representing the node.

Reimplemented from Shape.

Reimplemented in BooleanXor.

void updateBuffer (  )  [protected, virtual]

Only initialize all the attributes if the boolean output is tangible.

Reimplemented from Hexahedron.


The documentation for this class was generated from the following files:
Generated on Wed Jun 9 01:36:35 2010 for Gander by  doxygen 1.6.3