papyrus logo

Papyrus::Polyline Class Reference

A polyline is drawn as a set of ordered vertices relative to the shape's x,y coordinate. More...

#include <polyline.h>

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

List of all members.

Public Member Functions

 PAPYRUS_DRAWABLE (Polyline)
virtual ~Polyline ()
Polylineoperator= (const Polyline &other)
Vertex vertex (unsigned n) const
const Verticesvertices () const
void add_vertex (Vertex v)
void add_vertex (double x, double y)
void set_vertex (unsigned n, Vertex v)
void set_vertex (unsigned n, double x, double y)
void set_vertices (const Vertices &vertices)
virtual Marker::pointer marker (MarkerPosition position)
virtual bool set_marker (MarkerPosition position, Marker::pointer marker)
 Sets the specified marker to the provided drawable.
virtual void draw (Context &cairo) const
virtual void draw_shape (Context &cairo) const
 Draws on the provided context.
sigc::signal< void, unsigned > signal_vertex ()
sigc::signal< void > signal_vertices ()

Static Public Member Functions

static pointer create (const Vertices &vertices=Vertices(), Stroke::pointer stroke=Stroke::pointer())
 Creates a polyline from a specified set of vertices.
static pointer create (const Vertices &vertices, Fill::pointer fill, Stroke::pointer stroke=Stroke::pointer())
static pointer create (const Glib::ustring &id, Vertices vertices=Vertices(), Stroke::pointer stroke=Stroke::pointer())
static pointer create (const Glib::ustring &id, Vertices vertices, Fill::pointer fill, Stroke::pointer stroke=Stroke::pointer())

Protected Member Functions

 Polyline (const Glib::ustring &id, const Vertices &vertices, Fill::pointer fill, Stroke::pointer stroke)
virtual void on_vertex_changed (int n)
virtual void on_vertices_changed ()
void update_marker_position (MarkerPosition n)
virtual Region calculate_pre_viewbox_extents (const Matrix &m=Matrix::Identity) const
 This method extends the parent Shape method by incorporating any marker extents in the raw extents.
void on_marker_changed (MarkerPosition which)

Protected Attributes

Vertices m_vertices
Marker::pointer m_markers [3]
sigc::signal< void, unsigned > m_signal_vertex
sigc::signal< void > m_signal_vertices
sigc::connection m_marker_changed_connections [3]

Detailed Description

A polyline is drawn as a set of ordered vertices relative to the shape's x,y coordinate.

Polylines may be filled or unfilled. An unfilled polyline is more conceptually familiar with what is implied by a polyline. A filled polyline is essentially an unclosed polygon.

polyline.png

Unfilled Polyline

polyline_filled.png

Filled Polyline

Author:
Rick L Vinyard Jr TODO change marker handling to allow setting positional markers

Constructor & Destructor Documentation

Papyrus::Polyline::Polyline ( const Glib::ustring &  id,
const Vertices vertices,
Fill::pointer  fill,
Stroke::pointer  stroke 
) [protected]
Papyrus::Polyline::~Polyline (  )  [virtual]

Member Function Documentation

void Papyrus::Polyline::add_vertex ( double  x,
double  y 
)

References m_vertices, and on_vertex_changed().

void Papyrus::Polyline::add_vertex ( Vertex  v  ) 

References m_vertices, and on_vertex_changed().

Region Papyrus::Polyline::calculate_pre_viewbox_extents ( const Matrix m = Matrix::Identity  )  const [protected, virtual]

This method extends the parent Shape method by incorporating any marker extents in the raw extents.

References Papyrus::Drawable::calculate_extents().

Polyline::pointer Papyrus::Polyline::create ( const Glib::ustring &  id,
Vertices  vertices,
Fill::pointer  fill,
Stroke::pointer  stroke = Stroke::pointer() 
) [static]

References PAPYRUS_CREATE.

Polyline::pointer Papyrus::Polyline::create ( const Glib::ustring &  id,
Vertices  vertices = Vertices(),
Stroke::pointer  stroke = Stroke::pointer() 
) [static]

References PAPYRUS_CREATE.

Polyline::pointer Papyrus::Polyline::create ( const Vertices vertices,
Fill::pointer  fill,
Stroke::pointer  stroke = Stroke::pointer() 
) [static]

Reimplemented in Papyrus::Polygon.

References PAPYRUS_CREATE.

Polyline::pointer Papyrus::Polyline::create ( const Vertices vertices = Vertices(),
Stroke::pointer  stroke = Stroke::pointer() 
) [static]
void Papyrus::Polyline::draw ( Context cairo  )  const [virtual]
void Papyrus::Polyline::draw_shape ( Context cairo  )  const [virtual]

Draws on the provided context.

Implements Papyrus::Shape.

Reimplemented in Papyrus::Polygon.

References m_vertices, Papyrus::Drawable::x(), and Papyrus::Drawable::y().

Referenced by draw().

Marker::pointer Papyrus::Polyline::marker ( MarkerPosition  position  )  [virtual]

References Papyrus::END_MARKER, and m_markers.

void Papyrus::Polyline::on_marker_changed ( MarkerPosition  which  )  [protected]

References Papyrus::Shape::shape_changed().

Referenced by set_marker().

void Papyrus::Polyline::on_vertex_changed ( int  n  )  [protected, virtual]
void Papyrus::Polyline::on_vertices_changed (  )  [protected, virtual]
Polyline & Papyrus::Polyline::operator= ( const Polyline other  ) 
Papyrus::Polyline::PAPYRUS_DRAWABLE ( Polyline   ) 
bool Papyrus::Polyline::set_marker ( MarkerPosition  position,
Marker::pointer  marker 
) [virtual]

Sets the specified marker to the provided drawable.

Returns:
true if successfully set, false otherwise

References Papyrus::END_MARKER, m_marker_changed_connections, m_markers, on_marker_changed(), and Papyrus::Shape::shape_changed().

void Papyrus::Polyline::set_vertex ( unsigned  n,
double  x,
double  y 
)

References m_vertices, and on_vertex_changed().

void Papyrus::Polyline::set_vertex ( unsigned  n,
Vertex  v 
)

References m_vertices, and on_vertex_changed().

void Papyrus::Polyline::set_vertices ( const Vertices vertices  ) 
sigc::signal< void, unsigned > Papyrus::Polyline::signal_vertex (  ) 

References m_signal_vertex.

sigc::signal< void > Papyrus::Polyline::signal_vertices (  ) 

References m_signal_vertices.

void Papyrus::Polyline::update_marker_position ( MarkerPosition  n  )  [protected]
Vertex Papyrus::Polyline::vertex ( unsigned  n  )  const

References m_vertices.

const Vertices & Papyrus::Polyline::vertices (  )  const

References m_vertices.


Member Data Documentation

sigc::connection Papyrus::Polyline::m_marker_changed_connections[3] [mutable, protected]

Referenced by draw(), and set_marker().

Referenced by draw(), marker(), operator=(), and set_marker().

sigc::signal<void, unsigned> Papyrus::Polyline::m_signal_vertex [protected]

Referenced by on_vertex_changed(), and signal_vertex().

sigc::signal<void> Papyrus::Polyline::m_signal_vertices [protected]

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