HDK
|
#include <GU_AgentDefinition.h>
Public Types | |
using | CustomDataItemConstructor = UT_Function< GU_AgentCustomDataItemPtr(const GU_AgentDefinition &)> |
Public Member Functions | |
GU_AgentDefinition () | |
GU_AgentDefinition (const GU_AgentRigConstPtr &rig, const GU_AgentShapeLibConstPtr &shapelib) | |
GU_AgentDefinition (const GU_AgentDefinition &src_defn, const GU_AgentShapeLibConstPtr &new_shapelib, const GU_AgentRigConstPtr &new_rig=nullptr) | |
int64 | getMemoryUsage (bool inclusive) const |
bool | load (UT_JSONParser &p) |
bool | save (UT_JSONWriter &w) const |
const GU_AgentRigConstPtr & | rig () const |
const GU_AgentShapeLibConstPtr & | shapeLibrary () const |
void | addLayer (const GU_AgentLayerConstPtr &layer) |
void | removeLayer (const UT_StringRef &name) |
Remove a layer from the agent definition by name. More... | |
const UT_Array < GU_AgentLayerConstPtr > & | layers () const |
Return the list of layers. More... | |
const GU_AgentLayer * | layer (const UT_StringRef &name) const |
Get a pointer to a specfic layer. This may be a NULL pointer. More... | |
exint | layerIndex (const UT_StringRef &name) const |
Get the index of a layer, or -1 if it does not exist. More... | |
const GU_AgentLayer & | layer (exint i) const |
Get a reference to the ith layer. More... | |
exint | numLayers () const |
Return the layer count. More... | |
void | sortLayersIfNeeded () |
void | addClip (const GU_AgentClipConstPtr &clip) |
void | removeClip (const UT_StringRef &name) |
Remove a clip from the agent definition by name. More... | |
const UT_Array < GU_AgentClipConstPtr > & | clips () const |
Return the list of clips. More... | |
const GU_AgentClip * | clip (const UT_StringRef &name) const |
Get a pointer to a specfic clip. This may be a NULL pointer. More... | |
exint | clipIndex (const UT_StringRef &name) const |
Get the index of a clip, or -1 if it does not exist. More... | |
const GU_AgentClip & | clip (exint i) const |
Get a reference to the ith clip. More... | |
exint | numClips () const |
Return the clip count. More... | |
void | sortClipsIfNeeded () |
void | addTransformGroup (const GU_AgentTransformGroupConstPtr &group) |
void | removeTransformGroup (const UT_StringRef &name) |
Remove a transform group from the agent definition by name. More... | |
const UT_Array < GU_AgentTransformGroupConstPtr > & | transformGroups () const |
Return the list of groups. More... | |
const GU_AgentTransformGroup * | transformGroup (const UT_StringRef &name) const |
Get a pointer to a specfic group. This may be a NULL pointer. More... | |
exint | transformGroupIndex (const UT_StringRef &name) const |
Get the index of a transform group, or -1 if it does not exist. More... | |
const GU_AgentTransformGroup & | defaultTransformGroup () const |
const GU_AgentTransformGroup & | transformGroup (exint i) const |
Get a reference to the ith group. More... | |
exint | numTransformGroups () const |
Return the transform group count. More... | |
void | sortTransformGroupsIfNeeded () |
const GU_AgentMetadataConstPtr & | metadata () const |
Return the metadata dictionary. This may be a nullptr. More... | |
void | setMetadata (const GU_AgentMetadataConstPtr &data) |
Replace the metadata dictionary. More... | |
void | addCustomDataItem (const GU_AgentCustomDataItemConstPtr &data) |
void | removeCustomDataItem (const UT_StringRef &name) |
Remove a custom data item from the agent definition by name. More... | |
const UT_Array < GU_AgentCustomDataItemConstPtr > & | customDataItems () const |
Return the list of custom data items. More... | |
const GU_AgentCustomDataItem * | customDataItem (const UT_StringRef &name) const |
const GU_AgentCustomDataItem & | customDataItem (exint i) const |
Get a reference to the ith custom data item. More... | |
exint | numCustomDataItems () const |
Return the number of custom data items. More... | |
void | sortCustomDataItemsIfNeeded () |
void | sortItemsIfNeeded () |
Public Member Functions inherited from UT_IntrusiveRefCounter< GU_AgentDefinition > | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter () noexcept |
Default constructor: Sets counter to 0. More... | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept |
Copy constructor: Sets counter to 0. More... | |
UT_IntrusiveRefCounter & | operator= (const UT_IntrusiveRefCounter &) noexcept |
Assignment operator: Does not modify counter. More... | |
SYS_FORCE_INLINE uint32 | use_count () const noexcept |
Return current counter. More... | |
SYS_FORCE_INLINE bool | conditionalAddRef () noexcept |
Static Public Member Functions | |
static void | registerCustomDataItemType (const UT_StringHolder &dataitemtype, CustomDataItemConstructor constructor) |
Register a new custom data item type. More... | |
static void | installCustomDataItemTypes () |
Called by GU_Agent during startup to register custom data item types. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from UT_IntrusiveRefCounter< GU_AgentDefinition > | |
SYS_FORCE_INLINE | ~UT_IntrusiveRefCounter () |
Destructor: Only derived classes can destruct this. More... | |
An agent definition contains a rig, a shape library, a set of available clips, a set of available layers, and a set of transform groups.
Definition at line 35 of file GU_AgentDefinition.h.
using GU_AgentDefinition::CustomDataItemConstructor = UT_Function<GU_AgentCustomDataItemPtr (const GU_AgentDefinition &)> |
Constructs a new instance of a GU_AgentCustomDataItem. The provided agent definition can be used if the data item requires references to the rig, shape library, etc.
Definition at line 188 of file GU_AgentDefinition.h.
GU_AgentDefinition::GU_AgentDefinition | ( | ) |
GU_AgentDefinition::GU_AgentDefinition | ( | const GU_AgentRigConstPtr & | rig, |
const GU_AgentShapeLibConstPtr & | shapelib | ||
) |
GU_AgentDefinition::GU_AgentDefinition | ( | const GU_AgentDefinition & | src_defn, |
const GU_AgentShapeLibConstPtr & | new_shapelib, | ||
const GU_AgentRigConstPtr & | new_rig = nullptr |
||
) |
Create a copy of the given agent definition, but referencing a new version of the shape library and/or rig.
void GU_AgentDefinition::addClip | ( | const GU_AgentClipConstPtr & | clip | ) |
Add a clip to the agent definition. Replaces any pre-existing clip of the same name.
void GU_AgentDefinition::addCustomDataItem | ( | const GU_AgentCustomDataItemConstPtr & | data | ) |
Add a custom data item to the agent definition. Replaces any pre-existing item of the same name.
void GU_AgentDefinition::addLayer | ( | const GU_AgentLayerConstPtr & | layer | ) |
Add a layer to the agent definition. Replaces any pre-existing layer of the same name.
void GU_AgentDefinition::addTransformGroup | ( | const GU_AgentTransformGroupConstPtr & | group | ) |
Add a transform group to the agent definition. Replaces any pre-existing group of the same name.
|
inline |
Get a pointer to a specfic clip. This may be a NULL pointer.
Definition at line 241 of file GU_AgentDefinition.h.
|
inline |
Get a reference to the ith clip.
Definition at line 108 of file GU_AgentDefinition.h.
|
inline |
Get the index of a clip, or -1 if it does not exist.
Definition at line 104 of file GU_AgentDefinition.h.
|
inline |
Return the list of clips.
Definition at line 98 of file GU_AgentDefinition.h.
|
inline |
Get a pointer to a specfic data item by name. This may be a NULL pointer.
Definition at line 255 of file GU_AgentDefinition.h.
|
inline |
Get a reference to the ith custom data item.
Definition at line 174 of file GU_AgentDefinition.h.
|
inline |
Return the list of custom data items.
Definition at line 166 of file GU_AgentDefinition.h.
|
inline |
Get the default transform group, which contains all transforms in the rig.
Definition at line 137 of file GU_AgentDefinition.h.
int64 GU_AgentDefinition::getMemoryUsage | ( | bool | inclusive | ) | const |
|
static |
Called by GU_Agent during startup to register custom data item types.
|
inline |
Get a pointer to a specfic layer. This may be a NULL pointer.
Definition at line 234 of file GU_AgentDefinition.h.
|
inline |
Get a reference to the ith layer.
Definition at line 81 of file GU_AgentDefinition.h.
|
inline |
Get the index of a layer, or -1 if it does not exist.
Definition at line 77 of file GU_AgentDefinition.h.
|
inline |
Return the list of layers.
Definition at line 71 of file GU_AgentDefinition.h.
bool GU_AgentDefinition::load | ( | UT_JSONParser & | p | ) |
Loads the agent definition from JSON. Used when loading agent primitives from a geometry file.
|
inline |
Return the metadata dictionary. This may be a nullptr.
Definition at line 152 of file GU_AgentDefinition.h.
|
inline |
Return the clip count.
Definition at line 111 of file GU_AgentDefinition.h.
|
inline |
Return the number of custom data items.
Definition at line 178 of file GU_AgentDefinition.h.
|
inline |
Return the layer count.
Definition at line 84 of file GU_AgentDefinition.h.
|
inline |
Return the transform group count.
Definition at line 145 of file GU_AgentDefinition.h.
|
static |
Register a new custom data item type.
void GU_AgentDefinition::removeClip | ( | const UT_StringRef & | name | ) |
Remove a clip from the agent definition by name.
void GU_AgentDefinition::removeCustomDataItem | ( | const UT_StringRef & | name | ) |
Remove a custom data item from the agent definition by name.
void GU_AgentDefinition::removeLayer | ( | const UT_StringRef & | name | ) |
Remove a layer from the agent definition by name.
void GU_AgentDefinition::removeTransformGroup | ( | const UT_StringRef & | name | ) |
Remove a transform group from the agent definition by name.
|
inline |
Definition at line 60 of file GU_AgentDefinition.h.
bool GU_AgentDefinition::save | ( | UT_JSONWriter & | w | ) | const |
Saves the agent definition to JSON. Used when saving agent primitives to a geometry file.
|
inline |
Replace the metadata dictionary.
Definition at line 155 of file GU_AgentDefinition.h.
|
inline |
Definition at line 61 of file GU_AgentDefinition.h.
void GU_AgentDefinition::sortClipsIfNeeded | ( | ) |
Sorts the clips by name, if any clips have been added or removed since the last sort.
void GU_AgentDefinition::sortCustomDataItemsIfNeeded | ( | ) |
Sorts the custom data items by name, if any items have been added or removed since the last sort.
void GU_AgentDefinition::sortItemsIfNeeded | ( | ) |
Sorts the clips, layers, transform groups, and custom data items by name, if any items have been added or removed since the last sort. This is equivalent to individually calling sortClipsIfNeeded() and similar methods.
void GU_AgentDefinition::sortLayersIfNeeded | ( | ) |
Sorts the layers by name, if any layers have been added or removed since the last sort.
void GU_AgentDefinition::sortTransformGroupsIfNeeded | ( | ) |
Sorts the transform groups by name, if any groups have been added or removed since the last sort.
|
inline |
Get a pointer to a specfic group. This may be a NULL pointer.
Definition at line 248 of file GU_AgentDefinition.h.
|
inline |
Get a reference to the ith group.
Definition at line 141 of file GU_AgentDefinition.h.
|
inline |
Get the index of a transform group, or -1 if it does not exist.
Definition at line 132 of file GU_AgentDefinition.h.
|
inline |
Return the list of groups.
Definition at line 125 of file GU_AgentDefinition.h.