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

ParamVector2C Class Reference

2D vector parameter class. More...

#include <ParamI.h>

Inheritance diagram for ParamVector2C:

ParamI EditableI DataBlockI List of all members.

Public Methods

virtual Edit::DataBlockIcreate ()
 Creates new parameter.

virtual Edit::DataBlockIcreate (Edit::EditableI *pOriginal)
 Creates new datablock, with reference to the original.

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::uint32 get_type () const
 Returns the type of the parameter.

virtual void set_controller (ControllerC *cnt)
 Sets the controller of the parameter.

virtual ControllerCget_controller ()
 Returns the conroller attached to the parameter.

virtual void set_min_max (const PajaTypes::Vector2C &min, const PajaTypes::Vector2C &max)
 Sets the range of the parameter.

virtual const PajaTypes::Vector2Cget_min () const
 Returns the minimum of the value range.

virtual const PajaTypes::Vector2Cget_max () const
 Returns the maximum of the value range.

virtual bool get_min_max (PajaTypes::float32 *pMin, PajaTypes::float32 *pMax)
 Returns the range of the parameter.

virtual void set_increment (PajaTypes::float32 inc)
 Sets the spinner increment of the parameter.

virtual PajaTypes::float32 get_increment () const
 Returns the spinner increment.

virtual void set_style (PajaTypes::uint32 style)
 Sets the style of the parameter.

virtual PajaTypes::uint32 get_style () const
 Returns the style of the parameter.

virtual void set_id (PajaTypes::uint32 id)
 Sets the ID of the parmeter.

virtual PajaTypes::uint32 get_id () const
 Returns the ID of the parameter.

virtual PajaTypes::uint32 set_val (PajaTypes::int32 t, const PajaTypes::Vector2C &val)
 Sets the value of the parameter at specified time.

virtual void get_val (PajaTypes::int32 t, PajaTypes::Vector2C &val)
 Gets the value of the parameter at specified time.

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

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


Static Public Methods

ParamVector2C * create_new (GizmoI *pParent, const char *name, const PajaTypes::Vector2C &value, PajaTypes::uint32 id, PajaTypes::uint32 style=PARAM_STYLE_EDITBOX, bool animatable=true, const PajaTypes::Vector2C &min=PajaTypes::Vector2C(), const PajaTypes::Vector2C &max=PajaTypes::Vector2C(), PajaTypes::float32 inc=0.1f)
 Creates a new 2D vector parameter.


Protected Methods

 ParamVector2C ()
 Default constructor.

 ParamVector2C (GizmoI *pParent, const char *name, const PajaTypes::Vector2C &value, PajaTypes::uint32 id, PajaTypes::uint32 style=PARAM_STYLE_EDITBOX, bool animatable=true, const PajaTypes::Vector2C &min=PajaTypes::Vector2C(), const PajaTypes::Vector2C &max=PajaTypes::Vector2C(), PajaTypes::float32 inc=0.1f)
 Constructor.

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

virtual ~ParamVector2C ()
 Default destructor.


Detailed Description

2D vector parameter class.

The 2D vector parameter can used to control everything where two parameter is enough. This parameter can have extra styles which enables it to be used as a percentage or an angle parameter. Also a couple of flags enables it to be used efficiently as positional parameter. This parameter type can also be edited in the Layout view if prper styles are set.

A new 2D vector parameter is created using the create_new() static method.


Constructor & Destructor Documentation

ParamVector2C   [protected]
 

Default constructor.

ParamVector2C GizmoI   pParent,
const char *    name,
const PajaTypes::Vector2C   value,
PajaTypes::uint32    id,
PajaTypes::uint32    style = PARAM_STYLE_EDITBOX,
bool    animatable = true,
const PajaTypes::Vector2C   min = PajaTypes::Vector2C(),
const PajaTypes::Vector2C   max = PajaTypes::Vector2C(),
PajaTypes::float32    inc = 0.1f
[protected]
 

Constructor.

ParamVector2C Edit::EditableI   pOriginal [protected]
 

Constructor with reference to the original.

virtual ~ParamVector2C   [protected, virtual]
 

Default destructor.


Member Function Documentation

virtual void copy Edit::EditableI   pEditable [virtual]
 

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

Reimplemented from ParamI.

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

Creates new datablock, with reference to the original.

Parameters:
pOriginal  Pointer to the original editable. This method is used by the undo system to create a copy of the editable while keeping reference to the original.
The method restore() is used to restore the data from the original copy.

Implements EditableI.

virtual Edit::DataBlockI* create   [virtual]
 

Creates new parameter.

Following default values are used:

            pParent = 0,
            szName = 0,
            rValue = (0, 0),
            ui32ID = 0,
            ui32Style = 0,
            bAnimatable = false,
            rMin = (0, 0),
            rMax = (0, 0),
            f32Inc = 0.1f

See also:
create_new

Implements EditableI.

ParamVector2C* create_new GizmoI   pParent,
const char *    name,
const PajaTypes::Vector2C   value,
PajaTypes::uint32    id,
PajaTypes::uint32    style = PARAM_STYLE_EDITBOX,
bool    animatable = true,
const PajaTypes::Vector2C   min = PajaTypes::Vector2C(),
const PajaTypes::Vector2C   max = PajaTypes::Vector2C(),
PajaTypes::float32    inc = 0.1f
[static]
 

Creates a new 2D vector parameter.

