#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 } |
enum class | QUERY_FLAGS { NONE , MATCH_FIRST , MATCH_ALL , 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) |
Static Public Member Functions | |
static MAXON_METHOD String | GetDescriptionKey () |
static MAXON_METHOD String | GetFlagsKey () |
static MAXON_METHOD String | GetIdKey () |
static MAXON_METHOD String | GetLanguageKey () |
static MAXON_METHOD String | GetQueryKey () |
static MAXON_METHOD String | GetQueryModeKey () |
static MAXON_METHOD String | GetSpaceKey () |
static MAXON_METHOD String | GetTypeKey () |
static MAXON_METHOD Result< DataDictionary > | GenerateDescription (NodesGraphModelRef &graph, DataDictionary description) |
static MAXON_METHOD Result< DataDictionary > | TranslateDescription (DataDictionary description) |
static MAXON_METHOD Result< DataDictionary > | ApplyDescription (NodesGraphModelRef &graph, DataDictionary description) |
static MAXON_METHOD Result< nodes::NodesGraphModelRef > | CreateGraph (BaseList2D *element, Id &nodeSpaceId, const Bool &createEmpty, const String &name) |
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. |
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 |
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 |
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 . |