#include <nodedescription_asset.h>
A description asset allows easy reuse of partial or complete descriptions. Asset can be used to create new nodes or to add some component to existing nodes and groups.
Static Public Member Functions | |
static MAXON_METHOD Result< NodeDescriptionAsset > | Create () |
Private Member Functions | |
MAXON_INTERFACE (NodeDescriptionAssetInterface, MAXON_REFERENCE_COPY_ON_WRITE, "net.maxon.node.interface.asset.nodedescription") | |
|
private |
MAXON_ATTRIBUTE_CLASS | ( | Bool | , |
OverwriteAllAttributes | , | ||
"net.maxon.node.assettype.context.overwriteall" | , | ||
RESOURCE_DEFAULT(false) | |||
) |
Allows to overwrite node description attributes instead of creating unique port entries. Set to true to overwrite all attributes, i.e. the same asset dropped multiple times on a node will create ports on first drop, subsequent drops would update the description so it matches the dropped description. Set to false to allow same asset dropped multiple times on a node to create new unique ports each time. Port identifiers will be appended with an increasing number (1, 2, 3, ....). This only applies to ports. Include commands, groups and separators will only get updated, not created with unique identifiers. False by default.
MAXON_ATTRIBUTE_CLASS | ( | Id | , |
DefaultPortClassification | , | ||
"net.maxon.node.assettype.context.defaultportclass" | |||
) |
Defines the default classification to assign to an attribute which has DESCRIPTION::DATA::BASE::CLASSIFICATION not set. Providing this allow to use a basic NodeDescriptionAsset both as input or output.
|
static |
Creates a new NodeDescriptionAsset. Asset will be empty and should be stored in a repository with AssetRepositoryInterface::StoreAsset to save it's content.
MAXON_METHOD Result<void> Apply | ( | const GraphNode & | node, |
const DataDictionary & | context | ||
) |
Uses the NodeDescriptionAsset's definition to update the the target node with any additional entries or changes it contains.
[in] | node | The group node where to apply the description changes. |
[in] | context | Additional arguments for the node definition update. |
MAXON_METHOD Result<void> MergeDescriptions | ( | const DataDescriptionDefinitionWithUIAndLanguageStrings & | desc | ) |
Merges the given DataDescriptionDefinition desc with the current asset's content.
[in] | desc | The descriptions to add or merge to the current asset. |
MAXON_METHOD Result<DataDescriptionDefinition> GetDataDescriptionDefinition | ( | const Id & | category | ) | const |
Reads the description from the requested category.
[in] | category | Either DATADESCRIPTION_CATEGORY_DATA, DATADESCRIPTION_CATEGORY_UI or a language identifier. |
MAXON_METHOD Result<void> SetDataDescriptionDefinition | ( | const Id & | category, |
const DataDescriptionDefinition & | desc | ||
) |
Writes the description for the requested category. Asset should be stored to repository for changes to be permanent.
[in] | category | Either DATADESCRIPTION_CATEGORY_DATA, DATADESCRIPTION_CATEGORY_UI or a language identifier. |
[in] | desc | The new description (no merge will occur). |
MAXON_METHOD Result<const DataDescriptionDefinitionWithUIAndLanguageStrings&> GetCompleteDescription | ( | ) | const |
Reads all description categories.
MAXON_METHOD Result<void> SetCompleteDescription | ( | const DataDescriptionDefinitionWithUIAndLanguageStrings & | desc | ) |
Writes the all description categories. Asset should be stored to repository for changes to be permanent.
[in] | desc | The new description (no merge will occur). |
MAXON_METHOD Result<DataDescriptionDefinitionWithUIAndLanguageStrings> CreateFinalDefinition | ( | const DataDescriptionDefinitionWithUIAndLanguageStrings & | compareDefinition, |
const DataDictionary & | context | ||
) |
Uses the NodeDescriptionAsset's definition to create a new one ready to be used in the given context. Attributes could be skipped, removed or receive a new identifier based on the content of context. I.e. #compareDefinition will be compared with the asset's definition and a final adjusted result will be returned.
[in] | compareDefinition | The definition categories to which add the NodeDescriptionAsset's content. |
[in] | context | Additional arguments for the definition comparison. |