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 draw_point (const Vector &c, const StyleProperties &style=StyleProperties())
 Draws a point on the figure.
 
static void draw_box (const IntervalVector &x, const StyleProperties &style=StyleProperties())
 Draws a box on the figure.
 
static void draw_circle (const Vector &c, double r, const StyleProperties &style=StyleProperties())
 Draws a circle on the figure.
 
static void draw_ring (const Vector &c, const Interval &r, const StyleProperties &style=StyleProperties())
 Draws a ring on the figure.
 
static void draw_line (const Vector &p1, const Vector &p2, const StyleProperties &style=StyleProperties())
 Draws a line on the figure.
 
static void draw_line (const Segment &e, const StyleProperties &style=StyleProperties())
 Draws a line on the figure.
 
static void draw_arrow (const Vector &p1, const Vector &p2, float tip_length, const StyleProperties &style=StyleProperties())
 Draws an arrow on the figure.
 
static void draw_polyline (const std::vector< Vector > &x, const StyleProperties &style=StyleProperties())
 Draws a polyline on the figure.
 
static void draw_polyline (const std::vector< Vector > &x, float tip_length, const StyleProperties &style=StyleProperties())
 Draws a polyline on the figure.
 
static void draw_polygon (const Polygon &x, const StyleProperties &style=StyleProperties())
 Draws a Polygon object on the figure.
 
static void draw_parallelepiped (const Vector &z, const Matrix &A, const StyleProperties &style=StyleProperties())
 Draws a parallelepiped z+A*[-1,1]^2 on the figure.
 
static void draw_zonotope (const Vector &z, const std::vector< Vector > &A, const StyleProperties &style=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 &style=StyleProperties())
 Draws a pie on the figure.
 
static void draw_ellipse (const Vector &c, const Vector &ab, double theta, const StyleProperties &style=StyleProperties())
 Draws an ellipse on the figure.
 
static void draw_ellipsoid (const Ellipsoid &e, const StyleProperties &style=StyleProperties())
 Draws an ellipsoid on the figure.
 
static void draw_trajectory (const SampledTraj< Vector > &x, const StyleProperties &style=StyleProperties())
 Draws a trajectory on the figure.
 
static void draw_trajectory (const AnalyticTraj< VectorType > &x, const StyleProperties &style=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 &style=StyleProperties())
 Plots a trajectory on the figure (x-axis is the time)
 
static void plot_trajectories (const SampledTraj< Vector > &x, const StyleProperties &style=StyleProperties())
 Plots a set of trajectories on the figure (x-axis is the time)
 
static void draw_tube (const SlicedTube< IntervalVector > &x, const StyleProperties &style=StyleProperties())
 Draws a tube of IntervalVector on the figure.
 
static void draw_tube (const SlicedTube< IntervalVector > &x, const ColorMap &cmap)
 Draws a tube of IntervalVector on the figure with a colormap.
 
static void draw_tank (const Vector &x, float size, const StyleProperties &style=StyleProperties())
 Draws a tank on the figure.
 
static void draw_AUV (const Vector &x, float size, const StyleProperties &style=StyleProperties())
 Draws an AUV on the figure.
 
static void draw_motor_boat (const Vector &x, float size, const StyleProperties &style=StyleProperties())
 Draws a motor boat on the figure.
 
static void draw_paving (const PavingOut &p, const StyleProperties &boundary_style=StyleProperties::boundary(), const StyleProperties &outside_style=StyleProperties::outside())
 Draws a paving on the figure.
 
static void draw_paving (const PavingInOut &p, const StyleProperties &boundary_style=StyleProperties::boundary(), const StyleProperties &outside_style=StyleProperties::outside(), const StyleProperties &inside_style=StyleProperties::inside())
 Draws a paving on the figure.
 
template<typename P>
static void draw_subpaving (const Subpaving< P > &p, const StyleProperties &style=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
489 {
490 if(_selected_fig == nullptr)
491 _selected_fig = _default_fig;
492 return _selected_fig;
493 }

◆ set()

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

Setter for the default figure.

Parameters
figThe new default figure
501 {
502 _selected_fig = fig;
503 }

◆ 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)
512 {
513 auto_init();
514 return selected_fig()->set_axes(axis1,axis2);
515 }
static std::shared_ptr< Figure2D > selected_fig()
Getter for the default figure.
Definition codac2_Figure2D.h:488

◆ 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
524 {
525 auto_init();
526 selected_fig()->set_window_properties(pos,size);
527 }

◆ draw_point()

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

Draws a point on the figure.

