Reingold.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. #ifndef REINGOLD_H
  2. #define REINGOLD_H
  3. #include<Common/GraphType.h>
  4. #include<Common/BoostGraphWrapper.h>
  5. #include<Common/GraphType.h>
  6. #include<algorithm>
  7. #include<cmath>
  8. #include <HierarchicalLayoutGenerator/HierarchicalLayouter.h>
  9. #include<Common/GraphType.h>
  10. #include<algorithm>
  11. #include<math.h>
  12. #include <ForceBasedLayout/SpringEmbedder.h>
  13. /**
  14. * @brief The Reingold class
  15. *
  16. * The class provides implementation of Reingold-Fruchtermann algorithm.
  17. */
  18. class GRAPHLAYOUTLIBRARYSHARED_EXPORT Reingold
  19. {
  20. public:
  21. double iK = 0; /*!< Inter vertex distance */
  22. /** @name Creators
  23. * The methods under this section are responsible for constructing
  24. * an instance of type Reingold.
  25. */
  26. //@{
  27. /**
  28. Constructs new object of type Reingold.
  29. @pre none
  30. @param none
  31. @return none
  32. @throw none
  33. */
  34. Reingold();
  35. //@}
  36. /** @name Queries
  37. * The methods under this section are responsible for accessing
  38. * an instance of type Reingold.
  39. */
  40. //@{
  41. /** Returns attractive force between two points
  42. @pre
  43. -# gGraph != NULL
  44. @param idist
  45. distance between two nodes
  46. @return attractive force
  47. @throw none
  48. */
  49. float getAttractiveForce(double idist);
  50. /** Returns repulsive force between two points
  51. @pre
  52. -# gGraph != NULL
  53. @param idist
  54. distance between two nodes
  55. @return repulsive force
  56. @throw none */
  57. float getRepulsiveForce(double idist);
  58. //@}
  59. /** @name Modifiers
  60. * The methods under this section are responsible for modifying
  61. * an instance of Reingold.
  62. */
  63. //@{
  64. /** Reingold Fruchtermann algo
  65. @pre
  66. -# l_graph != NULL
  67. @param l_graph
  68. reference to graph
  69. @return none
  70. @throw none
  71. */
  72. void ApplyReingold(SubGraph& l_graph);
  73. /**
  74. * @brief setCompartMentProps
  75. *
  76. * Calculates and sets compartment properties of the graph and its subgraphs.
  77. *
  78. * @param l_graph
  79. * reference to graph whose compartment properties are to be set.
  80. *
  81. * @param iMargine
  82. * margine to be used for innermost cluster.
  83. *
  84. * @return integer value of margine used for outermost cluster.
  85. *
  86. * @throw LayoutException
  87. */
  88. int setCompartMentProps(SubGraph &l_graph, int iMargine);
  89. /** Iterates Clusters and calls ApplyReingold
  90. @pre
  91. -# l_graph != NULL
  92. @param l_graph
  93. reference to graph
  94. @return none
  95. @throw none
  96. */
  97. void ApplyLocalFR(SubGraph& l_graph);
  98. /** Calculates and set height of graph and its subgraphs , in use
  99. @pre
  100. -# l_graph != NULL
  101. @param l_graph
  102. reference to graph
  103. @return none
  104. @throw none
  105. */
  106. void SetClusterCompartmentProps(SubGraph& l_graph);
  107. /** Calculates and set height of graph and its subgraphs for Force directed
  108. * lay out.
  109. @pre
  110. -# l_graph != NULL
  111. @param l_graph
  112. reference to graph
  113. @return none
  114. @throw none
  115. */
  116. void SetClusterCompartmentPropsNew(SubGraph &l_graph);
  117. //@}
  118. };
  119. #endif // REINGOLD_H