23 #ifndef __TOOLS_LASERGUI_VISDISPLAY_H_ 24 #define __TOOLS_LASERGUI_VISDISPLAY_H_ 26 #include <cairomm/context.h> 30 #include <interfaces/VisualDisplay2DInterface.h> 41 void draw(Cairo::RefPtr<Cairo::Context> cr);
47 unsigned char r = 0,
unsigned char g = 0,
48 unsigned char b = 0,
unsigned char a = 0);
50 virtual void draw(Cairo::RefPtr<Cairo::Context> &cr) = 0;
54 inline unsigned int id() {
return _id; }
56 inline void color(
float &r,
float &g,
float &b,
float &a)
72 Line(
float x1,
float y1,
float x2,
float y2,
73 unsigned int id,
unsigned int owner,
75 unsigned char r = 0,
unsigned char g = 0,
76 unsigned char b = 0,
unsigned char a = 0);
77 void draw(Cairo::RefPtr<Cairo::Context> &cr);
87 Rectangle(
float x,
float y,
float width,
float height,
88 unsigned int id,
unsigned int owner,
90 unsigned char r = 0,
unsigned char g = 0,
91 unsigned char b = 0,
unsigned char a = 0);
92 void draw(Cairo::RefPtr<Cairo::Context> &cr);
102 Circle(
float x,
float y,
float radius,
103 unsigned int id,
unsigned int owner,
105 unsigned char r = 0,
unsigned char g = 0,
106 unsigned char b = 0,
unsigned char a = 0);
107 void draw(Cairo::RefPtr<Cairo::Context> &cr);
116 Text(
float x,
float y, std::string text,
119 unsigned int id,
unsigned int owner,
120 unsigned char r = 0,
unsigned char g = 0,
121 unsigned char b = 0,
unsigned char a = 0);
122 void draw(Cairo::RefPtr<Cairo::Context> &cr);
132 std::map<unsigned int, Shape *> __shapes;
133 std::map<unsigned int, Shape *>::iterator __sit;
void color(float &r, float &g, float &b, float &a)
Get shape color.
LineStyle
Enumeration defining the possible line styles.
fawkes::VisualDisplay2DInterface::LineStyle _line_style
Line style.
2D visualization processor for VisualDisplay2DInterface.
float _color_g
green part of RGBA object color
float _color_a
alpha part of RGBA object color
void set_interface(fawkes::VisualDisplay2DInterface *interface)
Set interface.
Anchor
Enumeration defining the possible anchor points.
~VisualDisplay2D()
Destructor.
float _color_b
blue part of RGBA object color
unsigned int id()
Get shape ID.
void apply_style(Cairo::RefPtr< Cairo::Context > &cr)
Set style on context.
void process_messages()
Process messages.
Shape(unsigned int id, unsigned int owner, fawkes::VisualDisplay2DInterface::LineStyle line_style=fawkes::VisualDisplay2DInterface::LS_SOLID, unsigned char r=0, unsigned char g=0, unsigned char b=0, unsigned char a=0)
Constructor.
Class representing a text object.
unsigned int owner()
Get owner ID.
virtual void draw(Cairo::RefPtr< Cairo::Context > &cr)=0
Draw shape to Cairo context.
unsigned int _id
Object ID.
Class representing a circle Line represented by its center point and radius.
Class representing a shape.
Class representing a rectangle.
Class representing a line.
void draw(Cairo::RefPtr< Cairo::Context > cr)
Draw objects.
virtual ~Shape()
Virtual empty destructor.
VisualDisplay2DInterface Fawkes BlackBoard Interface.
unsigned int _owner
Owner ID.
VisualDisplay2D()
Constructor.
float _color_r
red part of RGBA object color