Design Patterns
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
image_proxy.h
Go to the documentation of this file.
1 // Based on "Design Patterns: Elements of Reusable Object-Oriented Software"
2 // book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm
3 //
4 // Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.
5 
6 #ifndef STRUCTURAL_PROXY_IMAGE_PROXY_H_
7 #define STRUCTURAL_PROXY_IMAGE_PROXY_H_
8 
9 #include "graphic_interface.h"
10 #include "image.h"
11 
12 namespace structural
13 {
14 namespace proxy
15 {
17 {
18  public:
19  explicit ImageProxy(const std::string& file_name);
20  virtual ~ImageProxy();
21 
22  virtual void Draw(const commons::Point<float>& at) override;
23  virtual void HandleMouse(Event& event) override;
24  virtual const commons::Point<float> &GetExtent() override;
25  virtual void Load(std::istream& from) override;
26  virtual void Save(std::ostream& to) override;
27 
28  protected:
29  Image *GetImage();
30 
31  private:
32  const commons::Point<float> kZeroExtent = commons::Point<float>(0, 0);
33  Image* image_;
34  commons::Point<float> extent_;
35  std::string file_name_;
36 };
37 }
38 }
39 
40 #endif
41 
virtual void Draw(const commons::Point< float > &at) override
Definition: image_proxy.cc:42
Definition: shape_interface.h:11
ImageProxy(const std::string &file_name)
Definition: image_proxy.cc:12
Definition: graphic_interface.h:17
Image * GetImage()
Definition: image_proxy.cc:24
virtual void Save(std::ostream &to) override
Definition: image_proxy.cc:52
Definition: event.h:13
virtual ~ImageProxy()
Definition: image_proxy.cc:19
Definition: image.h:18
virtual const commons::Point< float > & GetExtent() override
Definition: image_proxy.cc:33
Definition: image_proxy.h:16
virtual void HandleMouse(Event &event) override
Definition: image_proxy.cc:47
virtual void Load(std::istream &from) override
Definition: image_proxy.cc:54