Public Member Functions | Static Public Member Functions | Public Attributes

MSPluginEffect Class Reference

Search for all occurrences

#include <mxsPlugin.h>

Inheritance diagram for MSPluginEffect:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MSPluginEffect ()
  MSPluginEffect (MSPluginClass *pc, BOOL loading)
  ~MSPluginEffect ()
RefTargetHandle  Clone (RemapDir &remap)
  This method is used by 3ds Max to clone an object.
EffectParamDlg CreateParamDialog (IRendParams *imp)
DWORD  GBufferChannelsRequired (TimeValue t)
void  Apply (TimeValue t, Bitmap *bm, RenderGlobalContext *gc, CheckAbortCallback *cb)
virtual bool  SupportsBitmap (Bitmap &bitmap)
  Returns wether the given bitmap is supported by the effect.
Effect to_effect ()

Static Public Member Functions

static RefTargetHandle  create (MSPluginClass *pc, BOOL loading)

Public Attributes

MSAutoEParamDlg masterFXDlg

Constructor & Destructor Documentation

MSPluginEffect ( ) [inline]
{ }
MSPluginEffect ( MSPluginClass *  pc,
BOOL  loading 
)
~MSPluginEffect ( ) [inline]

Member Function Documentation

static RefTargetHandle create ( MSPluginClass *  pc,
BOOL  loading 
) [static]
RefTargetHandle Clone ( RemapDir remap ) [virtual]

This method is used by 3ds Max to clone an object.

See also:
CloneRefHierarchy(), class RemapDir This method is called by 3ds Max to have the plugin clone itself. The plug-in's implementation of this method should copy both the data structure and all the data residing in the data structure of this reference target. The plugin should clone all its references as well. Also, the plug-in's implementation of this method must call BaseClone(). In order for classes derived from this class to clone cleanly, the Clone method should just create the new instance, and then call an implementation of BaseClone that clones the references and copies any other necessary data. For example:
            class MyDerivedPlugin
                : public MyBasePlugin
            {
                const int MY_REFERENCE = 1;

                ReferenceTarget* Clone(RemapDir& remap)
                {
                    ReferenceTarget* result = new MyDerivedPlugin();
                    BaseClone(this, result, remap);
                    return result;
                }

                void BaseClone(ReferenceTarget* from, ReferenceTarget* to, RemapDir& remap)
                {
                    if (!to || !from || from == to)
                        return;    
                    MyBasePlugin::BaseClone(from, to, remap);
                    to->ReplaceReference(MY_REFERENCE, remap->CloneRef(from->GetReference(MY_REFERENCE)));
                }
            };

This method should not be directly called by plug-ins. Instead, either RemapDir::CloneRef() or CloneRefHierachy() should be used to perform cloning. These methods ensure that the mapping from the original object to the clone is added to the RemapDir used for cloning, which may be used during backpatch operations

Note:
See the remarks in method BaseClone() below.
Parameters:
remap - A RemapDir instance used for remapping references during a Clone.
Returns:
A pointer to the cloned item.

Reimplemented from ReferenceTarget.

Reimplemented in MSEffectXtnd.

EffectParamDlg* CreateParamDialog ( IRendParams ip ) [virtual]
Remarks:
This method creates and returns a new instance of a class derived from EffectParamDlg to manage the user interface. This put up a modal dialog that lets the user edit the plug-ins parameters.
Parameters:
IRendParams *ip

This is the interface given to the rendering effect so it may display its parameters.
Returns:
A new instance of a class derived from EffectParamDlg.

Note: typedef SFXParamDlg EffectParamDlg;
Default Implementation:
{return NULL;}

Reimplemented from Effect.

Reimplemented in MSEffectXtnd.

DWORD GBufferChannelsRequired ( TimeValue  t ) [virtual]
Remarks:
Returns a DWORD that indicates the channels that this Effect requires in the output bitmap.
Parameters:
TimeValue t

The time at which the channels are required.
Returns:
The required channels. See Image (G-Buffer) Channels.
Default Implementation:
{ return 0; }

Reimplemented from Effect.

Reimplemented in MSEffectXtnd.

void Apply ( TimeValue  t,
Bitmap bm,
RenderGlobalContext gc,
CheckAbortCallback cb 
) [virtual]
Remarks:
This is the method that is called to apply the effect to the bitmap passed.
Parameters:
TimeValue t

The time at which to apply the effect.

Bitmap *bm

The bitmap the effect modifies and stores the result in.

RenderGlobalContext *gc

This can be used to retireve information about the global rendering enviornment.

CheckAbortCallback *cb

Points to an object whose Check() method may be called to determine if the user wants to abort. See Class CheckAbortCallback.

Implements Effect.

Reimplemented in MSEffectXtnd.

virtual bool SupportsBitmap ( Bitmap bitmap ) [virtual]

Returns wether the given bitmap is supported by the effect.

The implementation should usualy check the bitmap type (bitmap.Storage()->Type()) to determine whether it supports that type.

Usage example: An effect plugin which uses the BMM_Color_64 version of Bitmap::GetPixels() will work with 32bit floating-point bitmaps, but will clamp the colors and should therefore be considered incompatible. An effect plugin which uses the BMM_Color_fl version of Bitmap::GetPixels() can be considered as compatible with all bitmap types.

To check whether an effect supports a given bitmap, it is advised to call the static method Effect8::SupportsBitmap(Effect&, Bitmap&) instead of this. The static method handles class Effect as well as Effect8 and implements appropriate default behaviour for class Effect.

Parameters:
[in] bitmap - The bitmap to be tested for compatibility.
Returns:
true if the bitmap is supported by this render effect, false otherwise.

Implements Effect8.

Effect* to_effect ( ) [inline, virtual]

Reimplemented from Value.

{ return this; }

Member Data Documentation


MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect
MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect MSPluginEffect