VertexOverlapRemoval.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #ifndef VERTEXOVERLAPREMOVAL_H
  2. #define VERTEXOVERLAPREMOVAL_H
  3. #include<Common/GraphType.h>
  4. #include<Common/BoostGraphWrapper.h>
  5. #include <ForceBasedLayout/SpringEmbedder.h>
  6. #include "MembershipInitializer.h"
  7. #include <HierarchicalLayoutGenerator/HierarchicalLayouter.h>
  8. #include <Common/LayoutEnum.h>
  9. #include <Common/GraphType.h>
  10. #include <ForceBasedLayout/Reingold.h>
  11. #include <ForceBasedLayout/Postprocessing.h>
  12. #include <ForceBasedLayout/RelaxInterEdges.h>
  13. #include<LayoutException/LayoutExceptionConstants.h>
  14. #include<ForceBasedLayout/Constants.h>
  15. #include<LayoutManager/GraphLayoutErrorCodes.h>
  16. #include <GraphLayoutLibrary_global.h>
  17. #include<LayoutException/LayoutExceptionEnum.h>
  18. #include <GraphMLReader/GraphMLReader.h>
  19. #include <GraphMLWriter/GraphMLWriter.h>
  20. /**
  21. * @brief The VertexOverlapRemoval class
  22. *
  23. * The class provides helpers to manage vertex overlaps in graph with force directed layout .
  24. */
  25. class GRAPHLAYOUTLIBRARYSHARED_EXPORT VertexOverlapRemoval
  26. {
  27. public:
  28. int m_iVertexOverlapConter = 0; /*!< counter to maintain vertex overlap */
  29. /** @name Creators
  30. * The methods under this section are responsible for constructing
  31. * an instance of type VertexOverlapRemoval.
  32. */
  33. //@{
  34. /**
  35. Constructs new object of type VertexOverlapRemoval.
  36. @pre none
  37. @param none
  38. @return none
  39. @throw none
  40. */
  41. VertexOverlapRemoval();
  42. //@}
  43. /** @name Modifiers
  44. * The methods under this section are responsible for modifying
  45. * an instance of VertexOverlapRemoval.
  46. */
  47. //@{
  48. /** Repels overlapping vertices with other ones.
  49. @pre
  50. -# gMainGraph != NULL
  51. @param gMaingraph
  52. @return none
  53. @throw none
  54. */
  55. void repelOverlappingVerticesWithOther(SubGraph& gMaingraph);
  56. /** Removes overlapping from the vertices .
  57. @pre
  58. -# gMainGraph != NULL
  59. @param gMaingraph
  60. @return none
  61. @throw none
  62. */
  63. GraphLayoutErrorCodes::LayoutErrorCode removeOverlaps(QString sInputGraphMLFilePath,
  64. QString sOutputGraphMLFilePath);
  65. //@}
  66. /** @name Queries
  67. * The methods under this section are responsible for accessing
  68. * an instance of type VertexOverlapRemoval.
  69. */
  70. //@{
  71. /** Returns a vector of overlapping from the vertices .
  72. @pre
  73. -# gMainGraph != NULL
  74. @param sInputGraphMLFilePath
  75. @param sOutputGraphMLFilePath
  76. @return LayoutEnum
  77. @throw none
  78. */
  79. QVector<VertexIterator> getOverlappingVertices(SubGraph& gMaingraph);
  80. /** Returns true if two vertices overlap .
  81. @pre
  82. -# gMainGraph != NULL
  83. @param vVertexFirst
  84. Vertex Descriptor for first Vertex
  85. @param vVertexSecond
  86. Vertex Descriptor for second Vertex
  87. @param gMaingraph
  88. @return vOverlappingVertices
  89. A vector of overlapping vertices
  90. @throw none
  91. */
  92. bool bIsOverlappingVertices(VertexIterator vVertexFirst
  93. ,VertexIterator vVertexSecond
  94. ,SubGraph& gMaingraph);
  95. /** Returns true if overlap is present in graph .
  96. @pre
  97. -# gMainGraph != NULL
  98. @param gMaingraph
  99. @return bOverlapExist
  100. bool value for overlaps
  101. @throw none
  102. */
  103. bool bOverlapExist(SubGraph& gMaingraph);
  104. //@}
  105. };
  106. #endif // VERTEXOVERLAPREMOVAL_H