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

eagine::shapes Namespace Reference

Shape generator and loader code is placed in this namespace. More...

Classes

class  centered_gen
 Generator modifier recalculating the shape center from vertex positions. More...
 
class  centered_unit_shape_generator_base
 Base class for shape generators re-calculating the center. More...
 
class  delegated_gen
 Base class for delegating shape generators based on other generators. More...
 
struct  draw_operation
 Draw operation parameters. More...
 
struct  generator
 Interface for shape loaders or generators. More...
 
class  generator_base
 Common base implementation of the shape generator interface. More...
 
class  mesh_edge
 Class storing information about an edge between two mesh faces. More...
 
class  mesh_triangle
 Class storing information about a mesh tirangular face. More...
 
class  occluded_gen
 Generator modifier calculating vertex occlusion weights. More...
 
class  reboxed_gen
 Generator modifier recalculating the vertex box coords values. More...
 
class  scaled_gen
 Generator modifier scaling the generated vertices by specifed amount. More...
 
class  to_patches_gen
 Generator modifier changing primitives in draw instructions to patches. More...
 
class  to_quads_gen
 Generator modifier transforming triangle strips to quads (lines with adjacency) More...
 
class  topology
 Class holding information about the topology of a generated shape. More...
 
class  translated_gen
 Generator modifier translating the generated vertices by specifed amount. More...
 
class  triangle_adjacency_gen
 Generator modifier adding triangle adjacency to drawing instructions. More...
 
class  unit_cube_gen
 Generator of centered cube shape with unit edge size. More...
 
class  unit_icosahedron_gen
 Generator of centered icosahedron shape with unit diameter. More...
 
class  unit_round_cube_gen
 Generator of centered, subdivided and rounded cube shape with unit radius. More...
 
class  unit_screen_gen
 Generator of centered flat 2d screen shape from (-1,-1,0) to (1,1,0) More...
 
class  unit_sphere_gen
 Generator of centered UV-sphere shape with unit diameter. More...
 
class  unit_torus_gen
 Generator of centered torus shape with unit diameter. More...
 
class  unit_twisted_torus_gen
 Generator of centered UV-sphere shape with unit diameter. More...
 
class  value_tree_loader
 Loader that fetches shape data from a value tree (JSON, YAML, etc.) More...
 
class  vertex_attrib_variant
 Class designating an vertex attribute variant in a shape generator. More...
 

Typedefs

using drawing_variant = span_size_t
 Alias for shape drawing variant index type.
 
using generator_capabilities = bitfield< generator_capability >
 Alias for generator_capability bitfield type.
 
using vertex_attrib_bits = bitfield< vertex_attrib_kind >
 Alias for vertex_attrib_kind bitfield type.
 
template<std::size_t N>
using vertex_attrib_variants = std::array< const vertex_attrib_variant, N >
 Array of several vertex attribute variant instances. More...
 

Enumerations

enum  primitive_type : std::uint8_t {
  primitive_type::points, primitive_type::lines, primitive_type::line_strip, primitive_type::line_loop,
  primitive_type::triangles, primitive_type::triangle_strip, primitive_type::triangle_fan, primitive_type::triangles_adjacency,
  primitive_type::quads, primitive_type::tetrahedrons, primitive_type::patches
}
 The shape primitive type enumeration. More...
 
enum  attrib_data_type {
  attrib_data_type::none, attrib_data_type::ubyte, attrib_data_type::int_16, attrib_data_type::int_32,
  attrib_data_type::uint_16, attrib_data_type::uint_32, attrib_data_type::float_
}
 Shape vertex attribute data type enumeration. More...
 
enum  index_data_type : std::uint8_t { index_data_type::none, index_data_type::unsigned_8, index_data_type::unsigned_16, index_data_type::unsigned_32 }
 Shape element index type enumeration. More...
 
enum  generator_capability { generator_capability::element_strips, generator_capability::element_fans, generator_capability::primitive_restart }
 Shape generator capability bit enumeration. More...
 
enum  vertex_attrib_kind : std::uint16_t {
  vertex_attrib_kind::object_id, vertex_attrib_kind::position, vertex_attrib_kind::normal, vertex_attrib_kind::tangential,
  vertex_attrib_kind::bitangential, vertex_attrib_kind::pivot, vertex_attrib_kind::pivot_pivot, vertex_attrib_kind::vertex_pivot,
  vertex_attrib_kind::box_coord, vertex_attrib_kind::face_coord, vertex_attrib_kind::wrap_coord, vertex_attrib_kind::color,
  vertex_attrib_kind::weight, vertex_attrib_kind::occlusion, vertex_attrib_kind::polygon_id, vertex_attrib_kind::material_id
}
 Shape vertex attribute kind enumeration. More...
 

Functions

static auto add_triangle_adjacency (std::shared_ptr< generator > gen, drawing_variant var) noexcept
 Constructs instances of triangle_adjacency_gen modifier.
 
static auto add_triangle_adjacency (std::shared_ptr< generator > gen) noexcept
 Constructs instances of triangle_adjacency_gen modifier.
 
static auto center (std::shared_ptr< generator > gen) noexcept
 Constructs instances of centered_gen modifier.
 
static auto unit_cube (vertex_attrib_bits attr_bits)
 Constructs instances of unit_cube_gen. More...
 
static constexpr auto operator| (generator_capability a, generator_capability b) noexcept -> generator_capabilities
 Bitwise-or operator for generator_capability enumerators.
 
static auto unit_icosahedron (vertex_attrib_bits attr_bits)
 Constructs instances of unit_icosahedron_gen. More...
 
static auto occlude (std::shared_ptr< generator > gen, span_size_t samples=8) noexcept
 Constructs instances of occluded_gen modifier.
 
static auto rebox (std::shared_ptr< generator > gen) noexcept
 Constructs instances of reboxed_gen modifier.
 
static auto unit_round_cube (vertex_attrib_bits attr_bits, int divisions)
 Constructs instances of unit_round_cube_gen. More...
 
static auto scale (std::shared_ptr< generator > gen, std::array< float, 3 > s) noexcept
 Constructs instances of scaled_gen modifier.
 
static auto unit_screen (vertex_attrib_bits attr_bits)
 Constructs instances of unit_screen_gen. More...
 
static auto unit_sphere (vertex_attrib_bits attr_bits, valid_if_greater_than< int, 2 > rings, valid_if_greater_than< int, 3 > sections)
 Constructs instances of unit_sphere_gen. More...
 
static auto unit_sphere (vertex_attrib_bits attr_bits)
 Constructs instances of unit_sphere_gen. More...
 
static auto to_patches (std::shared_ptr< generator > gen) noexcept
 Constructs instances of to_patches_gen modifier.
 
static auto to_quads (std::shared_ptr< generator > gen) noexcept
 Constructs instances of to_quads_gen modifier.
 
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.
 
static auto unit_torus (vertex_attrib_bits attr_bits)
 Constructs instances of unit_torus_gen. More...
 
static auto translate (std::shared_ptr< generator > gen, std::array< float, 3 > d) noexcept
 Constructs instances of translated_gen modifier.
 
static auto unit_twisted_torus (vertex_attrib_bits attr_bits, int twist, valid_if_greater_than< int, 2 > rings, valid_if_greater_than< int, 3 > sections, valid_if_ge0_lt1< float > radius_ratio)
 Constructs instances of unit_twisted_torus_gen. More...
 
static auto unit_twisted_torus (vertex_attrib_bits attr_bits)
 Constructs instances of unit_twisted_torus_gen. More...
 
static auto from_value_tree (valtree::compound source, main_ctx_parent parent)
 Constructs instances of value_tree_loader. More...
 
static constexpr auto all_vertex_attrib_bits () noexcept -> vertex_attrib_bits
 Returns vertex_attrib_bits value with all bits set.
 
static constexpr auto operator| (vertex_attrib_kind a, vertex_attrib_kind b) noexcept -> vertex_attrib_bits
 Bitwise-or operator for vertex_attrib_kind bits.
 
static constexpr auto operator/ (vertex_attrib_kind attrib, span_size_t variant_index) noexcept -> vertex_attrib_variant
 Operator for constructing of vertex_attrib_variant from kind and index.
 
static constexpr auto operator+ (vertex_attrib_variant a) noexcept -> vertex_attrib_variants< 1 >
 Operator for creating of single element array of vertex attrib variant. More...
 
static constexpr auto operator+ (vertex_attrib_variant a, vertex_attrib_variant b) noexcept -> vertex_attrib_variants< 2 >
 Operator for creating of two element array of vertex attrib variants. More...
 
template<std::size_t N>
static constexpr auto operator+ (const vertex_attrib_variants< N > &a, vertex_attrib_variant b) noexcept -> vertex_attrib_variants< N+1 >
 Operator for concatenation of vertex attrib variants into an array. More...
 
template<std::size_t N>
static auto get_attrib_bits (const vertex_attrib_variants< N > &vaals) noexcept -> vertex_attrib_bits
 Extracts vertex attribute kind bits from and vertex attribute variants array. More...
 
static auto attrib_values_per_vertex (vertex_attrib_kind attr) noexcept -> span_size_t
 Gets the default number of values per vertex for an attribute kind.
 
static auto attrib_values_per_vertex (vertex_attrib_variant vav) noexcept
 Gets the default number of values per vertex for an attribute variant.
 

Detailed Description

Shape generator and loader code is placed in this namespace.


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