Vibes C++ API
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups
Classes | Namespaces | Macros | Functions
vibes.h File Reference

Vibes C++ API Header. More...

#include <vector>
#include <string>
#include <map>
#include <sstream>

Go to the source code of this file.

Classes

class  vibes::Value
 
struct  vibes::Vec< T, N >
 
class  vibes::Params
 
class  vibes::Params::NameHelper
 

Namespaces

 vibes
 

Macros

#define VIBES_GENERATE_vibesXXX_MACROS
 
#define VIBES_DEBUG(i)
 Verbose debugging functions (logs to standard output), only useful for library devs. More...
 
#define VIBES_COLOR_PARAM_NAME   "format"
 
#define VIBES_FUNC_COLOR_PARAM_1(func_name, T1, a)
 
#define VIBES_FUNC_COLOR_PARAM_2(func_name, T1, a, T2, b)
 
#define VIBES_FUNC_COLOR_PARAM_3(func_name, T1, a, T2, b, T3, c)
 
#define VIBES_FUNC_COLOR_PARAM_4(func_name, T1, a, T2, b, T3, c, T4, d)
 
#define VIBES_FUNC_COLOR_PARAM_5(func_name, T1, a, T2, b, T3, c, T4, d, T5, e)
 
#define VIBES_FUNC_COLOR_PARAM_6(func_name, T1, a, T2, b, T3, c, T4, d, T5, e, T6, f)
 
#define vibesParams(...)   (vibes::Params(), __VA_ARGS__)
 Macro to simplify contruction of a Params object. More...
 
#define vibesDrawBox(x_lb, x_ub, y_lb, y_ub,...)   vibes::drawBox(x_lb,x_ub,y_lb,y_ub,vibesParams(__VA_ARGS__))
 Convenience macros for "Matlab style" variadic calls.
 
#define vibesDrawEllipse(cx, cy, a, b, rot,...)   vibes::drawEllipse(cx,cy,a,b,rot,vibesParams(__VA_ARGS__))
 
#define vibesDrawConfidenceEllipse(cx, cy, sxx, sxy, syy, K,...)   vibes::drawConfidenceEllipse(cx,cy,sxx,sxy,syy,K,vibesParams(__VA_ARGS__))
 
#define vibesDrawCircle(cx, cy, r,...)   vibes::drawCircle(cx,cy,r,vibesParams(__VA_ARGS__))
 

Typedefs

Useful types for colors, vectors and points
typedef Vec< int, 3 > vibes::RGB
 A RGB triplet [0..255].
 
typedef Vec< int, 4 > vibes::RGBA
 A RGBA triplet [0..255].
 
typedef Vec< double, 2 > vibes::Vec2d
 A 2D floating point vector.
 
typedef Vec< double, 3 > vibes::Vec3d
 A 3D floating point vector.
 
typedef Vec< double, 4 > vibes::Vec4d
 A 4D floating point vector.
 

Functions

void vibes::beginDrawing ()
 Start VIBes in connected mode: connects to the VIBes viewer.
 
void vibes::beginDrawing (const std::string &fileName)
 Start VIBes in file saving mode. All commands are saved to the specified file.
 
void vibes::endDrawing ()
 Close connection to the viewer or the drawing file.
 
void vibes::drawCircle (const double &cx, const double &cy, const double &r, const Params &params)
 
Figure management
void vibes::newFigure (const std::string &figureName=std::string())
 Create a new figure named figureName.
 
void vibes::clearFigure (const std::string &figureName=std::string())
 Clears the contents of the figure figureName, or the current figure if argument is given.
 
void vibes::closeFigure (const std::string &figureName=std::string())
 Close the figure named figureName, or the current figure if no argument is given.
 
void vibes::saveImage (const std::string &fileName, const std::string &figureName)
 
void vibes::selectFigure (const std::string &figureName)
 Select figureName as the current figure. Drawing operations will then apply to figureName.
 
View settings
void vibes::axisAuto (Params params=Params())
 Set axes limits to the bounding box of the drawing.
 
void vibes::axisLimits (const double &x_lb, const double &x_ub, const double &y_lb, const double &y_ub, Params params=Params())
 Specify the rectangle to be displayed: Lower-left corner (x_lb, y_lb) and a upper-right corner (x_ub, y_ub).
 
Primitive drawing functions

Functions for drawing boxes, ellipses, lines. By default, all these functions operate on the current figure. The optional agument format provides quick graphics attribute setup. Additional parameters can be provided in the optional last argument params.

void vibes::drawBox (const double &x_lb, const double &x_ub, const double &y_lb, const double &y_ub, Params params)
 Draw a 2-D box with a left lower corner at (x_lb, y_lb) and a right upper corner at (x_ub, y_ub)
 
