File indexing completed on 2025-01-18 09:28:08
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include <map>
0012 #include <optional>
0013 #include <string>
0014 #include <utility>
0015 #include <vector>
0016
0017 #include "actsvg/core/style.hpp"
0018 #include "actsvg/styles/defaults.hpp"
0019 #include "grid.hpp"
0020
0021 namespace actsvg {
0022
0023 namespace proto {
0024
0025
0026
0027
0028
0029
0030
0031 template <typename point3_container>
0032 struct surface {
0033
0034 enum type {
0035 e_annulus,
0036 e_cylinder,
0037 e_diamond,
0038 e_disc,
0039 e_polygon,
0040 e_rectangle,
0041 e_trapez
0042 };
0043
0044 enum boolean { e_clipping, e_union, e_subtraction, e_none };
0045
0046
0047 std::string _name = "unnamed";
0048
0049
0050 std::map<std::string, std::vector<std::string>> _aux_info = {};
0051
0052
0053 point3_container _vertices = {};
0054
0055
0056
0057 std::array<scalar, 2> _radii = {0., 0.};
0058 std::array<scalar, 2> _opening = {-M_PI, M_PI};
0059 std::array<scalar, 2> _zparameters = {0., 0.};
0060
0061
0062 std::vector<surface<point3_container>> _boolean_surface = {};
0063 boolean _boolean_operation = e_none;
0064
0065
0066 style::fill _fill = defaults::__s_fill;
0067 style::stroke _stroke = defaults::__s_stroke;
0068 style::transform _transform = defaults::__t_identity;
0069
0070
0071 type _type = e_trapez;
0072
0073
0074 std::vector<scalar> _measures = {};
0075
0076
0077 svg::object _template_object;
0078
0079 using point3_type = typename point3_container::value_type;
0080
0081
0082
0083
0084
0085
0086 static surface<point3_container> from_template(
0087 const surface<point3_container>& t_, const svg::object& o_,
0088 const std::string& name_) {
0089 surface<point3_container> s;
0090 s._name = name_;
0091 s._type = t_._type;
0092 s._aux_info = t_._aux_info;
0093 s._vertices = t_._vertices;
0094 s._measures = t_._measures;
0095 s._radii = t_._radii;
0096 s._opening = t_._opening;
0097 s._fill = t_._fill;
0098 s._stroke = t_._stroke;
0099 s._transform = t_._transform;
0100 s._template_object = o_;
0101 return s;
0102 }
0103 };
0104
0105 }
0106
0107 }