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

eagine::shapes::value_tree_loader Class Reference

Loader that fetches shape data from a value tree (JSON, YAML, etc.) More...

#include <eagine/shapes/value_tree.hpp>

Public Member Functions

auto vertex_count () -> span_size_t override
 Returns the shaped vertex count.
 
auto attribute_variants (vertex_attrib_kind) -> span_size_t override
 Returns the count of shape attribute variants.
 
auto variant_name (vertex_attrib_variant) -> string_view override
 Returns the name of the specified attribute variant.
 
auto values_per_vertex (vertex_attrib_variant) -> span_size_t override
 Returns the number of values per vertex for the specified variant.
 
auto attrib_type (vertex_attrib_variant vav) -> attrib_data_type override
 Returns the attribute data type for the specified variant.
 
auto is_attrib_normalized (vertex_attrib_variant) -> bool override
 Indicates if the specified variant attribute values should be normalized.
 
void attrib_values (vertex_attrib_variant, span< byte >) override
 Fetches the vertex attribute data for the specified variant as bytes.
 
void attrib_values (vertex_attrib_variant, span< std::int16_t >) override
 Fetches the vertex attribute data for the specified variant as integers.
 
void attrib_values (vertex_attrib_variant, span< std::int32_t >) override
 Fetches the vertex attribute data for the specified variant as integers.
 
void attrib_values (vertex_attrib_variant, span< std::uint16_t >) override
 Fetches the vertex attribute data for the specified variant as integers.
 
void attrib_values (vertex_attrib_variant, span< std::uint32_t >) override
 Fetches the vertex attribute data for the specified variant as integers.
 
void attrib_values (vertex_attrib_variant, span< float >) override
 Fetches the vertex attribute data for the specified variant as floats.
 
auto index_type (drawing_variant) -> index_data_type override
 Returns the index data type for the specified draw variant.
 
auto index_count (drawing_variant) -> span_size_t override
 Returns the index count for the specified drawing variant.
 
void indices (drawing_variant, span< std::uint16_t > dest) override
 Fetches the index data for the specified drawing variant.
 
void indices (drawing_variant, span< std::uint32_t > dest) override
 Fetches the index data for the specified drawing variant.
 
auto operation_count (drawing_variant) -> span_size_t override
 Returns the number of drawing instructions for the specified variant.
 
void instructions (drawing_variant, span< draw_operation > ops) override
 Fetches the drawing operations for the specified drawing variant.
 
- Public Member Functions inherited from eagine::main_ctx_object
 main_ctx_object (identifier obj_id, main_ctx_parent parent) noexcept
 Initialization from object id and parent.
 
auto process_instance_id () const noexcept -> process_instance_id_t
 Returns the process id.
 
auto main_context () const noexcept -> main_ctx &
 Returns a reference to the main context singleton.
 
auto app_config () const noexcept -> application_config &
 Returns a reference to the application config object.
 
auto as_parent () noexcept -> main_ctx_object_parent_info
 Returns this as main_ctx_object_parent_info.
 
template<typename T >
auto cfg_init (string_view key, T initial, string_view tag={}) -> T
 Reads and returns the configuration value identified by key.
 
template<typename Extractable , typename T >
auto cfg_extr (string_view key, T initial, string_view tag={}, type_identity< Extractable >={}) -> T
 Reads and returns the configuration value identified by key.
 
- Public Member Functions inherited from eagine::named_logging_object< main_ctx_log_backend_getter >
 named_logging_object (identifier id, main_ctx_log_backend_getter backend_getter) noexcept
 Constructor from identifier and backend_getter object. More...
 
 named_logging_object (identifier id, const named_logging_object &parent) noexcept
 Constructor from logger id and parent logging object.
 
 named_logging_object () noexcept=default
 Construct logging object without backend.
 
 named_logging_object (named_logging_object &&temp) noexcept
 Move constructor.
 
 named_logging_object (const named_logging_object &that) noexcept
 Copy constructor.
 
auto operator= (named_logging_object &&) noexcept -> named_logging_object &=default
 Move assignment operator.
 
auto operator= (const named_logging_object &) -> named_logging_object &=default
 Copy assignment operator.
 
constexpr auto object_id () const noexcept
 Returns the identifier of this logging object.
 
void object_description (string_view display_name, string_view description) noexcept
 Sets the human-readable name and description of this object.
 
auto log_fatal (string_view format) noexcept
 Create a log message entry for fatal error, with specified format. More...
 
auto log_error (string_view format) noexcept
 Create a log message entry for error, with specified format. More...
 
auto log_warning (string_view format) noexcept
 Create a log message entry for warning, with specified format. More...
 
auto log_info (string_view format) noexcept
 Create a log message entry for information, with specified format. More...
 
auto log_stat (string_view format) noexcept
 Create a log message entry for statistic, with specified format. More...
 
auto log_debug (string_view format) noexcept
 Create a log message entry for debugging, with specified format. More...
 
auto log_trace (string_view format) noexcept
 Create a log message entry for tracing, with specified format. More...
 
auto log_backtrace (string_view format) noexcept
 Create a log message entry for backtracing, with specified format. More...
 