Parameters:
pParent  Pointer to the parent gizmo.
szName  The name of the parameter as NULL terminated string.
rValue  Start value of the parameter.
ui32ID  ID of the parameter.
ui32Style  The style of the parameter. Must be PARAM_STYLE_EDITBOX. In addition PARAM_STYLE_PERCENT, PARAM_STYLE_ANGLE, PARAM_STYLE_ABS_POSITION, PARAM_STYLE_REL_POSITION, PARAM_STYLE_WORLD_SPACE, or PARAM_STYLE_OBJECT_SPACE can be set. Default PARAM_STYLE_EDITBOX.
bAnimatable  If set true the parameter is animatable, else it's not (you may use PARAM_ANIMATABLE or PARAM_NOT_ANIMATABLE too). Default true.
rMin  The minimum of the parameter value range. Default (0, 0).
rMax  The maximum of the parameter value range. Default (0, 0).
f32Inc  The increment of the value spinner in type-in. Default 0.1.
If minimum and maximum of the range are same no range checking is used.

The only type-in style is editbox.

If PARAM_STYLE_PERCENT is set, percent marks are used in the GUI, and also the values are multiplied by 100 before displayed. That is, the value for 100% is 1.0.

If PARAM_STYLE_ANGLE is set, the angle mark is shown in the GUI. The value is not scaled.

If PARAM_STYLE_ABS_POSITION is set the parameter is treated as absolute position from the layout origo (lower left corner). Absolute positions are always in the world space. If the parameter is the position of the effect, this style has to be set.

If PARAM_STYLE_REL_POSITION is set the parameter is treated as relative to the position of the effect (not including the pivot). If the parameter is the pivot of the effect, this style has to be set along with the PARAM_STYLE_WORLD_SPACE style.

If PARAM_STYLE_WORLD_SPACE is set the parameter is in the world space coordinate system. The world space coordinate system is the same as the layouts coord-sys.

If PARAM_STYLE_OBJECT_SPACE is set the parameter is in the object space coordinate system. The object space coordinate system is the same as the effect's coord-sys. If this style is set, the point this parameter defines will move along with the effect as it rotates, scales, or when it's pivot is changed.

If the parameter has PARAM_STYLE_ABS_POSITION or PARAM_STYLE_REL_POSITION style the parameter can be edited in the Layout view.

Example: This example creates new parameter. The name of the parameter is "Center", it's default value is (0, 0) and it's ID is ID_CENTER (constant defined by the plugin writer), the type-in style is editbox, the parameter can be animated, and no range is defined. The represents a position which is relative to the effect position and is in effects coordinate system. The is used as effect's center point and therefore it has to transform along with the effect. Spinner increment is default 0.1.

            m_pParamCenter = ParamVector2C::create_new( this, "Center", Vector2C(), ID_CENTER,
                                                        PARAM_STYLE_EDITBOX | PARAM_STYLE_REL_POSITION | PARAM_STYLE_OBJECT_SPACE,
                                                        PARAM_ANIMATABLE );

virtual ControllerC* get_controller   [virtual]
 

Returns the conroller attached to the parameter.

NULL is returned if the parameter cannot be animated.

Implements ParamI.

virtual PajaTypes::uint32 get_id   const [virtual]
 

Returns the ID of the parameter.

Implements ParamI.

virtual PajaTypes::float32 get_increment   const [virtual]
 

Returns the spinner increment.

Implements ParamI.

virtual const PajaTypes::Vector2C& get_max   const [virtual]
 

Returns the maximum of the value range.

virtual const PajaTypes::Vector2C& get_min   const [virtual]
 

Returns the minimum of the value range.

virtual bool get_min_max PajaTypes::float32   pMin,
PajaTypes::float32   pMax
[virtual]
 

Returns the range of the parameter.

Parameters:
pMin  pointer to a array of maximum of KEY_MAXCHANNEL floats.
pMax  pointer to a array of maximum of KEY_MAXCHANNEL floats.
If the type of the parameter id not know use arrays of KEY_MAXCHANNEL floats.

Returns :
true if the range is valid, false if the range is not used.

Implements ParamI.

virtual PajaTypes::uint32 get_style   const [virtual]
 

Returns the style of the parameter.

Implements ParamI.

virtual PajaTypes::uint32 get_type   const [virtual]
 

Returns the type of the parameter.

Implements ParamI.

virtual void get_val PajaTypes::int32    t,
PajaTypes::Vector2C   val
[virtual]
 

Gets the value of the parameter at specified time.

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

Serialize the parameter from a Demopaja input stream.

Reimplemented from ParamI.

virtual void restore Edit::EditableI   pEditable [virtual]
 

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

Reimplemented from ParamI.

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

Serialize the parameter to a Demopaja output stream.

Reimplemented from ParamI.

virtual void set_controller ControllerC   cnt [virtual]
 

Sets the controller of the parameter.

Implements ParamI.

virtual void set_id PajaTypes::uint32    id [virtual]
 

Sets the ID of the parmeter.

Implements ParamI.

virtual void set_increment PajaTypes::float32    inc [virtual]
 

Sets the spinner increment of the parameter.

The spinner increment is the smallest value the parameter is meant to control. For 1/10th accuracy use spinner increment of 0.1. The spinner increment is used in the spinners of the type-ins and also to draw the values in the GUI.

Implements ParamI.

virtual void set_min_max const PajaTypes::Vector2C   min,
const PajaTypes::Vector2C   max
[virtual]
 

Sets the range of the parameter.

virtual void set_style PajaTypes::uint32    style [virtual]
 

Sets the style of the parameter.

Implements ParamI.

virtual PajaTypes::uint32 set_val PajaTypes::int32    t,
const PajaTypes::Vector2C   val
[virtual]
 

Sets the value of the parameter at specified time.


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