Skip to content
Snippets Groups Projects
Commit c6c55002 authored by Iwainsky, Christian's avatar Iwainsky, Christian
Browse files

work on making the headers reusable

parent c94dc8e5
Branches
No related tags found
No related merge requests found
......@@ -353,7 +353,7 @@ private:
// 3d
bool projection_3d;
};
#ifndef MathPlotLibCPP17_DeclarationOnly
// add_artist
ObjectWrapper Axes::add_artist(const pybind11::tuple &args,
const pybind11::dict &kwargs) {
......@@ -725,7 +725,7 @@ Axes Axes::twinx(const pybind11::tuple &args, const pybind11::dict &kwargs) {
pybind11::object ret = twinx_attr(*args, **kwargs);
return Axes(ret);
}
#endif
} // namespace matplotlibcpp17::axes
#endif /* MATPLOTLIBCPP17_AXES_H */
......@@ -37,7 +37,7 @@ private:
void load_attrs() { LOAD_FUNC_ATTR(legend_elements, self); }
pybind11::object legend_elements_attr;
};
#ifndef MathPlotLibCPP17_DeclarationOnly
// legend_elements
/// NOTE: this func does not return list of Line2Ds(handles) and list of
/// strs(labels) unlike original python func
......@@ -49,7 +49,7 @@ PathCollection::legend_elements(const pybind11::tuple &args,
pybind11::object labels = ret[1];
return {ObjectWrapper(std::move(handles)), ObjectWrapper(std::move(labels))};
}
#endif
/**
* @brief A wrapper class for matplotlib.collections.PatchCollection
**/
......@@ -71,13 +71,14 @@ private:
void load_attrs() { LOAD_FUNC_ATTR(set_array, self); }
pybind11::object set_array_attr;
};
#ifndef MathPlotLibCPP17_DeclarationOnly
ObjectWrapper PatchCollection::set_array(const pybind11::tuple &args,
const pybind11::dict &kwargs) {
pybind11::object ret = set_array_attr(*args, **kwargs);
return ObjectWrapper(std::move(ret));
}
#endif
/**
* @brief A wrapper class for matplotlib.collections.QuadMesh
**/
......@@ -86,7 +87,6 @@ public:
QuadMesh(const pybind11::object &quadmesh) { self = quadmesh; }
QuadMesh(pybind11::object &&quadmesh) { self = std::move(quadmesh); }
};
} // namespace matplotlibcpp17::collections
#endif /* MATPLOTLIBCPP17_COLLECTIONS_H */
......@@ -85,7 +85,7 @@ private:
pybind11::object tight_layout_attr;
pybind11::object set_size_inches_attr;
};
#ifndef MathPlotLibCPP17_DeclarationOnly
// add_axes
axes::Axes Figure::add_axes(const pybind11::tuple &args,
const pybind11::dict &kwargs) {
......@@ -146,7 +146,7 @@ ObjectWrapper Figure::tight_layout(const pybind11::tuple &args,
pybind11::object ret = tight_layout_attr(*args, **kwargs);
return ObjectWrapper(std::move(ret));
}
#endif
} // namespace matplotlibcpp17::figure
#endif /* MATPLOTLIBCPP17_FIGURE_H */
......@@ -210,7 +210,7 @@ private:
pybind11::object ylabel_attr;
pybind11::object ylim_attr;
};
#ifndef MathPlotLibCPP17_DeclarationOnly
// axes
axes::Axes PyPlot::axes(const pybind11::dict &kwargs) {
pybind11::object ax_obj = axes_attr(**kwargs);
......@@ -455,7 +455,7 @@ PyPlot import() {
auto g_pyplot = PyPlot(mod);
return g_pyplot;
}
#endif
} // namespace matplotlibcpp17::pyplot
// Args & Kwargs
......
......@@ -33,13 +33,13 @@ private:
void load_attrs() { LOAD_FUNC_ATTR(set_rotation, self); }
pybind11::object set_rotation_attr;
};
#ifndef MathPlotLibCPP17_DeclarationOnly
ObjectWrapper Text::set_rotation(const pybind11::tuple &args,
const pybind11::dict &kwargs) {
pybind11::object ret = set_rotation_attr(*args, **kwargs);
return ObjectWrapper(std::move(ret));
}
#endif
} // namespace matplotlibcpp17::text
#endif /* MATPLOTLIBCPP17_TEXT_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment