PumpkinBrush
include
Draw.hpp
Go to the documentation of this file.
1
7
#ifndef DRAW_H
8
#define DRAW_H
9
10
// Include our Third-Party SFML header
11
// #include ...
12
// Include standard library C++ libraries.
13
#include <string>
14
#include <vector>
15
// Project header files
16
#include "
Command.hpp
"
17
#include "
GeneralBrush.hpp
"
18
19
20
// Anytime we want to implement a new command in our paint tool,
21
// we have to inherit from the command class.
22
// This forces us to implement an 'execute' and 'undo' command.
23
class
Draw
:
public
Command
{
24
private
:
25
sf::Vector2f m_coordinate;
//andrew edit ***
26
App
* m_app;
27
std::vector<std::vector<int>> m_shader;
28
std::vector<sf::Color> m_originalColors;
29
sf::Color m_color;
30
31
32
public
:
33
34
bool
execute
();
35
bool
undo
();
36
void
setOriginalColor
();
37
// Draw(sf::Vector2i m_coordinate, App*);
38
Draw
(sf::Vector2f coordinate,
App
* app,
int
flag, std::string command);
//andrew edit ***
39
40
};
41
42
#endif
Draw::undo
bool undo()
Undo command to undo the pixel creation.
Definition:
Draw.cpp:35
Command
Definition:
Command.hpp:18
Draw::execute
bool execute()
Execute the command to draw pixels.
Definition:
Draw.cpp:23
Draw
Definition:
Draw.hpp:23
GeneralBrush.hpp
Command.hpp
Represents an actionable command by the user.
Draw::setOriginalColor
void setOriginalColor()
Get the original color of each pixel.
Definition:
Draw.cpp:46
Draw::Draw
Draw(sf::Vector2f coordinate, App *app, int flag, std::string command)
Constructor of draw command.
Definition:
Draw.cpp:56
App
Definition:
App.hpp:37
Generated by
1.8.17