Combines shapes in different ways to create a new one. More...
#include <Boolean.hpp>
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 |
| Group * | group |
| 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 |
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.
Creates a new Boolean node.
| 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.
| 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.
| 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.
| NodeException | if the group named by of cannot be found. |
| void findShapes | ( | ) | [protected] |
| 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] |
| void updateBuffer | ( | ) | [protected, virtual] |
Only initialize all the attributes if the boolean output is tangible.
Reimplemented from Hexahedron.
1.6.3