BooleanXor Class Reference
[Advanced]

Exclusive OR boolean operator for two shapes. More...

#include <BooleanXor.hpp>

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

List of all members.

Public Member Functions

 BooleanXor (const Tag &tag)
virtual void draw () const
virtual string toString () const

Static Public Member Functions

static ShapeTraits getTraits ()

Protected Member Functions

void addPiece (list< Extent > &pieces, const Extent &piece)
virtual void calculate ()
virtual void calculateTangible ()
void drawWhenNotOverlapped (Matrix &rotation) const
void drawWhenOverlapped (Matrix &rotation) const
void explode (const Extent &piece, int d, list< Extent > &pieces)
pair< Extent, Extent > knife (const Extent &extent, float at, int on)
bool isDrawn (float aDepth, float bDepth) const
virtual void updateBufferPoints ()
virtual void updateBufferNormals ()
virtual void updateBufferCoords ()

Private Types

enum  {
  ALL,
  BEHIND,
  FORWARD
}

Private Attributes

GLfloat points [BOOLEAN_XOR_COUNT][3]
GLfloat coords [BOOLEAN_XOR_COUNT][3]
int only
list< Extent > pieces

Detailed Description

Exclusive OR boolean operator for two shapes.

Vertex Attributes


Constructor & Destructor Documentation

BooleanXor ( const Tag tag  ) 

Sets the only attribute.


Member Function Documentation

void addPiece ( list< Extent > &  pieces,
const Extent &  piece 
) [protected]

Adds piece to pieces only if it's substantial.

void calculate (  )  [protected, virtual]

Creates the pieces by knifing at the intersection point of each axis.

Reimplemented from Boolean.

void calculateTangible (  )  [inline, protected, virtual]

Assumed to be always visible (for now).

Implements Boolean.

void draw (  )  const [virtual]

Draw the pieces or one of the shapes according to overlap and depth.

Reimplemented from Boolean.

void drawWhenNotOverlapped ( Matrix rotation  )  const [protected]

Draws one of the shapes according to depth.

void drawWhenOverlapped ( Matrix rotation  )  const [protected]

Draw some of the pieces according to depth.

void explode ( const Extent &  piece,
int  d,
list< Extent > &  pieces 
) [protected]

Recursively splits a piece.

ShapeTraits getTraits (  )  [static]
Returns:
list of attributes used in the shape.

Reimplemented from Hexahedron.

bool isDrawn ( float  aDepth,
float  bDepth 
) const [protected]
Returns:
True if A should be drawn when compared to B.
pair< Extent, Extent > knife ( const Extent &  extent,
float  at,
int  on 
) [protected]
Returns:
Two pieces of extent cut at at along the on axis.
string toString (  )  const [virtual]
Returns:
string representing the node.

Reimplemented from Boolean.

void updateBufferNormals (  )  [protected, virtual]

Initializes the normals in the vertex buffer.

Reimplemented from Hexahedron.

void updateBufferPoints (  )  [protected, virtual]

Initializes the points in the vertex buffer.

     6-------7
    /|      /|
   2-------3 |
   | 4-----|-5
   |/      |/
   0-------1
 

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