![]() |
Lysa
0.0
Lysa 3D Engine
|
A 2D shape loaded from an SVG document
Inheritance diagram for SVG:Classes | |
| struct | Segment |
Public Member Functions | |
| SVG (const std::string &document, SVGBounds bounds=SVGBounds::DOCUMENT, float strokeWidth=0.0f, float tolerance=DEFAULT_TOLERANCE) | |
| const auto & | getSegments () const |
| auto | getFillRule () const |
| auto | getStrokeWidth () const |
| auto | getAspectRatio () const |
| auto | isEmpty () const |
Public Member Functions inherited from UnmanagedResource | |
| UnmanagedResource () | |
| UnmanagedResource (const Resource &other) | |
Public Member Functions inherited from Resource | |
| bool | operator== (const Resource &other) const |
| Resource () = default | |
| Resource (const unique_id id) | |
| virtual | ~Resource () = default |
Static Public Member Functions | |
| static SVG | load (const std::string &uri, SVGBounds bounds=SVGBounds::DOCUMENT, float strokeWidth=0.0f, float tolerance=DEFAULT_TOLERANCE) |
Static Public Attributes | |
| static constexpr float | DEFAULT_TOLERANCE {0.002f} |
| static constexpr float | STROKE_WIDTH_GRID {24.0f} |
| static constexpr float | MIN_STROKE_WIDTH {0.5f} |
| static constexpr float | MAX_STROKE_WIDTH {5.0f} |
| static constexpr float | DEFAULT_STROKE_WIDTH {2.5f} |
Additional Inherited Members | |
Public Attributes inherited from Resource | |
| unique_id | id {INVALID_ID} |
|
explicit |
Parses and flattens an SVG document already in memory.
| document | Content of the .svg document |
| bounds | Box the geometry is fitted into |
| strokeWidth | Width replacing the stroke-width of a stroked document, |
| tolerance | Maximum distance between a curve and the segments approximating it, as a fraction of the shape size |
|
inline |
Returns the width/height ratio of the box the geometry was fitted into
|
inline |
Returns the rule used to decide if a point is inside the shape
|
inline |
Returns the flattened geometry in the normalized [0.0, 1.0] shape space
|
inline |
Returns the width of the stroke
|
inline |
Returns true when the document contains no usable geometry
|
static |
Loads and flattens an SVG document from the virtual file system.
| uri | URI of the .svg document |
| bounds | Box the geometry is fitted into |
| strokeWidth | Width replacing the stroke-width of a stroked document, |
| tolerance | Maximum distance between a curve and the segments approximating it, as a fraction of the shape size |
|
staticconstexpr |
Stroke width of the usual icon sets
|
staticconstexpr |
Default flattening tolerance as a fraction of the shape size
|
staticconstexpr |
Thickest stroke width an override can ask for
|
staticconstexpr |
Thinnest stroke width an override can ask for
|
staticconstexpr |
Grid the stroke width overrides are expressed on