Public Types | Public Member Functions | Static Public Member Functions

MObjectListFilter Class Reference

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

#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 MStringname () const
 Query the name identifier.
const MStringUIname () 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

Type of filter list.

Enumerator:
kInclusionList 

Include only items on the list.

kExclusionList 

Exclude only items on the list.

kNumberOfFilterTypes 

Not to be used.

This is the number of filter types.

Type of scene update.

Enumerator:
kNone 

List update is not dependent on scene changes.

kAddRemoveObjects 

List update is dependent on addition or removal of dag objects from the scene.


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]nameUnique name for the filter.

Member Function Documentation

bool requireListUpdate ( ) [pure virtual]

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]

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]listObject filter list (MSelectionList)
Returns:
Status code
Status Codes:
MObjectListFilter::MSceneUpdateType dependentOnSceneUpdates ( ) [virtual]

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)

Set the filter type.

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

Parameters:
[in]filterTypeFilter type defined by MObjectListFilter::MFilterType.
MObjectListFilter::MFilterType filterType ( ) const

Query the filter type.

Returns:
Filter type (MObjectListFilter::MFilterType)
const MString & name ( ) const

Query the name identifier.

Returns:
Name identifier
const MString & UIname ( ) const

Query the UI name.

Returns:
UI name
void setUIName ( const MString name)

Set the UI name.

Parameters:
[in]nameUI name
MStatus registerFilter ( const MObjectListFilter filter) [static]

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]filterFilter to register
Returns:
Status code
Status Codes:
MStatus deregisterFilter ( const MObjectListFilter filter) [static]

Deregister the object filter from the list of available filters.

Parameters:
[in]filterFilter to deregister
Returns:
Status code
Status Codes:
const char * className ( ) [static]

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