Fawkes API  Fawkes Development Version
graph_viewport.h
1 
2 /***************************************************************************
3  * graph_viewport.h - FSM Graph Viewport for Skill GUI
4  *
5  * Created: Mon Dec 15 15:38:02 2008
6  * Copyright 2008 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __TOOLS_SKILLGUI_GRAPH_VIEWPORT_H_
24 #define __TOOLS_SKILLGUI_GRAPH_VIEWPORT_H_
25 
26 #include <papyrus.h>
27 #include <papyrus-gtkmm/viewport.h>
28 
29 #include <gvc.h>
30 #include <gvcjob.h>
31 
32 #include <string>
33 
34 class SkillGuiGraphViewport : public Papyrus::Gtk::Viewport
35 {
36  public:
39 
40  void set_gvjob(GVJ_t *job);
41  void set_graph_fsm(std::string fsm_name);
42  void set_graph(std::string graph);
43 
44  bool get_update_graph();
45  void set_update_graph(bool update);
46 
47  void save();
48  void render();
49 
50  void zoom_in();
51  void zoom_out();
52  void zoom_fit();
53  void zoom_reset();
54 
55  Papyrus::AffineController::pointer get_affine();
56 
57  void add_drawable(Papyrus::Drawable::pointer d);
58  virtual void clear();
59  void set_bb(double bbw, double bbh);
60  void set_pad(double pad_x, double pad_y);
61  void set_translation(double tx, double ty);
62  void set_scale(double scale);
63  bool scale_override();
64 
65  protected:
66  void on_expose(GdkEventExpose *event);
67 
68  private:
69  GVC_t *__gvc;
70  GVJ_t *__gvjob;
71 
72  std::string __graph_fsm;
73  std::string __graph;
74 
75  double __bbw;
76  double __bbh;
77  double __pad_x;
78  double __pad_y;
79  double __translation_x;
80  double __translation_y;
81  double __scale;
82  bool __update_graph;
83 
84  bool __scale_override;
85 
86  Gtk::FileChooserDialog *__fcd;
87  Papyrus::AffineController::pointer __affine;
88  Papyrus::Translator::pointer __translator;
89 };
90 
91 
92 #endif
void on_expose(GdkEventExpose *event)
Called on explose.
void zoom_in()
Zoom in.
SkillGuiGraphViewport()
Constructor.
void set_graph_fsm(std::string fsm_name)
Set graph&#39;s FSM name.
void set_pad(double pad_x, double pad_y)
Set padding.
void set_scale(double scale)
Set scale.
bool scale_override()
Check if scale override is enabled.
void save()
Render current graph.
void add_drawable(Papyrus::Drawable::pointer d)
Add a drawable.
void set_bb(double bbw, double bbh)
Set bounding box.
void set_update_graph(bool update)
Set if the graph should be updated on new data.
virtual void clear()
Clear all drawables.
void set_gvjob(GVJ_t *job)
Set current Graphviz job.
Papyrus::AffineController::pointer get_affine()
Get scaler.
void set_graph(std::string graph)
Set graph.
void zoom_out()
Zoom out.
void set_translation(double tx, double ty)
Set translation.
~SkillGuiGraphViewport()
Destructor.
void zoom_fit()
Zoom to fit.
void zoom_reset()
Zoom reset.
void render()
Render current graph.
Skill FSM Graph Viewport.
bool get_update_graph()
Check if graph is being updated.