Add a sub-model or ufo in the Eagle data base.
Synopsis
EIF_add_modufo (item,frag,pos,strflag, strfac, rotflag,rotmat,ipen, transp,solid,hatch,subname, len,max,min,fill,id);
Input Parameters
int item,frag,strflag,rotflag,ipen,len,*subname,fill; double *pos,*strfac,rotmat[3][3],*max,*min;
Output Parameters
int*id;
Returns
An error flag.
Arguments
i |
The
type of item. It can be initialized with the function |
pos |
The
position of the ufo |
strflag |
The
stretch flag. If 1 the ufo is stretched. |
strfac |
The
stretching factor of the ufo. |
rotflag |
It is
a combination of rotated flag + index for the ufo. |
rotmat |
Rotation
matrix. |
pen |
The
vector style for ufo |
transp |
Only
for sub-model: transparency flag. |
solid |
Only for ufo: solid flag. |
hatch |
Only for ufo: type of hatch. |
max |
The maximum co-ordinates of the ufo. |
min |
The minimum co-ordinates of the ufo. |
name |
The
name of the ufo. |
len |
The
length of the name of the ufo. |
fill |
The
color fill and the tile pattern. These two values can be set to
0 because these values are defined in the item's attribute. |
pen |
Line
style of the ufo. This value is a combination of pen, dash and
thickness. It should be split with the routine |
id |
Item identifier : id = 0 means that an error occurred while adding the item to the Eagle data base. |
Include Files
EIF_lib.h, EIF_std.h
Description
Put in the Eagle data base the information about the ufo. Before using this routine, you should read the information from the model file with the functions
EIF_cardmodufo_ascii EIF_getmodufo_ascii
and you should allocate the array name
with the function EIF_liballoc . It is then recommended to
free the array with the function EIF_libfree
Example
#include <stdio.h> #include "EIF_lib.h" #include "EIF_std.h" FILE *fp; int frag,leng,strcol,stretch,colour,rottra,rotflag, index,pen,hatsol,hatch,solid,*name; double pos[3],stretfact[3],matrix[3][3],max[3],min[3]; if ( ( leng = EIF_cardmodufo_ascii(fp)) > 0) { if (name =(int *)EIF_liballoc(INT,leng,1) == NULL) { printf("\n Error allocating memory \n"); return(-1); } if( (EIF_getmodufo_ascii(fp,item,frag,pos,&stretchflag, stretfac,&rotflag,matrix,&pen, &transp,&solid,&hatch,name, max, min)) { if((EIF_add_modufo(item,frag,pos,stretchflag, stretfac,rotflag,matrix,pen, transp,solid,hatch,name,leng, max,min,fill,&id )) } ...
EIF_libfree((char *)name);
Related Routines
EIF_liballoc
, EIF_libfree,
EIF_cardmodufo_ascii,
EIF_getmodufo_ascii