PumpkinBrush
Clear.hpp
Go to the documentation of this file.
1 
8 #ifndef APP_CLEAR_H
9 #define APP_CLEAR_H
10 
11 #include "Command.hpp"
12 #include "App.hpp"
13 
17 class Clear: public Command {
18 private:
19  sf::Image* m_newImage;
20  sf::Image m_originalImage;
21  sf::Color m_backgroundColor;
22  sf::Vector2u m_imageSize;
23  App* m_app;
24 
25 public:
26  bool execute();
27  bool undo();
28  Clear(App* app, int flag, std::string command); // class constructor
29  ~Clear();
30 };
31 
32 #endif //APP_CLEAR_H
Clear::Clear
Clear(App *app, int flag, std::string command)
The constructor of the Clear class.
Definition: Clear.cpp:13
Clear::execute
bool execute()
Execute the clear canvas command and wipe off all the drawing from the canvas.
Definition: Clear.cpp:34
Clear
Clear command.
Definition: Clear.hpp:17
Command
Definition: Command.hpp:18
App.hpp
App class interface.
Clear::~Clear
~Clear()
The destructor of the Clear class.
Definition: Clear.cpp:26
Command.hpp
Represents an actionable command by the user.
App
Definition: App.hpp:37
Clear::undo
bool undo()
Undo the clear canvas command and restore the original image on the canvas.
Definition: Clear.cpp:48