|
codac 2.0.0
|
Figure3D class, used for 3D figures. More...
#include <codac2_Figure3D.h>
Public Member Functions | |
| Figure3D (const std::string &name) | |
| Creates a new Figure3D object, with a given name. | |
| ~Figure3D () | |
| Destructor for the Figure3D class. | |
| const std::string & | name () const |
| Getter for the name of the figure. | |
| void | draw_triangle (const Vector &c, const Matrix &A, const Vector &p1, const Vector &p2, const Vector &p3, const StyleProperties &style={ Color::dark_gray(0.5) }) |
| Draws a triangle. | |
| void | draw_triangle (const Vector &p1, const Vector &p2, const Vector &p3, const StyleProperties &style={ Color::dark_gray(0.5) }) |
| Draws a triangle, shorter version. | |
| void | draw_polygon (const Vector &c, const Matrix &A, const std::vector< Vector > &l, const StyleProperties &style={ Color::dark_gray(0.5) }) |
| Draws a `‘star-shaped’' polygon as a sequence of adjacent triangles (l[0],l[k],l[k+1]) with k>=1. | |
| void | draw_parallelogram (const Vector &c, const Matrix &A, const Vector &p, const Vector &v1, const Vector &v2, const StyleProperties &style={ Color::dark_gray(0.5) }) |
| Draws a parallelogram c + A (p + [-1,1]*v1 + [-1,1]*v2) | |
| void | draw_parallelepiped (const Parallelepiped &p, const StyleProperties &style={ Color::dark_gray(0.5) }) |
| Draws a parallelepiped z+A*[-1,1]^3 on the figure. | |
| void | draw_zonotope (const Zonotope &z, const StyleProperties &style={ Color::dark_gray(0.5) }) |
| Draws a zonotope z+sum_i [-1,1] A_i on the figure. | |
| void | draw_box (const IntervalVector &x, const StyleProperties &style={ Color::dark_gray(0.5) }) |
| Draws a box on the figure. | |
| void | draw_arrow (const Vector &c, const Matrix &A, const StyleProperties &style={ Color::dark_gray(0.5) }) |
| Draws an arrow (box c + A * ([0,1],[-0.01,0.01],[-0.01,0.01]) and a tip at the end) | |
| void | draw_axes (double size=1.0) |
| Draws the (x,y,z) axes on the figure in red, green and blue. | |
| void | draw_surface (const Vector &c, const Matrix &A, const Interval &Ip1, double dp1, const Interval &Ip2, double dp2, std::function< Vector(double, double)> f, const StyleProperties &style={ Color::dark_gray(0.5) }) |
| Draws a parametric surface. | |
| void | draw_sphere (const Vector &c, const Matrix &A, const StyleProperties &style={ Color::dark_gray(0.5) }) |
| Draws a sphere (ellipsoid) | |
| void | draw_ellipsoid (const Ellipsoid &e, const StyleProperties &style={ Color::dark_gray(0.5) }) |
| Draws an ellipsoid (from the Ellipsoid class) | |
| void | draw_car (const Vector &c, const Matrix &A, const StyleProperties &style={ Color::yellow(0.5) }) |
| Draws a car, with blue windscreen. | |
| void | draw_plane (const Vector &c, const Matrix &A, bool yaw_is_up=true, const StyleProperties &style={ Color::dark_gray(0.8) }) |
| Draws a (paper) plane. | |
| void | draw_paving (const PavingOut &p, const StyleProperties &bound_style={ Color::yellow(0.5) }) |
| Draws a paving on the figure (Only the boundary is drawn). | |
| void | draw_paving (const PavingInOut &p, const StyleProperties &bound_style={ Color::yellow(0.3), "paving_bound" }, const StyleProperties &in_style={ Color::green(0.5), "paving_in" }) |
| Draws a paving on the figure (Only the boundary and the inside is drawn). | |
| template<typename P> | |
| void | draw_subpaving (const Subpaving< P > &p, const StyleProperties &style=StyleProperties()) |
| Draws a subpaving on the figure. | |
Figure3D class, used for 3D figures.
This class is used to display 3D figures. It generates an OBJ file that can be opened with a 3D viewer.
| codac2::Figure3D::Figure3D | ( | const std::string & | name | ) |
Creates a new Figure3D object, with a given name.
| name | Name of the figure |
| const std::string & codac2::Figure3D::name | ( | ) | const |
Getter for the name of the figure.
| void codac2::Figure3D::draw_triangle | ( | const Vector & | c, |
| const Matrix & | A, | ||
| const Vector & | p1, | ||
| const Vector & | p2, | ||
| const Vector & | p3, | ||
| const StyleProperties & | style = { Color::dark_gray(0.5) } ) |
Draws a triangle.
| c | translation |
| A | scaling |
| p1 | first point |
| p2 | second point |
| p3 | third point |
| style | style |
| void codac2::Figure3D::draw_triangle | ( | const Vector & | p1, |
| const Vector & | p2, | ||
| const Vector & | p3, | ||
| const StyleProperties & | style = { Color::dark_gray(0.5) } ) |
Draws a triangle, shorter version.
| p1 | first point |
| p2 | second point |
| p3 | third point |
| style | style |
| void codac2::Figure3D::draw_polygon | ( | const Vector & | c, |
| const Matrix & | A, | ||
| const std::vector< Vector > & | l, | ||
| const StyleProperties & | style = { Color::dark_gray(0.5) } ) |
Draws a `‘star-shaped’' polygon as a sequence of adjacent triangles (l[0],l[k],l[k+1]) with k>=1.
| c | translation |
| A | scaling |
| l | points |
| style | style |
| void codac2::Figure3D::draw_parallelogram | ( | const Vector & | c, |
| const Matrix & | A, | ||
| const Vector & | p, | ||
| const Vector & | v1, | ||
| const Vector & | v2, | ||
| const StyleProperties & | style = { Color::dark_gray(0.5) } ) |
Draws a parallelogram c + A (p + [-1,1]*v1 + [-1,1]*v2)
| c | translation |
| A | scaling |
| p | base point |
| v1 | vector |
| v2 | vector |
| style | style |
| void codac2::Figure3D::draw_parallelepiped | ( | const Parallelepiped & | p, |
| const StyleProperties & | style = { Color::dark_gray(0.5) } ) |
Draws a parallelepiped z+A*[-1,1]^3 on the figure.
| p | Parallelepiped to draw (center and shape matrix) |
| style | Style of the parallelepiped (edge color) |
| void codac2::Figure3D::draw_zonotope | ( | const Zonotope & | z, |
| const StyleProperties & | style = { Color::dark_gray(0.5) } ) |
Draws a zonotope z+sum_i [-1,1] A_i on the figure.
| z | Zonotope to draw (center and shape matrix) |
| style | Style of the zonotope (edge color) |
| void codac2::Figure3D::draw_box | ( | const IntervalVector & | x, |
| const StyleProperties & | style = { Color::dark_gray(0.5) } ) |
Draws a box on the figure.
| x | Box to draw |
| style | Style of the box (edge color) |
| void codac2::Figure3D::draw_arrow | ( | const Vector & | c, |
| const Matrix & | A, | ||
| const StyleProperties & | style = { Color::dark_gray(0.5) } ) |
Draws an arrow (box c + A * ([0,1],[-0.01,0.01],[-0.01,0.01]) and a tip at the end)
| c | start |
| A | orientation (first column) |
| style | Style (color) |
| void codac2::Figure3D::draw_axes | ( | double | size = 1.0 | ) |
Draws the (x,y,z) axes on the figure in red, green and blue.
| size | Size of the axes |
| void codac2::Figure3D::draw_surface | ( | const Vector & | c, |
| const Matrix & | A, | ||
| const Interval & | Ip1, | ||
| double | dp1, | ||
| const Interval & | Ip2, | ||
| double | dp2, | ||
| std::function< Vector(double, double)> | f, | ||
| const StyleProperties & | style = { Color::dark_gray(0.5) } ) |
Draws a parametric surface.
| c | translation |
| A | scaling |
| Ip1 | bounds of p1 |
| dp1 | incrementation for p1 |
| Ip2 | bounds of p2 |
| dp2 | incrementation for p2 |
| f | function computing the values |
| style | Style (color) |
| void codac2::Figure3D::draw_sphere | ( | const Vector & | c, |
| const Matrix & | A, | ||
| const StyleProperties & | style = { Color::dark_gray(0.5) } ) |
Draws a sphere (ellipsoid)
| c | translation |
| A | scaling |
| style | Style (color) |
| void codac2::Figure3D::draw_ellipsoid | ( | const Ellipsoid & | e, |
| const StyleProperties & | style = { Color::dark_gray(0.5) } ) |
| void codac2::Figure3D::draw_car | ( | const Vector & | c, |
| const Matrix & | A, | ||
| const StyleProperties & | style = { Color::yellow(0.5) } ) |
Draws a car, with blue windscreen.
| c | `‘center’' (low) of the car |
| A | orientation |
| style | Style (color) |
| void codac2::Figure3D::draw_plane | ( | const Vector & | c, |
| const Matrix & | A, | ||
| bool | yaw_is_up = true, | ||
| const StyleProperties & | style = { Color::dark_gray(0.8) } ) |
Draws a (paper) plane.
| c | `‘center’' (low) of the car |
| A | orientation |
| yaw_is_up | yaw axis is up (default true) |
| style | Style (color) |
| void codac2::Figure3D::draw_paving | ( | const PavingOut & | p, |
| const StyleProperties & | bound_style = { Color::yellow(0.5) } ) |
Draws a paving on the figure (Only the boundary is drawn).
| p | PavingOut to draw (result of a paving with contractors). |
| bound_style | Style of the boundary of the paving |
| void codac2::Figure3D::draw_paving | ( | const PavingInOut & | p, |
| const StyleProperties & | bound_style = { Color::yellow(0.3), "paving_bound" }, | ||
| const StyleProperties & | in_style = { Color::green(0.5), "paving_in" } ) |
Draws a paving on the figure (Only the boundary and the inside is drawn).
| p | PavingInOut to draw (result of a paving with separators). |
| bound_style | Style of the boundary of the paving |
| in_style | Style of the inside of the paving |
|
inline |
Draws a subpaving on the figure.
| p | Subpaving to draw |
| style | Style of the subpaving |