An arc is drawn centered on the (x,y) coordinate with a specified radius and start/stop angles. More...
#include <arc.h>
Public Member Functions | |
PAPYRUS_DRAWABLE (Arc) | |
virtual | ~Arc () |
Destructor. | |
double | radius () const |
Returns the radius of this arc. | |
void | set_radius (double r) |
Sets the radius to r. | |
double | start_angle () const |
Sets the start angle of the arc. | |
double | end_angle () const |
Sets the end angle of the arc. | |
void | set_angles (double start, double end) |
Set both start and stop angles in a single method. | |
virtual void | draw_shape (Context &cairo) const |
Draws on the provided context. | |
sigc::signal< void > | signal_radius () |
Signal emitted when the radius is changed. | |
sigc::signal< void > | signal_angle () |
Signal emitted when the start or end angle is changed. | |
Static Public Member Functions | |
static pointer | create (double radius=1.0, double angle_start=0.0, double angle_end=M_PI/2.0, Fill::pointer fill=Fill::pointer(), Stroke::pointer stroke=Stroke::pointer()) |
Creates an arc with the specified start angle, stop angle and radius. | |
static pointer | create (const Glib::ustring &id, double radius=1.0, double angle_start=0.0, double angle_end=M_PI/2.0, Fill::pointer fill=Fill::pointer(), Stroke::pointer stroke=Stroke::pointer()) |
Creates an arc with the specified start angle, stop angle and radius. | |
Protected Member Functions | |
Arc (const Glib::ustring &id, double radius, double angle_start, double angle_end, Fill::pointer fill=Fill::pointer(), Stroke::pointer stroke=Stroke::pointer()) | |
Protected Attributes | |
double | m_radius |
The radius of the arc. | |
double | m_angle_start |
double | m_angle_end |
sigc::signal< void > | m_signal_radius |
Signal emitted when the radius is changed. | |
sigc::signal< void > | m_signal_angle |
Signal emitted when the start or end angle is changed. |
An arc is drawn centered on the (x,y) coordinate with a specified radius and start/stop angles.
Arc
Papyrus::Arc::Arc | ( | const Glib::ustring & | id, | |
double | radius, | |||
double | angle_start, | |||
double | angle_end, | |||
Fill::pointer | fill = Fill::pointer() , |
|||
Stroke::pointer | stroke = Stroke::pointer() | |||
) | [protected] |
References m_angle_end, and m_angle_start.
Papyrus::Arc::~Arc | ( | ) | [virtual] |
Destructor.
Arc::pointer Papyrus::Arc::create | ( | const Glib::ustring & | id, | |
double | radius = 1.0 , |
|||
double | angle_start = 0.0 , |
|||
double | angle_end = M_PI / 2.0 , |
|||
Fill::pointer | fill = Fill::pointer() , |
|||
Stroke::pointer | stroke = Stroke::pointer() | |||
) | [static] |
Creates an arc with the specified start angle, stop angle and radius.
References PAPYRUS_CREATE.
Arc::pointer Papyrus::Arc::create | ( | double | radius = 1.0 , |
|
double | angle_start = 0.0 , |
|||
double | angle_end = M_PI / 2.0 , |
|||
Fill::pointer | fill = Fill::pointer() , |
|||
Stroke::pointer | stroke = Stroke::pointer() | |||
) | [static] |
Creates an arc with the specified start angle, stop angle and radius.
References PAPYRUS_CREATE.
void Papyrus::Arc::draw_shape | ( | Context & | cairo | ) | const [virtual] |
Draws on the provided context.
Implements Papyrus::Shape.
References m_angle_end, m_angle_start, and m_radius.
double Papyrus::Arc::end_angle | ( | ) | const |
Sets the end angle of the arc.
References m_angle_end.
Papyrus::Arc::PAPYRUS_DRAWABLE | ( | Arc | ) |
double Papyrus::Arc::radius | ( | ) | const |
Returns the radius of this arc.
References m_radius.
void Papyrus::Arc::set_angles | ( | double | start, | |
double | end | |||
) |
Set both start and stop angles in a single method.
References m_angle_end, m_angle_start, m_signal_angle, and Papyrus::Shape::shape_changed().
void Papyrus::Arc::set_radius | ( | double | r | ) |
Sets the radius to r.
References m_radius, m_signal_radius, and Papyrus::Shape::shape_changed().
sigc::signal< void > Papyrus::Arc::signal_angle | ( | ) |
Signal emitted when the start or end angle is changed.
References m_signal_angle.
sigc::signal< void > Papyrus::Arc::signal_radius | ( | ) |
Signal emitted when the radius is changed.
References m_signal_radius.
double Papyrus::Arc::start_angle | ( | ) | const |
Sets the start angle of the arc.
References m_angle_start.
double Papyrus::Arc::m_angle_end [protected] |
Referenced by Arc(), draw_shape(), end_angle(), and set_angles().
double Papyrus::Arc::m_angle_start [protected] |
Referenced by Arc(), draw_shape(), set_angles(), and start_angle().
double Papyrus::Arc::m_radius [protected] |
The radius of the arc.
Referenced by draw_shape(), radius(), and set_radius().
sigc::signal<void> Papyrus::Arc::m_signal_angle [protected] |
Signal emitted when the start or end angle is changed.
Referenced by set_angles(), and signal_angle().
sigc::signal<void> Papyrus::Arc::m_signal_radius [protected] |
Signal emitted when the radius is changed.
Referenced by set_radius(), and signal_radius().