IMtlBrowserFilter Class Reference
 
 
 
IMtlBrowserFilter Class Reference

This reference page is linked to from the following overview topics: Mental Ray Classes.


#include <IMtlBrowserFilter.h>

Inheritance diagram for IMtlBrowserFilter:
BaseInterface InterfaceServer MaxHeapOperators mrShaderFilter

Class Description

See also:
Class IMtlBrowserFilter_Manager, Class ISubMtlMap_BrowserFilter
Description
This is the base class for all mtl/map browser filters. This public interface provides developers the ability to filter the contents of the material/map browser based on certain criteria of the material or texture.

With the introduction of mental ray, certain materials or textures were unusable by the scanline renderer or even as sub materials. This meant a system was needed to filter out unsupported materials. A material that hosts sub materials may require a specific type of sub material, e.g. a material that supported displacement evaluation. The material can then filter the list for only materials that support displacement.

The system is made of a manager (class IMtlBrowserFilter_Manager) and a filter (class IMtlBrowserFilter). The mtl/texmap browser queries the manager, before adding any mtl/texmap to its list, to determine whether each item should be included or filtered out.
Implementation
All a developer has to do to access this feature is to implement a filter, derived from class IMtlBrowserFilter, and add it to the filter manager.

Public Member Functions

virtual const MCHAR *  FilterName ()=0
  Returns the name of the filter.
virtual bool  Enabled ()=0
  Returns if this filter is enabled.
virtual void  Enable (bool enable)=0
  Used to enable/disable this filter.
virtual void  Registered ()=0
  Called when this filter is added to the manager.
virtual void  Unregistered ()=0
  Called when a filter is removed from the manager.
virtual bool  Include (MtlBase &mtlBase, DWORD flags)=0
  Returns whether the given material/map should be included in the browser, when browsing for existing materials/maps.
virtual bool  Include (ClassDesc &classDesc, DWORD flags)=0
  Returns whether the given material/map should be included in the browser, when browsing for 'new'.
virtual Interface_ID  GetID ()

Member Function Documentation

virtual const MCHAR* FilterName ( ) [pure virtual]

Returns the name of the filter.

Implemented in mrShaderFilter.

virtual bool Enabled ( ) [pure virtual]

Returns if this filter is enabled.

The filter manager will not call disabled filters.

Returns:
true if this filter should be applied

Implemented in mrShaderFilter.

virtual void Enable ( bool  enable ) [pure virtual]

Used to enable/disable this filter.

Parameters:
enable - if false, disable this filter by returning false from Enabled

Implemented in mrShaderFilter.

virtual void Registered ( ) [pure virtual]

Called when this filter is added to the manager.

Implemented in mrShaderFilter.

virtual void Unregistered ( ) [pure virtual]

Called when a filter is removed from the manager.

Implemented in mrShaderFilter.

virtual bool Include ( MtlBase mtlBase,
DWORD  flags 
) [pure virtual]

Returns whether the given material/map should be included in the browser, when browsing for existing materials/maps.

Parameters:
mtlBase - The material/texmap to be filtered
flags - See the List of Material Browser Flags.
Returns:
true if this material should be included in the browser

Implemented in mrShaderFilter.

virtual bool Include ( ClassDesc classDesc,
DWORD  flags 
) [pure virtual]

Returns whether the given material/map should be included in the browser, when browsing for 'new'.

Parameters:
classDesc - The material/map class descriptor to be filtered
flags - See the List of Material Browser Flags.
Returns:
true if this material should be included in the browser

Implemented in mrShaderFilter.

Interface_ID GetID ( ) [inline, virtual]
Remarks:
This method returns the unique interface ID.

Reimplemented from BaseInterface.