Class PBValidator

3DS Max Plug-In SDK

Class PBValidator

See Also: Structure ParamDef, List of Type 2 Params, Class ParamBlockDesc2.

class PBValidator : public InterfaceServer

Description:

This class is available in release 3.0 and later only.

A pointer to an instance of this class is a data member of struct ParamDef and is also used by the p_validator tag in a ParamBlockDesc2 constructor. Any parameter can have a custom validator. This is used by the scripter and node pick button filter for example. If you want to validate a parameter block 2 value create an instance of this class and implement the Validate() method.

Methods:

public:

Prototype:

virtual BOOL Validate(PB2Value& v)=0;

Remarks:

Returns TRUE if the given PB2Value if valid; otherwise FALSE.

Parameters:

PB2Value& v

The value to check.

Prototype:

virtual BOOL Validate(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex);

Remarks:

This method is available in release 4.0 and later only.

A variant of Validate() method to PBValidate which supplies more context than the original Validate(), effectively giving the same context information as the Set() & Get() methods in a PBAccessor.

Parameters:

PB2Value& v

The value to check.

ReferenceMaker* owner

Points to the owner of the parameter.

ParamID id

The permanent ID of the parameter.

int tabIndex

If the parameter is a Tab<> this is the zero based index of the parameter in the table.

Prototype:

virtual void DeleteThis();

Remarks:

This method that can be used to destroy dynamically allocated instances of this class.

Default Implementation:

{ }