creativity  v1.3.0
Agent-based model of creativity and piracy
Target.hpp
1 #pragma once
2 #include <cairomm/context.h>
3 #include <eris/noncopyable.hpp>
4 
5 namespace creativity { namespace data { namespace graph {
6 
13 class Target : private eris::noncopyable {
14  public:
17  virtual Cairo::RefPtr<Cairo::Surface> surface() = 0;
18 
26  virtual Cairo::Matrix unitTransformation() const { return Cairo::scaling_matrix(width(), height()); }
27 
29  virtual const double& width() const = 0;
30 
32  virtual const double& height() const = 0;
33 
38  virtual void newPage() = 0;
39 };
40 
41 }}}
virtual Cairo::Matrix unitTransformation() const
Returns a Cairo::Matrix that translates [0,1]x[0,1] coordinates into the drawable image surface...
Definition: Target.hpp:26
Primary namespace for all Creativity library code.
Definition: config.hpp:4
virtual void newPage()=0
Called to indicate that the current page/surface is finished and should be saved and a new...
Abstract base class for graph destinations.
Definition: Target.hpp:13
virtual const double & width() const =0
Returns the surface width, in device units.
virtual const double & height() const =0
Returns the surface height, in device units.
virtual Cairo::RefPtr< Cairo::Surface > surface()=0
Creates and returns the Cairo::Surface on which to draw the graph.