Parameters
cCoordinates of the point
styleStyle of the point (edge color and fill color)
547 {
548 auto_init();
549 selected_fig()->draw_point(c,style);
550 }

◆ draw_box()

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

Draws a box on the figure.

Parameters
xBox to draw
styleStyle of the box (edge color and fill color)
559 {
560 auto_init();
561 selected_fig()->draw_box(x,style);
562 }

◆ draw_circle()

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

Draws a circle on the figure.

Parameters
cCenter of the circle
rRadius of the circle
styleStyle of the circle (edge color and fill color)
572 {
573 auto_init();
574 selected_fig()->draw_circle(c,r,style);
575 }

◆ draw_ring()

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

Draws a ring on the figure.

Parameters
cCenter of the ring
rInner and outer radius of the ring
styleStyle of the ring (edge color and fill color)
585 {
586 auto_init();
587 selected_fig()->draw_ring(c,r,style);
588 }

◆ draw_line() [1/2]

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

Draws a line on the figure.

Parameters
p1First point of the line
p2Second point of the line
styleStyle of the line (edge color)
598 {
599 auto_init();
600 selected_fig()->draw_line(p1,p2,style);
601 }

◆ draw_line() [2/2]

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

Draws a line on the figure.

Parameters
esegment to be drawn
styleStyle of the line (edge color)
610 {
611 auto_init();
612 selected_fig()->draw_line(e,style);
613 }

◆ draw_arrow()