auto log_debug_stream () noexcept
 Returns a log entry stream for debug messages. More...
 
auto log_error_stream () noexcept
 Returns a log entry stream for error messages. More...
 
auto log_chart_sample (identifier series, float value) noexcept -> named_logging_object &
 Stores a new value in the specified chart data series.
 
auto log_chart_sample (identifier series, const tagged_quantity< T, U > &qty) noexcept -> std::enable_if_t< std::is_convertible_v< T, float >, named_logging_object & >
 Stores a new value in the specified chart data series.
 
auto log_chart_sample (identifier series, const valid_if< T, P > &opt_value) noexcept -> named_logging_object &
 Stores a new value in the specified chart data series.
 
- Public Member Functions inherited from eagine::basic_logger< main_ctx_log_backend_getter >
auto backend () noexcept
 Returns a pointer to the backend of this logger object.
 
auto instance_id () const noexcept -> logger_instance_id
 Returns the unique id of this logger instance.
 
- Public Member Functions inherited from eagine::shapes::generator_base
auto attrib_bits () noexcept -> vertex_attrib_bits final
 Returns the set of vertex attributes supported by this generator.
 
auto enable (generator_capability cap, bool value) noexcept -> bool final
 Enables or disables the specified generator capability.
 
auto is_enabled (generator_capability cap) noexcept -> bool final
 Indicates if the specified generator capability is enabled.
 
auto draw_variant_count () -> span_size_t override
 Returns the count of possible shape draw variants.
 
void indices (drawing_variant, span< std::uint8_t > dest) override
 Fetches the index data for the specified drawing variant.
 
- Public Member Functions inherited from eagine::shapes::generator
auto has (vertex_attrib_kind attrib) noexcept
 Tests if the specified attribute is supported by this generator.
 
auto disable (generator_capability cap) noexcept
 Disables the specified generator capability.
 
auto strips_allowed () noexcept -> bool
 Indicates if element strips are enabled.
 
auto fans_allowed () noexcept -> bool
 Indicates if element fans are enabled.
 
auto primitive_restart () noexcept -> bool
 Indicates if primitive restart is enabled.
 
auto find_variant (vertex_attrib_kind attrib, string_view name) -> vertex_attrib_variant
 Finds attribute variant by kind and name.
 
auto value_count (vertex_attrib_variant vav) -> span_size_t
 Returns the total number of values for the specified attribute variant.
 
auto draw_variant (span_size_t index) -> drawing_variant
 Returns the identifier of the drawing variant at the specified index.
 
auto index_type () -> index_data_type
 Returns the index data type for the default draw variant.
 
auto index_count ()
 Returns the index count for the default drawing variant.
 
void indices (span< std::uint8_t > dest)
 Fetches the index data for the default drawing variant.
 
void indices (span< std::uint16_t > dest)
 Fetches the index data for the default drawing variant.
 
void indices (span< std::uint32_t > dest)
 Fetches the index data for the default drawing variant.
 
auto operation_count ()
 Returns the number of drawing instructions for the default variant.
 
void instructions (span< draw_operation > dest)
 Fetches the drawing operations for the default drawing variant.
 
virtual auto bounding_sphere () -> math::sphere< float, true >
 Returns the bounding sphere for the generated shape.
 
virtual void ray_intersections (drawing_variant, span< const math::line< float, true >> rays, span< optionally_valid< float >> intersections)
 Calculates the intersections of the shape geometry with a ray.
 
void ray_intersections (span< const math::line< float, true >> rays, span< optionally_valid< float >> intersections)
 Calculates the intersections of the shape geometry with a ray.
 
auto ray_intersection (drawing_variant var, const math::line< float, true > &ray) -> optionally_valid< float >
 Returns the parameter for the nearest intersection with a ray.
 
auto ray_intersection (const math::line< float, true > &ray) -> optionally_valid< float >
 Returns the parameter for the nearest intersection with a ray.
 
- Public Member Functions inherited from eagine::interface< generator >
constexpr interface (const interface &)=delete
 Not copyable.
 
auto operator= (interface &&)=delete
 Not move assignable.
 
auto operator= (const interface &)=delete
 Not copy assignable.
 

Additional Inherited Members

- Public Types inherited from eagine::named_logging_object< main_ctx_log_backend_getter >
using entry_type = std::conditional_t< is_log_level_enabled_v< severity >, log_entry, no_log_entry >
 The entry type for the specified log_event_severity. More...
 
- Public Types inherited from eagine::basic_logger< main_ctx_log_backend_getter >
using entry_type = std::conditional_t< is_log_level_enabled_v< severity >, log_entry, no_log_entry >
 The entry type for the specified log_event_severity. More...
 
- Protected Member Functions inherited from eagine::interface< generator >
constexpr interface () noexcept=default
 Default constructible by derived.
 
constexpr interface (interface &&) noexcept=default
 Move constructible by derived.
 

Detailed Description

Loader that fetches shape data from a value tree (JSON, YAML, etc.)

See also
from_value_tree
valtree::compound
valtree::attribute
valtree::from_json_text
valtree::from_yaml_text

The documentation for this class was generated from the following file:

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