3ds Max C++ API Reference
FPEnum Class Reference

#include <ifnpub.h>

+ Inheritance diagram for FPEnum:

Classes

struct  enum_code
 

Public Attributes

EnumID ID
 ID for this enumeration. More...
 
Tab< enum_codeenumeration
 The table of enumeration codes. 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 FPInterface, Function Publishing

Description:
This class contains an ID for the enumeration and a table of structures which contains a name and an integer code for each item. This is used by metadata clients to support symbolic values for TYPE_ENUM types (ints).

One or more symbolic enums, similar to C++ enums, can now be added to an FPInterface's metadata, and individual int parameters and/or results for functions in that interface can be defined as TYPE_ENUM and associated with one of the enum lists. Working in a similar manner as MAXScript, this allows metadata clients to support symbolic encodings for these parameters and results.

Enums are defined in the FPInterface descriptor following the function and property definitions as sets of string/code pairs. Each enum list is identified by a unique integer, similar to function IDs, which is used to associated a TYPE_ENUM parameter or result with its enum. IDs for these would normally be defined somewhere near the function IDs for an interface. For example:
// function IDs
enum
{
bmm_getWidth,
bmm_getHeight,
bmm_getType,
bmm_copyImage,
...
};
// enum IDs
enum
{
bmm_type,
bmm_copy_quality,
...
};
might be some of the IDs for a possible bitmap manager interface. The two enums provide symbolic codes for the bitmap type and copyImage quality defines in the "bitmap.h" SDK header, such as BMM_PALETTED, BMM_TRUE_32, COPY_IMAGE_RESIZE_LO_QUALITY, etc. In the descriptor for the interface, any enum lists follow the function and property definitions. They are introduced by the special tag, 'enums', as in the following example:
static FPInterfaceDesc bmmfpi
(
BMM_INTERFACE, _M("bmm"), IDS_BMMI, NULL, FP_CORE,
...
bmm_copyImage, _M("copyImage"), ...
_M("copyType"), IDS_COPYTYPE, TYPE_ENUM, bmm_copy_quality,
...
geo_getType, geo_setType, _M("type"), 0, TYPE_ENUM, bmm_type,
bmm_type, 7,
M("lineArt") , BMM_LINE_ART,
M("paletted") , BMM_PALETTED,
M("gray8") , BMM_GRAY_8,
M("gray16") , BMM_GRAY_16 ,
M("true16") , BMM_TRUE_16,
M("true32") , BMM_TRUE_32,
M("true24") , BMM_TRUE_64,
bmm_copy_quality, 4,
M("crop") , COPY_IMAGE_CROP,
M("useCustom") , COPY_IMAGE_USE_CUSTOM,
end
);
#define NULL
Definition: autoptr.h:18
Definition: ifnpub.h:325
@ properties
Definition: paramtype.h:965
@ enums
Definition: paramtype.h:968
#define COPY_IMAGE_CROP
Copy image to current map size w/cropping if necessary.
Definition: bitmap.h:339
#define COPY_IMAGE_USE_CUSTOM
Resize based on Image Input Options (BitmapInfo *)
Definition: bitmap.h:346
#define COPY_IMAGE_RESIZE_HI_QUALITY
This is a resize from 50x50 to 150x150 using this option.
Definition: bitmap.h:345
#define COPY_IMAGE_RESIZE_LO_QUALITY
This is a resize from 50x50 to 150x150 using this option.
Definition: bitmap.h:342
#define BMM_GRAY_8
8-bit grayscale bitmap.
Definition: bitmap.h:132
#define BMM_TRUE_64
64-bit color: 16 bits each for Red, Green, Blue, and Alpha.
Definition: bitmap.h:136
#define BMM_GRAY_16
16-bit grayscale bitmap.
Definition: bitmap.h:133
#define BMM_LINE_ART
1-bit monochrome image
Definition: bitmap.h:130
#define BMM_TRUE_32
32-bit color: 8 bits each for Red, Green, Blue, and Alpha.
Definition: bitmap.h:135
#define BMM_TRUE_16
16-bit true color image.
Definition: bitmap.h:134
#define BMM_PALETTED
8-bit paletted image.
Definition: bitmap.h:131
#define FP_CORE
Definition: ifnpub.h:522
@ TYPE_ENUM
Identifies an enum argument type or return value.
Definition: paramtype.h:112
#define _M(x)
Used to wrap string literals.
Definition: strbasic.h:67
In the above example, the enums are listed following the function and property definitions. They are introduced by the 'enums' tag and consist of an enum ID followed by a count of items, followed by that many string and code pairs. By attaching them to the interface like this, any number of functions and properties in the interface can use them.

The above example also has function and property definitions showing the use of TYPE_ENUM. The copyImage function takes a copyType parameter which uses the bmm_copy_quality enum and the type property uses the bmm_type enum. In all situations where TYPE_xxx types can be supplied in a descriptor, including the new property definitions, TYPE_ENUM can be used to indicate an int by-value type. TYPE_ENUM's must always be followed by an enum ID. This is the only case in which the type is specified as a pair of values. TYPE_ENUM parameters and results show up in MAXScript as # names. For example, if a bmm interface was in the variable 'bm1' and the bitmap type was BMM_GRAY_16:
bm1.type
--> #gray16
bm1.type = #true32 -- set it to #true24 (code is BMM_TRUE_24)
bm2 = bm1.copyImage #resizeHi
#define BMM_TRUE_24
24-bit color: 8 bits each for Red, Green, and Blue.
Definition: bitmap.h:153
the integer TYPE_ENUM codes are translated back-and-forth to symbolic # names by MAXScript using the definitions in the FPInterface descriptor's enums. If you need to access the enum metadata in an FPInterfaceDesc, it is available in the 'enumerations' data member. This is a Tab<> of pointers to FPEnum class instances which themselves contain a Tab<> of name, code pairs. See class FPEnum in /MAXSDK/INCLUDE/FnPub.h for details.

Member Data Documentation

◆ ID

EnumID ID

ID for this enumeration.

◆ enumeration

Tab<enum_code> enumeration

The table of enumeration codes.