AttributeEnumeration Class Reference

AttributeEnumeration Class Reference

#include <node.h>

Class Description

This attribute is very similar to the aint type but on the user interface it will be displayed as a combobox, and the user will be able to choose its value from a list.

+ Examples:

Definition at line 1071 of file node.h.

+ Inheritance diagram for AttributeEnumeration:

Public Member Functions

 AttributeEnumeration (Node *pOwner, const QString &sID)
 
 OPERATORS (int)
 
AttributeWidgetCreateEditorWidget (QWidget *pParent, int iWidth)
 This function creates and returns the address of a QWidget object. More...
 
unsigned int AddItem (const QString &sValue, bool bEnabled=true)
 Add a new value to the attribute. More...
 
void SetItem (unsigned int iIndex, const QString &sValue, bool bEnabled=true)
 
void SetIconMode (bool bDisplayAsIcons )
 This function controls how the attribute should be displayed on the user interface. More...
 
bool IconMode (void) const
 Returns true if the attribute is displayed as buttons or false for combo. More...
 
AttributeEnumerationoperator<< (const char *sValue)
 This operator is provided to make it easier to fill the possible values for the attribute. More...
 
AttributeEnumerationoperator= (const AttributeEnumeration &aeValue)
 
unsigned int ItemCount (void) const
 Returns the number of items in the enumeration. More...
 
void Clear (void)
 
QString Item (unsigned int iIndex) const
 
bool IsItemEnabled (unsigned int iIndex) const
 
- Public Member Functions inherited from AttributeInstance< int >
 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. More...
 
 AttributeInstance (Node *pOwner, const QString &sID, const int &cValue)
 Using this constructor you can also specify the initial value of the attribute with its name. More...
 
 AttributeInstance (const AttributeInstance< int > &o)
 
virtual ~AttributeInstance (void)
 
const intValue (void) const
 Returns the value of the attribute. More...
 
virtual void SetValue (int cValue, bool bInternal=false)
 Set the value of the attribute to cValue. More...
 
void UpdateTargets (void)
 
void Serialize (Stream &s)
 Serialize the value of the attribute into a stream. More...
 
void AddTarget (Attribute &cTarget, bool bInternal=false)
 Connection management. More...
 
virtual QString AsString (bool bLocalized=false) const
 Returns the value of the attribute as a string. More...
 
virtual void SetFromString (const QString &sValue, bool bInternal=true, bool=false)
 Sets the value of the attribute as a string. More...
 
AttributeWidgetCreateEditorWidget (QWidget *pParent, int iWidth)
 This function creates and returns the address of a QWidget object. More...
 
Attribute::AttributeType Type (void) const
 Returns the type of the attribute. More...
 
 OPERATORS (int)
 
- Public Member Functions inherited from Attribute
unsigned int TargetCount (void) const
 Returns the number of attributes currently linked to this attribute as target. More...
 
AttributeTarget (unsigned int iIndex) const
 Returns the target with the given index. If iIndex is greater than the number of targets, returns 0;. More...
 
AttributeSource (void) const
 Returns the source attribute, or 0 if there is no source. More...
 
bool operator== (const Attribute &cAttribute) const
 This is a special operator, it does NOT compare the value of the attribute. See Node::OnNodeEvent for details. More...
 
bool operator!= (const Attribute &cAttribute) const
 This is a special operator, it does NOT compare the value of the attribute. See Node::OnNodeEvent for details. More...
 
QString ID (void) const
 Returns the unique ID (within this node) of the attribute. More...
 
QString Name (void) const
 Returns the name of the attribute. More...
 
void SetName (const QString &sName)
 Sets the name of the attribute. More...
 
QString Category (void) const
 Returns the category of the attribute. More...
 
void SetCategory (const QString &sCategory, bool bSeparator=false)
 Sets the category of the attribute. This value will be used in the user interface to determine which attribute group to be used. More...
 
bool Separator (void) const
 Returns the separator state of the widget. More...
 
void SetSeparator (bool bSeparator)
 Call this with true to display a separator line below this widget. More...
 
bool Const (void) const
 Gets the constant status of the attribute. Default value is false. If this is set to true the attribute will not be editable by the user on the interface. More...
 
void SetConst (bool bConst)
 Sets the constant status of the attribute. Default value is false. If this is set to true the attribute will not be editable by the user on the interface. More...
 
bool InstantEdit (void) const
 Returns true, if the attribute edition should be instant, i.e. the attribute should change every time the user makes any changes to the widget. Default is false. More...
 
void SetInstantEdit (bool bOn)
 If bOn is true, editing the attribute on the UI will be instant, i.e. More...
 
bool Visible (void) const
 Returns true if the property is visible. More...
 
void SetVisible (bool bVisible)
 Sets the visible status of the property. More...
 