static void codac2::DefaultFigure::draw_arrow ( const Vector & p1,
const Vector & p2,
float tip_length,
const StyleProperties & style = 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
styleStyle of the arrow (edge color and fill color)
624 {
625 auto_init();
626 selected_fig()->draw_arrow(p1,p2,tip_length,style);
627 }

◆ draw_polyline() [1/2]

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

Draws a polyline on the figure.

Parameters
xVector of the points of the polyline
styleStyle of the polyline (edge color)
636 {
637 auto_init();
638 selected_fig()->draw_polyline(x,style);
639 }

◆ draw_polyline() [2/2]

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

Draws a polyline on the figure.

Parameters
xVector of the points of the polyline
tip_lengthLength of the tip of the arrow
styleStyle of the polyline (edge color and fill color)
649 {
650 auto_init();
651 selected_fig()->draw_polyline(x,tip_length,style);
652 }

◆ draw_polygon()

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

Draws a Polygon object on the figure.

Parameters
xthe Polygon object to be drawn
styleStyle of the polygone (edge color and fill color)
661 {
662 auto_init();
663 selected_fig()->draw_polygon(x,style);
664 }

◆ draw_parallelepiped()

static void codac2::DefaultFigure::draw_parallelepiped ( const Vector & z,
const Matrix & A,
const StyleProperties & style = StyleProperties() )
inlinestatic

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

Parameters
zCoordinates of the center of the parallelepiped
AMatrix of the parallelepiped
styleStyle of the parallelepiped (edge color and fill color)
674 {
675 auto_init();
676 selected_fig()->draw_parallelepiped(z,A,style);
677 }

◆ draw_zonotope()

static void codac2::DefaultFigure::draw_zonotope ( const Vector & z,
const std::vector< Vector > & A,
const StyleProperties & style = StyleProperties() )
inlinestatic

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

Parameters
zCoordinates of the center of the zonotope
Alist of vectors
styleStyle of the zonotope (edge color and fill color)
687 {
688 auto_init();
689 selected_fig()->draw_zonotope(z,A,style);
690 }

◆ draw_pie()

static void codac2::DefaultFigure::draw_pie ( const Vector & c,
const Interval & r,
const Interval & theta,
const StyleProperties & style = 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)
styleStyle of the pie (edge color and fill color)
701 {
702 auto_init();
703 selected_fig()->draw_pie(c,r,theta,style);
704 }

◆ draw_ellipse()

static void codac2::DefaultFigure::draw_ellipse ( const Vector & c,
const Vector & ab,
double theta,
const StyleProperties & style = 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)
styleStyle of the ellipse (edge color and fill color)
715 {
716 auto_init();
717 selected_fig()->draw_ellipse(c,ab,theta,style);
718 }

◆ draw_ellipsoid()

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

Draws an ellipsoid on the figure.

Parameters
eEllipsoid to draw
styleStyle of the ellipsoid (edge color and fill color)
727 {
728 auto_init();
729 selected_fig()->draw_ellipsoid(e,style);
730 }

◆ draw_trajectory() [1/4]

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

Draws a trajectory on the figure.

Parameters
xTrajectory to draw
styleStyle of the trajectory (edge color)
739 {
740 auto_init();
741 selected_fig()->draw_trajectory(x,style);
742 }

◆ draw_trajectory() [2/4]

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

Draws a trajectory on the figure.

Parameters
xAnalyticTraj to draw
styleStyle of the trajectory (edge color)
751 {
752 auto_init();
753 selected_fig()->draw_trajectory(x,style);
754 }

◆ 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
763 {
764 auto_init();
765 selected_fig()->draw_trajectory(x,cmap);
766 }

◆ 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
775 {
776 auto_init();
777 selected_fig()->draw_trajectory(x,cmap);
778 }

◆ plot_trajectory()

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

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

Parameters
xSampledTraj to plot
styleStyle of the trajectory (edge color)
787 {
788 auto_init();
789 selected_fig()->plot_trajectory(x,style);
790 }

◆ plot_trajectories()

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

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

Parameters
xSampledTraj<Vector> set of trajectories to plot
styleStyle of the trajectory (edge color)
799 {
800 auto_init();
801 selected_fig()->plot_trajectories(x,style);
802 }

◆ draw_tube() [1/2]

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

Draws a tube of IntervalVector on the figure.

Parameters
xSlicedTube to draw
styleStyle of the tube
811 {
812 auto_init();
813 selected_fig()->draw_tube(x,style);
814 }

◆ draw_tube() [2/2]

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

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

Parameters
xSlicedTube to draw
cmapColormap to use
823 {
824 auto_init();
825 selected_fig()->draw_tube(x,cmap);
826 }

◆ draw_tank()

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

Draws a tank on the figure.

Parameters
xCoordinates of the tank
sizeSize of the tank
styleStyle of the tank (edge color and fill color)
838 {
839 auto_init();
840 selected_fig()->draw_tank(x,size,style);
841 }

◆ draw_AUV()

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

Draws an AUV on the figure.

Parameters
xCoordinates of the AUV
sizeSize of the AUV
styleStyle of the AUV (edge color and fill color)
851 {
852 auto_init();
853 selected_fig()->draw_AUV(x,size,style);
854 }

◆ draw_motor_boat()

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

Draws a motor boat on the figure.

Parameters
xCoordinates of the motor boat
sizeSize of the motor boat
styleStyle of the motor boat (edge color and fill color)
864 {
865 auto_init();
866 selected_fig()->draw_motor_boat(x,size,style);
867 }

◆ draw_paving() [1/2]

static void codac2::DefaultFigure::draw_paving ( const PavingOut & p,
const StyleProperties & boundary_style = StyleProperties::boundary(),
const StyleProperties & outside_style = StyleProperties::outside() )
inlinestatic

Draws a paving on the figure.

Parameters
pPavingOut to draw (result of a paving with contractors)
boundary_styleStyle of the boundary of the paving
outside_styleStyle of the outside of the paving
881 {
882 if(auto_init())
883 {
884 double rx = p.tree()->hull()[0].diam(), ry = p.tree()->hull()[1].diam();
885 _default_fig->set_window_properties({20.,20.},
886 rx > ry ? Vector({800.,800.*ry/rx}) : Vector({800.*rx/ry,800.}));
887 _default_fig->set_axes(axis(0,p.tree()->hull()[0]),axis(1,p.tree()->hull()[1]));
888 }
889
890 selected_fig()->draw_paving(p, boundary_style, outside_style);
891 }

◆ draw_paving() [2/2]

static void codac2::DefaultFigure::draw_paving ( const PavingInOut & p,
const StyleProperties & boundary_style = StyleProperties::boundary(),
const StyleProperties & outside_style = StyleProperties::outside(),
const StyleProperties & inside_style = StyleProperties::inside() )
inlinestatic

Draws a paving on the figure.

Parameters
pPavingInOut to draw (result of a paving with separators)
boundary_styleStyle of the boundary of the paving
outside_styleStyle of the outside of the paving
inside_styleStyle of the inside of the paving
905 {
906 if(auto_init())
907 {
908 double rx = p.tree()->hull()[0].diam(), ry = p.tree()->hull()[1].diam();
909 _default_fig->set_window_properties({20.,20.},
910 rx > ry ? Vector({800.,800.*ry/rx}) : Vector({800.*rx/ry,800.}));
911 _default_fig->set_axes(axis(0,p.tree()->hull()[0]),axis(1,p.tree()->hull()[1]));
912 }
913
914 selected_fig()->draw_paving(p, boundary_style, outside_style, inside_style);
915 }

◆ draw_subpaving()

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

Draws a subpaving on the figure.

Parameters
pSubpaving to draw
styleStyle of the subpaving
925 {
926 auto_init();
927 selected_fig()->draw_subpaving(p, style);
928 }

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