Fawkes API
Fawkes Development Version
|
Graph drawing area. More...
#include "graph_drawing_area.h"
Public Member Functions | |
SkillGuiGraphDrawingArea () | |
Constructor. More... | |
void | save () |
save current graph. More... | |
void | open () |
Open a dot graph and display it. More... | |
bool | set_recording (bool recording) |
Enable/disable recording. More... | |
void | zoom_in () |
Zoom in. More... | |
void | zoom_out () |
Zoom out. More... | |
void | zoom_fit () |
Zoom to fit. More... | |
void | zoom_reset () |
Zoom reset. More... | |
void | set_graph_fsm (std::string fsm_name) |
Set graph's FSM name. More... | |
void | set_graph (std::string graph) |
Set graph. More... | |
void | set_bb (double bbw, double bbh) |
Set bounding box. More... | |
void | set_pad (double pad_x, double pad_y) |
Set padding. More... | |
void | set_translation (double tx, double ty) |
Set translation. More... | |
void | set_scale (double scale) |
Set scale. More... | |
bool | scale_override () |
Check if scale override is enabled. More... | |
double | get_scale () |
Get scale. More... | |
void | get_translation (double &tx, double &ty) |
Get translation. More... | |
void | get_dimensions (double &width, double &height) |
Get dimensions. More... | |
void | get_pad (double &pad_x, double &pad_y) |
Get padding. More... | |
Cairo::RefPtr< Cairo::Context > | get_cairo () |
Get Cairo context. More... | |
bool | get_update_graph () |
Check if graph is being updated. More... | |
void | set_update_graph (bool update) |
Set if the graph should be updated on new data. More... | |
sigc::signal< void > | signal_update_disabled () |
Get "update disabled" signal. More... | |
![]() | |
virtual | ~SkillGuiCairoRenderInstructor () |
Empty virtual destructor. More... | |
Protected Member Functions | |
virtual bool | on_expose_event (GdkEventExpose *event) |
Expose event handler. More... | |
virtual bool | on_scroll_event (GdkEventScroll *event) |
Scroll event handler. More... | |
virtual bool | on_button_press_event (GdkEventButton *event) |
Button press event handler. More... | |
virtual bool | on_motion_notify_event (GdkEventMotion *event) |
Mouse motion notify event handler. More... | |
Graph drawing area.
Derived version of Gtk::DrawingArea that renders a graph via Graphviz.
Definition at line 33 of file graph_drawing_area.h.
SkillGuiGraphDrawingArea::SkillGuiGraphDrawingArea | ( | ) |
Constructor.
Definition at line 37 of file graph_drawing_area.cpp.
References on_button_press_event(), on_expose_event(), and on_motion_notify_event().
|
virtual |
Get Cairo context.
This is only valid during the expose event and is only meant for the Graphviz plugin.
Implements SkillGuiCairoRenderInstructor.
Definition at line 386 of file graph_drawing_area.cpp.
|
virtual |
Get dimensions.
width | upon return contains width |
height | upon return contains height |
Implements SkillGuiCairoRenderInstructor.
Definition at line 305 of file graph_drawing_area.cpp.
|
virtual |
Get padding.
To be called only by the Graphviz plugin.
pad_x | upon return contains padding in x |
pad_y | upon return contains padding in y |
Implements SkillGuiCairoRenderInstructor.
Definition at line 244 of file graph_drawing_area.cpp.
|
virtual |
Get scale.
To be called only by the Graphviz plugin.
Implements SkillGuiCairoRenderInstructor.
Definition at line 283 of file graph_drawing_area.cpp.
|
virtual |
Get translation.
tx | upon return contains translation value |
ty | upon return contains translation value |
Implements SkillGuiCairoRenderInstructor.
Definition at line 293 of file graph_drawing_area.cpp.
bool SkillGuiGraphDrawingArea::get_update_graph | ( | ) |
Check if graph is being updated.
Definition at line 397 of file graph_drawing_area.cpp.
Referenced by SkillGuiGtkWindow::~SkillGuiGtkWindow().
|
protectedvirtual |
Button press event handler.
event | event data |
Definition at line 643 of file graph_drawing_area.cpp.
Referenced by SkillGuiGraphDrawingArea().
|
protectedvirtual |
Expose event handler.
event | event info structure. |
Definition at line 586 of file graph_drawing_area.cpp.
Referenced by SkillGuiGraphDrawingArea().
|
protectedvirtual |
Mouse motion notify event handler.
event | event data |
Definition at line 656 of file graph_drawing_area.cpp.
Referenced by SkillGuiGraphDrawingArea().
|
protectedvirtual |
Scroll event handler.
event | event structure |
Definition at line 627 of file graph_drawing_area.cpp.
References zoom_in(), and zoom_out().
void SkillGuiGraphDrawingArea::open | ( | ) |
Open a dot graph and display it.
Definition at line 542 of file graph_drawing_area.cpp.
Referenced by SkillGuiGtkWindow::SkillGuiGtkWindow().
void SkillGuiGraphDrawingArea::save | ( | ) |
save current graph.
Definition at line 462 of file graph_drawing_area.cpp.
Referenced by SkillGuiGtkWindow::SkillGuiGtkWindow().
|
virtual |
Check if scale override is enabled.
Implements SkillGuiCairoRenderInstructor.
Definition at line 374 of file graph_drawing_area.cpp.
|
virtual |
Set bounding box.
To be called only by the Graphviz plugin.
bbw | bounding box width |
bbh | bounding box height |
Implements SkillGuiCairoRenderInstructor.
Definition at line 218 of file graph_drawing_area.cpp.
void SkillGuiGraphDrawingArea::set_graph | ( | std::string | graph | ) |
Set graph.
graph | string representation of the current graph in the dot language. |
Definition at line 171 of file graph_drawing_area.cpp.
Referenced by SkillGuiGtkWindow::~SkillGuiGtkWindow().
void SkillGuiGraphDrawingArea::set_graph_fsm | ( | std::string | fsm_name | ) |
Set graph's FSM name.
fsm_name | name of FSM the graph belongs to |
Definition at line 154 of file graph_drawing_area.cpp.
Referenced by SkillGuiGtkWindow::~SkillGuiGtkWindow().
|
virtual |
Set padding.
To be called only by the Graphviz plugin.
pad_x | padding in x |
pad_y | padding in y |
Implements SkillGuiCairoRenderInstructor.
Definition at line 231 of file graph_drawing_area.cpp.
bool SkillGuiGraphDrawingArea::set_recording | ( | bool | recording | ) |
Enable/disable recording.
recording | true to enable recording, false otherwise |
Definition at line 442 of file graph_drawing_area.cpp.
Referenced by SkillGuiGtkWindow::~SkillGuiGtkWindow().
|
virtual |
Set scale.
To be called only by the Graphviz plugin.
scale | scale value |
Implements SkillGuiCairoRenderInstructor.
Definition at line 273 of file graph_drawing_area.cpp.
|
virtual |
Set translation.
To be called only by the Graphviz plugin.
tx | translation in x |
ty | translation in y |
Implements SkillGuiCairoRenderInstructor.
Definition at line 261 of file graph_drawing_area.cpp.
void SkillGuiGraphDrawingArea::set_update_graph | ( | bool | update | ) |
Set if the graph should be updated on new data.
update | true to update on new data, false to disable update |
Definition at line 407 of file graph_drawing_area.cpp.
Referenced by SkillGuiGtkWindow::~SkillGuiGtkWindow().
sigc::signal< void > SkillGuiGraphDrawingArea::signal_update_disabled | ( | ) |
Get "update disabled" signal.
Definition at line 144 of file graph_drawing_area.cpp.
Referenced by SkillGuiGtkWindow::SkillGuiGtkWindow().
void SkillGuiGraphDrawingArea::zoom_fit | ( | ) |
Zoom to fit.
Disables scale override and draws with values suggested by Graphviz plugin.
Definition at line 348 of file graph_drawing_area.cpp.
Referenced by SkillGuiGtkWindow::SkillGuiGtkWindow().
void SkillGuiGraphDrawingArea::zoom_in | ( | ) |
Zoom in.
Increases zoom factor by 20, no upper limit.
Definition at line 317 of file graph_drawing_area.cpp.
Referenced by on_scroll_event(), and SkillGuiGtkWindow::SkillGuiGtkWindow().
void SkillGuiGraphDrawingArea::zoom_out | ( | ) |
Zoom out.
Decreases zoom factor by 20 with a minimum of 1.
Definition at line 331 of file graph_drawing_area.cpp.
Referenced by on_scroll_event(), and SkillGuiGtkWindow::SkillGuiGtkWindow().
void SkillGuiGraphDrawingArea::zoom_reset | ( | ) |
Zoom reset.
Reset zoom to 1. Enables scale override.
Definition at line 359 of file graph_drawing_area.cpp.
Referenced by SkillGuiGtkWindow::SkillGuiGtkWindow().