QString ToolTip (void) const
 Gets the tooltip text to be used on the user interface, this is optional. More...
 
void SetToolTip (const QString &sToolTip)
 Sets the tooltip text to be used on the user interface, this is optional. More...
 
unsigned int Size (void) const
 Returns the size of the attribute value in bytes. More...
 
float LabelWidth (void) const
 Returns the width of label relative to the full width of the line. More...
 
void SetLabelWidth (float fLabelWidth)
 Set the width of label. More...
 
int Index (void) const
 Returns the attribute index;. More...
 
void SetIndex (int iIndex)
 Sets the attribute index;. More...
 
NodeOwner (void) const
 Gets the address of the Node which contains this attribute. More...
 
virtual ~Attribute (void)
 
virtual void StartEvent (NodeEventType cType) const
 
void SetOwner (Node *pOwner)
 This function sets the owner of the attribute. More...
 
void LogTargets (void)
 
void LogSource (void)
 
void CheckValidity (void)
 
void ClearTargets (void)
 Removes all outgoing connections from the attribute. More...
 
void ClearSource (void)
 Removes the incoming connection for this attribute. More...
 
void Connect (Attribute &cSource, bool bInternal=false)
 Connect this attribute to another one. More...
 
virtual const ClassDescTargetType (void) const
 This is valid only for pointer attributes (See AttributePointer). Returns the type of the pointer. More...
 
virtual void SetPointerValue (Node *pValue, bool bLink=true)
 This is valid only for pointer attributes (See AttributePointer). More...
 
virtual NodePointerValue (void) const
 This is valid only for pointer attributes (See AttributePointer). More...
 
virtual bool ValidatePointerValue (const Node *pValue)
 Validate a possible value for the pointer, returns true if the value is acceptable. More...
 

Additional Inherited Members

- Public Types inherited from Attribute
enum  AttributeType {
  typeUnknown, typeInt, typeFloat, typeBool,
  typeString, typePointer, typeColor, typeVector,
  typeEnum, typeWatch
}
 Type of the attribute. More...
 
- Public Attributes inherited from AttributeInstance< int >
int m_cValue
 
- Protected Member Functions inherited from AttributeInstance< int >
 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. More...
 
- Protected Member Functions inherited from Attribute
 Attribute (Node *pOwner, const QString &sID)
 
 Attribute (Node *pOwner, bool bInstall)
 
void Uninstall (void)
 
- Protected Attributes inherited from Attribute
int m_iSize
 
Attributem_pSource
 
Attributem_pNext
 
Store< Attribute * > m_aTargets
 
Nodem_pNode
 
QString m_sName
 
bool m_bSeparator
 
QString m_sCategory
 
QString m_sToolTip
 
float m_fLabelWidth
 
bool m_bConst
 
bool m_bVisible
 
int m_iIndex
 
bool m_bInstantEdit
 
QString m_sID
 

Constructor & Destructor Documentation

AttributeEnumeration ( Node pOwner,
const QString sID 
)

Member Function Documentation

OPERATORS ( int  )
AttributeWidget* CreateEditorWidget ( QWidget pParent,
int  iWidth 
)
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.

unsigned int AddItem ( const QString sValue,
bool  bEnabled = true 
)

Add a new value to the attribute.

The values will be assigned by calling order to this function, so the first given string will mean value 0, second will mean 1 and so on.

void SetItem ( unsigned int  iIndex,
const QString sValue,
bool  bEnabled = true 
)
void SetIconMode ( bool  bDisplayAsIcons)
inline

This function controls how the attribute should be displayed on the user interface.

Parameters
bDisplayAsIconsTrue to display the possible attribute values as small buttons in a row. In this case, the name of each parameter is interpreted as a filename to an icon, which will be used on the buttons. False (default) to display the attribute as a combo box where each attribute is dispayed as a string.

Definition at line 1092 of file node.h.

1096  { m_bDisplayAsIcons = bDisplayAsIcons; };
bool IconMode ( void  ) const
inline

Returns true if the attribute is displayed as buttons or false for combo.

Definition at line 1098 of file node.h.

1098 { return m_bDisplayAsIcons; };
AttributeEnumeration& operator<< ( const char *  sValue)

This operator is provided to make it easier to fill the possible values for the attribute.

You can write:

m_eImageType << "gif" << "bmp" << "jpg" << "tif";

Which is the same as

n_eImageType.AddValue( "gif" );
n_eImageType.AddValue( "bmp" );
n_eImageType.AddValue( "jpg" );
n_eImageType.AddValue( "tif" );
AttributeEnumeration& operator= ( const AttributeEnumeration aeValue)
unsigned int ItemCount ( void  ) const

Returns the number of items in the enumeration.

void Clear ( void  )
QString Item ( unsigned int  iIndex) const
bool IsItemEnabled ( unsigned int  iIndex) const

The documentation for this class was generated from the following file: