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

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_axes (double size=1.0)
 Draws the (x,y,z) axes on the figure in red, green and blue.
 
void draw_box (const IntervalVector &x, const StyleProperties &s={ Color::dark_gray(0.5) })
 Draws a box on the figure.
 
void draw_parallelepiped (const Vector &z, const Matrix &A, const StyleProperties &s={ Color::dark_gray(0.5) })
 Draws a parallelepiped z+A*[-1,1]^3 on the figure.
 
void draw_paving (const PavingOut &p, const StyleProperties &bound_s={ Color::yellow(0.5) })
 Draws a paving on the figure (Only the boundary is drawn).
 
void draw_paving (const PavingInOut &p, const StyleProperties &bound_s={ Color::yellow(0.3) }, const StyleProperties &in_s={ Color::green(0.5) })
 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 &s=StyleProperties())
 Draws a subpaving on the figure.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Figure3D()

codac2::Figure3D::Figure3D ( const std::string & name)

Creates a new Figure3D object, with a given name.

Parameters
nameName of the figure

Member Function Documentation

◆ name()

const std::string & codac2::Figure3D::name ( ) const

Getter for the name of the figure.

Returns
The name of the figure

◆ draw_axes()

void codac2::Figure3D::draw_axes ( double size = 1.0)

Draws the (x,y,z) axes on the figure in red, green and blue.

Parameters
sizeSize of the axes

◆ draw_box()

void codac2::Figure3D::draw_box ( const IntervalVector & x,
const StyleProperties & s = Color::dark_gray(0.5) } )

Draws a box on the figure.

Parameters
xBox to draw
sStyle of the box (edge color)

◆ draw_parallelepiped()

void codac2::Figure3D::draw_parallelepiped ( const Vector & z,
const Matrix & A,
const StyleProperties & s = Color::dark_gray(0.5) } )

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

Parameters
zCoordinates of the center of the parallelepiped
AMatrix of the parallelepiped
sStyle of the parallelepiped (edge color)

◆ draw_paving() [1/2]

void codac2::Figure3D::draw_paving ( const PavingOut & p,
const StyleProperties & bound_s = Color::yellow(0.5) } )

Draws a paving on the figure (Only the boundary is drawn).

Parameters
pPavingOut to draw (result of a paving with contractors).
bound_sStyle of the boundary of the paving

◆ draw_paving() [2/2]

void codac2::Figure3D::draw_paving ( const PavingInOut & p,
const StyleProperties & bound_s = Color::yellow(0.3) },
const StyleProperties & in_s = Color::green(0.5) } )

Draws a paving on the figure (Only the boundary and the inside is drawn).

Parameters
pPavingInOut to draw (result of a paving with separators).
bound_sStyle of the boundary of the paving
in_sStyle of the inside of the paving

◆ draw_subpaving()

template<typename P>
void codac2::Figure3D::draw_subpaving ( const Subpaving< P > & p,
const StyleProperties & s = StyleProperties() )
inline

Draws a subpaving on the figure.

Parameters
pSubpaving to draw
sStyle of the subpaving
111 {
112 for(const auto& pi : p.boxes())
113 draw_box(pi, s);
114 }
void draw_box(const IntervalVector &x, const StyleProperties &s={ Color::dark_gray(0.5) })
Draws a box on the figure.

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