Preprocessor Definitions

ENSURE_ALLOCATED(var, type, count)

Expands to

SEMI_PROTECT(if (count > 0) {              \
        BSTREAM_ALLOC_ARRAY(var, count, type); \
        if ((var) == 0)                        \
            return tk.Error();                 \
    })
ENSURE_ALLOCATED_CLEAR(var, type, count)

Expands to

SEMI_PROTECT(BSTREAM_ALLOC_ARRAY(var, count, type); if ((var) == 0) return tk.Error(); \
                 memset(var, 0, (count) * sizeof(type));)
ID_Key

ID_Key is just a pointer sized long integer by which it is assumed that the graphics system can uniquely identify its contents. Declared as 64-bit on win64 systems because a long is not big enough to store a pointer there (unlike all other 64-bit systems we have supported in the past

Expands to

long
IMPLEMENT_CLONE(class_name)

macro to simplify normal implementation of the Clone function

Expands to

TK_Status class_name::Clone(BStreamFileToolkit& tk, BBaseOpcodeHandler** newhandler) const \
    {                                                                                          \
        *newhandler = BSTREAM_NEW(class_name);                                                 \
        if (*newhandler != nullptr)                                                            \
            return TK_Normal;                                                                  \
        else                                                                                   \
            return tk.Error("memory allocation in" #class_name "::clone failed");              \
    }
IMPLEMENT_CLONE_OPCODE(class_name)

a version of IMPLEMENT_CLONE for the classes that need to know the opcode

Expands to

TK_Status class_name::Clone(BStreamFileToolkit& tk, BBaseOpcodeHandler** newhandler) const \
    {                                                                                          \
        *newhandler = BSTREAM_NEW(class_name)(Opcode());                                       \
        if (*newhandler != nullptr)                                                            \
            return TK_Normal;                                                                  \
        else                                                                                   \
            return tk.Error("memory allocation in" #class_name "::clone failed");              \
    }
NC_HAS_END

a float is specified for where the TK_NURBS_Curve ends in parametric [0,1] space

Expands to

0x08
NC_HAS_KNOTS

an array of floats for the knots is specified with the TK_NURBS_Curve

Expands to

0x02
NC_HAS_START

a float is specified for where the TK_NURBS_Curve starts in parametric [0,1] space

Expands to

0x04
NC_HAS_WEIGHTS

an array of floats for the weights is specified with the TK_NURBS_Curve

Expands to

0x01
NS_HAS_KNOTS

an array of floats for the knots is specified with the TK_NURBS_Surface

Expands to

0x02
NS_HAS_TRIMS

the TK_NURBS_Surface contains a list of trims

Expands to

0x04
NS_HAS_WEIGHTS

an array of floats for the weights is specified with the TK_NURBS_Surface

Expands to

0x01
NS_TRIM_COLLECTION

all trim objects up to the next NS_TRIM_END should be combined as one.

Expands to

3
NS_TRIM_CURVE

the next trim is a nurbs curve in parametric space

Expands to

2
NS_TRIM_END

terminates an NS_TRIM_COLLECTION if one is active, otherwise terminates the list of trims

Expands to

0
NS_TRIM_HAS_KNOTS

applies only to trims of type NS_TRIM_CURVE: an array of floats for the knots is specified with the trim curve

Expands to

0x04
NS_TRIM_HAS_WEIGHTS

applies only to trims of type NS_TRIM_CURVE: an array of floats for the weights is specified with the trim curve

Expands to

0x02
NS_TRIM_KEEP

instead of the usual cutting away the enclosed area, cut away everything but

Expands to

0x01
NS_TRIM_LAST_KNOWN_TYPE

the last known trim type defined as of the current version of the toolkit

Expands to

3
NS_TRIM_POLY

the next trim is a polyline (closed automatically if not already a closed loop)

Expands to

1
SEMI_PROTECT(x)

Expands to

do {                \
        x               \
    } while (0)
TKLOD_ESCAPE

terminates the list of all LOD levels. TKE_Termination could not be used, since 0 is a valid value for LOD level.

Expands to

255
TKO_Font_Size_Object

Expands to

TKO_Generic_Size_Object
TKO_Font_Size_Percent

Expands to

TKO_Generic_Size_Percent
TKO_Font_Size_Pixels

Expands to

TKO_Generic_Size_Pixels
TKO_Font_Size_Points

Expands to

TKO_Generic_Size_Points
TKO_Font_Size_Screen

Expands to

TKO_Generic_Size_Screen
TKO_Font_Size_Units

Expands to

TKO_Generic_Size_Units
TKO_Font_Size_Window

Expands to

TKO_Generic_Size_Window
TKO_Font_Size_World

Expands to

TKO_Generic_Size_World
TKO_Rendo_Extended

Extended bit for Rendering Options

Expands to

0x80000000
TKO_Rendo_Extended2

Expands to

0x80000000
TKPP_ANY_2D_MASK

Expands to

0x3F00
TKPP_EXPLICIT_PRIMITIVE_MASK

Expands to

0x0006
TKPP_X_2D_MASK

Expands to

0x0300
TKPP_Y_2D_MASK

Expands to

0x0C00
TKPP_Z_2D_MASK

Expands to

0x3000
TK_DEFAULT_BUFFER_SIZE

default amount of the internal memory buffer used for file processing

Expands to

32768
TK_File_Format_Version

the HSF specification version that this toolkit supports (along with any previous versions)

Expands to

2305