Debian Codegraph @

3rdparty/yams/yamslib.h

raw
1 #ifdef __cplusplus
2 extern "C" {
3 #endif
4
5 /* Edge: Structure used to store specified mesh edges */
6 typedef struct yams_sedge {
7 int p1,p2;
8 int ref;
9 int tag;
10 } yams_Edge;
11 typedef yams_Edge * yams_pEdge;
12
13 #ifndef ERR
14 #define ERR 1
15 #define WAR 2
16 #define MSG 3
17 #endif
18
19 typedef struct yams_error {
20 double cooerr[6];
21 int inderr[6];
22 int lerror;
23 int coderr;
24 } yams_Error;
25
26 #include "defines.h"
27
28 /* HashTable: hash table structure for mesh edges */
29 typedef struct yams_shashtab {
30 int min; /* min(a,b) */
31 int nxt; /* next edge */
32 int elt;
33 int ind;
34 } yams_Hashtable;
35 typedef yams_Hashtable * yams_pHashtable;
36
37 typedef struct yams_sstack {
38 int *t;
39 int in,out,cur;
40 } yams_Stack;
41 typedef yams_Stack * yams_pStack;
42
43 typedef struct yams_sinfo {
44 double xmin,ymin,zmin,xmax,ymax,zmax; /* bounding box */
45 double delta;
46 double dmin,dmax; /* edge lengths */
47 float qworst;
48 int meshtype,cc,flip;
49 long nulp,nulf,nuln; /* not used */
50 int qpire;
51 int nedg,nrid,ncoi,nreq,nvus;
52 int nafixe,nvrequis,ndang;
53 int manifold;
54 } yams_Info;
55
56 typedef struct yams_soptions {
57 float hmin,hmax; /* desired sizes */
58 float kmin,kmax; /* curvature min,max*/
59 float eps,iso; /* max. tolerance, isovalue */
60 float alpha,gap; /* max values allow.*/
61 float degrad; /* max degrad. qual */
62 float ridge; /* cosine ridge ang */
63 float geom;
64 float shock; /* mesh gradation */
65 float bande; /* bandwidth */
66 float walton; /* angle limitation */
67 float declic;
68 float lambda,mu; /* for smoothing */
69 int ctrl; /* absolute values */
70 int minnp;
71 short iter,choix;
72 unsigned char ptmult,noreff,ffem,check;
73 } yams_Options;
74
75 #ifndef ubyte
76 typedef unsigned char ubyte;
77 #endif
78
79 /* Point: Structure that defines a vertex in a mesh. */
80 typedef struct yams_spoint {
81 float c[3]; /* coordinates */
82 float size; /* calculated size */
83 int tge; /* tangent at ridge */
84 short color;
85 int ref;
86 int tmp;
87 ubyte tag; /* vertex type */
88 ubyte geom;
89 ubyte flag;
90 } yams_Point;
91 typedef yams_Point * yams_pPoint;
92
93 /* Triangle: Structure that defines a triangle in a mesh. */
94 typedef struct yams_striangle {
95 float n[3]; /* face normal */
96 float dish; /* distance to surface */
97 float qual; /* triangle quality */
98
99 int v[3]; /* array of vertex indices */
100 int adj[3]; /* array of adjacent trias */
101 int vn[3]; /* array of vertex normals */
102 int edg[3];
103 int nxt;
104 int ref;
105 short cc;
106
107 ubyte voy[3]; /* array of voyeur vertices */
108 ubyte flag1;
109 ubyte tag[3]; /* array of edge classes */
110 ubyte flag2;
111 } yams_Triangle;
112 typedef yams_Triangle * yams_pTriangle;
113
114 typedef struct yams_squad {
115 float qual;
116 float n[3];
117 int v[4];
118 int adj[4];
119 int ref,edg[4],vn[4];
120 short cc;
121 ubyte flag1,flag2;
122 ubyte voy[4];
123 ubyte tag[4];
124 } yams_Quad;
125 typedef yams_Quad * yams_pQuad;
126
127 typedef struct {
128 int v[4];
129 int ref;
130 } yams_Tetra;
131 typedef yams_Tetra * yams_pTetra;
132
133 typedef struct yams_geomsupp {
134 float vn[3]; /* array of vertex normals */
135 float gap; /* local gap value */
136 int newnum; /* pointer to new number */
137 } yams_GeomSupp;
138 typedef yams_GeomSupp * yams_pGeomSupp;
139
140 typedef struct yams_geomtge {
141 float t[3];
142 int newnum;
143 } yams_Geomtge;
144 typedef yams_Geomtge * yams_pGeomtge;
145
146 typedef struct yams_metric {
147 float k1,k2;
148 float m[6]; /* anisotropic metric */
149 } yams_Metric;
150 typedef yams_Metric * yams_pMetric;
151
152
153 /* SurfMesh: Structure that defines a mesh. */
154 typedef struct yams_smesh {
155 int dim; /* mesh dimension (2,3) */
156 int type;
157 int connex; /* # connected component */
158 int np,npfixe,npmax; /* number of vertices */
159 int ne,nefixe,nemax; /* number of triangles */
160 int nq,ntet; /* quads, ntets */
161 int nv,nvfixe,nvmax; /* number of vertex normals */
162 int nafixe,nmfixe;
163 int nt,ntfixe,ntmax; /* vertex tgtes */
164 int mark; /* coloring... */
165 int ipil;
166
167 char *infile;
168 char *outfile;
169
170 yams_pPoint point; /* array of vertices */
171 yams_pTriangle tria; /* array of triangles */
172 yams_pTetra tetra;
173 yams_pQuad quad;
174 yams_pGeomSupp geom; /* pointer to geometric info */
175 yams_pGeomtge tgte; /* pointer to tge at ridge */
176 yams_pMetric metric; /* local metric at vertex */
177
178 yams_pEdge edge;
179 } yams_SurfMesh;
180 typedef yams_SurfMesh * yams_pSurfMesh;
181
182 #ifdef __cplusplus
183 namespace yams{
184 #endif
185 int yams_main(yams_pSurfMesh sm, int intopt[23], double fopt[14], int infondang, int infocc );
186 int zaldy1(int nemax,int npmax,int nvmax,int memory,yams_pSurfMesh sm,int choix);
187 int zaldy2(int npmax);
188 int zaldy3(yams_pSurfMesh ,int code);
189 void yams_free(yams_pSurfMesh sm); // Add FH 03/14
190
191 #ifdef __cplusplus
192 }
193 #endif
194 #ifdef __cplusplus
195 }
196 #endif
197