#include <node.h>
Inheritance diagram for mudbox::AttributeInstance< type >:
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.
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. |
|
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) |
void | AddTarget (Attribute &cTarget) |
QString | AsString (void) const |
void | SetFromString (const QString &sValue) |
AttributeWidget * | CreateEditorWidget (QWidget *pParent, int iWidth) |
Attribute::AttributeType | Type (void) const |
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. |
|
Standard constructor. You have to specify the name of the attribute which will be used in the user interface. |
|
Using this constructor you can also specify the initial value of the attribute with its name. |
|
Protected constructor, do not use it. You have to specify the name of the attribute which will be used in the user interface. 00464 : |
|
Returns the value of the attribute.
00375 { return m_cValue; };
|
|
Set the value of the attribute to cValue.
Reimplemented in mudbox::AttributePointer< type >, and mudbox::AttributePointer< NURBSCurve >. 00379 { 00380 m_cValue = cValue; 00381 UpdateTargets(); 00382 if ( !bInternal ) 00383 StartEvent( etValueChanged ); 00384 }; |
|
Reimplemented from mudbox::Attribute. 00386 { 00387 for ( unsigned int i = 0; i < TargetCount(); i++ ) 00388 { 00389 if ( Target(i)->Size() == Size() ) 00390 ((AttributeInstance<type> *)Target(i))->SetValue( m_cValue ); 00391 else 00392 Target(i)->StartEvent( etValueChanged ); 00393 }; 00394 }; |
|
Reimplemented from mudbox::Attribute. Reimplemented in mudbox::AttributePointer< type >, and mudbox::AttributePointer< NURBSCurve >. 00305 { s == m_cValue; }; |
|
Reimplemented from mudbox::Attribute. Reimplemented in mudbox::AttributePointer< type >, and mudbox::AttributePointer< NURBSCurve >. 00399 { 00400 Attribute::AddTarget( cTarget ); 00401 if ( cTarget.Size() ) 00402 { 00403 AttributeInstance<type> *pT = (AttributeInstance<type> *)&cTarget; 00404 if ( pT->Value() != Value() ) 00405 pT->SetValue( Value() ); 00406 }; 00407 00408 StartEvent( etTargetChanged ); 00409 cTarget.StartEvent( etSourceChanged ); 00410 }; |
|
Reimplemented from mudbox::Attribute. Reimplemented in mudbox::AttributeCheckableFloat, mudbox::AttributePointer< type >, and mudbox::AttributePointer< NURBSCurve >. 00414 { 00415 QString sValue; 00416 const unsigned char *tData = (const unsigned char *)(void *)(&m_cValue); 00417 for ( unsigned int i = 0; i < sizeof(m_cValue); i++ ) 00418 { 00419 if ( i ) 00420 sValue += " "; 00421 sValue += QString("%1").arg(int(tData[i])); 00422 }; 00423 return sValue; 00424 }; |
|
Reimplemented from mudbox::Attribute. Reimplemented in mudbox::AttributeCheckableFloat, mudbox::AttributePointer< type >, and mudbox::AttributePointer< NURBSCurve >. 00426 { 00427 unsigned char *tData = (unsigned char *)(void *)(&m_cValue); 00428 for ( int i = 0; i < (int)sizeof(m_cValue); i++ ) 00429 tData[i] = sValue.section(' ', i, i).toInt(); 00430 }; |
|
Reimplemented from mudbox::Attribute. Reimplemented in mudbox::AttributeCheckableFloat, mudbox::AttributeFloatRange, mudbox::AttributeEnumeration, mudbox::AttributeFilename, mudbox::AttributeTextureFilename, and mudbox::AttributePointer< type >.
00431 { return Attribute::CreateEditorWidget( pParent, iWidth ); };
|
|
Reimplemented from mudbox::Attribute. Reimplemented in mudbox::AttributeCheckableFloat, mudbox::AttributePointer< type >, and mudbox::AttributePointer< NURBSCurve >.
00432 { return Attribute::AttributeType(); };
|
|
Reimplemented in mudbox::AttributeNumber, and mudbox::AttributeEnumeration. |
|