Return to index


mg_handle, mg_entity, mg_ename, mg_nqcdivs - entity assistance and control


int mg_handle( int en, int ac, char *av )

int mg_entity( char *name )

extern char mg_ename[MG_NENTITIES][MG_MAXELEN]

extern int mg_nqcdivs


The mg_handle routine may be used to pass entities back to the parser to be redirected through the mg_ehand dispatch table. This method is recommended rather than calling through mg_ehand directly, since the parser sometimes has its own support routines that it needs to call for specific entities. The first argument, en, is the corresponding entity number, or -1 if mg_handle should figure it out from the first av argument.

The mg_entity function gets an entity number from its name, using a hash table on the mg_ename list.

The mg_ename table contains the string names corresponding to each MGF entity in the designated order. (See the mg_init page for the list of MGF entities.)

The global integer variable mg_nqcdivs tells the parser how many subdivisions to use per quarter circle (90 degrees) when tesselating curved geometry. The default value is 5, and it may be reset at any time by the calling program.


The mg_handle function returns MG_OK if the entity is handled correctly, or one of the predefined error values if there is a problem. (See the mg_load page for a list of error values.)

The mg_entity function returns -1 if the passed name does not appear in the mg_ename list.


mg_init, mg_load, mg_open