Logo Search packages:      
Sourcecode: palapeli version File versions  Download package

void Palapeli::Pattern::addPiece ( const QImage &  image,
const QRectF &  positionInImage 
) [protected, inherited]

Adds a piece to the puzzle scene. Internally, the piece is assigned a consecutive index (0 for the first piece, 1 for the second piece, and so on) which has to be used when defining relations between the pieces.

Parameters:
image the visible image (may contain transparent areas to gain a non-rectangular piece shape)
positionInImage the bounding box of the piece (or more precisely, the bounding box of the image, including any transparent areas!)

Definition at line 122 of file pattern.cpp.

References Palapeli::Pattern::CreatePuzzle, Palapeli::Pattern::mode(), and Palapeli::Pattern::pieceGenerated().

Referenced by doSlice(), Palapeli::JigsawPattern::doSlice(), and Palapeli::HexagonalPattern::doSlice().

{
      if (mode() == CreatePuzzle)
            emit pieceGenerated(image, positionInImage, generateNextBasePosition(positionInImage));
}


Generated by  Doxygen 1.6.0   Back to index