PageRenderTime 45ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/src/third_party/egads/egads.h

https://gitlab.com/philipclaude/avro2
C Header | 265 lines | 224 code | 23 blank | 18 comment | 0 complexity | 13cba200f4ad7728e75efb1960bbafbd MD5 | raw file
  1. #ifndef EGADS_H
  2. #define EGADS_H
  3. /*
  4. * EGADS: Electronic Geometry Aircraft Design System
  5. *
  6. * Function Prototypes
  7. *
  8. * Copyright 2011-2019, Massachusetts Institute of Technology
  9. * Licensed under The GNU Lesser General Public License, version 2.1
  10. * See http://www.opensource.org/licenses/lgpl-2.1.php
  11. *
  12. */
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include "egadsTypes.h"
  16. #ifdef __ProtoExt__
  17. #undef __ProtoExt__
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #define __ProtoExt__
  22. #else
  23. #define __ProtoExt__ extern
  24. #endif
  25. /* memory functions */
  26. __ProtoExt__ /*@null@*/ /*@out@*/ /*@only@*/
  27. void *EG_alloc( int nbytes );
  28. __ProtoExt__ /*@null@*/ /*@only@*/
  29. void *EG_calloc( int nele, int size );
  30. __ProtoExt__ /*@null@*/ /*@only@*/
  31. void *EG_reall( /*@null@*/ /*@only@*/ /*@returned@*/ void *ptr,
  32. int nbytes );
  33. __ProtoExt__ /*@null@*/ /*@only@*/
  34. char *EG_strdup( /*@null@*/ const char *str );
  35. __ProtoExt__ void EG_free( /*@null@*/ /*@only@*/ void *pointer );
  36. /* base-level object functions */
  37. __ProtoExt__ void EG_revision( int *major, int *minor, const char **OCCrev );
  38. __ProtoExt__ int EG_open( ego *context );
  39. __ProtoExt__ int EG_loadModel( ego context, int bflg, const char *name,
  40. ego *model );
  41. __ProtoExt__ int EG_saveModel( const ego model, const char *name );
  42. __ProtoExt__ int EG_deleteObject( ego object );
  43. __ProtoExt__ int EG_makeTransform( ego context, const double *xform,
  44. ego *oform );
  45. __ProtoExt__ int EG_getTransformation( const ego oform, double *xform );
  46. __ProtoExt__ int EG_getContext( ego object, ego *context );
  47. __ProtoExt__ int EG_setOutLevel( ego context, int outLevel );
  48. __ProtoExt__ int EG_getInfo( const ego object, int *oclass, int *mtype,
  49. ego *topObj, ego *prev, ego *next );
  50. __ProtoExt__ int EG_copyObject( const ego object, /*@null@*/ void *oform,
  51. ego *copy );
  52. __ProtoExt__ int EG_flipObject( const ego object, ego *flippedCopy );
  53. __ProtoExt__ int EG_close( ego context );
  54. __ProtoExt__ int EG_setUserPointer( ego context, void *ptr );
  55. __ProtoExt__ int EG_getUserPointer( const ego context, void **ptr );
  56. /* attribute functions */
  57. __ProtoExt__ int EG_attributeAdd( ego obj, const char *name, int type, int len,
  58. /*@null@*/ const int *ints,
  59. /*@null@*/ const double *reals,
  60. /*@null@*/ const char *str );
  61. __ProtoExt__ int EG_attributeDel( ego object, /*@null@*/ const char *name );
  62. __ProtoExt__ int EG_attributeNum( const ego obj, int *num );
  63. __ProtoExt__ int EG_attributeGet( const ego obj, int index, const char **name,
  64. int *atype, int *len,
  65. /*@null@*/ const int **ints,
  66. /*@null@*/ const double **reals,
  67. /*@null@*/ const char **str );
  68. __ProtoExt__ int EG_attributeRet( const ego obj, const char *name, int *atype,
  69. int *len, /*@null@*/ const int **ints,
  70. /*@null@*/ const double **reals,
  71. /*@null@*/ const char **str );
  72. __ProtoExt__ int EG_attributeDup( const ego src, ego dst );
  73. /* geometry functions */
  74. __ProtoExt__ int EG_getGeometry( const ego geom, int *oclass, int *mtype,
  75. ego *refGeom, int **ivec, double **rvec );
  76. __ProtoExt__ int EG_makeGeometry( ego context, int oclass, int mtype,
  77. /*@null@*/ ego refGeom,
  78. /*@null@*/ const int *ivec,
  79. const double *rvec, ego *geom );
  80. __ProtoExt__ int EG_getRange( const ego geom, double *range, int *periodic );
  81. __ProtoExt__ int EG_evaluate( const ego geom, const double *param,
  82. double *results );
  83. __ProtoExt__ int EG_invEvaluate( const ego geom, double *xyz, double *param,
  84. double *results );
  85. __ProtoExt__ int EG_invEvaluateGuess( const ego geom, double *xyz,
  86. double *param, double *results );
  87. __ProtoExt__ int EG_arcLength( const ego geom, double t1, double t2,
  88. double *alen );
  89. __ProtoExt__ int EG_curvature( const ego geom, const double *param,
  90. double *results );
  91. __ProtoExt__ int EG_approximate( ego context, int maxdeg, double tol,
  92. const int *sizes, const double *xyzs,
  93. ego *bspline );
  94. __ProtoExt__ int EG_fitTriangles( ego context, int npts, double *xyzs,
  95. int ntris, const int *tris,
  96. /*@null@*/ const int *tric, double tol,
  97. ego *bspline );
  98. __ProtoExt__ int EG_otherCurve( const ego surface, const ego curve,
  99. double tol, ego *newcurve );
  100. __ProtoExt__ int EG_isSame( const ego geom1, const ego geom2 );
  101. __ProtoExt__ int EG_isoCline( const ego surface, int UV, double val,
  102. ego *newcurve );
  103. __ProtoExt__ int EG_convertToBSpline( ego geom, ego *bspline );
  104. __ProtoExt__ int EG_convertToBSplineRange( ego geom, const double *range,
  105. ego *bspline );
  106. __ProtoExt__ int EG_skinning ( ego context, int nCurves, ego *curves,
  107. int skinning_degree, ego *surface );
  108. /* topology functions */
  109. __ProtoExt__ int EG_tolerance( const ego topo, double *tol );
  110. __ProtoExt__ int EG_getTolerance( const ego topo, double *tol );
  111. __ProtoExt__ int EG_setTolerance( ego topo, double tol );
  112. __ProtoExt__ int EG_getTopology( const ego topo, ego *geom, int *oclass,
  113. int *type, /*@null@*/ double *limits,
  114. int *nChildren, ego **children, int **sense );
  115. __ProtoExt__ int EG_makeTopology( ego context, /*@null@*/ ego geom, int oclass,
  116. int mtype, /*@null@*/ double *limits,
  117. int nChildren, /*@null@*/ ego *children,
  118. /*@null@*/ int *senses, ego *topo );
  119. __ProtoExt__ int EG_makeLoop( int nedge, ego *edges, /*@null@*/ ego geom,
  120. double toler, ego *result );
  121. __ProtoExt__ int EG_getArea( ego object, /*@null@*/ const double *limits,
  122. double *area );
  123. __ProtoExt__ int EG_makeFace( ego object, int mtype,
  124. /*@null@*/ const double *limits, ego *face );
  125. __ProtoExt__ int EG_getBodyTopos( const ego body, /*@null@*/ ego src,
  126. int oclass, int *ntopo,
  127. /*@null@*/ ego **topos );
  128. __ProtoExt__ int EG_indexBodyTopo( const ego body, const ego src );
  129. __ProtoExt__ int EG_objectBodyTopo( const ego body, int oclass, int index,
  130. ego *obj );
  131. __ProtoExt__ int EG_inTopology( const ego topo, const double *xyz );
  132. __ProtoExt__ int EG_inFace( const ego face, const double *uv );
  133. __ProtoExt__ int EG_getEdgeUV( const ego face, const ego edge, int sense,
  134. double t, double *UV );
  135. __ProtoExt__ int EG_getEdgeUVs( const ego face, const ego edge, int sense,
  136. int nts, const double *ts, double *UV );
  137. __ProtoExt__ int EG_getPCurve( const ego face, const ego edge, int sense,
  138. int *mtype, int **ivec, double **rvec );
  139. __ProtoExt__ int EG_getWindingAngle( ego edge, double t, double *angle );
  140. __ProtoExt__ int EG_getBody( const ego object, ego *body );
  141. __ProtoExt__ int EG_makeSolidBody( ego context, int stype, const double *rvec,
  142. ego *body );
  143. __ProtoExt__ int EG_getBoundingBox( const ego topo, double *bbox );
  144. __ProtoExt__ int EG_getMassProperties( const ego topo, double *result );
  145. __ProtoExt__ int EG_isEquivalent( const ego topo1, const ego topo2 );
  146. __ProtoExt__ int EG_sewFaces( int nobj, const ego *objs, double toler,
  147. int flag, ego *result );
  148. __ProtoExt__ int EG_replaceFaces( const ego body, int nobj, ego *objs,
  149. ego *result );
  150. __ProtoExt__ int EG_mapBody( const ego sBody, const ego dBody,
  151. const char *fAttr, ego *mapBody );
  152. __ProtoExt__ int EG_matchBodyEdges( const ego body1, const ego body2,
  153. double toler, int *nmatch, int **match );
  154. __ProtoExt__ int EG_matchBodyFaces( const ego body1, const ego body2,
  155. double toler, int *nmatch, int **match );
  156. /* tessellation functions */
  157. __ProtoExt__ int EG_setTessParam( ego context, int iparam, double value,
  158. double *oldvalue );
  159. __ProtoExt__ int EG_makeTessGeom( ego obj, double *params, int *sizes,
  160. ego *tess );
  161. __ProtoExt__ int EG_getTessGeom( const ego tess, int *sizes, double **xyz );
  162. __ProtoExt__ int EG_makeTessBody( ego object, double *params, ego *tess );
  163. __ProtoExt__ int EG_remakeTess( ego tess, int nobj, ego *objs,
  164. double *params );
  165. __ProtoExt__ int EG_finishTess( ego tess, double *params );
  166. __ProtoExt__ int EG_mapTessBody( ego tess, ego body, ego *mapTess );
  167. __ProtoExt__ int EG_locateTessBody( const ego tess, int npt, const int *ifaces,
  168. const double *uv, /*@null@*/ int *itri,
  169. double *results );
  170. __ProtoExt__ int EG_getTessEdge( const ego tess, int eIndex, int *len,
  171. const double **xyz, const double **t );
  172. __ProtoExt__ int EG_getTessFace( const ego tess, int fIndex, int *len,
  173. const double **xyz, const double **uv,
  174. const int **ptype, const int **pindex,
  175. int *ntri, const int **tris,
  176. const int **tric );
  177. __ProtoExt__ int EG_getTessLoops( const ego tess, int fIndex, int *nloop,
  178. const int **lIndices );
  179. __ProtoExt__ int EG_getTessQuads( const ego tess, int *nquad,
  180. int **fIndices );
  181. __ProtoExt__ int EG_makeQuads( ego tess, double *params, int fIndex );
  182. __ProtoExt__ int EG_getQuads( const ego tess, int fIndex, int *len,
  183. const double **xyz, const double **uv,
  184. const int **ptype, const int **pindex,
  185. int *npatch );
  186. __ProtoExt__ int EG_getPatch( const ego tess, int fIndex, int patch,
  187. int *nu, int *nv, const int **ipts,
  188. const int **bounds );
  189. __ProtoExt__ int EG_quadTess( const ego tess, ego *quadTess );
  190. __ProtoExt__ int EG_insertEdgeVerts( ego tess, int eIndex, int vIndex,
  191. int npts, double *t );
  192. __ProtoExt__ int EG_deleteEdgeVert( ego tess, int eIndex, int vIndex,
  193. int dir );
  194. __ProtoExt__ int EG_moveEdgeVert( ego tess, int eIndex, int vIndex,
  195. double t );
  196. __ProtoExt__ int EG_openTessBody( ego tess );
  197. __ProtoExt__ int EG_initTessBody( ego object, ego *tess );
  198. __ProtoExt__ int EG_statusTessBody( ego tess, ego *body, int *state, int *np );
  199. __ProtoExt__ int EG_setTessEdge( ego tess, int eIndex, int len,
  200. const double *xyz, const double *t );
  201. __ProtoExt__ int EG_setTessFace( ego tess, int fIndex, int len,
  202. const double *xyz, const double *uv,
  203. int ntri, const int *tris );
  204. __ProtoExt__ int EG_localToGlobal( const ego tess, int index, int local,
  205. int *global );
  206. __ProtoExt__ int EG_getGlobal( const ego tess, int global, int *ptype,
  207. int *pindex, /*@null@*/ double *xyz );
  208. /* high level functions */
  209. __ProtoExt__ int EG_fuseSheets( const ego src, const ego tool, ego *sheet );
  210. __ProtoExt__ int EG_solidBoolean( const ego src, const ego tool, int oper,
  211. ego *model );
  212. __ProtoExt__ int EG_intersection( const ego src, const ego tool, int *nedge,
  213. /*@null@*/ ego **facEdg, ego *model );
  214. __ProtoExt__ int EG_imprintBody( const ego src, int nedge, const ego *facEdg,
  215. ego *result );
  216. __ProtoExt__ int EG_filletBody( const ego src, int nedge, const ego *edges,
  217. double radius,
  218. ego *result, /*@null@*/ int **facemap );
  219. __ProtoExt__ int EG_chamferBody( const ego src, int nedge, const ego *edges,
  220. const ego *faces, double dis1, double dis2,
  221. ego *result, /*@null@*/ int **facemap );
  222. __ProtoExt__ int EG_hollowBody( const ego src, int nface,
  223. /*@null@*/ const ego *faces, double offset,
  224. int join, ego *result,
  225. /*@null@*/ int **facemap );
  226. __ProtoExt__ int EG_extrude( const ego src, double dist, const double *dir,
  227. ego *result );
  228. __ProtoExt__ int EG_rotate( const ego src, double angle, const double *axis,
  229. ego *result );
  230. __ProtoExt__ int EG_sweep( const ego src, const ego spine, int mode,
  231. ego *result );
  232. __ProtoExt__ int EG_loft( int nsec, const ego *secs, int opt, ego *result );
  233. __ProtoExt__ int EG_blend( int nsec, const ego *secs, /*@null@*/ double *rc1,
  234. /*@null@*/ double *rcN, ego *result );
  235. __ProtoExt__ int EG_ruled( int nsec, const ego *secs, ego *result );
  236. /* other functions */
  237. __ProtoExt__ int EG_inTriExact( double *t1, double *t2, double *t3, double *p,
  238. double *w );
  239. #ifdef __cplusplus
  240. }
  241. #endif
  242. #endif