Walls And Holes  1
FillTool Class Reference

#include <filltool.h>

Inheritance diagram for FillTool:
Collaboration diagram for FillTool:

Public Slots

void invalidateSelection ()
 

Public Member Functions

 FillTool (TileMapPreviewGraphicsItem *previewItem, QUndoStack *undoStack)
 
void cellClicked (int x, int y, QMouseEvent *) override
 This will immediately fill an area. More...
 
void cellHovered (int x, int y, QMouseEvent *) override
 This will show a preview for the selected area. More...
 
void toolTileMapChanged (TileMap *prev) override
 Called whenever mTileMap changes. Called in constructor. More...
 
void mouseExitedMap (QMouseEvent *) override
 Called when the mouse is no longer hovering over a cell. More...
 
void deactivate () override
 Deactivates the tool. This is called before the tool stops being used. More...
 
- Public Member Functions inherited from AbstractTileMapTool
 AbstractTileMapTool (TileMapPreviewGraphicsItem *previewItem)
 
void setTileMap (TileMap *tileMap)
 
void setTileTemplate (TileTemplate *tileTemplate)
 
virtual void cellActivated (int, int, QMouseEvent *)
 Called when the left mouse button is down over a new cell. More...
 
virtual void cellReleased (int, int, QMouseEvent *)
 Called when the left mouse button is released over a cell. More...
 
- Public Member Functions inherited from AbstractTool
virtual ~AbstractTool ()
 
virtual void activate ()
 Activates the tool. This is called before the tool is used. More...
 
virtual QList< QAction * > contextActions ()
 Returns a vector of qactions which can be used to modify the behaviour of the tool. Will be used by the tool manager to add the actions to a context tool bar. More...
 
virtual void mousePressEvent (QMouseEvent *)
 
virtual void mouseReleaseEvent (QMouseEvent *)
 
virtual void mouseMoveEvent (QMouseEvent *)
 
virtual void wheelEvent (QWheelEvent *)
 

Protected Member Functions

void updateSelection (int x, int y)
 
void drawOverlay (int endX, int endY)
 Draws an overlay previewing the area that will be filled. More...
 
void clearOverlay ()
 Clears the overlay. More...
 
- Protected Member Functions inherited from AbstractTileMapTool
TileMapgetTileMap () const
 
TileTemplategetTileTemplate () const
 

Protected Attributes

QSet< QPoint > mSelection
 The set of points that will be filled in. More...
 
QUndoStack * mUndoStack
 
- Protected Attributes inherited from AbstractTileMapTool
TileMapPreviewGraphicsItem *const mPreviewItem
 

Constructor & Destructor Documentation

◆ FillTool()

FillTool::FillTool ( TileMapPreviewGraphicsItem previewItem,
QUndoStack *  undoStack 
)

Member Function Documentation

◆ cellClicked()

void FillTool::cellClicked ( int  x,
int  y,
QMouseEvent *   
)
overridevirtual

This will immediately fill an area.

Parameters
xThe X position of the clicked tile.
yThe Y position of the clicked tile.

Reimplemented from AbstractTileMapTool.

Here is the call graph for this function:

◆ cellHovered()

void FillTool::cellHovered ( int  x,
int  y,
QMouseEvent *   
)
overridevirtual

This will show a preview for the selected area.

Reimplemented from AbstractTileMapTool.

Here is the call graph for this function:

◆ clearOverlay()

void FillTool::clearOverlay ( )
protected

Clears the overlay.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deactivate()

void FillTool::deactivate ( )
overridevirtual

Deactivates the tool. This is called before the tool stops being used.

Reimplemented from AbstractTool.

Here is the call graph for this function:

◆ drawOverlay()

void FillTool::drawOverlay ( int  endX,
int  endY 
)
protected

Draws an overlay previewing the area that will be filled.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ invalidateSelection

void FillTool::invalidateSelection ( )
slot
Here is the caller graph for this function:

◆ mouseExitedMap()

void FillTool::mouseExitedMap ( QMouseEvent *  )
overridevirtual

Called when the mouse is no longer hovering over a cell.

Reimplemented from AbstractTileMapTool.

Here is the call graph for this function:

◆ toolTileMapChanged()

void FillTool::toolTileMapChanged ( TileMap previous)
overridevirtual

Called whenever mTileMap changes. Called in constructor.

Parameters
previousThe OLD mTileMap. The new one can be retreived using getTileMap().

Reimplemented from AbstractTileMapTool.

Here is the call graph for this function:

◆ updateSelection()

void FillTool::updateSelection ( int  x,
int  y 
)
protected

Updates mSelection to match the points that will be filled if the given point is selected.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mSelection

QSet<QPoint> FillTool::mSelection
protected

The set of points that will be filled in.

◆ mUndoStack

QUndoStack* FillTool::mUndoStack
protected

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