#include <graphdescription.h>
Provides functions and constants to read and write node graphs from and into the graph description format.
A graph description is JSON-like format to describe complete or partial node graphs for arbitrary node spaces. Graph descriptions can describe node types and their attributes over their labels in a natural language, absolute and lazy node paths, and queries to select entities in a graph by their values. Graph descriptions are primarily intended to be written and read from the Python API which binds to this class.
Public Types | |
enum class | PARSE_FLAGS { NONE , VERBOSE_ATTRIBUTES , VERBOSE_REFERENCES , ALWAYS_VALIDATE_PATHS } |
enum class | QUERY_FLAGS { NONE , MATCH_FIRST , MATCH_ALL , MATCH_MAYBE , SELECT_THIS } |
Public Member Functions | |
enum maxon::nodes::GraphDescription::PARSE_FLAGS | MAXON_ENUM_FLAGS_CLASS (PARSE_FLAGS) |
enum maxon::nodes::GraphDescription::QUERY_FLAGS | MAXON_ENUM_FLAGS_CLASS (QUERY_FLAGS) |
Private Member Functions | |
MAXON_INTERFACE_NONVIRTUAL (GraphDescription, MAXON_REFERENCE_STATIC, "net.maxon.node.interface.graphdescription") | |
|
strong |
Expresses options when parsing graph descriptions.
|
strong |
Expresses options when querying a graph for nodes.
Enumerator | |
---|---|
NONE | Marks a query as having no special flags. |
MATCH_FIRST | Marks a query to pick the first match when ambiguous. Dominant over MATCH_ALL. When no match flag is set, a query must be unambiguous. |
MATCH_ALL | Marks a query to pick all matches when ambiguous. Suppressed by MATCH_FIRST. When no match flag is set, a query must be unambiguous. |
MATCH_MAYBE | Marks a query to match lazily, instead of raising an error, a non-matching sub-graph will simply not be executed. |
SELECT_THIS | Marks the to be selected element in a query. When a query does not contain a selection marker, the out most element will be selected. |
|
private |
enum maxon::nodes::GraphDescription::PARSE_FLAGS MAXON_ENUM_FLAGS_CLASS | ( | PARSE_FLAGS | ) |
enum maxon::nodes::GraphDescription::QUERY_FLAGS MAXON_ENUM_FLAGS_CLASS | ( | QUERY_FLAGS | ) |
|
static |
Returns the key for a description field in a description. Alias for "$description".
|
static |
Returns the key for a flags field in a description. Alias for "$flags".
|
static |
Returns the key for a node ID field in a description. Alias for "$id".
|
static |
Returns the key for a language ID field in a description. Alias for "$language".
|
static |
Returns the key for a query field in a description. Alias for "$query".
|
static |
Returns the key for a query mode field in a description. Alias for "$qmode".
|
static |
Returns the key for a node space ID field in a description. Alias for "$space".
|
static |
Returns the key for a node type field in a description. Alias for "$type".
|
static |
Returns the key for a node command field in a description. Alias for "$commands".
|
static |
Returns the command key for grouping a node. Alias for "$cmd_group".
|
static |
Returns the command key for grouping a node. Alias for "$cmd_ungroup".
|
static |
Returns the command key for a removing a node. Alias for "$cmd_remove".
|
static |
Returns the command key for setting a node to its defaults. Alias for "$cmd_default".
|
static |
Returns the command key for removing all wires from a node. Alias for "$cmd_disconnect".
|
static |
Returns the command key for changing the number of varidadic children of the variadic ports of a node. Alias for "$cmd_count_ports".
|
static |
Returns the command key for showing the ports of a node. Alias for "$cmd_show_ports".
|
static |
Returns the command key for hiding the ports of a node. Alias for "$cmd_hide_ports".
|
static |
Not yet implemented.
|
static |
Not yet implemented.
|
static |
Applies the given graph #description to the given nodes #graph.
[in] | graph | The nodes graph to apply the #description to. |
[in] | description | The graph description to apply to #graph. |
|
static |
GetGraph
.
|
static |
Returns the nodes graph for the given scene element and #nodeSpaceId.
element can be a BaseDocument
(for the document wide scene nodes graph), a BaseObject
(for capsules), or a material (for material graphs), or nullptr (to create a material in the active document). When the passed element does not yet have a graph in the requested node space, it will be created.
[in] | element | The scene element to get the graph for. Can be nullptr to create a material in the active document. |
[in] | nodeSpaceId | The node space to retrieve the graph for. When the empty ID is passed, it will default to the active node space for materials and the neutron node space for everything else. |
[in] | createEmpty | When #true, new graphs will be created as an empty graph, when #false the default graph will be created. |
[in] | name | The name to give the material which is created when element is the nullptr . |
|
static |
Returns all material graphs in the given scene doc which are in the given #nodeSpaceId.
[in] | doc | The document to get the material graphs from. |
[in] | nodeSpaceId | The node space to retrieve the graphs for. Cannot be the empty ID. |