#include "pogosim.h"
#include "geometry.h"
#include <yaml-cpp/yaml.h>
#include <string>
#include <stdexcept>
#include <sstream>
#include <vector>
#include <utility>
#include <type_traits>
Go to the source code of this file.
|
| std::string | polygons_to_yaml (const arena_polygons_t &polygons) |
| | Convert an arena_polygons_t structure into a compact YAML string.
|
| template<typename T> |
| std::enable_if< std::is_arithmetic< T >::value, T >::type | detail::numeric_fallback (const YAML::Node &n, const T &default_value) |
| | compile-time branch for arithmetic targets
|
| template<typename T> |
| std::enable_if<!std::is_arithmetic< T >::value, T >::type | detail::numeric_fallback (const YAML::Node &, const T &default_value) |
| | branch for non-arithmetic targets – just forward the default
|
◆ polygons_to_yaml()
Convert an arena_polygons_t structure into a compact YAML string.
- Parameters
-
| polygons | Polygons to serialise (outer vector = polygons, inner vector = ordered vertices). |
- Returns
- A UTF-8 YAML document (no trailing newline) suitable for Arrow metadata.
- Note
- The generated YAML uses a two-level nested sequence:
- - x: 0.0
y: 0.0
- x: 1.0
y: 0.0
- x: 1.0
y: 1.0
- x: 0.0
y: 1.0
- - x: 2.0
y: 2.0
...