This reference page is linked to from the following overview topics: Attributes.
This is a generic attribute which can be used instead of the standard built in types.
The difference between a standard type and this attribute is that this attribute can be viewed and its value can be changed by the user. Attributes can be linked together also so when the value of an attribute is changed, all target attributes value will be changed also. The owner node also can catch events regarding to the attrbibutes, for example when the user changes the value.
#include <node.h>

Public Member Functions |
|
| AttributeInstance (Node *pOwner, const QString &sID) | |
| Standard constructor. You have to specify
the name of the attribute which will be used in the user interface.
|
|
| AttributeInstance (Node *pOwner, const QString &sID, const type &cValue) | |
| Using this constructor you can also specify
the initial value of the attribute with its name. |
|
| AttributeInstance (const AttributeInstance< type > &o) | |
| const type & | Value (void) const |
| Returns the value of the attribute. |
|
| virtual void | SetValue (type cValue, bool bInternal=false) |
| Set the value of the attribute to cValue.
|
|
| void | UpdateTargets (void) |
| void | Serialize (Stream &s) |
| Serialize the value of the attribute into a
stream. |
|
| void | AddTarget (Attribute &cTarget) |
| Adds a new outgoing connection for this node
to pTarget. |
|
| QString | AsString (bool bLocalized=false) const |
| Returns the value of the attribute as a
string. |
|
| void | SetFromString (const QString &sValue, bool bInternal=true, bool=false) |
| Sets the value of the attribute as a string.
|
|
| AttributeWidget * | CreateEditorWidget (QWidget *pParent, int iWidth) |
| This function creates and returns the
address of a QWidget
object. |
|
| Attribute::AttributeType | Type (void) const |
| Returns the type of the attribute. |
|
| OPERATORS (type) | |
Public Attributes |
|
| type | m_cValue |
Protected Member Functions |
|
| AttributeInstance (Node *pOwner, const QString &sName, bool bInstall) | |
| Protected constructor, do not use it. You
have to specify the name of the attribute which will be used in the
user interface. |
|
| AttributeInstance | ( | Node * | pOwner, |
| const QString & | sID | ||
| ) | [inline] |
| AttributeInstance | ( | Node * | pOwner, |
| const QString & | sID, | ||
| const type & | cValue | ||
| ) | [inline] |
| AttributeInstance | ( | const AttributeInstance< type > & | o | ) | [inline] |
| AttributeInstance | ( | Node * | pOwner, |
| const QString & | sName, | ||
| bool | bInstall | ||
| ) | [inline, protected] |
| const type& Value | ( | void | ) | const [inline] |
| virtual void SetValue | ( | type | cValue, |
| bool | bInternal =
false |
||
| ) | [inline, virtual] |
Set the value of the attribute to cValue.
| bInternal | if this is false the owner node will receive an event about the value change (See NodeEventType::etValueChanged). |
Reimplemented in AttributePointer< type >, and AttributePointer< NURBSCurve >.
Definition at line 394 of file node.h.
{
m_cValue = cValue;
UpdateTargets();
if ( !bInternal )
StartEvent( etValueChanged );
};
| void UpdateTargets | ( | void | ) | [inline, virtual] |
Update the values of all the connected target attributes with the current value. Used internally only, do not call this directly.
Reimplemented from Attribute.
Definition at line 401 of file node.h.
{
for ( unsigned int i = 0; i < TargetCount(); i++ )
{
if ( Target(i)->Size() == Size() )
((AttributeInstance<type> *)Target(i))->SetValue( m_cValue );
else
Target(i)->StartEvent( etValueChanged );
};
};
| void Serialize | ( | Stream & | s | ) | [inline, virtual] |
Serialize the value of the attribute into a stream.
Reimplemented from Attribute.
Reimplemented in AttributePointer< type >, and AttributePointer< NURBSCurve >.
Definition at line 306 of file stream.h.
{ s == m_cValue; };
| void AddTarget | ( | Attribute & | cTarget | ) | [inline, virtual] |
Adds a new outgoing connection for this node to pTarget.
Reimplemented from Attribute.
Reimplemented in AttributePointer< type >, and AttributePointer< NURBSCurve >.
Definition at line 414 of file node.h.
{
Attribute::AddTarget( cTarget );
if ( cTarget.Size() )
{
AttributeInstance<type> *pT = (AttributeInstance<type> *)&cTarget;
if ( pT->Value() != Value() )
pT->SetValue( Value() );
};
StartEvent( etTargetChanged );
cTarget.StartEvent( etSourceChanged );
};
| QString AsString | ( | bool | bLocalized = false |
) | const [inline, virtual] |
Returns the value of the attribute as a string.
See also SetFromString.
| bLocalized | if this is true the string representation of the value is assumed to be localized (translated) |
Reimplemented from Attribute.
Reimplemented in AttributeCheckableFloat, AttributePointer< type >, and AttributePointer< NURBSCurve >.
| void SetFromString | ( | const QString & | sValue, |
| bool | bInternal = true, |
||
| bool | bLocalized =
false |
||
| ) | [inline, virtual] |
Sets the value of the attribute as a string.
See also AsString.
| bInternal | if this is false the owner node will receive an event about the value change (See NodeEventType::etValueChanged). |
| bLocalized | if this is true the string representation of the value is assumed to be localized (translated) |
Reimplemented from Attribute.
Reimplemented in AttributeCheckableFloat, AttributePointer< type >, and AttributePointer< NURBSCurve >.
| AttributeWidget * CreateEditorWidget | ( | QWidget * | pParent, |
| int | iWidth | ||
| ) | [inline, virtual] |
This function creates and returns the address of a QWidget object.
The object then can be used in the interface to give the user control over the attribute value. Mudbox calls this function for every attribute in a node when it displays a properties dialog box for it. You must override it if you implement a new kind of attribute and want a special interface.
Reimplemented from Attribute.
Reimplemented in AttributeCheckableFloat, AttributeCheckableFloatArray, AttributeFloatRange, AttributeEnumeration, AttributeFilename, AttributeTextureFilename, and AttributeLocale.
Definition at line 450 of file node.h.
{ return Attribute::CreateEditorWidget( pParent, iWidth ); };
| Attribute::AttributeType Type | ( | void | ) | const [inline, virtual] |
Returns the type of the attribute.
Reimplemented from Attribute.
Reimplemented in AttributeCheckableFloat, AttributeCheckableFloatArray, AttributePointer< type >, and AttributePointer< NURBSCurve >.
Definition at line 451 of file node.h.
{ return Attribute::AttributeType(); };
| OPERATORS | ( | type | ) |
Reimplemented in AttributeNumber, and AttributeEnumeration.
| type m_cValue |