OGLplus  (0.59.0) a C++ wrapper for rendering APIs

centered.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_SHAPES_CENTERED_HPP
10 #define EAGINE_SHAPES_CENTERED_HPP
11 
12 #include "delegated.hpp"
13 #include <eagine/config/basic.hpp>
14 #include <utility>
15 
16 namespace eagine {
17 namespace shapes {
18 //------------------------------------------------------------------------------
22 class centered_gen : public delegated_gen {
23 
24 public:
25  centered_gen(std::shared_ptr<generator> gen) noexcept
26  : delegated_gen{std::move(gen)} {}
27 
28  void attrib_values(vertex_attrib_variant, span<float>) override;
29 
30  auto bounding_sphere() -> math::sphere<float, true> override;
31 };
32 //------------------------------------------------------------------------------
35 static inline auto center(std::shared_ptr<generator> gen) noexcept {
36  return std::make_unique<centered_gen>(std::move(gen));
37 }
38 //------------------------------------------------------------------------------
39 } // namespace shapes
40 } // namespace eagine
41 
42 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
43 #include <eagine/shapes/centered.inl>
44 #endif
45 
46 #endif // EAGINE_SHAPES_CENTERED_HPP
Basic template for spheres in N-dimensional space.
Definition: primitives.hpp:122
Generator modifier recalculating the shape center from vertex positions.
Definition: centered.hpp:22
Common code is placed in this namespace.
Definition: eagine.hpp:21
auto bounding_sphere() -> math::sphere< float, true > override
Returns the bounding sphere for the generated shape.
Class designating an vertex attribute variant in a shape generator.
Definition: vertex_attrib.hpp:104
void attrib_values(vertex_attrib_variant, span< float >) override
Fetches the vertex attribute data for the specified variant as floats.
Base class for delegating shape generators based on other generators.
Definition: delegated.hpp:21
static auto center(std::shared_ptr< generator > gen) noexcept
Constructs instances of centered_gen modifier.
Definition: centered.hpp:35

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).