Skip to content

Commit f460af8

Browse files
committed
[graphics] removing unusable flag for Figure2D constructor ( closes #344 )
1 parent 0c5e04f commit f460af8

4 files changed

Lines changed: 5 additions & 20 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

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)