cmiptgraph.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /** \file
  2. * \brief routines
  3. *
  4. * \par
  5. * Copyright (C)<br>
  6. * See README.md in the root directory for details.
  7. *
  8. * \par
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * \par
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * \par
  21. * You should have received a copy of the GNU General Public
  22. * License along with this program; if not, see
  23. * http://www.gnu.org/copyleft/gpl.html
  24. */
  25. /**
  26. * @file: cmiptgraph.h
  27. */
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /* return version number */
  32. extern const char *cmipt_version (void);
  33. /* new graph */
  34. extern void *cmipt_newgraph (void);
  35. /* delete graph */
  36. extern void *cmipt_deletegraph (void *g);
  37. /* get number of real nodes in graph without dummy nodes */
  38. extern int cmipt_graphnrealnodes(void* g);
  39. /* get number of nodes in graph including dummy nodes */
  40. extern int cmipt_graphnnodes(void* g);
  41. /* get number of dummy nodes in graph */
  42. extern int cmipt_graphndummynodes(void* g);
  43. /* get number of edges in graph without self-edges */
  44. extern int cmipt_graphnedges(void* g);
  45. /* get number of horizontal edges in graph without self-edges */
  46. extern int cmipt_graphnhoredges(void* g);
  47. /* set number of horizontal edges in graph without self-edges */
  48. extern void cmipt_graphsetnhoredges(void* g, int value);
  49. /* get number of reversed edges in graph without self-edges */
  50. extern int cmipt_graphnreversededges(void* g);
  51. /* get number of self-edges in graph */
  52. extern int cmipt_graphnselfedges(void* g);
  53. /* get max node id in graph */
  54. extern int cmipt_graphmaxnodeid(void* g);
  55. /* get max edge id in graph */
  56. extern int cmipt_graphmaxedgeid(void* g);
  57. /* new node */
  58. extern void *cmipt_newnode (void *g);
  59. /* id of node */
  60. extern int cmipt_nodeid (void *n);
  61. /* xsize of node */
  62. extern int cmipt_nodexsize (void *n);
  63. /* ysize of node */
  64. extern int cmipt_nodeysize (void *n);
  65. /* set (x,y) size of node */
  66. extern void cmipt_setnodesize (void *n, int xs, int ys);
  67. /* dummy node status of node */
  68. extern int cmipt_nodeisdummy (void *n);
  69. /* relative x pos of node */
  70. extern int cmipt_noderxpos (void *n);
  71. /* relative y pos of node */
  72. extern int cmipt_noderypos (void *n);
  73. /* x pos of node */
  74. extern int cmipt_nodexpos (void *n);
  75. /* y pos of node */
  76. extern int cmipt_nodeypos (void *n);
  77. /* x pos of node */
  78. extern int cmipt_nodefxpos (void *n);
  79. /* y pos of node */
  80. extern int cmipt_nodefypos (void *n);
  81. /* number of selfedges at node */
  82. extern int cmipt_nodenselfedges (void *n);
  83. /* find node */
  84. extern void* cmipt_findnode(void* g, int num);
  85. /* new edge */
  86. extern void *cmipt_newedge (void *g, void *f, void *t, void *e);
  87. /* find edge */
  88. extern void* cmipt_findedge(void* g, int num);
  89. /* get from node of edge */
  90. extern int cmipt_edgefromnode (void *e);
  91. /* get to node of edge */
  92. extern int cmipt_edgetonode (void *e);
  93. /* return if edge is horizontal */
  94. extern int cmipt_edgeishor (void *e);
  95. /* return if edge is reversed */
  96. extern int cmipt_edgeisrev (void *e);
  97. /* return if edge is split */
  98. extern int cmipt_edgeissplit (void *e);
  99. /* return 1 if edge is head of split edge */
  100. extern int cmipt_edgeisheadsplit (void *e);
  101. /* return 1 if edge is tail of split edge */
  102. extern int cmipt_edgeistailsplit (void *e);
  103. /* return 1 if edge is type 1 edge */
  104. extern int cmipt_edgeistype1 (void *e);
  105. /* return usrdata of edge */
  106. extern void *cmipt_edgeusrdata (void *e);
  107. /* run layout */
  108. extern void cmipt_layout (void *g, int iter, int transpose, int iter2, int debug, int usebary);
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112. /* end. */