creativity  v1.3.0
Agent-based model of creativity and piracy
PDF.hpp
1 #pragma once
2 #include "creativity/data/graph/Target.hpp"
3 #include <cairomm/surface.h>
4 
5 namespace creativity { namespace data { namespace graph {
6 
8 class PDF : public Target {
9  public:
11  PDF(std::string filename, double width_inches, double height_inches);
12 
14  virtual Cairo::RefPtr<Cairo::Surface> surface() override;
15 
17  virtual const double& width() const override;
18 
20  virtual const double& height() const override;
21 
23  virtual void newPage() override;
24 
25  private:
26  Cairo::RefPtr<Cairo::PdfSurface> pdf_;
27  double width_, height_;
28 };
29 
30 }}}
virtual const double & width() const override
Returns the surface width.
Primary namespace for all Creativity library code.
Definition: config.hpp:4
PDF(std::string filename, double width_inches, double height_inches)
Constructs a new PDF target with the given filename and size.
Abstract base class for graph destinations.
Definition: Target.hpp:13
virtual const double & height() const override
Returns the surface height.
virtual void newPage() override
Writes the current surface to disk and starts a new page.
virtual Cairo::RefPtr< Cairo::Surface > surface() override
Creates and returns a Cairo::Context that writes to the current page.
Graph target that writes to pages of a PDF file.
Definition: PDF.hpp:8