codac  1.5.7
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 "codac_ConvexPolygon.h"
23 #include "vibes.h"
24 
25 namespace codac2
26 {
27  template<class T>
28  class Tube;
29 }
30 
31 namespace codac
32 {
37  class VIBesFig : public Figure
38  {
39  public:
40 
43 
49  VIBesFig(const std::string& fig_name);
50 
55 
59  void close();
60 
69  void set_properties(int x, int y, int width, int height);
70 
76  void set_background(const std::string& bg_color);
77 
92  const IntervalVector& axis_limits(double x_min, double x_max, double y_min, double y_max, bool same_ratio = false, float margin = 0.);
93 
105  const IntervalVector& axis_limits(const IntervalVector& viewbox, bool same_ratio = false, float margin = 0.);
106 
110 
120  void save_image(const std::string& suffix = "", const std::string& extension = "svg", const std::string& path = ".") const;
121 
125 
129  void show() {};
130 
134  void clear();
135 
139 
146  void draw_box(const IntervalVector& box, const vibes::Params& params);
147 
155  void draw_box(const IntervalVector& box, const std::string& color = "", const vibes::Params& params = vibes::Params());
156 
163  void draw_boxes(const std::vector<IntervalVector>& v_boxes, const vibes::Params& params);
164 
172  void draw_boxes(const std::vector<IntervalVector>& v_boxes, const std::string& color = "", const vibes::Params& params = vibes::Params());
173 
181  void draw_line(const std::vector<double>& v_x, const std::vector<double>& v_y, const vibes::Params& params);
182 
191  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());
192 
199  void draw_line(const std::vector<std::vector<double> >& v_pts, const vibes::Params& params);
200 
208  void draw_line(const std::vector<std::vector<double> >& v_pts, const std::string& color = "", const vibes::Params& params = vibes::Params());
209 
218  void draw_circle(double x, double y, double r, const vibes::Params& params);
219 
229  void draw_circle(double x, double y, double r, const std::string& color = "", const vibes::Params& params = vibes::Params());
230 
239  void draw_ring(double x, double y, const Interval& r, const vibes::Params& params);
240 
250  void draw_ring(double x, double y, const Interval& r, const std::string& color = "", const vibes::Params& params = vibes::Params());
251 
261  void draw_pie(double x, double y, const Interval& r, const Interval& theta, const vibes::Params& params);
262 
273  void draw_pie(double x, double y, const Interval& r, const Interval& theta, const std::string& color = "", const vibes::Params& params = vibes::Params());
274 
281  void draw_edge(const ThickEdge& e, const vibes::Params& params);
282 
290  void draw_edge(const ThickEdge& e, const std::string& color = "", const vibes::Params& params = vibes::Params());
291 
298  void draw_polygon(const Polygon& p, const vibes::Params& params);
299 
307  void draw_polygon(const Polygon& p, const std::string& color = "", const vibes::Params& params = vibes::Params());
308 
315  void draw_polygons(const std::vector<ConvexPolygon>& v_p, const vibes::Params& params);
316 
324  void draw_polygons(const std::vector<ConvexPolygon>& v_p, const std::string& color = "", const vibes::Params& params = vibes::Params());
325 
333  void draw_polygons(const std::vector<ConvexPolygon>& v_p, const ColorMap& color_map, const vibes::Params& params = vibes::Params());
334  void draw_polygon_tube(const codac2::Tube<ConvexPolygon>& x, const ColorMap& color_map, const vibes::Params& params = vibes::Params());
335 
342  void draw_point(const ThickPoint& p, const vibes::Params& params);
343 
351  void draw_point(const ThickPoint& p, const std::string& color = "", const vibes::Params& params = vibes::Params());
352 
360  void draw_point(const ThickPoint& p, float size, const vibes::Params& params);
361 
370  void draw_point(const ThickPoint& p, float size, const std::string& color = "", const vibes::Params& params = vibes::Params());
371 
379  void draw_points(const std::vector<ThickPoint>& v_pts, float size, const vibes::Params& params);
380 
389  void draw_points(const std::vector<ThickPoint>& v_pts, float size, const std::string& color = "", const vibes::Params& params = vibes::Params());
390 
400  void draw_vehicle(double x, double y, double heading, double size, const vibes::Params& params);
401 
412  void draw_vehicle(double x, double y, double heading, double size, const std::string& color = "", const vibes::Params& params = vibes::Params());
413 
415  };
416 }
417 
418 #endif
Associates colors to a range of values.
Definition: codac_ColorMap.h:32
Two-dimensional graphical item.
Definition: codac_Figure.h:26
int x() const
Returns the horizontal coordinate of this figure.
int y() const
Returns the vertical coordinate of this figure.
int width() const
Returns the width of this figure.
int height() const
Returns the height of this figure.
Two-dimensional graphical item based on the VIBes viewer.
Definition: codac_VIBesFig.h:38
void draw_vehicle(double x, double y, double heading, double size, const vibes::Params &params)
Draws a vehicle.
void draw_box(const IntervalVector &box, const vibes::Params &params)
Draws a box.
void draw_points(const std::vector< ThickPoint > &v_pts, float size, const vibes::Params &params)
Draws a set of points.
void draw_point(const ThickPoint &p, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a point.
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.
void draw_boxes(const std::vector< IntervalVector > &v_boxes, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a set of boxes.
void draw_polygons(const std::vector< ConvexPolygon > &v_p, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a set of polygons.
void draw_circle(double x, double y, double r, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a circle.
void draw_vehicle(double x, double y, double heading, double size, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a vehicle.
void show()
Displays this figure.
Definition: codac_VIBesFig.h:129
void draw_polygons(const std::vector< ConvexPolygon > &v_p, const ColorMap &color_map, const vibes::Params &params=vibes::Params())
Draws a set of polygons.
void close()
Closes this figure.
void draw_points(const std::vector< ThickPoint > &v_pts, float size, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a set of points.
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())
Draws a line of points.
void draw_edge(const ThickEdge &e, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws an edge.
void clear()
Clears this figure by removing displayed items.
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 draw_polygon(const Polygon &p, const vibes::Params &params)
Draws a polygon.
void draw_point(const ThickPoint &p, float size, const vibes::Params &params)
Draws a point.
void set_properties(int x, int y, int width, int height)
Sets the properties (coordinates and dimensions) of this figure.
void draw_ring(double x, double y, const Interval &r, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a ring.
void draw_circle(double x, double y, double r, const vibes::Params &params)
Draws a circle.
void draw_line(const std::vector< std::vector< double > > &v_pts, const vibes::Params &params)
Draws a line of points.
VIBesFig(const std::string &fig_name)
Creates a VIBesFig.
void draw_boxes(const std::vector< IntervalVector > &v_boxes, const vibes::Params &params)
Draws a set of boxes.
~VIBesFig()
VIBesFig destructor.
void draw_polygons(const std::vector< ConvexPolygon > &v_p, const vibes::Params &params)
Draws a set of polygons.
void draw_pie(double x, double y, const Interval &r, const Interval &theta, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a pie: radial portion of a ring.
void draw_edge(const ThickEdge &e, const vibes::Params &params)
Draws an edge.
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 save_image(const std::string &suffix="", const std::string &extension="svg", const std::string &path=".") const
Saves the figure in SVG/PNG/... format.
const IntervalVector & axis_limits(const IntervalVector &viewbox, bool same_ratio=false, float margin=0.)
Sets the axis limits of this figure.
void draw_line(const std::vector< std::vector< double > > &v_pts, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a line of points.
void set_background(const std::string &bg_color)
Sets the background color of this figure.
void draw_box(const IntervalVector &box, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a box.
void draw_point(const ThickPoint &p, const vibes::Params &params)
Draws a point.
void draw_ring(double x, double y, const Interval &r, const vibes::Params &params)
Draws a ring.
void draw_point(const ThickPoint &p, float size, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a point.
void draw_polygon(const Polygon &p, const std::string &color="", const vibes::Params &params=vibes::Params())
Draws a polygon.
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition: codac_capd_helpers.h:9