codac
codac_VIBesFig.h
Go to the documentation of this file.
1 
12 #ifndef __CODAC_VIBESFIG_H__
13 #define __CODAC_VIBESFIG_H__
14 
15 #include "codac_Interval.h"
16 #include "codac_Figure.h"
17 #include "codac_ThickPoint.h"
18 #include "codac_Polygon.h"
19 #include "codac_ConvexPolygon.h"
20 #include "codac_ColorMap.h"
21 #include "vibes.h"
22 
23 namespace codac
24 {
29  class VIBesFig : public Figure
30  {
31  public:
32 
35 
41  VIBesFig(const std::string& fig_name);
42 
46  ~VIBesFig();
47 
51  void close();
52 
61  void set_properties(int x, int y, int width, int height);
62 
68  void set_background(const std::string& bg_color);
69 
84  const IntervalVector& axis_limits(double x_min, double x_max, double y_min, double y_max, bool same_ratio = false, float margin = 0.);
85 
97  const IntervalVector& axis_limits(const IntervalVector& viewbox, bool same_ratio = false, float margin = 0.);
98 
102 
112  void save_image(const std::string& suffix = "", const std::string& extension = "svg", const std::string& path = ".") const;
113 
117 
121  void show() {};
122 
126  void clear();
127 
131 
138  void draw_box(const IntervalVector& box, const vibes::Params& params);
139 
147  void draw_box(const IntervalVector& box, const std::string& color = "", const vibes::Params& params = vibes::Params());
148 
155  void draw_boxes(const std::vector<IntervalVector>& v_boxes, const vibes::Params& params);
156 
164  void draw_boxes(const std::vector<IntervalVector>& v_boxes, const std::string& color = "", const vibes::Params& params = vibes::Params());
165 
173  void draw_line(const std::vector<double>& v_x, const std::vector<double>& v_y, const vibes::Params& params);
174 
183  void draw_line(const std::vector<double>& v_x, const std::vector<double>& v_y, const std::string& color = "", const vibes::Params& params = vibes::Params());
184 
191  void draw_line(const std::vector<std::vector<double> >& v_pts, const vibes::Params& params);
192 
200  void draw_line(const std::vector<std::vector<double> >& v_pts, const std::string& color = "", const vibes::Params& params = vibes::Params());
201 
210  void draw_circle(double x, double y, double r, const vibes::Params& params);
211 
221  void draw_circle(double x, double y, double r, const std::string& color = "", const vibes::Params& params = vibes::Params());
222 
231  void draw_ring(double x, double y, const Interval& r, const vibes::Params& params);
232 
242  void draw_ring(double x, double y, const Interval& r, const std::string& color = "", const vibes::Params& params = vibes::Params());
243 
253  void draw_pie(double x, double y, const Interval& r, const Interval& theta, const vibes::Params& params);
254 
265  void draw_pie(double x, double y, const Interval& r, const Interval& theta, const std::string& color = "", const vibes::Params& params = vibes::Params());
266 
273  void draw_edge(const ThickEdge& e, const vibes::Params& params);
274 
282  void draw_edge(const ThickEdge& e, const std::string& color = "", const vibes::Params& params = vibes::Params());
283 
290  void draw_polygon(const Polygon& p, const vibes::Params& params);
291 
299  void draw_polygon(const Polygon& p, const std::string& color = "", const vibes::Params& params = vibes::Params());
300 
307  void draw_polygons(const std::vector<ConvexPolygon>& v_p, const vibes::Params& params);
308 
316  void draw_polygons(const std::vector<ConvexPolygon>& v_p, const std::string& color = "", const vibes::Params& params = vibes::Params());
317 
325  void draw_polygons(const std::vector<ConvexPolygon>& v_p, const ColorMap& color_map, const vibes::Params& params = vibes::Params());
326 
333  void draw_point(const ThickPoint& p, const vibes::Params& params);
334 
342  void draw_point(const ThickPoint& p, const std::string& color = "", const vibes::Params& params = vibes::Params());
343 
351  void draw_point(const ThickPoint& p, float size, const vibes::Params& params);
352 
361  void draw_point(const ThickPoint& p, float size, const std::string& color = "", const vibes::Params& params = vibes::Params());
362 
370  void draw_points(const std::vector<ThickPoint>& v_pts, float size, const vibes::Params& params);
371 
380  void draw_points(const std::vector<ThickPoint>& v_pts, float size, const std::string& color = "", const vibes::Params& params = vibes::Params());
381 
391  void draw_vehicle(double x, double y, double heading, double size, const vibes::Params& params);
392 
403  void draw_vehicle(double x, double y, double heading, double size, const std::string& color = "", const vibes::Params& params = vibes::Params());
404 
406  };
407 }
408 
409 #endif
void set_properties(int x, int y, int width, int height)
Sets the properties (coordinates and dimensions) of this figure.
void save_image(const std::string &suffix="", const std::string &extension="svg", const std::string &path=".") const
Saves the figure in SVG/PNG/... format.
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition: codac_capd_helpers.h:9
void draw_points(const std::vector< ThickPoint > &v_pts, float size, const vibes::Params &params)
Draws a set of points.
void draw_box(const IntervalVector &box, const vibes::Params &params)
Draws a box.
void draw_pie(double x, double y, const Interval &r, const Interval &theta, const vibes::Params &params)
Draws a pie: radial portion of a ring.
void draw_line(const std::vector< double > &v_x, const std::vector< double > &v_y, const vibes::Params &params)
Draws a line of points.
void clear()
Clears this figure by removing displayed items.
int height() const
Returns the height of this figure.
VIBesFig(const std::string &fig_name)
Creates a VIBesFig.
int y() const
Returns the vertical coordinate of this figure.
void draw_ring(double x, double y, const Interval &r, const vibes::Params &params)
Draws a ring.
void show()
Displays this figure.
Definition: codac_VIBesFig.h:121
int width() const
Returns the width of this figure.
Associates colors to a range of values.
Definition: codac_ColorMap.h:31
void set_background(const std::string &bg_color)
Sets the background color of this figure.
Two-dimensional graphical item.
Definition: codac_Figure.h:25
void draw_vehicle(double x, double y, double heading, double size, const vibes::Params &params)
Draws a vehicle.
void draw_point(const ThickPoint &p, const vibes::Params &params)
Draws a point.
void draw_circle(double x, double y, double r, const vibes::Params &params)
Draws a circle.
Two-dimensional graphical item based on the VIBes viewer.
Definition: codac_VIBesFig.h:29
void close()
Closes this figure.
void draw_polygon(const Polygon &p, const vibes::Params &params)
Draws a polygon.
void draw_edge(const ThickEdge &e, const vibes::Params &params)
Draws an edge.
void draw_boxes(const std::vector< IntervalVector > &v_boxes, const vibes::Params &params)
Draws a set of boxes.
int x() const
Returns the horizontal coordinate of this figure.
void draw_polygons(const std::vector< ConvexPolygon > &v_p, const vibes::Params &params)
Draws a set of polygons.
~VIBesFig()
VIBesFig destructor.
const IntervalVector & axis_limits(double x_min, double x_max, double y_min, double y_max, bool same_ratio=false, float margin=0.)
Sets the axis limits of this figure.