Draws an marker head or tail (not the body of the marker) with the tip or tail centered at (x,y). More...
#include <marker.h>
Public Types | |
enum | Style { FIRST_STYLE, NONE = FIRST_STYLE, LINES, TRIANGLE, DIAMOND, HALF_DIAMOND, HALF_HEAD_UPPER, HALF_HEAD_LOWER, SLASHED_CROSS, ELLIPSE, DOT, DOUBLE_TRIANGLE, DOT_AND_TRIANGLE, BOX, CROW_FOOT, CROSS, ONE_OR_MANY, ZERO_OR_MANY, ONE_OR_ZERO, ONE_EXACTLY, CONCAVE, ROUND, OPEN_ROUND, BACKSLASH, LAST_STYLE = BACKSLASH } |
enum | Facing { LEFT, RIGHT } |
typedef enum Papyrus::Marker::Style | Style |
typedef enum Papyrus::Marker::Facing | Facing |
Public Member Functions | |
PAPYRUS_DRAWABLE (Marker) | |
virtual | ~Marker () |
Destructor. | |
Style | style () const |
void | set_style (Style style) |
set marker style | |
double | width () const |
void | set_width (double width) |
set drawing width of marker | |
double | height () const |
void | set_height (double height) |
set drawing height of marker | |
void | width_height (double &width, double &height) const |
get the drawing width and height of the marker | |
void | set_width_height (double width, double height) |
set the drawing width and height of the marker | |
Facing | facing () const |
void | set_facing (Facing facing) |
set the facing direction | |
virtual void | draw_shape (Context &cairo) const |
Draws on the provided context. | |
Static Public Member Functions | |
static pointer | create (Style style=NONE, double width=20.0, double height=20.0, Facing facing=RIGHT, Fill::pointer fill=Fill::pointer(), Stroke::pointer stroke=Stroke::pointer()) |
Creates an marker with the specified style. | |
static pointer | create (const Glib::ustring &id, Style style=NONE, double width=20.0, double height=20.0, Facing facing=RIGHT, Fill::pointer fill=Fill::pointer(), Stroke::pointer stroke=Stroke::pointer()) |
Creates an marker with the specified style. | |
Static Public Attributes | |
static const char * | style_strings [] |
Protected Member Functions | |
Marker (const Glib::ustring &id, Style style, double width, double height, Facing facing, Fill::pointer fill, Stroke::pointer stroke) | |
Default constructor. | |
Protected Attributes | |
Style | m_style |
double | m_width |
double | m_height |
Facing | m_facing |
Draws an marker head or tail (not the body of the marker) with the tip or tail centered at (x,y).
typedef enum Papyrus::Marker::Facing Papyrus::Marker::Facing |
typedef enum Papyrus::Marker::Style Papyrus::Marker::Style |
Papyrus::Marker::Marker | ( | const Glib::ustring & | id, | |
Style | style, | |||
double | width, | |||
double | height, | |||
Facing | facing, | |||
Fill::pointer | fill, | |||
Stroke::pointer | stroke | |||
) | [protected] |
Default constructor.
References Papyrus::Stroke::create(), Papyrus::Shape::m_stroke, and Papyrus::Shape::set_stroke().
Papyrus::Marker::~Marker | ( | ) | [virtual] |
Destructor.
Marker::pointer Papyrus::Marker::create | ( | const Glib::ustring & | id, | |
Style | style = NONE , |
|||
double | width = 20.0 , |
|||
double | height = 20.0 , |
|||
Facing | facing = RIGHT , |
|||
Fill::pointer | fill = Fill::pointer() , |
|||
Stroke::pointer | stroke = Stroke::pointer() | |||
) | [static] |
Creates an marker with the specified style.
References PAPYRUS_CREATE.
Marker::pointer Papyrus::Marker::create | ( | Style | style = NONE , |
|
double | width = 20.0 , |
|||
double | height = 20.0 , |
|||
Facing | facing = RIGHT , |
|||
Fill::pointer | fill = Fill::pointer() , |
|||
Stroke::pointer | stroke = Stroke::pointer() | |||
) | [static] |
Creates an marker with the specified style.
References PAPYRUS_CREATE.
Referenced by Papyrus::Gtk::MarkerWidget::MarkerWidget().
void Papyrus::Marker::draw_shape | ( | Context & | cairo | ) | const [virtual] |
Draws on the provided context.
Implements Papyrus::Shape.
References BACKSLASH, BOX, CONCAVE, CROSS, CROW_FOOT, DIAMOND, DOT, DOT_AND_TRIANGLE, DOUBLE_TRIANGLE, ELLIPSE, HALF_DIAMOND, HALF_HEAD_LOWER, HALF_HEAD_UPPER, LEFT, LINES, m_facing, m_height, m_style, m_width, NONE, ONE_EXACTLY, ONE_OR_MANY, ONE_OR_ZERO, OPEN_ROUND, Papyrus::Context::restore(), RIGHT, ROUND, Papyrus::Context::save(), SLASHED_CROSS, TRIANGLE, and ZERO_OR_MANY.
Marker::Facing Papyrus::Marker::facing | ( | ) | const |
References m_facing.
double Papyrus::Marker::height | ( | ) | const |
References m_height.
Papyrus::Marker::PAPYRUS_DRAWABLE | ( | Marker | ) |
void Papyrus::Marker::set_facing | ( | Facing | facing | ) |
set the facing direction
References m_facing, and Papyrus::Shape::shape_changed().
void Papyrus::Marker::set_height | ( | double | height | ) |
set drawing height of marker
References m_height, and Papyrus::Shape::shape_changed().
void Papyrus::Marker::set_style | ( | Style | style | ) |
set marker style
References m_style, and Papyrus::Shape::shape_changed().
void Papyrus::Marker::set_width | ( | double | width | ) |
set drawing width of marker
References m_width, and Papyrus::Shape::shape_changed().
void Papyrus::Marker::set_width_height | ( | double | width, | |
double | height | |||
) |
set the drawing width and height of the marker
References m_height, m_width, and Papyrus::Shape::shape_changed().
Marker::Style Papyrus::Marker::style | ( | ) | const |
References m_style.
double Papyrus::Marker::width | ( | ) | const |
References m_width.
void Papyrus::Marker::width_height | ( | double & | width, | |
double & | height | |||
) | const |
Facing Papyrus::Marker::m_facing [protected] |
Referenced by draw_shape(), facing(), and set_facing().
double Papyrus::Marker::m_height [protected] |
Referenced by draw_shape(), height(), set_height(), set_width_height(), and width_height().
Style Papyrus::Marker::m_style [protected] |
Referenced by draw_shape(), set_style(), and style().
double Papyrus::Marker::m_width [protected] |
Referenced by draw_shape(), set_width(), set_width_height(), width(), and width_height().
const char * Papyrus::Marker::style_strings [static] |
{ "None", "Lines", "Triangle", "Diamond", "Half Diamond", "Half Head Upper", "Half Head Lower", "Slashed Cross", "Ellipse", "Dot", "Double Triangle", "Dot and Triangle", "Box", "Crow Foot", "Cross", "One or Many", "Zero or Many", "One or Zero", "One Exactly", "Concave", "Round", "Open Round", "Backslash", }