papyrus logo

Papyrus::Marker Class Reference

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>

Inheritance diagram for Papyrus::Marker:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

Draws an marker head or tail (not the body of the marker) with the tip or tail centered at (x,y).

Author:
Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>

Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
LEFT 
RIGHT 
Enumerator:
FIRST_STYLE 
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 
LAST_STYLE 

Constructor & Destructor Documentation

Papyrus::Marker::Marker ( const Glib::ustring &  id,
Style  style,
double  width,
double  height,
Facing  facing,
Fill::pointer  fill,
Stroke::pointer  stroke 
) [protected]
Papyrus::Marker::~Marker (  )  [virtual]

Destructor.


Member Function Documentation

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]
Marker::Facing Papyrus::Marker::facing (  )  const
Returns:
the facing direction. Changing the facing direction is more than a simple 180' rotation. It effects a mirror of the marker about the marker's local y-axis.

References m_facing.

double Papyrus::Marker::height (  )  const
Returns:
drawing height of marker

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
Returns:
marker style

References m_style.

double Papyrus::Marker::width (  )  const
Returns:
drawing width of marker

References m_width.

void Papyrus::Marker::width_height ( double &  width,
double &  height 
) const

get the drawing width and height of the marker

References m_height, and m_width.


Member Data Documentation

Referenced by draw_shape(), facing(), and set_facing().

double Papyrus::Marker::m_height [protected]

Referenced by draw_shape(), set_style(), and style().

double Papyrus::Marker::m_width [protected]
const char * Papyrus::Marker::style_strings [static]
Initial value:
 {
    "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",
  }

The documentation for this class was generated from the following files:

Generated on Fri Apr 16 12:41:08 2010 for papyrus by doxygen 1.6.1