IntelliPhoto  1
IntelliTool Class Referenceabstract

An abstract class that manages the basic events, like mouse clicks or scrolls events. More...

#include <IntelliTool.h>

Inheritance diagram for IntelliTool:
IntelliToolCircle IntelliToolFloodFill IntelliToolGradient IntelliToolLine IntelliToolPen IntelliToolPlainTool IntelliToolPolygon IntelliToolRectangle

Public Types

enum  Tooltype {
  Tooltype::CIRCLE, Tooltype::FLOODFILL, Tooltype::GRADIENT, Tooltype::LINE,
  Tooltype::PEN, Tooltype::PLAIN, Tooltype::POLYGON, Tooltype::RECTANGLE,
  Tooltype::NONE
}
 The Tooltype enum categorising the toosl. More...
 

Public Member Functions

 IntelliTool (PaintingArea *Area, IntelliColorPicker *colorPicker, IntelliToolsettings *Toolsettings)
 A constructor setting the general Painting Area and colorPicker. More...
 
virtual ~IntelliTool ()=0
 An abstract Destructor. More...
 
virtual void onMouseRightPressed (int x, int y)
 A function managing the right click Pressed of a Mouse. Constructing the Canvas to draw on. Call this in child classes! More...
 
virtual void onMouseRightReleased (int x, int y)
 A function managing the right click Released of a Mouse. Merging the Canvas to Active. Call this in child classes! More...
 
virtual void onMouseLeftPressed (int x, int y)
 A function managing the left click Pressed of a Mouse. Resetting the current draw. Call this in child classes! More...
 
virtual void onMouseLeftReleased (int x, int y)
 A function managing the left click Released of a Mouse. Call this in child classes! More...
 
virtual void onWheelScrolled (int value)
 A function managing the scroll event. A positive value means scrolling outwards. Call this in child classes! More...
 
virtual void onMouseMoved (int x, int y)
 A function managing the mouse moved event. Call this in child classes! More...
 
Tooltype getTooltype () const
 getTooltype returns the tools type More...
 
bool getIsDrawing () const
 getIsDrawing returns if the tool is currently drawing More...
 

Protected Attributes

PaintingAreaArea
 A pointer to the general PaintingArea to interact with. More...
 
Tooltype ActiveType
 ActiveType the type of the active tool. More...
 
IntelliColorPickercolorPicker
 A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors. More...
 
IntelliToolsettingsToolsettings
 Toolsettings a refrence to the tool settings. More...
 
LayerObjectactiveLayer
 A pointer to the underlying active Layer, do not work on this. This is used for data grabbing or previews. More...
 
LayerObjectCanvas
 A pointer to the drawing canvas of the tool, work on this. More...
 
bool isDrawing = false
 A flag checking if the user is currently drawing or not. More...
 

Detailed Description

An abstract class that manages the basic events, like mouse clicks or scrolls events.

Definition at line 17 of file IntelliTool.h.

Member Enumeration Documentation

◆ Tooltype

enum IntelliTool::Tooltype
strong

The Tooltype enum categorising the toosl.

Enumerator
CIRCLE 
FLOODFILL 
GRADIENT 
LINE 
PEN 
PLAIN 
POLYGON 
RECTANGLE 
NONE 

Definition at line 23 of file IntelliTool.h.

Constructor & Destructor Documentation

◆ IntelliTool()

IntelliTool::IntelliTool ( PaintingArea Area,
IntelliColorPicker colorPicker,
IntelliToolsettings Toolsettings 
)

A constructor setting the general Painting Area and colorPicker.

Parameters
Area- The general PaintingArea used by the project.
colorPicker- The general colorPicker used by the project.

Definition at line 5 of file IntelliTool.cpp.

◆ ~IntelliTool()

IntelliTool::~IntelliTool ( )
pure virtual

An abstract Destructor.

Definition at line 15 of file IntelliTool.cpp.

Member Function Documentation

◆ getIsDrawing()

bool IntelliTool::getIsDrawing ( ) const

getIsDrawing returns if the tool is currently drawing

Returns
returns if the tool is currently drawing

Definition at line 105 of file IntelliTool.cpp.

◆ getTooltype()

IntelliTool::Tooltype IntelliTool::getTooltype ( ) const

getTooltype returns the tools type

Returns
returns the tool type of the current tool.

Definition at line 101 of file IntelliTool.cpp.

◆ onMouseLeftPressed()

void IntelliTool::onMouseLeftPressed ( int  x,
int  y 
)
virtual

A function managing the left click Pressed of a Mouse. Resetting the current draw. Call this in child classes!

