Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions doc/manual/manual/visualization/figures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,6 @@ Any Figure2D object can be used as DefaultFigure with the set method:

Note that in C++ the figure must be a shared pointer in order to be passed to the `set` method.

Equivalently, a Figure2D can be used as DefaultFigure by setting the flag `set_as_default` to true in the constructor:

.. tabs::

.. code-tab:: py

fig = Figure2D("My figure", GraphicOutput.VIBES | GraphicOutput.IPE, True)

.. code-tab:: c++

Figure2D fig ("My Figure",GraphicOutput::VIBES|GraphicOutput::IPE,true);


.. _subsec-graphics-2d-figures-figure-properties:

Expand Down
10 changes: 5 additions & 5 deletions doc/manual/tuto/cp_robotics/src/lesson_C.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@
[mi,xi,si] = deal(res_ctc_minus.subvector(1,2),res_ctc_minus.subvector(3,6),res_ctc_minus.subvector(7,8));

res_ctc_plus = ctc_plus.contract(py.codac4matlab.cart_prod(xi(3), yi(3), ai)); % The result is a 3D IntervalVector
xi.setitem(3,res_ctc_plus(1));
yi.setitem(3,res_ctc_plus(2));
xi.set_item(3,res_ctc_plus(1));
yi.set_item(3,res_ctc_plus(2));
ai = res_ctc_plus(3);

res_ctc_polar = ctc_polar.contract(py.codac4matlab.cart_prod(si(1),si(2),yi(2),ai)); % The result is a 4D IntervalVector
si.setitem(1,res_ctc_polar(1));
si.setitem(2,res_ctc_polar(2));
yi.setitem(2,res_ctc_polar(3));
si.set_item(1,res_ctc_polar(1));
si.set_item(2,res_ctc_polar(2));
yi.set_item(2,res_ctc_polar(3));
ai = res_ctc_polar(4);

mi = ctc_constell.contract(mi);
Expand Down
6 changes: 3 additions & 3 deletions python/src/graphics/figures/codac2_py_Figure2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ void export_Figure2D(py::module& m)
exported(m, "Figure2D", FIGURE2D_MAIN);
exported

.def(py::init<const std::string&,GraphicOutput,bool>(),
FIGURE2D_FIGURE2D_CONST_STRING_REF_GRAPHICOUTPUT_BOOL,
"name"_a, "o"_a, "set_as_default"_a=false)
.def(py::init<const std::string&,GraphicOutput>(),
FIGURE2D_FIGURE2D_CONST_STRING_REF_GRAPHICOUTPUT,
"name"_a, "o"_a)

.def("name", &Figure2D::name,
CONST_STRING_REF_FIGURE2D_NAME_CONST)
Expand Down
4 changes: 1 addition & 3 deletions src/graphics/figures/codac2_Figure2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ using namespace codac2;
shared_ptr<Figure2D> DefaultFigure::_default_fig = nullptr;
shared_ptr<Figure2D> DefaultFigure::_selected_fig = DefaultFigure::_default_fig;

Figure2D::Figure2D(const string& name, GraphicOutput o, bool set_as_default_)
Figure2D::Figure2D(const string& name, GraphicOutput o)
: _name(name)
{
if(o & GraphicOutput::VIBES)
_output_figures.push_back(make_shared<Figure2D_VIBes>(*this));
if(o & GraphicOutput::IPE)
_output_figures.push_back(make_shared<Figure2D_IPE>(*this));
if(set_as_default_)
set_as_default();
}

vector<shared_ptr<OutputFigure2D>> Figure2D::output_figures()
Expand Down
3 changes: 1 addition & 2 deletions src/graphics/figures/codac2_Figure2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ namespace codac2
*
* \param name Name of the figure
* \param o Output of the figure, can be VIBes or IPE (or both)
* \param set_as_default (optionnal) If true, the figure is set as the default view, default is false
*/
Figure2D(const std::string& name, GraphicOutput o, bool set_as_default = false);
Figure2D(const std::string& name, GraphicOutput o);

/**
* \brief Returns ``OutputFigure2D`` objects rendering the current figure.
Expand Down