node.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*************************************************************************
  2. * Copyright (c) 2011 AT&T Intellectual Property
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * https://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors: Details at https://graphviz.org
  9. *************************************************************************/
  10. #pragma once
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #include <label/index.h>
  15. typedef struct Branch {
  16. Rect_t rect;
  17. struct Node *child;
  18. } Branch_t;
  19. typedef struct Node {
  20. int count;
  21. int level; /* 0 is leaf, others positive */
  22. struct Branch branch[NODECARD];
  23. } Node_t;
  24. void InitNode(Node_t *);
  25. void InitBranch(Branch_t *);
  26. Rect_t NodeCover(Node_t *);
  27. int PickBranch(Rect_t *, Node_t *);
  28. int AddBranch(RTree_t *, Branch_t *, Node_t *, Node_t **);
  29. void DisconBranch(Node_t *, int);
  30. void PrintBranch(int, Branch_t *);
  31. Node_t *RTreeNewNode(void);
  32. #ifdef RTDEBUG
  33. void PrintNode(Node_t * n);
  34. void PrintBranch(int i, Branch_t * b);
  35. #endif
  36. #ifdef __cplusplus
  37. }
  38. #endif