Vibes C++ API
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups
Classes | Functions | Variables

Classes

class  Params
 
class  Value
 
struct  Vec
 

Typedefs

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

Functions

void beginDrawing ()
 Start VIBes in connected mode: connects to the VIBes viewer.
 
void beginDrawing (const std::string &fileName)
 Start VIBes in file saving mode. All commands are saved to the specified file.
 
void endDrawing ()
 Close connection to the viewer or the drawing file.
 
void drawCircle (const double &cx, const double &cy, const double &r, const Params &params)
 
Figure management
void newFigure (const std::string &figureName=std::string())
 Create a new figure named figureName.
 
void clearFigure (const std::string &figureName=std::string())
 Clears the contents of the figure figureName, or the current figure if argument is given.
 
void closeFigure (const std::string &figureName=std::string())
 Close the figure named figureName, or the current figure if no argument is given.
 
void saveImage (const std::string &fileName, const std::string &figureName)
 
void selectFigure (const std::string &figureName)
 Select figureName as the current figure. Drawing operations will then apply to figureName.
 
View settings
void axisAuto (Params params=Params())
 Set axes limits to the bounding box of the drawing.
 
void 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 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 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 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 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 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 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 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 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 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 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 drawBox (const std::vector< double > &bounds, const std::string &format=std::string(), Params params=Params())
 
void 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 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 drawConfidenceEllipse (const std::vector< double > &center, const std::vector< double > &cov, const double &K, const std::string &format=std::string(), Params params=Params())
 
void drawCircle (const double &cx, const double &cy, const double &r, Params params)
 Draw a circle centered at (cx, cy), with radius r.
 
void drawCircle (const double &cx, const double &cy, const double &r, const std::string &format=std::string(), Params params=Params())
 
void drawBoxes (const std::vector< std::vector< double > > &bounds, const std::string &format=std::string(), Params params=Params())
 
void drawBoxesUnion (const std::vector< std::vector< double > > &bounds, const std::string &format=std::string(), Params params=Params())
 
void drawLine (const std::vector< std::vector< double > > &points, const std::string &format=std::string(), Params params=Params())
 
void 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 newGroup (const std::string &name, Params params)
 Create a new group with the specified name.
 
void clearGroup (const std::string &figureName, const std::string &groupName)
 Clear the contents of the group groupName in figure figureName.
 
void clearGroup (const std::string &groupName)
 Clear the contents of the group groupName in current figure.
 
void removeObject (const std::string &figureName, const std::string &objectName)
 Delete the named graphical object objectName from figure figureName.
 
void removeObject (const std::string &objectName)
 Delete the named graphical object objectName from current figure.
 
void newGroup (const std::string &name, const std::string &format=std::string(), Params params=Params())
 
Figure properties modification
void setFigureProperties (const std::string &figureName, const Params &properties)
 Assign the given properties to the figure figureName.
 
void setFigureProperties (const Params &properties)
 Assign the given properties to the current figure.
 
void 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 setFigureProperty (const std::string &key, const Value &value)
 Set the property key to the provided value for current figure. More...
 
Object properties modification
void setObjectProperties (const std::string &figureName, const std::string &objectName, const Params &properties)
 Assign properties to the named object objectName in figure figureName.
 
void setObjectProperties (const std::string &objectName, const Params &properties)
 Assign properties to the named object objectName in current figure.
 
void 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 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.
 

Variables

FILE * channel =0
 Current communication file descriptor.
 
string current_fig ="default"
 Current figure name (client-maintained state)
 

Detailed Description