Skip to content

Commit 55dc6f7

Browse files
authored
Merge pull request #348 from godardma/codac2_dev
correction on lessonC for matlab & closes #344
2 parents e012286 + f460af8 commit 55dc6f7

5 files changed

Lines changed: 10 additions & 25 deletions

File tree

doc/manual/manual/visualization/figures.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,6 @@ Any Figure2D object can be used as DefaultFigure with the set method:
7676

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

79-
Equivalently, a Figure2D can be used as DefaultFigure by setting the flag `set_as_default` to true in the constructor:
80-
81-
.. tabs::
82-
83-
.. code-tab:: py
84-
85-
fig = Figure2D("My figure", GraphicOutput.VIBES | GraphicOutput.IPE, True)
86-
87-
.. code-tab:: c++
88-
89-
Figure2D fig ("My Figure",GraphicOutput::VIBES|GraphicOutput::IPE,true);
90-
9179

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

doc/manual/tuto/cp_robotics/src/lesson_C.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@
124124
[mi,xi,si] = deal(res_ctc_minus.subvector(1,2),res_ctc_minus.subvector(3,6),res_ctc_minus.subvector(7,8));
125125

126126
res_ctc_plus = ctc_plus.contract(py.codac4matlab.cart_prod(xi(3), yi(3), ai)); % The result is a 3D IntervalVector
127-
xi.setitem(3,res_ctc_plus(1));
128-
yi.setitem(3,res_ctc_plus(2));
127+
xi.set_item(3,res_ctc_plus(1));
128+
yi.set_item(3,res_ctc_plus(2));
129129
ai = res_ctc_plus(3);
130130

131131
res_ctc_polar = ctc_polar.contract(py.codac4matlab.cart_prod(si(1),si(2),yi(2),ai)); % The result is a 4D IntervalVector
132-
si.setitem(1,res_ctc_polar(1));
133-
si.setitem(2,res_ctc_polar(2));
134-
yi.setitem(2,res_ctc_polar(3));
132+
si.set_item(1,res_ctc_polar(1));
133+
si.set_item(2,res_ctc_polar(2));
134+
yi.set_item(2,res_ctc_polar(3));
135135
ai = res_ctc_polar(4);
136136

137137
mi = ctc_constell.contract(mi);

python/src/graphics/figures/codac2_py_Figure2D.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ void export_Figure2D(py::module& m)
6565
exported(m, "Figure2D", FIGURE2D_MAIN);
6666
exported
6767

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

7272
.def("name", &Figure2D::name,
7373
CONST_STRING_REF_FIGURE2D_NAME_CONST)

src/graphics/figures/codac2_Figure2D.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ using namespace codac2;
2222
shared_ptr<Figure2D> DefaultFigure::_default_fig = nullptr;
2323
shared_ptr<Figure2D> DefaultFigure::_selected_fig = DefaultFigure::_default_fig;
2424

25-
Figure2D::Figure2D(const string& name, GraphicOutput o, bool set_as_default_)
25+
Figure2D::Figure2D(const string& name, GraphicOutput o)
2626
: _name(name)
2727
{
2828
if(o & GraphicOutput::VIBES)
2929
_output_figures.push_back(make_shared<Figure2D_VIBes>(*this));
3030
if(o & GraphicOutput::IPE)
3131
_output_figures.push_back(make_shared<Figure2D_IPE>(*this));
32-
if(set_as_default_)
33-
set_as_default();
3432
}
3533

3634
vector<shared_ptr<OutputFigure2D>> Figure2D::output_figures()

src/graphics/figures/codac2_Figure2D.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ namespace codac2
8787
*
8888
* \param name Name of the figure
8989
* \param o Output of the figure, can be VIBes or IPE (or both)
90-
* \param set_as_default (optionnal) If true, the figure is set as the default view, default is false
9190
*/
92-
Figure2D(const std::string& name, GraphicOutput o, bool set_as_default = false);
91+
Figure2D(const std::string& name, GraphicOutput o);
9392

9493
/**
9594
* \brief Returns ``OutputFigure2D`` objects rendering the current figure.

0 commit comments

Comments
 (0)