#include <pattern-hexagon.h>
For internal use only.
Definition at line 36 of file pattern-hexagon.h.
Public Types | |
enum | Mode { CreatePuzzle, SimulateCreation } |
Defines operation modes for this pattern. More... | |
Signals | |
void | allPiecesGenerated () |
void | pieceCountAvailable (int pieceCount) |
void | pieceGenerated (const QImage &image, const QImage &mask, const QRectF &positionInImage, const QPointF &sceneBasePosition) |
void | pieceGenerated (const QImage &image, const QRectF &positionInImage, const QPointF &sceneBasePosition) |
void | relationGenerated (int piece1Id, int piece2Id) |
Public Member Functions | |
HexagonalPattern (int xCount, int yCount) | |
void | loadPiecePositions (const QList< QPointF > &points) |
Mode | mode () const |
int | pieceCount () const |
void | setMode (Mode mode) |
void | setSceneSizeFactor (qreal factor) |
void | slice (const QImage &image) |
Protected Member Functions | |
void | addPiece (const QImage &baseImage, const QImage &mask, const QRectF &positionInImage) |
Adds a piece to the puzzle scene.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This overload adds the possibility to pass a mask which will define a shape to be cut out from the given baseImage. This is useful because some environments seem to have problems with image composition in non-GUI threads. | |
void | addPiece (const QImage &image, const QRectF &positionInImage) |
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. | |
void | addRelation (int piece1Id, int piece2Id) |
Adds a neighbor relation between two pieces. | |
virtual void | doSlice (const QImage &image) |
Provides the slicing algorithm. This function splits a given image into pieces and defines relations between them. These pieces and relations are used to build the puzzle. | |
QPoint | pieceBasePosition (int x, int y, const QSize &piece, const QSize &image) const |
void | reportPieceCount (int pieceCount) |
Informs Palapeli about the number of pieces to expect. Call this from your slicing algorithm to inform Palapeli about the number of pieces to be expected. (This should, of course, be done before any pieces are added to the scene.) The Palapeli game engine will use this information to show a progress bar to the user. | |
Private Attributes | |
int | m_xCount |
int | m_yCount |