![]() |
ThorVG v1.1
|
The Accessor is a utility class to debug the Scene structure by traversing the scene-tree. More...
#include <thorvg.h>
Public Member Functions | |
| Result | set (Paint *paint, std::function< bool(const Paint *paint, void *data)> func, void *data) noexcept |
| Set the access function for traversing the Picture scene tree nodes. | |
| const char * | name (uint32_t id) noexcept |
| Retrieve the original name string from a given unique ID. | |
Static Public Member Functions | |
| static uint32_t | id (const char *name) noexcept |
| Generate a unique ID (hash key) from a given name. | |
| static Accessor * | gen () noexcept |
| Creates a new Accessor object. | |
The Accessor is a utility class to debug the Scene structure by traversing the scene-tree.
The Accessor helps you search specific nodes to read the property information, figure out the structure of the scene tree and its size.
|
staticnoexcept |
|
staticnoexcept |
Generate a unique ID (hash key) from a given name.
This function computes a unique identifier value based on the provided string. You can use this to assign a unique ID to the Paint object.
| [in] | name | The input string to generate the unique identifier from. |
|
noexcept |
Retrieve the original name string from a given unique ID.
Returns the name associated with the specified identifier.
This method is only valid when Picture::accessible is set to true for the Picture associated with the given paint in Accessor::set() Otherwise, the name information may not be available.
| [in] | id | The unique identifier. |
nullptr if not found or unavailable.
|
noexcept |
Set the access function for traversing the Picture scene tree nodes.
| [in] | paint | The paint node to traverse the internal scene-tree. |
| [in] | func | The callback function calling for every paint nodes of the Picture. |
| [in] | data | Data passed to the func as its argument. |