qtree.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*-
  2. * Written by H. Mitasova, I. Kosinovsky, D. Gerdes Fall 1993
  3. * University of Illinois
  4. * US Army Construction Engineering Research Lab
  5. * Copyright 1993, H. Mitasova (University of Illinois),
  6. * I. Kosinovsky, (USA-CERL), and D.Gerdes (USA-CERL)
  7. *
  8. * updated by Mitasova Nov. 96, no changes necessary
  9. */
  10. #ifndef TREE_H
  11. #define TREE_H
  12. #define VOID_T char
  13. struct multfunc
  14. {
  15. int (*compare) ();
  16. struct quaddata **(*divide_data) ();
  17. int (*add_data) ();
  18. int (*intersect) ();
  19. int (*division_check) ();
  20. int (*get_points) ();
  21. };
  22. struct tree_info
  23. {
  24. struct multfunc *functions;
  25. double dmin;
  26. int kmax;
  27. struct multtree *root;
  28. };
  29. struct multtree
  30. {
  31. struct quaddata *data;
  32. struct multtree **leafs;
  33. struct multtree *parent;
  34. int multant;
  35. };
  36. struct multfunc *MT_functions_new(int (*)(struct triple *, struct quaddata *),
  37. struct quaddata **(*)(struct quaddata *,
  38. int, double),
  39. int (*)(struct triple *, struct quaddata *,
  40. double), int (*)(struct quaddata *,
  41. struct quaddata *),
  42. int (*)(struct quaddata *, int),
  43. int (*)(struct quaddata *,
  44. struct quaddata *, int));
  45. struct tree_info *MT_tree_info_new(struct multtree *, struct multfunc *,
  46. double, int);
  47. struct multtree *MT_tree_new(struct quaddata *, struct multtree **,
  48. struct multtree *, int);
  49. int MT_insert(struct triple *, struct tree_info *, struct multtree *, int);
  50. int MT_divide(struct tree_info *, struct multtree *, int);
  51. int MT_region_data(struct tree_info *, struct multtree *, struct quaddata *,
  52. int, int);
  53. #endif