Class for defining a scene list filter. More...
#include <MObjectListFilter.h>
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. More... | |
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. More... | |
virtual MStatus | getList (MSelectionList &list)=0 |
This method will return the selection list to use for filtering scene rendering. More... | |
virtual MSceneUpdateType | dependentOnSceneUpdates () |
Return whether the update of the filter list is dependent on scene updates. More... | |
void | setFilterType (MFilterType filterType) |
Set the filter type. More... | |
MFilterType | filterType () const |
Query the filter type. More... | |
const MString & | name () const |
Query the name identifier. More... | |
const MString & | UIname () const |
Query the UI name. More... | |
void | setUIName (const MString &name) |
Set the UI name. More... | |
Static Public Member Functions | |
static MStatus | registerFilter (const MObjectListFilter &filter) |
Register the object filter as one of an available set of filters. More... | |
static MStatus | deregisterFilter (const MObjectListFilter &filter) |
Deregister the object filter from the list of available filters. More... | |
static const char * | className () |
Returns the name of this class. More... | |
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
enum MFilterType |
enum MSceneUpdateType |
OPENMAYA_MAJOR_NAMESPACE_OPEN 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
[in] | name | Unique name for the filter. |
|
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.
|
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.
[out] | list | Object filter list (MSelectionList) |
|
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.
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.
[in] | filterType | Filter type defined by MObjectListFilter::MFilterType. |
MObjectListFilter::MFilterType filterType | ( | ) | const |
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.
[in] | name | UI name |
|
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.
[in] | filter | Filter to register |
|
static |
Deregister the object filter from the list of available filters.
[in] | filter | Filter to deregister |
|
static |
Returns the name of this class.