#include <renderable.h>
Public Types | |
typedef PapyrusPointer < Renderable > | pointer |
Public Member Functions | |
virtual | ~Renderable () |
virtual void | render (Cairo::RefPtr< Cairo::Context > cairo) const =0 |
virtual void | render (Cairo::RefPtr< Cairo::Context > cairo, double x, double y, double w, double h) const |
virtual Glib::ustring | svg (unsigned depth=0) |
Returns an SVG representation of the Renderable. | |
PAPYRUS_CLASS_NAME ("Renderable") | |
Protected Member Functions | |
Renderable (const Glib::ustring &id) | |
Glib::ustring | svg_spacing (unsigned depth) |
Glib::ustring | svg_id () |
Renderable provides the pure virtual render()
method, which takes a cairomm context as its only parameter. Descendants of Papyrus::Renderable provide their own implementations of render()
that allow them to be rendered into the supplied cairomm context.
The render()
method makes it possible to render a hierarchy (or hierarchies) of Renderables into a cairomm context employing a visitor pattern.
Inherit from Papyrus::Renderable when you want your object to be capable of being rendered into a cairo context through a common interface.
Don't forget to provide your own implementation of render()
since it's a pure virtual method.
typedef PapyrusPointer<Renderable> Papyrus::Renderable::pointer |
Reimplemented in Papyrus::Annulus, Papyrus::Arc, Papyrus::Beziergon, Papyrus::Bezierline, Papyrus::Boxed, Papyrus::Canvas, Papyrus::Circle, Papyrus::Drawable, Papyrus::Fill, Papyrus::Grid, Papyrus::Group, Papyrus::Handlebox, Papyrus::Image, Papyrus::Marker, Papyrus::Paint, Papyrus::Path, Papyrus::PathElement, Papyrus::Polygon, Papyrus::Polyline, Papyrus::Rectangle, Papyrus::Reference, Papyrus::RegularPolygon, Papyrus::Shape, Papyrus::Stroke, Papyrus::SVG, Papyrus::Text, Papyrus::Face, Papyrus::Hilbert, Papyrus::KochCurve, Papyrus::KochSnowflake, and Papyrus::Sierpinski.
Papyrus::Renderable::Renderable | ( | const Glib::ustring & | id | ) | [inline, protected] |
virtual Papyrus::Renderable::~Renderable | ( | ) | [inline, virtual] |
Papyrus::Renderable::PAPYRUS_CLASS_NAME | ( | "Renderable" | ) |
virtual void Papyrus::Renderable::render | ( | Cairo::RefPtr< Cairo::Context > | cairo, | |
double | x, | |||
double | y, | |||
double | w, | |||
double | h | |||
) | const [inline, virtual] |
virtual void Papyrus::Renderable::render | ( | Cairo::RefPtr< Cairo::Context > | cairo | ) | const [pure virtual] |
Implemented in Papyrus::Drawable, Papyrus::Fill, Papyrus::Paint, Papyrus::PathElement, and Papyrus::Stroke.
virtual Glib::ustring Papyrus::Renderable::svg | ( | unsigned | depth = 0 |
) | [inline, virtual] |
Returns an SVG representation of the Renderable.
Reimplemented in Papyrus::Circle, Papyrus::Fill, Papyrus::Group, Papyrus::Path, Papyrus::PathElement, Papyrus::Rectangle, Papyrus::Reference, and Papyrus::SVG.
Glib::ustring Papyrus::Renderable::svg_id | ( | ) | [inline, protected] |
References Papyrus::Object::m_id.
Referenced by Papyrus::SVG::svg(), Papyrus::Reference::svg(), Papyrus::Rectangle::svg(), Papyrus::Path::svg(), Papyrus::Group::svg(), and Papyrus::Circle::svg().
Glib::ustring Papyrus::Renderable::svg_spacing | ( | unsigned | depth | ) | [inline, protected] |