Class ParamDimension
See Also: Class ParamDimensionBase, List of Dimension Types.
Description:
Any parameter that can be controlled by a controller has a dimension. This dimension can be considered a unit of measure. It describes its type and its order of magnitude. When a controller needs to display the parameter values (for example in the function curve editor) it converts the value using its parameter dimension Convert() function. It can also convert back using the Unconvert() function.
Some parameters are stored over one range of values and displayed in another. For example parameter that use stdAngleDim store their parameters in radians but display them in degrees. By using stdAngleDim the value is converted to the proper format for display. Some parameter dimensions do not perform any conversion, for example stdWorldDim.
There are several default parameter dims implemented. Listed with each one is the type, convert functions and range of values usually stored (these are not enforced in any way).
If the type of parameter for your plug-in does not fit within any of the dimensions listed here you may simply use defaultDim. This performs no conversions and has no range.
ParamDimension *defaultDim;
Convert() is original value.
UnConvert() is original value.
Range: None.
ParamDimension *stdWorldDim;
The DimType is DIM_WORLD
Convert() return original value.
UnConvert() returns original value.
ParamDimension *stdAngleDim;
The DimType is DIM_ANGLE.
Convert() is RadToDeg()
UnConvert() is DegToRad()
ParamDimension *stdColorDim;
The DimType is DIM_COLOR
Convert() return original value.
UnConvert() returns original value.
Range: 0-1
ParamDimension *stdColor255Dim;
The DimType is DIM_COLOR255
Convert() is value * 255.0f
UnConvert() is value / 255.0f
Range: 0-255
ParamDimension *stdPercentDim;
The DimType is DIM_PERCENT
Convert() is value * 100.0f
UnConvert() is value / 100.0f
Range: 0-100
ParamDimension *stdNormalizedDim;
The DimType is DIM_NORMALIZED
Convert() is original value.
UnConvert() is original value.
Range: 0-1
ParamDimension *stdSegmentsDim;
The DimType is DIM_SEGMENTS
Convert() is original value.
UnConvert() is original value.
ParamDimension *stdTimeDim;
The DimType is DIM_TIME
Convert() is value/GetTicksPerFrame()
UnConvert()is value*GetTicksPerFrame() (see the section Time for details).
Methods:
If the DimType is custom than the methods below must be implemented. Note: This class is derived from ParamDimensionBase which provides methods DimensionType(), Convert() and Unconvert().
Prototype:
virtual float GetDimScale();
Remarks:
Implemented by the Plug-In.
Returns the dimension scale.
Prototype:
virtual void SetDimScale();
Remarks:
Implemented by the Plug-In.
Sets the dimension scale.
Prototype:
virtual TCHAR *DimensionName();
Remarks:
Implemented by the Plug-In.
Returns the name of the dimension.