disasmToMoves_c Class Reference

this class takes a disassembly tree and generates piecepositions for all pieces at each step of disassembly More...

#include <disasmtomoves.h>

Inheritance diagram for disasmToMoves_c:

Inheritance graph
[legend]
Collaboration diagram for disasmToMoves_c:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 disasmToMoves_c (const separation_c *tr, unsigned int sz, unsigned int maxPiece)
 create class.
virtual ~disasmToMoves_c ()
void setStep (float step, bool fadeOut=true, bool center_active=false)
 sets the moves for the step.
virtual float getX (unsigned int piece)
 the x-positions of the piece is returned
virtual float getY (unsigned int piece)
 the y-positions of the piece is returned
virtual float getZ (unsigned int piece)
 the z-positions of the piece is returned
virtual float getA (unsigned int piece)
 the alpha value of the piece (0 invisible, 1 opaque)
virtual bool moving (unsigned int piece)
 piece moving at this time

Private Member Functions

int doRecursive (const separation_c *tree, int step, float *array, bool center_active, int cx, int cy, int cz)
 this function walks the tree and sets the piece positions
 disasmToMoves_c (const disasmToMoves_c &)
void operator= (const disasmToMoves_c &)

Private Attributes

const separation_ctree
 the disassembly tree
unsigned int size
 size is used to removed pieces from the puzzle, this value controls how far they are moved out, when they are removed
float * moves
 this array contains the current position and alpha values of all pieces
bool * mv
 this array contains the information, if a piece is currently moving, or not
unsigned int maxPieceName
 the number of the last used piece this is NOT identical with pieceNumber of tree because there might be gaps


Detailed Description

this class takes a disassembly tree and generates piecepositions for all pieces at each step of disassembly

Constructor & Destructor Documentation

disasmToMoves_c::disasmToMoves_c ( const separation_c tr,
unsigned int  sz,
unsigned int  maxPiece 
)

create class.

sz is used when the pieces are removed from the assembled puzzle. The larger the further away the pieces will be moved

References maxPieceName, moves, mv, and tree.

disasmToMoves_c::~disasmToMoves_c (  )  [virtual]

References moves, mv, and tree.

disasmToMoves_c::disasmToMoves_c ( const disasmToMoves_c  )  [private]


Member Function Documentation

int disasmToMoves_c::doRecursive ( const separation_c tree,
int  step,
float *  array,
bool  center_active,
int  cx,
int  cy,
int  cz 
) [private]

float disasmToMoves_c::getA ( unsigned int  piece  )  [virtual]

the alpha value of the piece (0 invisible, 1 opaque)

Implements piecePositions_c.

References bt_assert, maxPieceName, and moves.

float disasmToMoves_c::getX ( unsigned int  piece  )  [virtual]

the x-positions of the piece is returned

Implements piecePositions_c.

References bt_assert, maxPieceName, and moves.

Referenced by doRecursive().

float disasmToMoves_c::getY ( unsigned int  piece  )  [virtual]

the y-positions of the piece is returned

Implements piecePositions_c.

References bt_assert, maxPieceName, and moves.

Referenced by doRecursive().

float disasmToMoves_c::getZ ( unsigned int  piece  )  [virtual]

the z-positions of the piece is returned

Implements piecePositions_c.

References bt_assert, maxPieceName, and moves.

Referenced by doRecursive().

bool disasmToMoves_c::moving ( unsigned int  piece  )  [virtual]

piece moving at this time

Implements piecePositions_c.

References bt_assert, maxPieceName, and mv.

void disasmToMoves_c::operator= ( const disasmToMoves_c  )  [private]

void disasmToMoves_c::setStep ( float  step,
bool  fadeOut = true,
bool  center_active = false 
)

sets the moves for the step.

if the value is not integer you get a intermediate of the necessary move (for animation) if fade out is true, pieces fade out, when they are removed from the rest of the puzzle if center_active if true, the group of pieces that currently is worked on is always in the middle of the display, other groups are invisible

References doRecursive(), maxPieceName, moves, mv, and tree.


Member Data Documentation

unsigned int disasmToMoves_c::maxPieceName [private]

the number of the last used piece this is NOT identical with pieceNumber of tree because there might be gaps

Referenced by disasmToMoves_c(), getA(), getX(), getY(), getZ(), moving(), and setStep().

float* disasmToMoves_c::moves [private]

this array contains the current position and alpha values of all pieces

Referenced by disasmToMoves_c(), getA(), getX(), getY(), getZ(), setStep(), and ~disasmToMoves_c().

bool* disasmToMoves_c::mv [private]

this array contains the information, if a piece is currently moving, or not

Referenced by disasmToMoves_c(), moving(), setStep(), and ~disasmToMoves_c().

unsigned int disasmToMoves_c::size [private]

size is used to removed pieces from the puzzle, this value controls how far they are moved out, when they are removed

Referenced by doRecursive().

the disassembly tree

Referenced by disasmToMoves_c(), setStep(), and ~disasmToMoves_c().


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

Generated on Sun Oct 10 10:02:45 2010 for BurrTools by  doxygen 1.5.8