RelaxInterEdges.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. #ifndef RELAXINTEREDGES_H
  2. #define RELAXINTEREDGES_H
  3. #include "ClusteredSpringEmbedder.h"
  4. #include "MembershipInitializer.h"
  5. #include <HierarchicalLayoutGenerator/HierarchicalLayouter.h>
  6. #include <Common/LayoutEnum.h>
  7. #include <Common/GraphType.h>
  8. #include <ForceBasedLayout/Reingold.h>
  9. #include <boost/geometry.hpp>
  10. #include <boost/geometry/geometries/segment.hpp>
  11. #include <boost/geometry/algorithms/intersection.hpp>
  12. #include <ForceBasedLayout/Postprocessing.h>
  13. /**
  14. * @brief The RelaxInterEdges class
  15. *
  16. * The class provides helpers to manage inter-subgraph edge in graph; used in force directed layout to stabilize edges crossing clusters.
  17. */
  18. class RelaxInterEdges
  19. {
  20. public:
  21. BoostGraphWrapper m_bGraphWrapper; /*!< Single object for accessing properties */
  22. /** @name Creators
  23. * The methods under this section are responsible for constructing
  24. * an instance of type RelaxInterEdges.
  25. */
  26. //@{
  27. /**
  28. Constructs new object of type RelaxInterEdges.
  29. @pre none
  30. @param none
  31. @return none
  32. @throw none
  33. */
  34. RelaxInterEdges();
  35. //@}
  36. /** @name Modifiers
  37. * The methods under this section are responsible for modifying
  38. * an instance of RelaxInterEdges.
  39. */
  40. //@{
  41. /** Calculates and sets displacement of vertices when one vertex is
  42. * in outermost graph and other is in its immediate subgraph.
  43. @pre
  44. -# gMaingraph != NULL
  45. @param gMaingraph
  46. reference to graph
  47. @param vSource
  48. Source Vertex Discriptor
  49. @param vTarget
  50. Target Vertex Discriptor
  51. @param iOuterIntersect
  52. Pointer to outer intersect points.
  53. @return none
  54. @throw none
  55. */
  56. void interEdgesCaseOne(SubGraph& gMaingraph,VertexDescriptor& vSource,
  57. VertexDescriptor& vTarget,int* iOuterIntersect);
  58. /** Calculates and sets displacement of vertices when Source vertex is
  59. * in outermost graph and other is in its non-immediate subgraph.
  60. @pre
  61. -# gMaingraph != NULL
  62. @param gMaingraph
  63. reference to graph
  64. @param vSource
  65. Source Vertex Discriptor
  66. @param vTarget
  67. Target Vertex Discriptor
  68. @param gTarget
  69. pointer to target graph
  70. @param iOuterIntersect
  71. Pointer to outer intersect points.
  72. @return none
  73. @throw none
  74. */
  75. void interEdgesCaseTwoSourceOuter(SubGraph& gMaingraph,
  76. VertexDescriptor& vSource,VertexDescriptor& vTarget,
  77. int* iOuterIntersect,SubGraph* gTarget);
  78. /** Calculates and sets displacement of vertices when Target vertex is
  79. * in outermost graph and other is in its non-immediate subgraph.
  80. @pre
  81. -# gMaingraph != NULL
  82. @param gMaingraph
  83. reference to graph
  84. @param vSource
  85. Source Vertex Discriptor
  86. @param vTarget
  87. Target Vertex Discriptor
  88. @param iOuterIntersect
  89. Pointer to outer intersect points.
  90. @param gTarget
  91. pointer to target graph
  92. @return none
  93. @throw LayoutException
  94. */
  95. void interEdgesCaseTwoSourceInner(SubGraph& gMaingraph,
  96. VertexDescriptor& vSource,VertexDescriptor& vTarget,
  97. int* iOuterIntersect,SubGraph* gTarget);
  98. /** Calculates and sets displacement of vertices when both Source vertex is
  99. * and other is in some overlapping graph.
  100. @pre
  101. -# gMaingraph != NULL
  102. @param gMaingraph
  103. reference to graph
  104. @param vSource
  105. Source Vertex Discriptor
  106. @param vTarget
  107. Target Vertex Discriptor
  108. @param gTarget
  109. Pointer to target graph
  110. @param iSourceGraphId
  111. GraphId of source graph.
  112. @return none
  113. @throw LayoutException
  114. */
  115. void OverLapCaseSourceOuter(SubGraph& gMaingraph, VertexDescriptor& vSource,
  116. VertexDescriptor& vTarget,SubGraph* gTarget,int iSourceGraphId);
  117. /** Calculates and sets displacement of vertices when both Source vertex is
  118. * and other is in some overlapping graph.
  119. @pre
  120. -# gMaingraph != NULL
  121. @param gMaingraph
  122. reference to graph
  123. @param vSource
  124. Source Vertex Discriptor
  125. @param gSource
  126. Pointer Source graph
  127. @param vTarget
  128. Target Vertex Discriptor
  129. @param iTargetGraphId
  130. GraphId of target graph.
  131. @return none
  132. @throw LayoutException
  133. */
  134. void OverLapCaseSourceInner(SubGraph& gMaingraph,VertexDescriptor& vSource,
  135. VertexDescriptor& vTarget,
  136. SubGraph* gSource,int iTargetGraphId);
  137. /** Calculates and sets displacement of vertices when both Source vertex is
  138. * and other is in some overlapping graph.
  139. @pre
  140. -# gMaingraph != NULL
  141. @param gMaingraph
  142. reference to graph
  143. @param vSource
  144. Source Vertex Discriptor
  145. @param gSource
  146. Pointer to Source graph
  147. @param gTarget
  148. Pointer to Target graph
  149. @param vTarget
  150. Target Vertex Discriptor
  151. @return none
  152. @throw LayoutException
  153. */
  154. void nonOverLapCase(SubGraph& gMaingraph,VertexDescriptor& vSource,
  155. VertexDescriptor& vTarget,SubGraph* gSource, SubGraph* gTarget);
  156. //@}
  157. };
  158. #endif // RELAXINTEREDGES_H