codac 2.0.0
Loading...
Searching...
No Matches
codac2::DefaultFigure Class Reference

Default view class, used to manage the default figure. More...

#include <codac2_Figure2D.h>

Static Public Member Functions

static std::shared_ptr< Figure2Dselected_fig ()
 Getter for the default figure.
 
static void set (std::shared_ptr< Figure2D > fig)
 Setter for the default figure.
 
static Figure2Dset_axes (const FigureAxis &axis1, const FigureAxis &axis2)
 Setter for the axes of the figure.
 
static void set_window_properties (const Vector &pos, const Vector &size)
 Setter for the position and size of the window.
 
static void auto_scale ()
 VIBes only: auto scale the figure.
 
static void clear ()
 Clear the figure.
 
static void draw_point (const Vector &c, const StyleProperties &s=StyleProperties())
 Draws a point on the figure.
 
static void draw_box (const IntervalVector &x, const StyleProperties &s=StyleProperties())
 Draws a box on the figure.
 
static void draw_circle (const Vector &c, double r, const StyleProperties &s=StyleProperties())
 Draws a circle on the figure.
 
static void draw_ring (const Vector &c, const Interval &r, const StyleProperties &s=StyleProperties())
 Draws a ring on the figure.
 
static void draw_line (const Vector &p1, const Vector &p2, const StyleProperties &s=StyleProperties())
 Draws a line on the figure.
 
static void draw_line (const Segment &e, const StyleProperties &s=StyleProperties())
 Draws a line on the figure.
 
static void draw_arrow (const Vector &p1, const Vector &p2, float tip_length, const StyleProperties &s=StyleProperties())
 Draws an arrow on the figure.
 
static void draw_polyline (const std::vector< Vector > &x, const StyleProperties &s=StyleProperties())
 Draws a polyline on the figure.
 
static void draw_polyline (const std::vector< Vector > &x, float tip_length, const StyleProperties &s=StyleProperties())
 Draws a polyline on the figure.
 
static void draw_polygon (const Polygon &x, const StyleProperties &s=StyleProperties())
 Draws a Polygon object on the figure.
 
static void draw_parallelepiped (const Parallelepiped &p, const StyleProperties &s=StyleProperties())
 Draws a parallelepiped z+A*[-1,1]^2 on the figure.
 
static void draw_zonotope (const Zonotope &z, const StyleProperties &s=StyleProperties())
 Draws a zonotope z+sum_i [-1,1] A_i on the figure.
 
static void draw_pie (const Vector &c, const Interval &r, const Interval &theta, const StyleProperties &s=StyleProperties())
 Draws a pie on the figure.
 
static void draw_ellipse (const Vector &c, const Vector &ab, double theta, const StyleProperties &s=StyleProperties())
 Draws an ellipse on the figure.
 
static void draw_ellipsoid (const Ellipsoid &e, const StyleProperties &s=StyleProperties())
 Draws an ellipsoid on the figure.
 
static void draw_trajectory (const SampledTraj< Vector > &x, const StyleProperties &s=StyleProperties())
 Draws a trajectory on the figure.
 
static void draw_trajectory (const AnalyticTraj< VectorType > &x, const StyleProperties &s=StyleProperties())
 Draws a trajectory on the figure.
 
static void draw_trajectory (const SampledTraj< Vector > &x, const ColorMap &cmap)
 Draws a trajectory on the figure with a colormap.
 
static void draw_trajectory (const AnalyticTraj< VectorType > &x, const ColorMap &cmap)
 Draws a trajectory on the figure with a colormap.
 
static void plot_trajectory (const SampledTraj< double > &x, const StyleProperties &s=StyleProperties())
 Plots a trajectory on the figure (x-axis is the time)
 
static void plot_trajectories (const SampledTraj< Vector > &x, const StyleProperties &s=StyleProperties())
 Plots a set of trajectories on the figure (x-axis is the time)
 
static void draw_tube (const SlicedTube< IntervalVector > &x, const StyleProperties &s)
 Draws a tube of IntervalVector on the figure.
 
