Inheritance diagram for DzElement:
Classes derived from DzElement may have any number of properties (objects derived from DzProperty). Those properties may be added and removed at runtime and may be specified as animatable or not. There are several types of properties that have been supplied with the Studio SDK. Property names must be unique within an element. A variety of methods are provided to allow easy traversal and/or searching of the properties list for an object.
Methods are provided to clear animation data on all properties of an object either over a range or over all time.
DzElement takes ownership of all properties added via addProperty(). Subclasses should not attempt to delete properties that have been added to the element.
DzElement also handles saving and loading of all properties. When DzElement loads a property from a file, it will delete any existing property of the same name and replace it with the new property read in - subclasses are responsible for updating any local references to properties whenever a file is loaded. The easiest and most reliable way to do this is for the subclass to write out and read back in any local pointers it maintains to properties. Another approach would be for the subclass to reimplement the postLoadFile() function and update its references by calling findProperty() to lookup the properties by name.
DzError DzElement::addDataItem | ( | DzElementData | item | ) |
Hang a new custom data item off of this element. Data items will be deleted when this element is deleted, so ownership of the data item is transferred to the element after this call. Do not attempt to delete the data item yourself unless you call removeDataItem() first.
item | The data item to attach to this element. |
DzError DzElement::addPrivateProperty | ( | DzProperty | prop | ) |
Add a new property. Adds a new private property that will be available for connections or direct editing.
newprop | A pointer to the property to add to the element |
DzError DzElement::addProperty | ( | DzProperty | prop | ) |
Add a new property. Adds a new property that will be available for connections or direct editing.
newprop | A pointer to the property to add to the element |
void DzElement::beginEdit | ( | ) |
Begins an editing operation for this element - DzProperty::beginEdit() will be called for all properties belonging to this element. Subclasses should reimplement this function to provide additional editing behavior.
Reimplemented in DzNode, and DzPoserJointParam.
void DzElement::cancelEdit | ( | ) |
Cancels an editing operation for this element - DzProperty::cancelEdit() will be called for all properties belonging to this element. Subclasses should reimplement this function to provide additional editing behavior.
Reimplemented in DzNode, and DzPoserJointParam.
void DzElement::clearAllAnimData | ( | ) |
Removes all animation keys on this object.
void DzElement::clearAnimData | ( | DzTimeRange | range | ) |
Clear animation keys in the currently active animation layer. Removes animation data on all animatible properties owned by this element over the given range.
range | The range of time over which keys will be removed. |
void DzElement::copyFrom | ( | DzElement | source | ) |
Matches the properties on this element to properties on the given element by name, and then copies the values of matching properties on source to the properties on this element.
source | The element that this element should copy property values from. |
DzElementClipboard DzElement::copyToClipboard | ( | ) |
Copies the property values of the element to a 'clipboard' so that they may be saved and applied (copied) to another element - or to the same element. Subclasses should reimplement this function if they contain non-property information or other implementation specific data that needs to be copied.
DzElementData DzElement::findDataItem | ( | String | dataName | ) |
Retrieve the user data item with the given ID, if one with that ID is attached to this element.
dataName | Unique ID to use in looking up the user data item. |
DzProperty DzElement::findPrivateProperty | ( | String | name | ) |
Locate a property by name.
name | Name of the property to search for. |
DzProperty DzElement::findPrivatePropertyByLabel | ( | String | label | ) |
Locate a property by label.
label | Label of the property to search for. |
DzProperty DzElement::findProperty | ( | String | name | ) |
Locate a property by name.
name | Name of the property to search for. |
DzProperty DzElement::findPropertyByLabel | ( | String | label | ) |
Locate a property by label.
label | Label of the property to search for. |
void DzElement::finishEdit | ( | ) |
finishes an editing operation for this element - DzProperty::finishEdit() will be called for all properties belonging to this element. Subclasses should reimplement this function to provide additional editing behavior.
Reimplemented in DzNode, and DzPoserJointParam.
void DzElement::getAttributes | ( | DzSettings | settings | ) |
Populates the given settings object with the attributes of this element. If this settings object is not empty the save filters will save out this settings information in the preset. See also setAttributes.
DzElementData DzElement::getDataItem | ( | Number | index | ) |
index | The index of the data item to return. |
Array DzElement::getDataItemList | ( | ) |
which | The index of the child element to return. |
DzElement DzElement::getElementParent | ( | ) |
String DzElement::getLabel | ( | ) |
DzScript DzElement::getLoadScript | ( | ) |
Number DzElement::getNumDataItems | ( | ) |
Number DzElement::getNumElementChildren | ( | ) |
Number DzElement::getNumPrivateProperties | ( | ) |
Get the number of private properties for this element
Number DzElement::getNumProperties | ( | ) |
Get the number of properties for this element
DzProperty DzElement::getPrivateProperty | ( | Number | index | ) |
Get a property from this element's property list
i | Index of the property to return |
DzPropertyGroupTree DzElement::getPrivatePropertyGroups | ( | ) |
QObjectList DzElement::getPrivatePropertyList | ( | ) |
This function is provided for DAZ Script access. Plugin developers are encouraged to use the much more efficient propertyListIterator() method.
DzProperty DzElement::getProperty | ( | Number | index | ) |
Get a property from this element's property list
i | Index of the property to return |
DzPropertyGroupTree DzElement::getPropertyGroups | ( | ) |
QObjectList DzElement::getPropertyList | ( | ) |
This function is provided for DAZ Script access. Plugin developers are encouraged to use the much more efficient propertyListIterator() method.
Boolean DzElement::inEdit | ( | ) |
DzError DzElement::insertPrivateProperty | ( | Number | index, | |
DzProperty | prop | |||
) |
Add a new property. Adds a new property that will be available for connections or direct editing.
newprop | A pointer to the property to add to the element |
DzError DzElement::insertProperty | ( | Number | index, | |
DzProperty | prop | |||
) |
Add a new property. Adds a new property that will be available for connections or direct editing.
index | The index in the properties list to insert the property. | |
prop | A pointer to the property to insert in the element |
name | The name to test for uniqueness. | |
makeUnique | If true, the value of name will be changed to make it unique. |
Given the name of a property, makes sure the name is currently unique for this element. If it is not and makeUnique is true, this method modifies the name to make it unique.
name | The name to test for uniqueness. | |
makeUnique | If true, the value of name will be modified to make it unique. |
Given the name of a property, makes sure the name is currently unique for this element. If it is not and makeUnique is true, this method modifies the name to make it unique.
name | The name to test for uniqueness. | |
makeUnique | If true, the value of name will be modified to make it unique. |
void DzElement::labelChanged | ( | String | newLabel | ) |
Signature: "labelChanged(const QString&)"
Emitted when this object's label is changed
newLabel | The new label of the element. |
DzError DzElement::movePrivateProperty | ( | DzProperty | prop, | |
DzElement | element | |||
) |
Moves the given property from this element to newElement, if it can be removed. Properties can be specified as non-removable (e.g. the rotation channels of the DzNode class). Doing so makes it impossible to move that property to another element.
prop | A pointer to the property to remove from the element. If prop is not a user property, it returns DZ_ILLEGAL_ARGUMENT_ERROR. Note: This is also the return code for a null pointer. Passing a null pointer generates a log message, whereas passing a non-user property does not. | |
newElement | A pointer to the element that prop should be moved to |
DzError DzElement::moveProperty | ( | DzProperty | prop, | |
DzElement | element | |||
) |
Moves the given property from this element to newElement, if it can be removed. Properties can be specified as non-removable (e.g. the rotation channels of the DzNode class). Doing so makes it impossible to move that property to another element.
prop | A pointer to the property to remove from the element. If prop is not a user property, it returns DZ_ILLEGAL_ARGUMENT_ERROR. Note: This is also the return code for a null pointer. Passing a null pointer generates a log message, whereas passing a non-user property does not. | |
newElement | A pointer to the element that prop should be moved to |
void DzElement::parentChanged | ( | ) |
Signature: "parentChanged()"
Emitted when this element's parent is changed
void DzElement::privatePropertyAdded | ( | DzProperty | prop | ) |
Signature: "privatePropertyAdded(DzProperty*)"
Emitted when a private property is added to this element
prop | A pointer the the property just added |
void DzElement::privatePropertyListChanged | ( | ) |
Signature: "privatePropertyListChanged()"
Emitted when a private property is added to or removed from this element
void DzElement::privatePropertyRemoved | ( | DzProperty | prop | ) |
Signature: "privatePropertyRemoved(DzProperty*)"
Emitted when a private property is removed from this element
prop | A pointer the the property just removed |
void DzElement::privatePropertyTreeChanged | ( | ) |
Signature: "privatePropertyTreeChanged()"
Emitted when the private property tree has changed
DzError DzElement::removeDataItem | ( | DzElementData | item | ) |
Remove the data item from this element.
item | A pointer to the data item to remove. |
Attempts to remove the named property. Fails if the property could not be found or could not be removed.
name | Name of the property to search for and remove if it is found. |
DzError DzElement::removePrivateProperty | ( | DzProperty | prop | ) |
Removes the given property, if it can be removed. Properties can be specified as non-removable (e.g. the rotation channels of the DzNode class). Doing so makes it impossible to remove that property from the object.
prop | A pointer to the property to remove from the element |
Attempts to remove the named property. Fails if the property could not be found or could not be removed.
name | Name of the property to search for and remove if it is found. |
DzError DzElement::removeProperty | ( | DzProperty | prop | ) |
Removes the given property, if it can be removed. Properties can be specified as non-removable (e.g. the rotation channels of the DzNode class). Doing so makes it impossible to remove that property from the object.
prop | A pointer to the property to remove from the element |
void DzElement::setAttributes | ( | DzSettings | settings | ) |
Sets attributes in the handed in settings and returns a pointer to an element set by these settings. The element returned may not be a new element or null if the settings are not correct. The caller is responsible for cleaning up the memory of the reutrn element it it is not this.
Default implementation returns this with no changes.
void DzElement::setLabel | ( | String | name | ) |
Set the user-defined label that is displayed in the interface for this object.
name | The new label for the element. |
Reimplemented in DzPoserJointParam.
void DzElement::setLoadScript | ( | DzScript | script | ) |
Sets the script that will be executed when this element is loaded from a file
script | A pointer to the script that will be saved with this element and executed when it is loaded from file. The element takes ownership of this pointer. |
void DzElement::setName | ( | String | name | ) |
Set the internal name of this object.
name | The name to assign to this element |
void DzElement::update | ( | ) |
Called to update any cached or display data for this object.