Skip to content

Commit

Permalink
Add Python bindings to support the extraction of the boundary of a (L…
Browse files Browse the repository at this point in the history
…abelled)Enclosure, resolve #602
  • Loading branch information
lgeretti committed May 22, 2021
1 parent b49fbe1 commit d6642b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Legenda for the issue kind:
- [#559](/~https://github.com/ariadne-cps/ariadne/issues/559) (N) Introduce an optional ariadne_main.hpp that offers an ariadne_main() function handling all header tasks for an executable
- [#562](/~https://github.com/ariadne-cps/ariadne/issues/562) (N) Introduce a command line interface class for acquiring CLI input arguments setting logger verbosity, theme and scheduler, along with concurrency, graphics backend and drawer
- [#599](/~https://github.com/ariadne-cps/ariadne/issues/599) (A) Add extra Python bindings for HybridEnclosure, add Python subscripting for ListSet<HybridEnclosure>
- [#602](/~https://github.com/ariadne-cps/ariadne/issues/602) (A) Add extra Python bindings for Enclosure, add Python bindings for Point2d for graphics
- [#551](/~https://github.com/ariadne-cps/ariadne/issues/551) (C) Make VectorFieldEvolver process sets in parallel (when splitting initially or during evolution)
- [#556](/~https://github.com/ariadne-cps/ariadne/issues/556) (C) Disallow unsafe default value of upper semantics for orbit methods
- [#565](/~https://github.com/ariadne-cps/ariadne/issues/565) (C) Draw lists of (Labelled/Hybrid)Enclosure in parallel
Expand Down
3 changes: 3 additions & 0 deletions python/source/evolution_submodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Void export_storage(pybind11::module& module) {
Void export_enclosure(pybind11::module& module) {
pybind11::class_<Enclosure,pybind11::bases<Drawable2dInterface>> enclosure_class(module,"Enclosure");
enclosure_class.def("bounding_box",&Enclosure::bounding_box);
enclosure_class.def("state_set",&Enclosure::state_set);
enclosure_class.def("state_auxiliary_set",&Enclosure::state_auxiliary_set);
enclosure_class.def("state_time_auxiliary_set",&Enclosure::state_time_auxiliary_set);
enclosure_class.def("__str__", &__cstr__<Enclosure>);
pybind11::class_<LabelledEnclosure,pybind11::bases<LabelledDrawable2dInterface,Enclosure>> labelled_enclosure_class(module,"LabelledEnclosure");
labelled_enclosure_class.def("bounding_box",&LabelledEnclosure::bounding_box);
Expand Down
1 change: 1 addition & 0 deletions python/source/geometry_submodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ Void export_constrained_image_set(pybind11::module& module)
validated_constrained_image_set_class.def("new_parameter_constraint", (Void(ValidatedConstrainedImageSet::*)(const ValidatedConstraint&))&ValidatedConstrainedImageSet::new_parameter_constraint);
validated_constrained_image_set_class.def("outer_approximation", &ValidatedConstrainedImageSet::outer_approximation);
validated_constrained_image_set_class.def("affine_approximation", &ValidatedConstrainedImageSet::affine_approximation);
validated_constrained_image_set_class.def("affine_over_approximation", &ValidatedConstrainedImageSet::affine_over_approximation);
validated_constrained_image_set_class.def("adjoin_outer_approximation_to", &ValidatedConstrainedImageSet::adjoin_outer_approximation_to);
validated_constrained_image_set_class.def("bounding_box", &ValidatedConstrainedImageSet::bounding_box);
validated_constrained_image_set_class.def("inside", &ValidatedConstrainedImageSet::inside);
Expand Down
9 changes: 9 additions & 0 deletions python/source/graphics_submodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@

using namespace Ariadne;

Void export_point2d(pybind11::module& module) {
pybind11::class_<Point2d> point2d_class(module, "Point2d");
point2d_class.def(pybind11::init<double, double>());
point2d_class.def_readwrite("x", &Point2d::x);
point2d_class.def_readwrite("y", &Point2d::y);
point2d_class.def("__repr__", &__cstr__<Point2d>);
}

Void export_colour(pybind11::module& module)
{
pybind11::class_<Colour> colour_class(module,"Colour");
Expand Down Expand Up @@ -126,6 +134,7 @@ Void export_plot(pybind11::module& module)
}

Void graphics_submodule(pybind11::module& module) {
export_point2d(module);
export_colour(module);
export_figure(module);
export_graphics_properties(module);
Expand Down

0 comments on commit d6642b3

Please sign in to comment.