|
| | Canvas ()=default |
| | Creates an empty canvas with default style and viewport settings.
|
| Canvas & | scale (double factor) |
| | Sets the global zoom factor used during SVG export.
|
| Canvas & | width (double widthPixels) |
| | Sets the exported SVG width in pixels.
|
| Canvas & | height (double heightPixels) |
| | Sets the exported SVG height in pixels.
|
| Canvas & | size (double widthPixels, double heightPixels) |
| | Sets the exported SVG size in pixels.
|
| Canvas & | borders (bool enabled=true) |
| | Enables or disables the optional border around the SVG.
|
| template<class PointType> |
| Canvas & | view (const Rectangle< PointType > &window) |
| | Fits the export to an explicit window of the plane instead of to the inserted geometry.
|
| Canvas & | margin (double marginPixels) |
| | Sets the margin reserved around the fitted drawing.
|
| void | writeSVG (const std::string &path) const |
| | Serializes the canvas to an SVG file.
|
| std::string | toSVG () const |
| | Serializes the canvas contents to an SVG string.
|
| void | writePDF (const std::string &path) const |
| | Serializes the canvas to a PDF file.
|
| std::string | toPDF () const |
| | Serializes the canvas contents to a PDF byte string.
|
| void | writeIPE (const std::string &path) const |
| | Serializes the canvas to an Ipe XML file (.ipe).
|
| std::string | toIPE () const |
| | Serializes the canvas contents to an Ipe XML string.
|
| Canvas & | operator<< (const CanvasCommand &command) |
| | Applies a style command to the current drawing style.
|
| template<class Number, class Label> |
| Canvas & | operator<< (const Point< Number, Label > &point) |
| | Appends a point using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const Segment< PointType, Label > &segment) |
| | Appends a segment using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const OrientedSegment< PointType, Label > &segment) |
| | Appends an oriented segment using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const Line< PointType, Label > &line) |
| | Appends a line using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const OrientedLine< PointType, Label > &line) |
| | Appends an oriented line using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const Ray< PointType, Label > &ray) |
| | Appends a ray using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const Halfplane< PointType, Label > &halfplane) |
| | Appends a half-plane using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const Rectangle< PointType, Label > &rectangle) |
| | Appends a rectangle using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const Triangle< PointType, Label > &triangle) |
| | Appends a triangle using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const Convex< PointType, Label > &convex) |
| | Appends a convex polygon using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const Disk< PointType, Label > &disk) |
| | Appends a disk using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const Polygon< PointType, Label > &polygon) |
| | Appends a (possibly non-convex) polygon using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const PolygonWithHoles< PointType, Label > ®ion) |
| | Appends a polygon with holes (one subpath per ring) using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const PolygonSet< PointType, Label > &set) |
| | Appends a polygon set (one subpath per ring of every component) using the current captured style.
|
| template<class PointType, class Label, class Storage> |
| Canvas & | operator<< (const MonotoneChain< PointType, Label, Storage > &chain) |
| | Appends an x-monotone chain (an SVG polyline) using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const Polyline< PointType, Label > &polyline) |
| | Appends a polyline (an open, possibly self-intersecting chain) using the current captured style.
|
| template<class PointType, class Label> |
| Canvas & | operator<< (const HalfplaneIntersection< PointType, Label > ®ion) |
| | Appends a half-plane intersection (clipped to the viewport, like a half-plane) using the current captured style.
|
| template<class PointType> |
| Canvas & | operator<< (const EmptyShape< PointType > &) |
| | Appends nothing: the empty shape has no geometry to draw.
|
| template<class PointType> |
| Canvas & | operator<< (const Shape< PointType > &shape) |
| | Appends the currently stored alternative of a runtime shape.
|
template<class... Types>
requires (requires(Canvas& canvas, const Types& value) { canvas << value; } && ...) |
| Canvas & | operator<< (const std::variant< Types... > &objects) |
| | Appends the currently stored alternative of a variant.
|
template<class Type>
requires requires(Canvas& canvas, const Type& value) { canvas << value; } |
| Canvas & | operator<< (const std::optional< Type > &object) |
| | Appends an optional object when it contains one.
|
template<std::ranges::input_range Range>
requires std::ranges::input_range<const Range> && requires( Canvas& canvas, std::ranges::range_reference_t<const Range> object
) { canvas << object; } |
| Canvas & | operator<< (const Range &objects) |
| | Appends every object in an input range, in iteration order.
|
Stores drawable objects and exports them as an SVG image.
The canvas keeps a current SVG style. Each inserted primitive captures the style that was active at insertion time.