#include <disasmtomoves.h>
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_c * | tree |
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 |
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 | ( | const disasmToMoves_c & | ) | [private] |
int disasmToMoves_c::doRecursive | ( | const separation_c * | tree, | |
int | step, | |||
float * | array, | |||
bool | center_active, | |||
int | cx, | |||
int | cy, | |||
int | cz | |||
) | [private] |
this function walks the tree and sets the piece positions
References bt_assert, separation_c::getLeft(), separation_c::getMoves(), separation_c::getPieceName(), separation_c::getPieceNumber(), separation_c::getRemoved(), separation_c::getState(), getX(), state_c::getX(), getY(), state_c::getY(), getZ(), state_c::getZ(), mabs(), mmax(), state_c::pieceRemoved(), and size.
Referenced by setStep().
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] |
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.
unsigned int disasmToMoves_c::maxPieceName [private] |
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().
const separation_c* disasmToMoves_c::tree [private] |