Go to the documentation of this file.
9 #ifndef EAGINE_SHAPES_TORUS_HPP
10 #define EAGINE_SHAPES_TORUS_HPP
12 #include "../callable_ref.hpp"
13 #include "../config/basic.hpp"
14 #include "../valid_if/ge0_lt1.hpp"
15 #include "../valid_if/greater_than.hpp"
39 :
unit_torus_gen(attr_bits, std::move(rings), std::move(sections), 0.5F) {
50 void vertex_pivots(span<float> dest) noexcept;
60 void wrap_coords(span<float> dest) noexcept;
67 void make_special_attrib_values(
96 const std::size_t _r_seed{1234};
97 const std::size_t _s_seed{2345};
104 template <
typename T>
115 return std::make_unique<unit_torus_gen>(
116 attr_bits, std::move(rings), std::move(sections), std::move(radius_ratio));
135 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
136 #include <eagine/shapes/torus.inl>
140 #endif // EAGINE_SHAPES_TORUS_HPP
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
Declaration of class template storing a reference to a callable object.
Definition: callable_ref.hpp:24
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
static auto unit_torus(vertex_attrib_bits attr_bits, valid_if_greater_than< int, 4 > rings, valid_if_greater_than< int, 3 > sections, valid_if_ge0_lt1< float > radius_ratio)
Constructs instances of unit_torus_gen.
Definition: torus.hpp:110
bitfield< vertex_attrib_kind > vertex_attrib_bits
Alias for vertex_attrib_kind bitfield type.
Definition: vertex_attrib.hpp:85
Basic template for spheres in N-dimensional space.
Definition: primitives.hpp:122
Common code is placed in this namespace.
Definition: eagine.hpp:21
void instructions(drawing_variant, span< draw_operation > ops) override
Fetches the drawing operations for the specified drawing variant.
auto operation_count()
Returns the number of drawing instructions for the default variant.
Definition: gen_base.hpp:179
Primary template for conditionally valid values.
Definition: decl.hpp:49
Class designating an vertex attribute variant in a shape generator.
Definition: vertex_attrib.hpp:104
span_size_t drawing_variant
Alias for shape drawing variant index type.
Definition: gen_base.hpp:31
auto variant_name(vertex_attrib_variant) -> string_view override
Returns the name of the specified attribute variant.
Base class for shape generators re-calculating the center.
Definition: gen_base.hpp:320
void attrib_values(vertex_attrib_variant, span< float >) override
Fetches the vertex attribute data for the specified variant as floats.
auto index_type() -> index_data_type
Returns the index data type for the default draw variant.
Definition: gen_base.hpp:139
auto attribute_variants(vertex_attrib_kind attrib) -> span_size_t override
Returns the count of shape attribute variants.
auto vertex_count() -> span_size_t override
Returns the shaped vertex count.
vertex_attrib_kind
Shape vertex attribute kind enumeration.
Definition: vertex_attrib.hpp:25
auto bounding_sphere() -> math::sphere< float, true > override
Returns the bounding sphere for the generated shape.
Generator of centered torus shape with unit diameter.
Definition: torus.hpp:27
auto draw_variant_count() -> span_size_t override
Returns the count of possible shape draw variants.
index_data_type
Shape element index type enumeration.
Definition: drawing.hpp:111
auto index_count()
Returns the index count for the default drawing variant.
Definition: gen_base.hpp:147
void indices(drawing_variant, span< std::uint8_t > dest) override
Fetches the index data for the specified drawing variant.