Abstract base of every node in a VectorScene. More...
#include <scene_node.hpp>
Public Member Functions | |
| SceneNode (SceneNodeKind kind) | |
| virtual | ~SceneNode ()=default |
| SceneNode (const SceneNode &)=delete | |
| SceneNode & | operator= (const SceneNode &)=delete |
| SceneNodeKind | kind () const |
| const std::string & | id () const |
| void | set_id (std::string v) |
| bool | visible () const |
| void | set_visible (bool v) |
| float | opacity () const |
| void | set_opacity (float a) |
| const SceneTransform & | transform () const |
| void | set_transform (const SceneTransform &t) |
| SceneGroup * | parent () const |
| virtual SceneRect | local_bounds () const =0 |
| Local-coordinate bounding box (pre-transform, pre-opacity). | |
| SceneRect | transformed_local_bounds () const |
| Bounds after the node's own transform — used for parent group unions. | |
| virtual void | paint_geometry (Canvas &canvas) const =0 |
| Paint this node (and its sub-tree) into canvas. | |
| bool | dirty () const |
| void | mark_dirty () |
| Mark this node and (recursively) every ancestor dirty. | |
| void | mark_clean (const SceneRect &painted_scene_bounds) |
| Called by the scene walker after a full paint. | |
| const SceneRect & | last_painted_bounds () const |
| The scene-space rect this node occupied at the last paint. | |
Friends | |
| class | SceneGroup |
Abstract base of every node in a VectorScene.
Mutation contract: any setter that changes the node's visual state (transform, opacity, paint, geometry) MUST call mark_dirty() before returning. The walker reads dirty() + last_painted_bounds() to compute the union of "what needs re-painting" on the next frame, then calls clear_dirty() after the paint is recorded.
|
inlineexplicit |
|
virtualdefault |
|
delete |
|
inline |
|
inline |
|
inline |
|
inline |
The scene-space rect this node occupied at the last paint.
Always united with the post-mutation bounds to derive the "what needs repainting" rect — this is the whole point of the retained scene graph: small mutations → small repaint rects.
|
pure virtual |
Local-coordinate bounding box (pre-transform, pre-opacity).
Subclasses MUST compute this from current geometry.
Implemented in pulp::canvas::SceneGroup, pulp::canvas::SceneImage, pulp::canvas::ScenePath, pulp::canvas::SceneShape, and pulp::canvas::SceneText.
|
inline |
Called by the scene walker after a full paint.
Captures the bounding box that was painted (in scene coordinates) so the next mutation knows what to invalidate.
| void pulp::canvas::SceneNode::mark_dirty | ( | ) |
Mark this node and (recursively) every ancestor dirty.
Returning the current node's last_painted_bounds() union with the new transformed_local_bounds() lets VectorScene::take_dirty_rect() report the exact rect that needs to be re-painted.
|
inline |
|
pure virtual |
Paint this node (and its sub-tree) into canvas.
The walker calls save() / restore() around this call, applies the composed CTM, and pushes opacity if opacity_ < 1.0. Implementations therefore emit geometry/state only — they MUST NOT touch save/restore.
Implemented in pulp::canvas::SceneGroup, pulp::canvas::SceneImage, pulp::canvas::ScenePath, pulp::canvas::SceneShape, and pulp::canvas::SceneText.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Bounds after the node's own transform — used for parent group unions.
|
inline |
|
friend |