3ds Max C++ API Reference
ParamDimension Class Reference

#include <ParamDimension.h>

+ Inheritance diagram for ParamDimension:

Public Member Functions

virtual float GetDimScale ()
 
virtual void SetDimScale ()
 
virtual MCHARDimensionName ()
 
- Public Member Functions inherited from ParamDimensionBase
virtual ~ParamDimensionBase ()
 
virtual DimType DimensionType ()=0
 
virtual float Convert (float value)=0
 
virtual float UnConvert (float value)=0
 
CoreExport int Convert (int value)
 Converts integer values based on the parameter dimensions. More...
 
CoreExport int UnConvert (int value)
 Unconverts integer values based on the parameter dimensions. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

See also
Class ParamDimensionBase, 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 Functions for details).
If the DimType is custom then the methods below must be implemented. Note: This class is derived from ParamDimensionBase which provides methods DimensionType(), Convert() and Unconvert().

Member Function Documentation

◆ GetDimScale()

virtual float GetDimScale ( )
inlinevirtual
Remarks
Returns the dimension scale.
166 {return 1.0f;}

◆ SetDimScale()

virtual void SetDimScale ( )
inlinevirtual
Remarks
Sets the dimension scale.
168 {}

◆ DimensionName()

virtual MCHAR* DimensionName ( )
inlinevirtual
Remarks
Returns the name of the dimension.
170 {return const_cast<MCHAR*>(_M(""));}
#define _M(x)
Used to wrap string literals.
Definition: strbasic.h:67
#define MCHAR
MBCS/Unicode helper defines std::wofstream doesn't mix well with Unicode.
Definition: strbasic.h:42