- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions

# MObjectListFilter Class Reference

# OpenMayaUI - API module for user interface

Search for all occurrences

## Detailed Description

Class for defining a scene list filter.

MObjectListFilter provides an interface to define a list of selection items which can be used to filter the display of items for interactive 3D scene rendering.

The selection list can either have the meaning of rendering only the items in that list (an inclusion list) or only rendering items which are not in the list (an exclusion list).

Programmers using this interface can derive from this class and implement the required methods. The derived class is responsible for

- Registering and deregistering the filter via the registerFilter() and deregisterFilter() methods.
- Maintaining the selection list to be used for filtering.
- Indicating when this list has been modified via the requireListUpdate() method. Note that it is valid to always mark the list as being modified.
- Return the selection list when asked via the getList() method.

`#include <MObjectListFilter.h>`

List of all members.

## Public Types
enum | MFilterType { kInclusionList = 0, kExclusionList, kNumberOfFilterTypes }
| Type of filter list. More...
enum | MSceneUpdateType { kNone = 0, kAddRemoveObjects = 1<<(0) }
| Type of scene update. More...
## Public Member Functions
| MObjectListFilter (const MString &name)
| Constructor for a filter.
virtual | ~MObjectListFilter ()
| Default destructor.
virtual bool | requireListUpdate ()=0
| This method is called by Maya to determine whether the contents of the object list for the filter has changed since the last requireLastUpdate() call was made.
virtual MStatus | getList (MSelectionList &list)=0
| This method will return the selection list to use for filtering scene rendering.
virtual MSceneUpdateType | dependentOnSceneUpdates ()
| Return whether the update of the filter list is dependent on scene updates.
void | setFilterType (MFilterType filterType)
| Set the filter type.
MFilterType | filterType () const
| Query the filter type.
const MString & | name () const
| Query the name identifier.
const MString & | UIname () const
| Query the UI name.
void | setUIName (const MString &name)
| Set the UI name.
## Static Public Member Functions
static MStatus | registerFilter (const MObjectListFilter &filter)
| Register the object filter as one of an available set of filters.
static MStatus | deregisterFilter (const MObjectListFilter &filter)
| Deregister the object filter from the list of available filters.
static const char * | className ()
| Returns the name of this class.

## Member Enumeration Documentation

enum MFilterType

Search for all occurrences

Type of filter list.

Enumerator:

  kInclusionList | Include only items on the list. Search for all occurrences
  kExclusionList | Exclude only items on the list. Search for all occurrences
  kNumberOfFilterTypes | Not to be used. This is the number of filter types. Search for all occurrences

enum MSceneUpdateType

Search for all occurrences

Type of scene update.

Enumerator:

  kNone | List update is not dependent on scene changes. Search for all occurrences
  kAddRemoveObjects | List update is dependent on addition or removal of dag objects from the scene. Search for all occurrences

## Constructor & Destructor Documentation

MObjectListFilter | ( | const MString & | name | ) |

Constructor for a filter.

By default the instance is created with the type kInclusionList (an inclusion list). And the UI name is set to be the input name parameter

Parameters:

  [in] | name | Unique name for the filter.

## Member Function Documentation

bool requireListUpdate | ( |  | ) | `[pure virtual]`

Search for all occurrences

This method is called by Maya to determine whether the contents of the object list for the filter has changed since the last requireLastUpdate() call was made.

If the list has changed then getList() will be called to query for the contents of the filter.

This method will be called once per frame render or refresh if the filter is actively being used for rendering.

Users should never call this method themselves.

Derived classes must implement this method.

Returns:
  true If the object list for the filter has changed.

MStatus getList | ( | MSelectionList & | list | ) | `[pure virtual]`

Search for all occurrences

This method will return the selection list to use for filtering scene rendering.

Currently filtering at the component level is not supported. Any components specified for selection items in the list will be ignored.

This method will be called when an update is indicated (by returning true from requireListUpdate()).

If the filter type (MObjectListFilter::MFilterType) is MObjectListFilter::kExclusionList, Maya will by default monitor for scene changes. When objects are added or removed from the scene this indicates that an update is required which in turns indicates that this method needs to be called.

Derived classes must implement this method.

Parameters:

  [out] | list | Object filter list (MSelectionList)

Returns:
  Status code

Status Codes:
  - MS::kSuccess A list could be returned properly.
  - MS::kFailure A list could not be returned properly.

MObjectListFilter::MSceneUpdateType dependentOnSceneUpdates | ( |  | ) | `[virtual]`

Search for all occurrences

Return whether the update of the filter list is dependent on scene updates.

If the method returns that it is dependent on scene updates then Maya will monitor for these changes and internally keep track that the filter requires an update on scene modifications. When Maya calls requireListUpdate() it will also check this internal state to determine wheter getList() needs to be called.

For example, if MObjectListFilter::kAddRemoveObjects is returned from this method then any additions or removals of dag objects from the scene will result in getList() being called to obtain a new filter list. In this situation, if there is no other explicit condition that the filter requires for update then requireListUpdate() could return a "false" value to avoid unnecessary filter list updates.

Returns:
  An MSceneUpdateType value. By default MObjectListFilter::kNone is returned indicating the filter is not dependent on scene updates.

void setFilterType | ( | MObjectListFilter::MFilterType | filterType | ) |

Search for all occurrences

Set the filter type.

This is a convenience method for the user. This method will never be called by Maya.

Parameters:

  [in] | filterType | Filter type defined by MObjectListFilter::MFilterType.

MObjectListFilter::MFilterType filterType | ( |  | ) | const

Search for all occurrences

Query the filter type.

Returns:
  Filter type (MObjectListFilter::MFilterType)

const MString & name | ( |  | ) | const

Search for all occurrences

Query the name identifier.

Returns:
  Name identifier

const MString & UIname | ( |  | ) | const

Search for all occurrences

Query the UI name.

Returns:
  UI name

void setUIName | ( | const MString & | name | ) |

Search for all occurrences

Set the UI name.

Parameters:

  [in] | name | UI name

MStatus registerFilter | ( | const MObjectListFilter & | filter | ) | `[static]`

Search for all occurrences

Register the object filter as one of an available set of filters.

It is not valid to register different object filters that have the same name as the name uniquely identifies the filter.

The same filter cannot be registered more than once. If registerFilter() is called with the same filter more than once before calling deregisterFilter(), then the filter will not be added again, but a success status code will be returned.

Parameters:

  [in] | filter | Filter to register

Returns:
  Status code

Status Codes:
  - MStatus::kSuccess The filter was registered or is already registered.
  - MStatus::kFailure The filter could not to be registered.
  - MStatus::kInvalidParameter Another filter with the same name is already registered.

MStatus deregisterFilter | ( | const MObjectListFilter & | filter | ) | `[static]`

Search for all occurrences

Deregister the object filter from the list of available filters.

Parameters:

  [in] | filter | Filter to deregister

Returns:
  Status code

Status Codes:
  - MStatus::kSuccess The filter was deregistered.
  - MStatus::kFailure The filter failed to be deregistered.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  Name of this class.

MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter
MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter MObjectListFilter