This reference page is linked to from the following overview topics: Mental Ray Classes.
#include <mrShaderFilter.h>
Public Member Functions |
|
mrShaderFilter (unsigned int applyTypes, ParamType2 paramType, bool acceptStructs) | |
virtual | ~mrShaderFilter () |
bool | ValidType (ParamType2 type) |
virtual const MCHAR * | FilterName () |
Returns the name of the filter. |
|
virtual bool | Enabled () |
Returns if this filter is enabled. |
|
virtual void | Enable (bool enable) |
Used to enable/disable this filter. |
|
virtual void | Registered () |
Called when this filter is added to the
manager. |
|
virtual void | Unregistered () |
Called when a filter is removed from the
manager. |
|
virtual bool | Include (MtlBase &mtlBase, DWORD flags) |
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) |
Returns whether the given material/map
should be included in the browser, when browsing for 'new'.
|
|
virtual BOOL | Validate (PB2Value &v) |
virtual BOOL | Validate (PB2Value &v, ReferenceMaker *owner, ParamID id, int tabIndex) |
virtual void | DeleteThis () |
virtual BaseInterface * | GetInterface (Interface_ID id) |
mrShaderFilter | ( | unsigned int | applyTypes, |
ParamType2 | paramType, | ||
bool | acceptStructs | ||
) |
: m_enabled(true),
m_applyTypes(applyTypes),
m_paramType(paramType),
m_acceptStructs(acceptStructs)
{
}
~mrShaderFilter | ( | ) | [virtual] |
{ }
bool ValidType | ( | ParamType2 | type | ) |
{ int choice = (int)m_paramType; switch(choice) { case TYPE_MAX_TYPE: return true; // Casts to more complex types are acceptable case TYPE_RGBA: case TYPE_FRGBA: return ((type == TYPE_RGBA) || (type == TYPE_FRGBA)); case TYPE_POINT3: case TYPE_POINT4: return ((type == TYPE_RGBA) || (type == TYPE_FRGBA) || (type == TYPE_POINT3) || (type == TYPE_POINT4)); case TYPE_FLOAT: return ((type == TYPE_RGBA) || (type == TYPE_FRGBA) || (type == TYPE_POINT3) || (type == TYPE_FLOAT)); default: return (type == m_paramType); } }
const MCHAR * FilterName | ( | ) | [virtual] |
Returns the name of the filter.
Implements IMtlBrowserFilter.
{ return _M("mental ray: Shader Filter"); }
bool Enabled | ( | ) | [virtual] |
Returns if this filter is enabled.
The filter manager will not call disabled filters.
Implements IMtlBrowserFilter.
{
return m_enabled;
}
void Enable | ( | bool | enable | ) | [virtual] |
Used to enable/disable this filter.
enable | - if false, disable this filter by returning false from Enabled |
Implements IMtlBrowserFilter.
{ m_enabled = enable; }
void Registered | ( | ) | [virtual] |
void Unregistered | ( | ) | [virtual] |
bool Include | ( | MtlBase & | mtlBase, |
DWORD | flags | ||
) | [virtual] |
Returns whether the given material/map should be included in the browser, when browsing for existing materials/maps.
mtlBase | - The material/texmap to be filtered |
flags | - See the List of Material Browser Flags. |
Implements IMtlBrowserFilter.
{ Interface* ip = GetCOREInterface(); if (!ip) { return false; } // Validate using the class ID ClassDesc* classDesc = ip->GetDllDir().ClassDir().FindClass( mtlBase.SuperClassID(), mtlBase.ClassID() ); DbgAssert(classDesc != NULL); if(classDesc != NULL) { return Include(*classDesc, flags); } else { return true; } }
bool Include | ( | ClassDesc & | classDesc, |
DWORD | flags | ||
) | [virtual] |
Returns whether the given material/map should be included in the browser, when browsing for 'new'.
classDesc | - The material/map class descriptor to be filtered |
flags | - See the List of Material Browser Flags. |
Implements IMtlBrowserFilter.
{
return (ValidateApplyType(classDesc) && ValidateReturnType(classDesc));
}
BOOL Validate | ( | PB2Value & | v | ) | [virtual] |
Implements PBValidator.
BOOL Validate | ( | PB2Value & | v, |
ReferenceMaker * | owner, | ||
ParamID | id, | ||
int | tabIndex | ||
) | [virtual] |
Reimplemented from PBValidator.
{ return Validate(v); }
void DeleteThis | ( | ) | [virtual] |
Reimplemented from PBValidator.
{ delete this; }
BaseInterface * GetInterface | ( | Interface_ID | id | ) | [virtual] |
Reimplemented from InterfaceServer.
{ if(id == MRSHADERFILTER_INTERFACEID) { return this; } else if(id == IMTLBROWSERFILTER_INTERFACEID) { return static_cast<IMtlBrowserFilter*>(this); } else { return PBValidator::GetInterface(id); } }