Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

AutoGizmoC Class Reference

Auto gizmo class. More...

#include <AutoGizmoC.h>

Inheritance diagram for AutoGizmoC:

GizmoI EditableI DataBlockI List of all members.

Public Methods

virtual Edit::DataBlockIcreate ()
 Creates new datablock. See DataBlockI.

virtual Edit::DataBlockIcreate (Edit::EditableI *pOriginal)
 Creates new layer (used internally), see Edit::EditableI::create().

virtual void copy (Edit::EditableI *pEditable)
 Deep copy from a data block, see Edit::DataBlockI::copy().

virtual void restore (Edit::EditableI *pEditable)
 Shallow copy from a editable, see Edit::EditableI::restore().

virtual PajaTypes::int32 get_parameter_count ()
 Returns number of parameters in the gizmo.

virtual void add_parameter (ParamI *pParam)
 Returns parameter at specified index.

virtual void del_parameter (PajaTypes::int32 i32Index)
 Returns parameter at specified index.

virtual ParamIget_parameter (PajaTypes::int32 i32Index)
 Returns parameter at specified index.

virtual ParamIget_parameter_by_id (PajaTypes::int32 i32Id)
 Returns parameter with spcified id.

virtual PajaTypes::uint32 save (FileIO::SaveC *pSave)
 Serialize the auto gizmo to a Demopaja output stream.

virtual PajaTypes::uint32 load (FileIO::LoadC *pLoad)
 Serialize the auto gizmo from a Demopaja input stream.


Static Public Methods

AutoGizmoC * create_new (EffectI *pParent, const char *szName, PajaTypes::uint32 ui32Id)
 Creates new datablock.


Protected Methods

 AutoGizmoC ()
 Default constructor.

 AutoGizmoC (EffectI *pParent, const char *szName, PajaTypes::uint32 ui32Id)
 Constructor.

 AutoGizmoC (Edit::EditableI *pOriginal)
 Constructor with reference to the original.

virtual ~AutoGizmoC ()
 Default destructor.


Detailed Description

Auto gizmo class.

Auto gizmo is a class derived from GizmoI interface. Auto gizmo class provides an easy way to implement a basic gizmo. This class has methods to create a gizmo without writing a new class. New parameters can be added and existing deleted. The changes made with add_parameter() and del_parameter() methods are not stored into the undo object.

The auto gizmo has to be created in the constructor of the plugin effect class. The auto gizmo has to be completely created at the time the auto gizmo is serialized.

The parameters are saved and loaded based on their IDs, so make them unique.

Example use:

        PlaaEffect::PlaaEffect()
        {
            // Create Transform gizmo.
            m_pTransGizmo = AutoGizmoC::create_new( this, "Transform", ID_TRANSFORM );
            m_pTransGizmo->add_parameter( ParamVector2C::create_new( this, "Position", Vector2C(), ID_TRANS_POS,
                                            PARAM_STYLE_EDITBOX | PARAM_STYLE_ABS_POSITION, PARAM_ANIMATABLE ) );
            m_pTransGizmo->add_parameter( ParamVector2C::create_new( this, "Pivot", Vector2C(), ID_TRANS_PIVOT,
                                            PARAM_STYLE_EDITBOX | PARAM_STYLE_REL_POSITION | PARAM_STYLE_WORLD_SPACE, PARAM_ANIMATABLE );
            m_pTransGizmo->add_parameter( ParamFloatC::create_new( this, "Rotation", 0, ID_TRANS_ROT,
                                            PARAM_STYLE_EDITBOX | PARAM_STYLE_ANGLE, PARAM_ANIMATABLE, 0, 0, 1.0f );
            m_pTransGizmo->add_parameter( ParamVector2C::create_new( this, "Scale", Vector2C( 1, 1 ), ID_TRANS_SCALE,
                                            PARAM_STYLE_EDITBOX | PARAM_STYLE_PERCENT, PARAM_ANIMATABLE, Vector2C(), Vector2C(), 0.01f );
        }

See also:
Composition::GizmoI


Constructor & Destructor Documentation

AutoGizmoC   [protected]
 

Default constructor.

AutoGizmoC EffectI   pParent,
const char *    szName,
PajaTypes::uint32    ui32Id
[protected]
 

Constructor.

Parameters:
pParent  pointer to the effect which is holds this gizmo.
szName  The name of the gizmo.
ui32Id  ID of the gizmo, this ID is passed to the update_notify() method.

AutoGizmoC Edit::EditableI   pOriginal [protected]
 

Constructor with reference to the original.

virtual ~AutoGizmoC   [protected, virtual]
 

Default destructor.


Member Function Documentation

virtual void add_parameter ParamI   pParam [virtual]
 

Returns parameter at specified index.

virtual void copy Edit::EditableI   pEditable [virtual]
 

Deep copy from a data block, see Edit::DataBlockI::copy().

Reimplemented from GizmoI.

virtual Edit::DataBlockI* create Edit::EditableI   pOriginal [virtual]
 

Creates new layer (used internally), see Edit::EditableI::create().

Implements EditableI.

virtual Edit::DataBlockI* create   [virtual]
 

Creates new datablock. See DataBlockI.

Implements EditableI.

AutoGizmoC* create_new EffectI   pParent,
const char *    szName,
PajaTypes::uint32    ui32Id
[static]
 

Creates new datablock.

Parameters:
pParent  Pointer to the parent effect.
ui32Id  ID of the gizmo.

virtual void del_parameter PajaTypes::int32    i32Index [virtual]
 

Returns parameter at specified index.

virtual ParamI* get_parameter PajaTypes::int32    i32Index [virtual]
 

Returns parameter at specified index.

Implements GizmoI.

virtual ParamI* get_parameter_by_id PajaTypes::int32    i32Id [virtual]
 

Returns parameter with spcified id.

The param ID is the ID set when the parameter is created.

virtual PajaTypes::int32 get_parameter_count   [virtual]
 

Returns number of parameters in the gizmo.

Implements GizmoI.

virtual PajaTypes::uint32 load FileIO::LoadC   pLoad [virtual]
 

Serialize the auto gizmo from a Demopaja input stream.

Reimplemented from GizmoI.

virtual void restore Edit::EditableI   pEditable [virtual]
 

Shallow copy from a editable, see Edit::EditableI::restore().

Reimplemented from GizmoI.

virtual PajaTypes::uint32 save FileIO::SaveC   pSave [virtual]
 

Serialize the auto gizmo to a Demopaja output stream.

Reimplemented from GizmoI.


Moppi Demopaja SDK Documentation -- Copyright © 2000-2002 Moppi Productions