Return to index
NAME
mg_handle, mg_entity, mg_ename, mg_nqcdivs - entity assistance and control
SYNOPSIS
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
DESCRIPTION
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.
DIAGNOSTICS
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.
SEE ALSO
mg_init, mg_load, mg_open