Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
BoundsGeometry.h File Reference
#include <map>
#include <memory>
#include <optional>
#include <span>
#include <unordered_map>
#include <utility>
#include <variant>
#include <vector>
#include "donner/base/Box.h"
#include "donner/base/EcsRegistry.h"
#include "donner/base/Path.h"
#include "donner/base/Transform.h"
Include dependency graph for BoundsGeometry.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::svg::components::BoundsGeometryPiece
 One piece of an element's geometry and the transform that places it in a measurement space. More...
class  donner::svg::components::BoundsGeometryPaths
 Path copies that collected geometry holds, shared between pieces that hold the same path, such as the pieces of every external <use> of one fragment. More...
struct  donner::svg::components::BoundsGeometryCollector
 Where collected geometry goes: its pieces, the shared path copies they hold, and the allowance those copies are charged to. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
namespace  donner::svg
 Donner SVG library, which can load, manipulate and render SVG files.
namespace  donner::svg::components
 Contains the implementation of the Donner ECS,.

Functions

std::optional< Box2d > donner::svg::components::BoundGeometryPieces (std::span< const BoundsGeometryPiece > pieces, const Transform2d &targetFromSpace)
 Bounds of pieces after targetFromSpace maps their measurement space into a target space, or nothing when there are no pieces or a bound is not finite.
bool donner::svg::components::HasIdenticalPathData (const Path &first, const Path &second)
 Whether first and second hold exactly the same commands and points.

Class Documentation

◆ donner::svg::components::BoundsGeometryPiece

struct donner::svg::components::BoundsGeometryPiece

One piece of an element's geometry and the transform that places it in a measurement space.

A path is bounded after a later transform is composed with spaceFromPiece, so its bounds stay tight however the transforms combine; a box, such as an image's or a text's, is mapped as a box.

Class Members
variant< shared_ptr< const Path >, Box2d > geometry
Transform2d spaceFromPiece Transform from the piece into the measurement space. The piece's path, shared with other pieces that hold the same path, or its box.

◆ donner::svg::components::BoundsGeometryCollector

struct donner::svg::components::BoundsGeometryCollector

Where collected geometry goes: its pieces, the shared path copies they hold, and the allowance those copies are charged to.

Class Members
StyleResourceBudget & budget Charged for new path copies.
BoundsGeometryPaths & paths Shares the pieces' path copies.
vector< BoundsGeometryPiece > & pieces Receives the pieces.