void vibes::drawBox (const double &x_lb, const double &x_ub, const double &y_lb, const double &y_ub, const std::string &format=std::string(), Params params=Params())
 
void vibes::drawBox (const std::vector< double > &bounds, Params params)
 Draw a N-D box from a list of bounds in the form (x_lb, x_ub, y_lb, y_ub, z_lb, z_ub, ...)
 
void vibes::drawBox (const std::vector< double > &bounds, const std::string &format=std::string(), Params params=Params())
 
void vibes::drawEllipse (const double &cx, const double &cy, const double &a, const double &b, const double &rot, Params params)
 Draw an ellipse centered at (cx, cy), with semi-major and minor axes a and b, and rotated by rot degrees.
 
void vibes::drawEllipse (const double &cx, const double &cy, const double &a, const double &b, const double &rot, const std::string &format=std::string(), Params params=Params())
 
void vibes::drawConfidenceEllipse (const double &cx, const double &cy, const double &sxx, const double &sxy, const double &syy, const double &K, Params params)
 Draw a 2-D confidence ellipse centered at (cx, cy), with covariance sxx, sxy, syy and scale K.
 
void vibes::drawConfidenceEllipse (const double &cx, const double &cy, const double &sxx, const double &sxy, const double &syy, const double &K, const std::string &format=std::string(), Params params=Params())
 
void vibes::drawConfidenceEllipse (const std::vector< double > &center, const std::vector< double > &cov, const double &K, Params params)
 Draw a N-D confidence ellipse centered at center, with covariance in cov and scale K.
 
void vibes::drawConfidenceEllipse (const std::vector< double > &center, const std::vector< double > &cov, const double &K, const std::string &format=std::string(), Params params=Params())
 
void vibes::drawCircle (const double &cx, const double &cy, const double &r, Params params)
 Draw a circle centered at (cx, cy), with radius r.
 
void vibes::drawCircle (const double &cx, const double &cy, const double &r, const std::string &format=std::string(), Params params=Params())
 
void vibes::drawBoxes (const std::vector< std::vector< double > > &bounds, Params params)
 Draw a list of N-D rectangles from a list of list of bounds in the form ((x_lb_1, x_ub_1, y_lb_1, ...), (x_lb_2, x_ub_2, y_lb_2, ...), ...)
 
void vibes::drawBoxes (const std::vector< std::vector< double > > &bounds, const std::string &format=std::string(), Params params=Params())
 
void vibes::drawBoxesUnion (const std::vector< std::vector< double > > &bounds, Params params)
 Computes and draw the union of a list of N-D rectangles, from a list of list of bounds in the form ((x_lb_1, x_ub_1, y_lb_1, ...), (x_lb_2, x_ub_2, y_lb_2, ...), ...)
 
void vibes::drawBoxesUnion (const std::vector< std::vector< double > > &bounds, const std::string &format=std::string(), Params params=Params())
 
void vibes::drawLine (const std::vector< std::vector< double > > &points, Params params)
 Draw a N-D line from the list of coordinates points in the form ((x_1, y_1, z_1, ...), (x_2, y_2, z_2, ...), ...)
 
void vibes::drawLine (const std::vector< std::vector< double > > &points, const std::string &format=std::string(), Params params=Params())
 
void vibes::drawLine (const std::vector< double > &x, const std::vector< double > &y, Params params)
 Draw a 2-D line from the list of abscissae x and the list of ordinates y.
 
void vibes::drawLine (const std::vector< double > &x, const std::vector< double > &y, const std::string &format=std::string(), Params params=Params())
 
Objects grouping and deletion
void vibes::newGroup (const std::string &name, Params params)
 Create a new group with the specified name.
 
void vibes::newGroup (const std::string &name, const std::string &format=std::string(), Params params=Params())
 
void vibes::clearGroup (const std::string &figureName, const std::string &groupName)
 Clear the contents of the group groupName in figure figureName.
 
void vibes::clearGroup (const std::string &groupName)
 Clear the contents of the group groupName in current figure.
 
void vibes::removeObject (const std::string &figureName, const std::string &objectName)
 Delete the named graphical object objectName from figure figureName.
 
void vibes::removeObject (const std::string &objectName)
 Delete the named graphical object objectName from current figure.
 
Object properties modification
void vibes::setObjectProperty (const std::string &figureName, const std::string &objectName, const std::string &key, const Value &value)
 Set the property key to the provided value for the named object objectName in figure figureName.
 
void vibes::setObjectProperty (const std::string &objectName, const std::string &key, const Value &value)
 Set the property key to the provided value for the named object objectName in current figure.
 
