DeAddClass(3D)

NAME
DeAddClass - Add a user-defined class (object type)

SYNOPSIS
C:
DtInt DeAddClass(name, count, list, default_routine)
DtPtr name;
DtInt count;
DtMethodEntry list[];
DtMethodPtr default_routine;

FORTRAN:
INTEGER*4 DEAC(NAME, N, COUNT, LIST, DFLTRT)
CHARACTER*N NAME
INTEGER*4 COUNT
INTEGER*4 LIST(*)
EXTERNAL DFLTRT
DEAMTH(LIST, METHOD, RTN, MTHCNT)
INTEGER*4 LIST(*)
INTEGER*4 METHOD
EXTERNAL RTN
INTEGER*4 MTHCNT

DESCRIPTION

DeAddClass adds a new class (object type) to the Dore system. It returns a unique class identification number.

Each class in Dore must have a unique name. The parameter name specifies the name for the new class. The convention is to name the class the same as the routine for creating an object of the new class.

The parameter list is an array of DtMethodEntry where each entry is defined as:

typedef struct {
   DtInt id; /*Method Identifier*/
   DtMethodPtr routine; /*Pointer to Method Routine*/ } DtMethodEntry;

The array is used to associate user-defined method routines with methods. The parameter count specifies the number of methods in list.

The parameter default_routine is a pointer to a routine that will be used for methods that are not specified in list, or DcNullPtr <DCNULL>.

Methods used by user-defined primitives are:

DcMethodCmpBndVolume   <DCMCBV>
    Compute bounding volume box.

DcMethodDestroy   <DCMDST>
    Deallocate space used by object.

DcMethodDynRender   <DCMDR>
    Dynamic rendering, if different from DcMethodStdRenderDisplay.

DcMethodGlbrndIniObjs   <DCMGIO>
    Production rendering, if different fromDcMethodStdRenderDisplay.

DcMethodPick   <DCMPCK>
    Determine if object has been picked.

DcMethodPrint   <DCMPRT>
    Print object information.

DcMethodStdRenderDisplay <DCMSRD>
    Update and execute alternate object.

DcMethodUpdStdAltObj <DCMSAO>
    Update and return alternate object.

FORTRAN SPECIFIC

The parameter NAME is a string of length N representing the name of the new class.

FORTRAN the method list is built using DEAMTH. The calling routine must allocate space for the list (twice as many elements as methods to be inserted). DEAMTH is called once for every method/routine pair to be added to the list. The parameter MTHCNT is the number of methods that have already been added to the list.

ERRORS
DeAddClass will fail if a method in list is invalid.

[WARNING - invalid method]