AttributeEnumeration Class Reference


Detailed 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:

MeshDisplace/displacer.h, PtexExtractor/PtexLayout.h, PtexExtractor/PtexUtilizer.h, and TextureSwapperViewportFilter/TextureSwapperViewportFilter.h.

Definition at line 965 of file node.h.

#include <node.h>

Inheritance diagram for AttributeEnumeration:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  AttributeEnumeration (Node *pOwner, const QString &sID)
  OPERATORS (int)
AttributeWidget CreateEditorWidget (QWidget *pParent, int iWidth)
  This function creates and returns the address of a QWidget object.
unsigned int  AddItem (const QString &sValue)
  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)
void  SetIconMode (bool bDisplayAsIcons)
  This function controls how the attribute should be displayed on the user interface.
bool  IconMode (void) const
  Returns true if the attribute is displayed as buttons or false for combo.
AttributeEnumeration operator<< (const char *sValue)
  This operator is provided to make it easier to fill the possible values for the attribute.
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

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 AttributeInstance< int >.

unsigned int AddItem ( const QString &  sValue )

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 
)
void SetIconMode ( bool  bDisplayAsIcons ) [inline]

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

Parameters:
bDisplayAsIcons True 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 984 of file node.h.

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

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

Definition at line 990 of file node.h.

{ m_bDisplayAsIcons = 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

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

AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration
AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration AttributeEnumeration