Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::Path::MeasuredPath Class Reference

Precomputed arc-length index for repeated path sampling. More...

#include "donner/base/Path.h"

Public Types

enum class  BoundarySide : uint8_t {
  Incoming ,
  Outgoing
}
 Side of a connected segment boundary used for its tangent and normal. More...

Public Member Functions

double pathLength () const
 Return the total measured arc length, or infinity when the measurement is not valid.
PointOnPath pointAtArcLength (double distance, BoundarySide boundarySide=BoundarySide::Incoming) const
 Sample this measured path at the given arc length.
std::vector< double > segmentEndDistances () const
 Return an owning list of cumulative distances at the drawable segment endpoints.
std::size_t segmentCount () const
 Number of drawable segments retained by this index.
bool valid () const
 Return true when measurement completed within its numeric and work limits.
std::size_t measurementWorkUnits () const
 Number of command visits and recursive subdivisions used to build this index.
std::optional< std::size_t > retainedBytes () const
 Exact object and vector-capacity bytes retained by this index, or nullopt on overflow.

Friends

class Path

Detailed Description

Precomputed arc-length index for repeated path sampling.

Construction is linear in the number of path commands. Sampling uses a binary search over drawable segments, so text-on-path does not rescan the complete source path once per glyph.

Member Enumeration Documentation

◆ BoundarySide

enum class donner::Path::MeasuredPath::BoundarySide : uint8_t
strong

Side of a connected segment boundary used for its tangent and normal.

Enumerator
Incoming 

Sample the segment ending at the boundary.

Outgoing 

Sample the connected segment beginning at the boundary.


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