From cfdaa9d60e24ae2495c3bd2bbd779b499b437ea0 Mon Sep 17 00:00:00 2001 From: Andreas Salzburger Date: Mon, 22 Apr 2024 14:19:16 +0200 Subject: [PATCH] backward compatibility --- core/include/actsvg/core/views.hpp | 60 ++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/core/include/actsvg/core/views.hpp b/core/include/actsvg/core/views.hpp index f42a15a..0e5ca14 100644 --- a/core/include/actsvg/core/views.hpp +++ b/core/include/actsvg/core/views.hpp @@ -88,6 +88,21 @@ struct x_y { } return c; } + + /** A planar view operator, asuming a contour in x/y plane + * + * @tparam point3_container is a 3D-point container, where elements + * of a single p3 object can be accessed via [] operators + * + * @param vertices_ the vertices of the surface, they are + * assumed to be in global/display coorindates + * + * @return a 2D contour array + */ + template + contour operator()(const point3_container &vertices_) const { + return path(vertices_); + } }; /// z_r projection view @@ -132,6 +147,21 @@ struct z_r { } return c; } + + /** A planar view operator + * + * @tparam point3_container is a 3D-point container, where elements + * of a single p3 object can be accessed via [] operators + * + * @param vertices_ the vertices of the surface, they are + * assumed to be in global/display coorindates + * + * @return a 2D contour array + */ + template + contour operator()(const point3_container &vertices_) const { + return path(vertices_); + } }; // z-phi projection view @@ -202,6 +232,21 @@ struct z_phi { } return c; } + + /** A planar view operator + * + * @tparam point3_container is a 3D-point container, where elements + * of a single p3 object can be accessed via [] operators + * + * @param vertices_ the vertices of the surface, they are + * assumed to be in global/display coorindates + * + * @return a 2D contour array + */ + template + contour operator()(const point3_container &vertices_) const { + return path(vertices_); + } }; // z_rphi projection view @@ -253,6 +298,21 @@ struct z_rphi { } return c; } + + /** A planar view operator + * + * @tparam point3_container is a 3D-point container, where elements + * of a single p3 object can be accessed via [] operators + * + * @param vertices_ the vertices of the surface, they are + * assumed to be in global/display coorindates + * + * @return a 2D contour array + */ + template + contour operator()(const point3_container &vertices_) const { + return path(vertices_); + } }; } // namespace views