File indexing completed on 2025-11-30 09:40:27
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include <array>
0012
0013 #include "actsvg/core/defs.hpp"
0014 #include "actsvg/proto/grid.hpp"
0015 #include "actsvg/styles/defaults.hpp"
0016
0017 namespace actsvg {
0018
0019 namespace proto {
0020
0021 struct material_slab {
0022
0023 std::array<scalar, 6u> _properties = {0., 0., 0., 0., 0., 0.};
0024 };
0025
0026 using matrial_matrix = std::vector<std::vector<material_slab> >;
0027
0028
0029
0030
0031
0032
0033
0034 std::array<std::array<scalar, 2u>, 3u> material_ranges(
0035 const matrial_matrix& mm_);
0036
0037
0038
0039
0040 struct surface_material {
0041
0042
0043 std::vector<std::vector<material_slab> > _material_matrix = {};
0044
0045
0046 proto::grid _grid = {};
0047
0048
0049 std::array<std::array<scalar, 2u>, 3u> _material_ranges = {};
0050
0051
0052 style::gradient _gradient = defaults::__rgb_gradient;
0053
0054
0055 point2 _gradient_pos = {0, 0};
0056
0057
0058 std::array<scalar, 2u> _gradient_box = {0., 0.};
0059
0060
0061 style::stroke _gradient_stroke = style::stroke{};
0062
0063
0064 style::font _gradient_font = style::font{};
0065
0066
0067 style::label _gradient_label = style::label{};
0068
0069
0070 point2 _info_pos = {0, 0};
0071
0072
0073 style::font _info_font = style::font{};
0074
0075
0076 void evaluate_material_ranges() {
0077 _material_ranges = material_ranges(_material_matrix);
0078 }
0079 };
0080
0081 }
0082 }