static void draw_tube (const SlicedTube< IntervalVector > &x, const ColorMap &cmap=ColorMap::blue_tube())
 Draws a tube of IntervalVector on the figure with a colormap.
 
static void draw_tank (const Vector &x, float size, const StyleProperties &s=StyleProperties())
 Draws a tank on the figure.
 
static void draw_AUV (const Vector &x, float size, const StyleProperties &s=StyleProperties())
 Draws an AUV on the figure.
 
static void draw_motor_boat (const Vector &x, float size, const StyleProperties &s=StyleProperties())
 Draws a motor boat on the figure.
 
static void draw_paving (const PavingOut &p, const PavingStyle &style=PavingStyle::default_style())
 Draws a previously computed paving (outer approximation) on the figure.
 
static void draw_paving (const PavingOut &p, const std::function< void(Figure2D &, const IntervalVector &, const StyleProperties &)> &draw_box, const PavingStyle &style=PavingStyle::default_style())
 Draws a previously computed paving (outer approximation) on the figure.
 
static void draw_paving (const PavingInOut &p, const PavingStyle &style=PavingStyle::default_style())
 Draws a previously computed paving (inner/outer approximation) on the figure.
 
static void draw_paving (const PavingInOut &p, const std::function< void(Figure2D &, const IntervalVector &, const StyleProperties &)> &draw_box, const PavingStyle &style=PavingStyle::default_style())
 Draws a previously computed paving (inner/outer approximation) on the figure.
 
template<typename C>
requires IsCtcBaseOrPtr<C,IntervalVector>
static void pave (const IntervalVector &x0, const C &c, double eps, const PavingStyle &style=PavingStyle::default_style())
 Draws a paving from a contractor while it is being computed.
 
template<typename C>
requires IsCtcBaseOrPtr<C,IntervalVector>
static void pave (const IntervalVector &x0, const C &c, double eps, const std::function< void(Figure2D &, const IntervalVector &, const StyleProperties &)> &draw_box, const PavingStyle &style=PavingStyle::default_style())
 Draws a paving from a contractor while it is being computed.
 
template<typename S>
requires IsSepBaseOrPtr<S>
static void pave (const IntervalVector &x0, const S &s, double eps, const PavingStyle &style=PavingStyle::default_style())
 Draws a paving from a separator while it is being computed.
 
template<typename S>
requires IsSepBaseOrPtr<S>
static void pave (const IntervalVector &x0, const S &s, double eps, const std::function< void(Figure2D &, const IntervalVector &, const StyleProperties &)> &draw_box, const PavingStyle &style=PavingStyle::default_style())
 Draws a paving from a separator while it is being computed.
 
template<typename P>
static void draw_subpaving (const Subpaving< P > &p, const StyleProperties &s=StyleProperties())
 Draws a subpaving on the figure.
 

Detailed Description

Default view class, used to manage the default figure.

This class is used to manage the default figure. By default it only interacts with VIBes.

Any figure can be set as the default view.

Member Function Documentation

◆ selected_fig()

static std::shared_ptr< Figure2D > codac2::DefaultFigure::selected_fig ( )
inlinestatic

Getter for the default figure.

Returns
The default figure
569 {
570 if(_selected_fig == nullptr)
571 _selected_fig = _default_fig;
572 return _selected_fig;
573 }

◆ set()

static void codac2::DefaultFigure::set ( std::shared_ptr< Figure2D > fig)
inlinestatic

Setter for the default figure.

Parameters
figThe new default figure
581 {
582 _selected_fig = fig;
583 }

◆ set_axes()

static Figure2D & codac2::DefaultFigure::set_axes ( const FigureAxis & axis1,
const FigureAxis & axis2 )
inlinestatic

Setter for the axes of the figure.

Parameters
axis1First axis (horizontal)
axis2Second axis (vertical)
592 {
593 auto_init();
594 return selected_fig()->set_axes(axis1,axis2);
595 }
static std::shared_ptr< Figure2D > selected_fig()
Getter for the default figure.
Definition codac2_Figure2D.h:568