void vibes::setObjectProperties (const std::string &figureName, const std::string &objectName, const Params &properties)
 Assign properties to the named object objectName in figure figureName.
 
void vibes::setObjectProperties (const std::string &objectName, const Params &properties)
 Assign properties to the named object objectName in current figure.
 
Figure properties modification
void vibes::setFigureProperty (const std::string &figureName, const std::string &key, const Value &value)
 Set the property key to the provided value for figure figureName. More...
 
void vibes::setFigureProperty (const std::string &key, const Value &value)
 Set the property key to the provided value for current figure. More...
 
void vibes::setFigureProperties (const std::string &figureName, const Params &properties)
 Assign the given properties to the figure figureName.
 
void vibes::setFigureProperties (const Params &properties)
 Assign the given properties to the current figure.
 

Detailed Description

Vibes C++ API Header.

Author
Vincent Drevelle, Jeremy Nicolas
Date
2013-2014
Version
0.2.0beta

Definition in file vibes.h.

Macro Definition Documentation

#define VIBES_DEBUG (   i)

Verbose debugging functions (logs to standard output), only useful for library devs.

Includes

Definition at line 46 of file vibes.h.

#define VIBES_FUNC_COLOR_PARAM_1 (   func_name,
  T1,
 
)
Value:
void func_name(T1 a, Params params); \
inline void func_name(T1 a, \
const std::string &format=std::string(), Params params=Params()) {func_name(a,(params,VIBES_COLOR_PARAM_NAME,format));}

Definition at line 157 of file vibes.h.

#define VIBES_FUNC_COLOR_PARAM_2 (   func_name,
  T1,
  a,
  T2,
 
)
Value:
void func_name(T1 a, T2 b, Params params); \
inline void func_name(T1 a, T2 b, \
const std::string &format=std::string(), Params params=Params()) {func_name(a,b,(params,VIBES_COLOR_PARAM_NAME,format));}

Definition at line 161 of file vibes.h.

#define VIBES_FUNC_COLOR_PARAM_3 (   func_name,
  T1,
  a,
  T2,
  b,
  T3,
 
)
Value:
void func_name(T1 a, T2 b, T3 c, Params params); \
inline void func_name(T1 a, T2 b, T3 c, \
const std::string &format=std::string(), Params params=Params()) {func_name(a,b,c,(params,VIBES_COLOR_PARAM_NAME,format));}

Definition at line 165 of file vibes.h.

#define VIBES_FUNC_COLOR_PARAM_4 (   func_name,
  T1,
  a,
  T2,
  b,
  T3,
  c,
  T4,
 
)
Value:
void func_name(T1 a, T2 b, T3 c, T4 d, Params params); \
inline void func_name(T1 a, T2 b, T3 c, T4 d, \
const std::string &format=std::string(), Params params=Params()) {func_name(a,b,c,d,(params,VIBES_COLOR_PARAM_NAME,format));}

Definition at line 169 of file vibes.h.

#define VIBES_FUNC_COLOR_PARAM_5 (   func_name,
  T1,
  a,
  T2,
  b,
  T3,
  c,
  T4,
  d,
  T5,
 
)
Value:
void func_name(T1 a, T2 b, T3 c, T4 d, T5 e, Params params); \
inline void func_name(T1 a, T2 b, T3 c, T4 d, T5 e, \
const std::string &format=std::string(), Params params=Params()) {func_name(a,b,c,d,e,(params,VIBES_COLOR_PARAM_NAME,format));}

Definition at line 173 of file vibes.h.

#define VIBES_FUNC_COLOR_PARAM_6 (   func_name,
  T1,
  a,
  T2,
  b,
  T3,
  c,
  T4,
  d,
  T5,
  e,
  T6,
 
)
Value:
void func_name(T1 a, T2 b, T3 c, T4 d, T5 e, T6 f, Params params); \
inline void func_name(T1 a, T2 b, T3 c, T4 d, T5 e, T6 f, \
const std::string &format=std::string(), Params params=Params()) {func_name(a,b,c,d,e,f,(params,VIBES_COLOR_PARAM_NAME,format));}

Definition at line 177 of file vibes.h.

#define VIBES_GENERATE_vibesXXX_MACROS

Vibes API configuration defines (def or undef as needed)Generate "vibesFunctionName(arg1,arg2,argN,...)" macros for each Vibes function, to allow Matlab style variadic calls with properies. Also defines the "vibesParams(...)" macro to help specifying parameters. Undef this if you don't want to define macros

Definition at line 27 of file vibes.h.

#define vibesParams (   ...)    (vibes::Params(), __VA_ARGS__)

Macro to simplify contruction of a Params object.

Convenience macros

Definition at line 435 of file vibes.h.