Parameters
x- The x coordinate relative to the active/canvas layer.
y- The y coordinate relative to the active/canvas layer.

Reimplemented in IntelliToolPolygon, IntelliToolCircle, IntelliToolRectangle, IntelliToolLine, IntelliToolPen, IntelliToolFloodFill, IntelliToolPlainTool, and IntelliToolGradient.

Definition at line 30 of file IntelliTool.cpp.

◆ onMouseLeftReleased()

void IntelliTool::onMouseLeftReleased ( int  x,
int  y 
)
virtual

A function managing the left click Released of a Mouse. Call this in child classes!

Parameters
x- The x coordinate relative to the active/canvas layer.
y- The y coordinate relative to the active/canvas layer.

Reimplemented in IntelliToolPolygon, IntelliToolCircle, IntelliToolRectangle, IntelliToolLine, IntelliToolPen, IntelliToolFloodFill, IntelliToolPlainTool, and IntelliToolGradient.

Definition at line 37 of file IntelliTool.cpp.

◆ onMouseMoved()

void IntelliTool::onMouseMoved ( int  x,
int  y 
)
virtual

A function managing the mouse moved event. Call this in child classes!

Parameters
x- The x coordinate of the new mouse position.
y- The y coordinate of the new mouse position.

Reimplemented in IntelliToolPolygon, IntelliToolCircle, IntelliToolRectangle, IntelliToolLine, IntelliToolPen, IntelliToolFloodFill, IntelliToolPlainTool, and IntelliToolGradient.

Definition at line 48 of file IntelliTool.cpp.

◆ onMouseRightPressed()

void IntelliTool::onMouseRightPressed ( int  x,
int  y 
)
virtual

A function managing the right click Pressed of a Mouse. Constructing the Canvas to draw on. Call this in child classes!

Parameters
x- The x coordinate relative to the active/canvas layer.
y- The y coordinate relative to the active/canvas layer.

Reimplemented in IntelliToolPolygon, IntelliToolCircle, IntelliToolRectangle, IntelliToolLine, IntelliToolPen, IntelliToolFloodFill, IntelliToolPlainTool, and IntelliToolGradient.

Definition at line 19 of file IntelliTool.cpp.

◆ onMouseRightReleased()

void IntelliTool::onMouseRightReleased ( int  x,
int  y 
)
virtual

A function managing the right click Released of a Mouse. Merging the Canvas to Active. Call this in child classes!

Parameters
x- The x coordinate relative to the active/canvas layer.
y- The y coordinate relative to the active/canvas layer.

Reimplemented in IntelliToolPolygon, IntelliToolCircle, IntelliToolRectangle, IntelliToolLine, IntelliToolPen, IntelliToolFloodFill, IntelliToolPlainTool, and IntelliToolGradient.

Definition at line 26 of file IntelliTool.cpp.

◆ onWheelScrolled()

void IntelliTool::onWheelScrolled ( int  value)
virtual

A function managing the scroll event. A positive value means scrolling outwards. Call this in child classes!

Parameters
value- The absolute the scroll has changed.

Reimplemented in IntelliToolPolygon, IntelliToolCircle, IntelliToolRectangle, IntelliToolLine, IntelliToolPen, IntelliToolFloodFill, IntelliToolPlainTool, and IntelliToolGradient.

Definition at line 53 of file IntelliTool.cpp.

Member Data Documentation

◆ activeLayer

LayerObject* IntelliTool::activeLayer
protected

A pointer to the underlying active Layer, do not work on this. This is used for data grabbing or previews.

Definition at line 74 of file IntelliTool.h.

◆ ActiveType

Tooltype IntelliTool::ActiveType
protected

ActiveType the type of the active tool.

Definition at line 59 of file IntelliTool.h.

◆ Area

PaintingArea* IntelliTool::Area
protected

A pointer to the general PaintingArea to interact with.

Definition at line 54 of file IntelliTool.h.

◆ Canvas

LayerObject* IntelliTool::Canvas
protected

A pointer to the drawing canvas of the tool, work on this.

Definition at line 79 of file IntelliTool.h.

◆ colorPicker

IntelliColorPicker* IntelliTool::colorPicker
protected

A pointer to the IntelliColorPicker of the PaintingArea to interact with, and get the colors.

Definition at line 64 of file IntelliTool.h.

◆ isDrawing

bool IntelliTool::isDrawing = false
protected

A flag checking if the user is currently drawing or not.

Definition at line 84 of file IntelliTool.h.

◆ Toolsettings

IntelliToolsettings* IntelliTool::Toolsettings
protected

Toolsettings a refrence to the tool settings.

Definition at line 69 of file IntelliTool.h.


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