Draw2D
drawNS::APIGnuPlot2D Class Reference

Implementation drawing 2D class using gnuplot Class implements proxy between gnuplot and C++ code. More...

#include <Dr2D_gnuplot_api.hh>

Inheritance diagram for drawNS::APIGnuPlot2D:
Collaboration diagram for drawNS::APIGnuPlot2D:

Public Member Functions

 APIGnuPlot2D ()=delete
 deleted non-parametric constructor to force using parametric.
 
 APIGnuPlot2D (double minX, double maxX, double minY, double maxY, int ref_time_ms=0)
 Constructor. More...
 
 ~APIGnuPlot2D ()
 destructor, also stops gnuplot proces.
 
uint draw_line (const Point2D &point1, const Point2D &point2, const std::string &color="black") override
 draws line between 2 points More...
 
uint draw_polygonal_chain (const std::vector< Point2D > &points, const std::string &color="black") override
 draws polygonal_chain between n points More...
 
void erase_shape (uint id) override
 draws polyhedron described by its apexs More...
 
void change_shape_color (uint id, const std::string &color) override
 change color of shape More...
 
void change_ref_time_ms (int ref_time_ms) override
 change mode for ploting and/or time between auto-replots More...
 
void redraw () override
 replot all shapes Replots all shapes, works only in negative refresh_rate_ms value mode.
 
- Public Member Functions inherited from drawNS::Draw2DAPI
 Draw2DAPI (int ref_time_ms=0)
 Constructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from drawNS::Draw2DAPI
int refresh_rate_ms
 mode for ploting and time between auto-replots More...
 

Detailed Description

Implementation drawing 2D class using gnuplot Class implements proxy between gnuplot and C++ code.

Colors are pre-defined or must be on form rgb:#rrggbb.
Pre defined colors: black, white, grey, blue, light-blue, red, green, yellow, orange, purple, as it was in default palette in Matlab 2014b.
Class have 3 modes, described in refresh_rate_ms variable.

Constructor & Destructor Documentation

APIGnuPlot2D::APIGnuPlot2D ( double  minX,
double  maxX,
double  minY,
double  maxY,
int  ref_time_ms = 0 
)

Constructor.

Parameters
minX- lower bounry in X axis,
maxX- upper bounry in X axis,
minY- lower bounry in Y axis,
maxY- upper bounry in Y axis,
minZ- lower bounry in Z axis,
maxZ- upper bounry in Z axis,
ref_time_ms- mode for plotting (negative, 0, positive, see refresh_rate_ms) and time between auto-replots (in miliseconds).

Member Function Documentation

void APIGnuPlot2D::change_ref_time_ms ( int  ref_time_ms)
overridevirtual

change mode for ploting and/or time between auto-replots

Parameters
ref_time_ms- mode for plotting (negative, 0, positive, see refresh_rate_ms) and time between auto-replots (in miliseconds).

Implements drawNS::Draw2DAPI.

void APIGnuPlot2D::change_shape_color ( uint  id,
const std::string &  color 
)
overridevirtual

change color of shape

Parameters
id- id of shape
color- color of line (see class description)

Implements drawNS::Draw2DAPI.

uint APIGnuPlot2D::draw_line ( const Point2D point1,
const Point2D point2,
const std::string &  color = "black" 
)
overridevirtual

draws line between 2 points

Parameters
point1- first point
point2- second point
color- color of line (see class description)
Returns
id of shape (see erase_shape, change_shape_color)

Implements drawNS::Draw2DAPI.

uint APIGnuPlot2D::draw_polygonal_chain ( const std::vector< Point2D > &  points,
const std::string &  color = "black" 
)
overridevirtual

draws polygonal_chain between n points

Parameters
points- vector of points
color- color of line (see class description)
Returns
id of shape (see erase_shape, change_shape_color)

Implements drawNS::Draw2DAPI.

void APIGnuPlot2D::erase_shape ( uint  id)
overridevirtual

draws polyhedron described by its apexs

Parameters
points_map- vector of points vectors. Every vector contains points describes one "layer" of polyhedron
color- color of line (see class description)
Returns
id of shape (see erase_shape, change_shape_color)

Implements drawNS::Draw2DAPI.


The documentation for this class was generated from the following files: