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

Shape generators and loaders

Classes

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

Typedefs

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

Enumerations

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

Functions

static auto eagine::shapes::add_triangle_adjacency (std::shared_ptr< generator > gen, drawing_variant var) noexcept
 Constructs instances of triangle_adjacency_gen modifier.
 
static auto eagine::shapes::add_triangle_adjacency (std::shared_ptr< generator > gen) noexcept
 Constructs instances of triangle_adjacency_gen modifier.
 
static auto eagine::shapes::center (std::shared_ptr< generator > gen) noexcept
 Constructs instances of centered_gen modifier.
 
static auto eagine::shapes::unit_cube (vertex_attrib_bits attr_bits)
 Constructs instances of unit_cube_gen. More...
 
static constexpr auto eagine::shapes::operator| (generator_capability a, generator_capability b) noexcept -> generator_capabilities
 Bitwise-or operator for generator_capability enumerators.
 
static auto eagine::shapes::unit_icosahedron (vertex_attrib_bits attr_bits)
 Constructs instances of unit_icosahedron_gen. More...
 
static auto eagine::shapes::occlude (std::shared_ptr< generator > gen, span_size_t samples=8) noexcept
 Constructs instances of occluded_gen modifier.
 
static auto eagine::shapes::rebox (std::shared_ptr< generator > gen) noexcept
 Constructs instances of reboxed_gen modifier.
 
static auto eagine::shapes::unit_round_cube (vertex_attrib_bits attr_bits, int divisions)
 Constructs instances of unit_round_cube_gen. More...
 
static auto eagine::shapes::scale (std::shared_ptr< generator > gen, std::array< float, 3 > s) noexcept
 Constructs instances of scaled_gen modifier.
 
static auto eagine::shapes::unit_screen (vertex_attrib_bits attr_bits)
 Constructs instances of unit_screen_gen. More...
 
static auto eagine::shapes::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 eagine::shapes::unit_sphere (vertex_attrib_bits attr_bits)
 Constructs instances of unit_sphere_gen. More...
 
static auto eagine::shapes::to_patches (std::shared_ptr< generator > gen) noexcept
 Constructs instances of to_patches_gen modifier.
 
static auto eagine::shapes::to_quads (std::shared_ptr< generator > gen) noexcept
 Constructs instances of to_quads_gen modifier.
 
static auto eagine::shapes::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 eagine::shapes::unit_torus (vertex_attrib_bits attr_bits)
 Constructs instances of unit_torus_gen. More...
 
static auto eagine::shapes::translate (std::shared_ptr< generator > gen, std::array< float, 3 > d) noexcept
 Constructs instances of translated_gen modifier.
 
static auto eagine::shapes::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 eagine::shapes::unit_twisted_torus (vertex_attrib_bits attr_bits)
 Constructs instances of unit_twisted_torus_gen. More...
 
static auto eagine::shapes::from_value_tree (valtree::compound source, main_ctx_parent parent)
 Constructs instances of value_tree_loader. More...
 
static constexpr auto eagine::shapes::all_vertex_attrib_bits () noexcept -> vertex_attrib_bits
 Returns vertex_attrib_bits value with all bits set.
 
static constexpr auto eagine::shapes::operator| (vertex_attrib_kind a, vertex_attrib_kind b) noexcept -> vertex_attrib_bits
 Bitwise-or operator for vertex_attrib_kind bits.
 
static constexpr auto eagine::shapes::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 eagine::shapes::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 eagine::shapes::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 eagine::shapes::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 eagine::shapes::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 eagine::shapes::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 eagine::shapes::attrib_values_per_vertex (vertex_attrib_variant vav) noexcept
 Gets the default number of values per vertex for an attribute variant.
 
template<typename A >
auto eagine::oglp::translate (const basic_gl_api< A > &, shapes::primitive_type) noexcept -> primitive_type
 Translates from shape primitive type to GL primitive type. More...
 
template<typename A >
auto eagine::oglp::translate (const basic_gl_api< A > &, shapes::attrib_data_type) noexcept -> data_type
 Translates from shape attribute data type to GL data type. More...
 
template<typename A >
auto eagine::oglp::translate (const basic_gl_api< A > &, shapes::index_data_type) noexcept -> index_data_type
 Translates from shape index data type to GL data type. More...
 
template<typename A >
auto eagine::oglp::type_size (const basic_gl_api< A > &, shapes::attrib_data_type) noexcept -> span_size_t
 Returns the byte size of a shape attribute data type. More...
 
template<typename A >
auto eagine::oglp::type_size (const basic_gl_api< A > &, shapes::index_data_type) noexcept -> span_size_t
 Returns the byte size of a shape index data type. More...
 
template<typename A >
void eagine::oglp::draw_using_instructions (const basic_gl_api< A > &api, span< const shape_draw_operation > ops) noexcept
 Takes a sequence of draw operations from a shape generator and draws them. More...
 
template<typename A >
void eagine::oglp::draw_instanced_using_instructions (const basic_gl_api< A > &api, span< const shape_draw_operation > ops, gl_types::sizei_type inst_count) noexcept
 Takes a sequence of draw operations from a shape generator and draws them. More...
 
template<typename A >
void eagine::oglp::draw_using_instructions (const basic_gl_api< A > &api, span< const shape_draw_operation > ops, const shape_draw_subset &subs) noexcept
 Takes a sequence of draw operations from a shape generator and draws them. More...
 
template<typename A >
void eagine::oglp::draw_instanced_using_instructions (const basic_gl_api< A > &api, span< const shape_draw_operation > ops, const shape_draw_subset &subs, gl_types::sizei_type inst_count) noexcept
 Takes a sequence of draw operations from a shape generator and draws them. More...
 

Detailed Description

Typedef Documentation

◆ vertex_attrib_variants

template<std::size_t N>
using eagine::shapes::vertex_attrib_variants = typedef std::array<const vertex_attrib_variant, N>

Array of several vertex attribute variant instances.

See also
vertex_attrib_variant

Enumeration Type Documentation

◆ attrib_data_type

Shape vertex attribute data type enumeration.

See also
index_data_type
Enumerator
none 

None / unknown.

ubyte 

Unsigned byte.

int_16 

Signed 16-bit integer.

int_32 

Signed 32-bit integer.

uint_16 

Unsigned 16-bit integer.

uint_32 

Unsigned 32-bit integer.

float_ 

Floating-point.

◆ generator_capability

Shape generator capability bit enumeration.

See also
generator_capabilities
Enumerator
element_strips 

Line or triangle strips should be generated if possible.

element_fans 

Line or triangle fanst should be generated if possible.

primitive_restart 

Primitive restart functionality should be used if possible.

◆ index_data_type

enum eagine::shapes::index_data_type : std::uint8_t
strong

Shape element index type enumeration.

See also
attrib_data_type
Enumerator
none 

None / unknown.

unsigned_8 

Unsigned 8-bit integer.

unsigned_16 

Unsigned 16-bit integer.

unsigned_32 

Unsigned 32-bit integer.

◆ primitive_type

enum eagine::shapes::primitive_type : std::uint8_t
strong

The shape primitive type enumeration.

Enumerator
points 

Individual points.

lines 

Individual line segments.

line_strip 

Line strips.

line_loop 

Close line loops.

triangles 

Individual triangles.

triangle_strip 

Triangle strips.

triangle_fan 

Triangle fans.

triangles_adjacency 

Individual triangles with adjacency.

quads 

Quadrilaterals (represented as lines with adjacency).

tetrahedrons 

Tetrahedrons (represented as lines with adjacency).

patches 

Patches.

◆ vertex_attrib_kind

enum eagine::shapes::vertex_attrib_kind : std::uint16_t
strong

Shape vertex attribute kind enumeration.

Enumerator
object_id 

The object id attributes (typically unique integer).

position 

Vertex position.

normal 

Vertex normal vector.

tangential 

Vertex tangential vector.

bitangential 

Vertex bi-tangential vector.

pivot 

Shape pivot point.

pivot_pivot 

Pivot of vertex pivot point.

vertex_pivot 

Vertex pivot point.

box_coord 

Normalized coordinate within shape bounding box.

face_coord 

Generic face coordinate.

wrap_coord 

UV-texture wrapping coordinate.

color 

Vertex color value.

weight 

Generic vertex weight value.

occlusion 

Vertex (ambient) light occlusion value.

polygon_id 

Face polygon id value (multiple faces can belong to the same polygon)

material_id 

Face material id value.

Function Documentation

◆ draw_instanced_using_instructions() [1/2]

template<typename A >
void eagine::oglp::draw_instanced_using_instructions ( const basic_gl_api< A > &  api,
span< const shape_draw_operation ops,
const shape_draw_subset subs,
gl_types::sizei_type  inst_count 
)
noexcept

Takes a sequence of draw operations from a shape generator and draws them.

See also
shape_draw_operation
draw_using_instructions

◆ draw_instanced_using_instructions() [2/2]

template<typename A >
void eagine::oglp::draw_instanced_using_instructions ( const basic_gl_api< A > &  api,
span< const shape_draw_operation ops,
gl_types::sizei_type  inst_count 
)
noexcept

Takes a sequence of draw operations from a shape generator and draws them.

See also
shape_draw_operation
draw_using_instructions
Examples
application/024_overdraw/resources.cpp, and application/031_tessellation/resources.cpp.

◆ draw_using_instructions() [1/2]

◆ draw_using_instructions() [2/2]

template<typename A >
void eagine::oglp::draw_using_instructions ( const basic_gl_api< A > &  api,
span< const shape_draw_operation ops,
const shape_draw_subset subs 
)
noexcept

Takes a sequence of draw operations from a shape generator and draws them.

See also
shape_draw_operation
draw_instanced_using_instructions

◆ from_value_tree()

◆ get_attrib_bits()

template<std::size_t N>
static auto eagine::shapes::get_attrib_bits ( const vertex_attrib_variants< N > &  vaals) -> vertex_attrib_bits
inlinestaticnoexcept

Extracts vertex attribute kind bits from and vertex attribute variants array.

See also
vertex_attrib_bits

◆ operator+() [1/3]

template<std::size_t N>
static constexpr auto eagine::shapes::operator+ ( const vertex_attrib_variants< N > &  a,
vertex_attrib_variant  b 
) -> vertex_attrib_variants<N + 1>
staticconstexprnoexcept

Operator for concatenation of vertex attrib variants into an array.

See also
vertex_attrib_variant
vertex_attrib_variants

◆ operator+() [2/3]

static constexpr auto eagine::shapes::operator+ ( vertex_attrib_variant  a) -> vertex_attrib_variants<1>
staticconstexprnoexcept

Operator for creating of single element array of vertex attrib variant.

See also
vertex_attrib_variant
vertex_attrib_variants

Referenced by eagine::shapes::operator+().

◆ operator+() [3/3]

static constexpr auto eagine::shapes::operator+ ( vertex_attrib_variant  a,
vertex_attrib_variant  b 
) -> vertex_attrib_variants<2>
staticconstexprnoexcept

Operator for creating of two element array of vertex attrib variants.

See also
vertex_attrib_variant
vertex_attrib_variants

◆ translate() [1/3]

template<typename A >
auto eagine::oglp::translate ( const basic_gl_api< A > &  ,
shapes::attrib_data_type   
) -> data_type
noexcept

Translates from shape attribute data type to GL data type.

See also
shapes::attrib_data_type

◆ translate() [2/3]

template<typename A >
auto eagine::oglp::translate ( const basic_gl_api< A > &  ,
shapes::index_data_type   
) -> index_data_type
noexcept

Translates from shape index data type to GL data type.

See also
shapes::index_data_type

◆ translate() [3/3]

template<typename A >
auto eagine::oglp::translate ( const basic_gl_api< A > &  ,
shapes::primitive_type   
) -> primitive_type
noexcept

Translates from shape primitive type to GL primitive type.

See also
shapes::primitive_type

◆ type_size() [1/2]

template<typename A >
auto eagine::oglp::type_size ( const basic_gl_api< A > &  ,
shapes::attrib_data_type   
) -> span_size_t
noexcept

Returns the byte size of a shape attribute data type.

See also
shapes::attrib_data_type

◆ type_size() [2/2]

template<typename A >
auto eagine::oglp::type_size ( const basic_gl_api< A > &  ,
shapes::index_data_type   
) -> span_size_t
noexcept

Returns the byte size of a shape index data type.

See also
shapes::index_data_type

◆ unit_cube()

◆ unit_icosahedron()

◆ unit_round_cube()

static auto eagine::shapes::unit_round_cube ( vertex_attrib_bits  attr_bits,
int  divisions 
)
inlinestatic

◆ unit_screen()

static auto eagine::shapes::unit_screen ( vertex_attrib_bits  attr_bits)
inlinestatic

◆ unit_sphere() [1/2]

static auto eagine::shapes::unit_sphere ( vertex_attrib_bits  attr_bits)
inlinestatic

◆ unit_sphere() [2/2]

static auto eagine::shapes::unit_sphere ( vertex_attrib_bits  attr_bits,
valid_if_greater_than< int, 2 >  rings,
valid_if_greater_than< int, 3 >  sections 
)
inlinestatic

◆ unit_torus()

static auto eagine::shapes::unit_torus ( vertex_attrib_bits  attr_bits)
inlinestatic

◆ unit_twisted_torus() [1/2]

static auto eagine::shapes::unit_twisted_torus ( vertex_attrib_bits  attr_bits)
inlinestatic

◆ unit_twisted_torus() [2/2]

static auto eagine::shapes::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 
)
inlinestatic

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