Brief Index      Full Index      I.M. Reference

HC_DEFINES File Reference


Defines

#define HC_ANY_ARGS   (see code)
#define HC_CDECL   (see code)
#define HC_POINT   (see code)
#define HC_PLANE   (see code)
#define HC_BOOLEAN   (see code)
#define HC_KEY   (see code)
#define HC_EXTRA_POINTER_FORMAT   (see below)
#define HC_POINTER_SIZED_INT   (see code)
#define HC_PIXEL   (see code)

Detailed Description


Define Documentation

#define HC_ANY_ARGS   (see code)

A variable argument function.

    #ifdef __cplusplus
    #   define      HC_ANY_ARGS ...
    #else
    #   define      HC_ANY_ARGS
    #endif

#define HC_CDECL   (see code)

A multi-platform abstraction.

    #ifndef HC_CDECL
    #   ifdef _MSC_VER
    #       define HC_CDECL __cdecl
    #   else
    #       define HC_CDECL
    #   endif
    #endif

#define HC_POINT   (see code)

A placeholder for a structure of three floats defining the x-y-z coordinates of a point.

    #ifndef HC_POINT
    #   define  HC_POINT    void
    #endif

NOTE: If you want a real definition for HC_POINT, put

    typedef struct {float x, y, z;} Point;
    #define HC_POINT        Point
in your program before including "hc.h"

#define HC_PLANE   (see code)

A placeholder for a structure of four floats defining the scalars (a, b, c, d) of the plane equation (ax + by + cz + d) = 0.

    #ifndef HC_PLANE
    #   define  HC_PLANE    void
    #endif

NOTE: if you want a real definition for HC_PLANE, put

    typedef struct {float a, b, c, d;} Plane;
    #define HC_PLANE    Plane
in your program before including "hc.h".

#define HC_BOOLEAN   (see code)

HOOPS Boolean return type.

    #ifndef HC_BOOLEAN
    #   define  HC_BOOLEAN  int
    #endif

#define HC_KEY   (see code)

HOOPS type for a unique object key.

    #ifndef HC_KEY
    #ifdef _M_IA64
    #   define  HC_KEY      __int64
    #else
    #   define  HC_KEY      long
    #endif
    #endif

NOTE: To maintain Windows IA64 compatibility, use this example to cast an HC_KEY in sprintf():

    sprintf (option, "use window id = %s%p", HC_EXTRA_POINTER_FORMAT, (void*)(HC_KEY)key);

See also:
HC_EXTRA_POINTER_FORMAT

#define HC_EXTRA_POINTER_FORMAT   (see below)

A multi platform abstraction used to support Windows on Itanium.

All options that take an integral value ("use window id" and "debug" in particular, but also including things like "face displacement" and "related selection limit") can take decimal, hexadecimal, or octal, using the same formatting as in C/C++ (leading 0x means hex, else leading 0 means oct, else dec).

Problems arise due to sprintf formatting. When sizeof(int) == sizeof(long) == sizeof(void *), the following work fine:

    sprintf (buffer, "use window id=%d", imageKey);
    sprintf (buffer, "use window id=0x%x", imageKey);

If the long and pointer types both change to 64 bits, "%ld" or "0x%lx" will work (on most systems), but if the pointer size is changed while long is kept at 32 bits, these won't work. At least one system supports "%I64d" and "0x%I64x" forms, but a better way is to use "%p" which is meant to convert pointers to hex strings. The only problem with that is the usual system-dependent implementation -- some add the "0x", some don't -- so additionally we can define HC_EXTRA_POINTER_FORMAT to add the "0x" where the system doesn't:

    #define HC_EXTRA_POINTER_FORMAT extra_pointer_format()
  
    const char* extra_pointer_format(void) {
    
        char buffer[1024];

        sprintf (buffer, "%p", (void*) buffer);

        if (buffer[0] == '0' && buffer[1] == 'x')
            return "";
        else
            return "0x";
    }

See also:
HC_KEY

#define HC_POINTER_SIZED_INT   (see code)

A multi-platform abstraction to support Windows on Itanium.

    #ifndef HC_POINTER_SIZED_INT
    #ifdef _M_IA64
    #   define  HC_POINTER_SIZED_INT    __int64
    #else
    #   define  HC_POINTER_SIZED_INT    long
    #endif
    #endif

#define HC_PIXEL   (see code)

A placeholder for a structure of three floats defining the three color values of a pixel.

    #ifndef HC_PIXEL
    #   define  HC_PIXEL    void
    #endif

NOTE: if you want a real definition for HC_PIXEL, put

    typedef struct {float r, g, b;} Pixel;
    #define HC_PIXEL    Pixel
in your program before including "hc.h".

Main Index
Brief Index      Full Index      I.M. Functions