Go to the documentation of this file.
9 #ifndef EAGINE_SHAPES_COMBINED_HPP
10 #define EAGINE_SHAPES_COMBINED_HPP
19 class combined_gen :
public generator {
21 std::vector<std::unique_ptr<generator>> _gens;
27 void _attrib_values(vertex_attrib_variant, span<T>);
30 combined_gen(std::vector<std::unique_ptr<generator>>&& gens) noexcept
31 : _gens{std::move(gens)} {}
33 auto add(std::unique_ptr<generator>&& gen) && -> combined_gen&&;
45 auto variant_name(vertex_attrib_variant) ->
string_view override;
47 auto values_per_vertex(vertex_attrib_variant) ->
span_size_t override;
51 auto is_attrib_normalized(vertex_attrib_variant) ->
bool override;
53 void attrib_values(vertex_attrib_variant,
span<
byte>) override;
54 void attrib_values(vertex_attrib_variant,
span<std::int16_t>) override;
55 void attrib_values(vertex_attrib_variant,
span<std::int32_t>) override;
56 void attrib_values(vertex_attrib_variant,
span<std::uint16_t>) override;
57 void attrib_values(vertex_attrib_variant,
span<std::uint32_t>) override;
58 void attrib_values(vertex_attrib_variant,
span<
float>) override;
76 void ray_intersections(
78 span<const math::
line<
float, true>> rays,
82 static inline auto combine(std::unique_ptr<generator>&& gen) {
83 std::vector<std::unique_ptr<generator>> v;
85 v.emplace_back(std::move(gen));
86 return std::make_unique<combined_gen>(std::move(v));
89 template <std::
size_t N>
90 static inline auto combine(std::array<std::unique_ptr<generator>, N>&& gens) {
91 std::vector<std::unique_ptr<generator>> v;
93 for(
auto& gen : gens) {
94 v.emplace_back(std::move(gen));
96 return std::make_unique<combined_gen>(std::move(v));
102 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
103 #include <eagine/shapes/combined.inl>
106 #endif // EAGINE_SHAPES_COMBINED_HPP
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
bitfield< vertex_attrib_kind > vertex_attrib_bits
Alias for vertex_attrib_kind bitfield type.
Definition: vertex_attrib.hpp:85
Common code is placed in this namespace.
Definition: eagine.hpp:21
basic_span< T, T *, S > span
Default alias for basic memory spans with native pointer type.
Definition: span.hpp:415
generator_capability
Shape generator capability bit enumeration.
Definition: gen_capabilities.hpp:21
span_size_t drawing_variant
Alias for shape drawing variant index type.
Definition: gen_base.hpp:31
basic_line< T, 3, V > line
Alias for lines in 3D space.
Definition: primitives.hpp:52
vertex_attrib_kind
Shape vertex attribute kind enumeration.
Definition: vertex_attrib.hpp:25
attrib_data_type
Shape vertex attribute data type enumeration.
Definition: drawing.hpp:67
index_data_type
Shape element index type enumeration.
Definition: drawing.hpp:111
valid_if< T, valid_flag_policy > optionally_valid
Specialization of valid_if with flag indicating validity.
Definition: decl.hpp:300