◆ set_window_properties()

static void codac2::DefaultFigure::set_window_properties ( const Vector & pos,
const Vector & size )
inlinestatic

Setter for the position and size of the window.

Parameters
posPosition of the window
sizeSize of the window
604 {
605 auto_init();
606 selected_fig()->set_window_properties(pos,size);
607 }

◆ draw_point()

static void codac2::DefaultFigure::draw_point ( const Vector & c,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a point on the figure.

Parameters
cCoordinates of the point
sStyle of the point (edge color and fill color)
636 {
637 auto_init();
638 selected_fig()->draw_point(c,s);
639 }

◆ draw_box()

static void codac2::DefaultFigure::draw_box ( const IntervalVector & x,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a box on the figure.

Parameters
xBox to draw
sStyle of the box (edge color and fill color)
648 {
649 auto_init();
650 selected_fig()->draw_box(x,s);
651 }

◆ draw_circle()

static void codac2::DefaultFigure::draw_circle ( const Vector & c,
double r,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a circle on the figure.

Parameters
cCenter of the circle
rRadius of the circle
sStyle of the circle (edge color and fill color)
661 {
662 auto_init();
663 selected_fig()->draw_circle(c,r,s);
664 }

◆ draw_ring()

static void codac2::DefaultFigure::draw_ring ( const Vector & c,
const Interval & r,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a ring on the figure.

Parameters
cCenter of the ring
rInner and outer radius of the ring
sStyle of the ring (edge color and fill color)
674 {
675 auto_init();
676 selected_fig()->draw_ring(c,r,s);
677 }

◆ draw_line() [1/2]

static void codac2::DefaultFigure::draw_line ( const Vector & p1,
const Vector & p2,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a line on the figure.

Parameters
p1First point of the line
p2Second point of the line
sStyle of the line (edge color)
687 {
688 auto_init();
689 selected_fig()->draw_line(p1,p2,s);
690 }

◆ draw_line() [2/2]

static void codac2::DefaultFigure::draw_line ( const Segment & e,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a line on the figure.

Parameters
esegment to be drawn
sStyle of the line (edge color)
699 {
700 auto_init();
701 selected_fig()->draw_line(e,s);
702 }

◆ draw_arrow()

static void codac2::DefaultFigure::draw_arrow ( const Vector & p1,
const Vector & p2,
float tip_length,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws an arrow on the figure.

Parameters
p1First point of the arrow
p2Second point of the arrow
tip_lengthLength of the tip of the arrow
sStyle of the arrow (edge color and fill color)
713 {
714 auto_init();
715 selected_fig()->draw_arrow(p1,p2,tip_length,s);
716 }

◆ draw_polyline() [1/2]

static void codac2::DefaultFigure::draw_polyline ( const std::vector< Vector > & x,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a polyline on the figure.

Parameters
xVector of the points of the polyline
sStyle of the polyline (edge color)
725 {
726 auto_init();
727 selected_fig()->draw_polyline(x,s);
728 }

◆ draw_polyline() [2/2]

static void codac2::DefaultFigure::draw_polyline ( const std::vector< Vector > & x,
float tip_length,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a polyline on the figure.

Parameters
xVector of the points of the polyline
tip_lengthLength of the tip of the arrow
sStyle of the polyline (edge color and fill color)
738 {
739 auto_init();
740 selected_fig()->draw_polyline(x,tip_length,s);
741 }

◆ draw_polygon()

static void codac2::DefaultFigure::draw_polygon ( const Polygon & x,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a Polygon object on the figure.

Parameters
xthe Polygon object to be drawn
sStyle of the polygone (edge color and fill color)
750 {
751 auto_init();
752 selected_fig()->draw_polygon(x,s);
753 }

◆ draw_parallelepiped()

static void codac2::DefaultFigure::draw_parallelepiped ( const Parallelepiped & p,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a parallelepiped z+A*[-1,1]^2 on the figure.

Parameters
pParallelepiped to draw (center and shape matrix)
sStyle of the parallelepiped (edge color and fill color)
762 {
763 auto_init();
764 selected_fig()->draw_parallelepiped(p,s);
765 }

◆ draw_zonotope()

static void codac2::DefaultFigure::draw_zonotope ( const Zonotope & z,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a zonotope z+sum_i [-1,1] A_i on the figure.

Parameters
zZonotope to draw (center and shape matrix)
sStyle of the zonotope (edge color and fill color)
774 {
775 auto_init();
776 selected_fig()->draw_zonotope(z,s);
777 }

◆ draw_pie()

static void codac2::DefaultFigure::draw_pie ( const Vector & c,
const Interval & r,
const Interval & theta,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a pie on the figure.

Parameters
cCenter of the pie
rInner and outer radius of the pie
thetaStart and end angle of the pie (in radians)
sStyle of the pie (edge color and fill color)
788 {
789 auto_init();
790 selected_fig()->draw_pie(c,r,theta,s);
791 }

◆ draw_ellipse()

static void codac2::DefaultFigure::draw_ellipse ( const Vector & c,
const Vector & ab,
double theta,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws an ellipse on the figure.

Parameters
cCenter of the ellipse
abHalf-lengths of the ellipse
thetaRotation angle of the ellipse (in radians)
sStyle of the ellipse (edge color and fill color)
802 {
803 auto_init();
804 selected_fig()->draw_ellipse(c,ab,theta,s);
805 }

◆ draw_ellipsoid()

static void codac2::DefaultFigure::draw_ellipsoid ( const Ellipsoid & e,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws an ellipsoid on the figure.

Parameters
eEllipsoid to draw
sStyle of the ellipsoid (edge color and fill color)
814 {
815 auto_init();
816 selected_fig()->draw_ellipsoid(e,s);
817 }

◆ draw_trajectory() [1/4]

static void codac2::DefaultFigure::draw_trajectory ( const SampledTraj< Vector > & x,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a trajectory on the figure.

Parameters
xTrajectory to draw
sStyle of the trajectory (edge color)
826 {
827 auto_init();
828 selected_fig()->draw_trajectory(x,s);
829 }

◆ draw_trajectory() [2/4]

static void codac2::DefaultFigure::draw_trajectory ( const AnalyticTraj< VectorType > & x,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a trajectory on the figure.

Parameters
xAnalyticTraj to draw
sStyle of the trajectory (edge color)
838 {
839 auto_init();
840 selected_fig()->draw_trajectory(x,s);
841 }

◆ draw_trajectory() [3/4]

static void codac2::DefaultFigure::draw_trajectory ( const SampledTraj< Vector > & x,
const ColorMap & cmap )
inlinestatic

Draws a trajectory on the figure with a colormap.

Parameters
xSampledTraj to draw
cmapColormap to use
850 {
851 auto_init();
852 selected_fig()->draw_trajectory(x,cmap);
853 }

◆ draw_trajectory() [4/4]

static void codac2::DefaultFigure::draw_trajectory ( const AnalyticTraj< VectorType > & x,
const ColorMap & cmap )
inlinestatic

Draws a trajectory on the figure with a colormap.

Parameters
xAnalyticTraj to draw
cmapColormap to use
862 {
863 auto_init();
864 selected_fig()->draw_trajectory(x,cmap);
865 }

◆ plot_trajectory()

static void codac2::DefaultFigure::plot_trajectory ( const SampledTraj< double > & x,
const StyleProperties & s = StyleProperties() )
inlinestatic

Plots a trajectory on the figure (x-axis is the time)

Parameters
xSampledTraj to plot
sStyle of the trajectory (edge color)
874 {
875 auto_init();
876 selected_fig()->plot_trajectory(x,s);
877 }

◆ plot_trajectories()

static void codac2::DefaultFigure::plot_trajectories ( const SampledTraj< Vector > & x,
const StyleProperties & s = StyleProperties() )
inlinestatic

Plots a set of trajectories on the figure (x-axis is the time)

Parameters
xSampledTraj<Vector> set of trajectories to plot
sStyle of the trajectory (edge color)
886 {
887 auto_init();
888 selected_fig()->plot_trajectories(x,s);
889 }

◆ draw_tube() [1/2]

static void codac2::DefaultFigure::draw_tube ( const SlicedTube< IntervalVector > & x,
const StyleProperties & s )
inlinestatic

Draws a tube of IntervalVector on the figure.

Parameters
xSlicedTube to draw
sStyle of the tube
898 {
899 auto_init();
900 selected_fig()->draw_tube(x,s);
901 }

◆ draw_tube() [2/2]

static void codac2::DefaultFigure::draw_tube ( const SlicedTube< IntervalVector > & x,
const ColorMap & cmap = ColorMap::blue_tube() )
inlinestatic

Draws a tube of IntervalVector on the figure with a colormap.

Parameters
xSlicedTube to draw
cmapColormap to use
910 {
911 auto_init();
912 selected_fig()->draw_tube(x,cmap);
913 }

◆ draw_tank()

static void codac2::DefaultFigure::draw_tank ( const Vector & x,
float size,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a tank on the figure.

Parameters
xCoordinates of the tank
sizeSize of the tank
sStyle of the tank (edge color and fill color)
925 {
926 auto_init();
927 selected_fig()->draw_tank(x,size,s);
928 }

◆ draw_AUV()

static void codac2::DefaultFigure::draw_AUV ( const Vector & x,
float size,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws an AUV on the figure.

Parameters
xCoordinates of the AUV
sizeSize of the AUV
sStyle of the AUV (edge color and fill color)
938 {
939 auto_init();
940 selected_fig()->draw_AUV(x,size,s);
941 }

◆ draw_motor_boat()

static void codac2::DefaultFigure::draw_motor_boat ( const Vector & x,
float size,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a motor boat on the figure.

Parameters
xCoordinates of the motor boat
sizeSize of the motor boat
sStyle of the motor boat (edge color and fill color)
951 {
952 auto_init();
953 selected_fig()->draw_motor_boat(x,size,s);
954 }

◆ draw_paving() [1/4]

static void codac2::DefaultFigure::draw_paving ( const PavingOut & p,
const PavingStyle & style = PavingStyle::default_style() )
inlinestatic

Draws a previously computed paving (outer approximation) on the figure.

Parameters
pPavingOut to draw (result of a paving with contractors)
stylePavingStyle for the drawing
977 {
978 if(auto_init())
979 init_axes_paving(p.tree()->hull());
980 selected_fig()->draw_paving(p, style);
981 }

◆ draw_paving() [2/4]

static void codac2::DefaultFigure::draw_paving ( const PavingOut & p,
const std::function< void(Figure2D &, const IntervalVector &, const StyleProperties &)> & draw_box,
const PavingStyle & style = PavingStyle::default_style() )
inlinestatic

Draws a previously computed paving (outer approximation) on the figure.

Parameters
pPavingOut to draw (result of a paving with contractors)
draw_boxCustom drawing function (for instance, if one wants to draw in polar coordinates)
stylePavingStyle for the drawing
993 {
994 if(auto_init())
995 init_axes_paving(p.tree()->hull());
996 selected_fig()->draw_paving(p, draw_box, style);
997 }
static void draw_box(const IntervalVector &x, const StyleProperties &s=StyleProperties())
Draws a box on the figure.
Definition codac2_Figure2D.h:647

◆ draw_paving() [3/4]

static void codac2::DefaultFigure::draw_paving ( const PavingInOut & p,
const PavingStyle & style = PavingStyle::default_style() )
inlinestatic

Draws a previously computed paving (inner/outer approximation) on the figure.

Parameters
pPavingInOut to draw (result of a paving with separators)
stylePavingStyle for the drawing
1007 {
1008 if(auto_init())
1009 init_axes_paving(p.tree()->hull());
1010 selected_fig()->draw_paving(p, style);
1011 }

◆ draw_paving() [4/4]

static void codac2::DefaultFigure::draw_paving ( const PavingInOut & p,
const std::function< void(Figure2D &, const IntervalVector &, const StyleProperties &)> & draw_box,
const PavingStyle & style = PavingStyle::default_style() )
inlinestatic

Draws a previously computed paving (inner/outer approximation) on the figure.

Parameters
pPavingInOut to draw (result of a paving with separators)
draw_boxCustom drawing function (for instance, if one wants to draw in polar coordinates)
stylePavingStyle for the drawing
1023 {
1024 if(auto_init())
1025 init_axes_paving(p.tree()->hull());
1026 selected_fig()->draw_paving(p, draw_box, style);
1027 }

◆ pave() [1/4]

template<typename C>
requires IsCtcBaseOrPtr<C,IntervalVector>
static void codac2::DefaultFigure::pave ( const IntervalVector & x0,
const C & c,
double eps,
const PavingStyle & style = PavingStyle::default_style() )
inlinestatic

Draws a paving from a contractor while it is being computed.

Parameters
x0Initial box
cContractor to be paved
epsAccuracy of the paving algorithm (the undefined boxes will have their max_diam <= eps)
stylePavingStyle for the drawing
1041 {
1042 if(auto_init())
1043 init_axes_paving(x0);
1044 selected_fig()->pave(x0, c, eps, style);
1045 }

◆ pave() [2/4]

template<typename C>
requires IsCtcBaseOrPtr<C,IntervalVector>
static void codac2::DefaultFigure::pave ( const IntervalVector & x0,
const C & c,
double eps,
const std::function< void(Figure2D &, const IntervalVector &, const StyleProperties &)> & draw_box,
const PavingStyle & style = PavingStyle::default_style() )
inlinestatic

Draws a paving from a contractor while it is being computed.

Parameters
x0Initial box
cContractor to be paved
epsAccuracy of the paving algorithm (the undefined boxes will have their max_diam <= eps)
draw_boxOptional custom drawing function (for instance, if one wants to draw in polar coordinates)
stylePavingStyle for the drawing
1061 {
1062 if(auto_init())
1063 init_axes_paving(x0);
1064 selected_fig()->pave(x0, c, eps, draw_box, style);
1065 }

◆ pave() [3/4]

template<typename S>
requires IsSepBaseOrPtr<S>
static void codac2::DefaultFigure::pave ( const IntervalVector & x0,
const S & s,
double eps,
const PavingStyle & style = PavingStyle::default_style() )
inlinestatic

Draws a paving from a separator while it is being computed.

Parameters
x0Initial box
sSeparator to be paved
epsAccuracy of the paving algorithm (the undefined boxes will have their max_diam <= eps)
stylePavingStyle for the drawing
1079 {
1080 if(auto_init())
1081 init_axes_paving(x0);
1082 selected_fig()->pave(x0, s, eps, style);
1083 }

◆ pave() [4/4]

template<typename S>
requires IsSepBaseOrPtr<S>
static void codac2::DefaultFigure::pave ( const IntervalVector & x0,
const S & s,
double eps,
const std::function< void(Figure2D &, const IntervalVector &, const StyleProperties &)> & draw_box,
const PavingStyle & style = PavingStyle::default_style() )
inlinestatic

Draws a paving from a separator while it is being computed.

Parameters
x0Initial box
sSeparator to be paved
epsAccuracy of the paving algorithm (the undefined boxes will have their max_diam <= eps)
draw_boxOptional custom drawing function (for instance, if one wants to draw in polar coordinates)
stylePavingStyle for the drawing
1099 {
1100 if(auto_init())
1101 init_axes_paving(x0);
1102 selected_fig()->pave(x0, s, eps, draw_box, style);
1103 }

◆ draw_subpaving()

template<typename P>
static void codac2::DefaultFigure::draw_subpaving ( const Subpaving< P > & p,
const StyleProperties & s = StyleProperties() )
inlinestatic

Draws a subpaving on the figure.

Parameters
pSubpaving to draw
sStyle of the subpaving
1113 {
1114 auto_init();
1115 selected_fig()->draw_subpaving(p, s);
1116 }

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