SubgraphOrderingGraph.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. #ifndef SUBGRAPHORDERINGGRAPH_H
  2. #define SUBGRAPHORDERINGGRAPH_H
  3. #include <GraphLayoutLibrary_global.h>
  4. #include <HierarchicalLayoutGenerator/SubgraphOrderingGraphType.h>
  5. /**
  6. * @brief The SubgraphOrderingGraphWrapper class
  7. *
  8. * The class provides helpers to manage subgraph ordering in hierarchical layout.
  9. */
  10. class GRAPHLAYOUTLIBRARYSHARED_EXPORT SubgraphOrderingGraphWrapper
  11. {
  12. public:
  13. SubgraphOrderingGraphType *m_gSubgraphOrderingGraph; /*!< Pointer reference to ordered subgraph */
  14. /** @name Creators
  15. * The methods under this section are responsible for constructing
  16. * an instance of type SubgraphOrderingGraphWrapper.
  17. */
  18. //@{
  19. /**
  20. Constructs new object of type SubgraphOrderingGraphWrapper.
  21. @pre none
  22. @param none
  23. @return none
  24. @throw none
  25. */
  26. SubgraphOrderingGraphWrapper();
  27. //@}
  28. /** @name Modifiers
  29. * The methods under this section are responsible for modifying
  30. * an instance of SubgraphOrderingGraphWrapper.
  31. */
  32. //@{
  33. /**
  34. Sets a vertex of graph as nesting tree subgraph node and sets layer node as false
  35. @pre none
  36. @param NestingTreeSubgraphNode
  37. reference to nesting tree subgraph node
  38. @param SubgraphOrderingGraphVertexDescriptor
  39. vertex descriptor to be set
  40. @param SubgraphOrderingGraphType
  41. reference to ordered subgraph
  42. @return none
  43. @throws LayoutException
  44. */
  45. void setVertexNestingTreeSubgraphNodeRef(NestingTreeSubgraphNode* nestingTreeNodeRef , SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
  46. /**
  47. Assigns the layer reference to a vertex descriptor in the subgraph
  48. @pre none
  49. @param LayerNode*
  50. pointer to layer node reference
  51. @param SubgraphOrderingGraphVertexDescriptor
  52. vertex descriptor to be set
  53. @param SubgraphOrderingGraphType
  54. reference to ordered subgraph
  55. @return none
  56. @throws LayoutException
  57. */
  58. void setVertexLayerNodeRef(LayerNode* layerNodeRef , SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
  59. // void setVertexAverageBarryCenter(double dAverageBarryCenter , SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
  60. /**
  61. This function set the property that 'IsEdge' is in spanning tree. This helps to detect edges in spanning tree
  62. @pre
  63. -# gSubgraphOrderingGraph.find_edge(eEdge) == true
  64. @param bIsSpannigTreeEdge
  65. boolean value to set to edge's bIsSpanningTreeEdge property
  66. @param eEdge
  67. subgraph ordering graph edge
  68. @param gSubgraphOrderingGraph
  69. subgraph ordering graph
  70. @return none
  71. @throws none
  72. */
  73. void setIsEdgeInSpanningTree(bool bIsSpannigTreeEdge , SubgraphOrderingGraphEdgeDescriptor eEdge , SubgraphOrderingGraphType& gSubgraphOrderingGraph);
  74. //@}
  75. /** @name Queries
  76. * The methods under this section are responsible for accessing
  77. * an instance of type SubgraphOrderingGraphWrapper.
  78. */
  79. //@{
  80. /**
  81. Returns nesting tree subgraph node of a vertex descriptor in SubgraphOrderingGraphType
  82. @pre none
  83. @param SubgraphOrderingGraphVertexDescriptor
  84. vertex descriptor to be set
  85. @param SubgraphOrderingGraphType
  86. reference to ordered subgraph
  87. @return none
  88. @throws LayoutException
  89. */
  90. NestingTreeSubgraphNode* getVertexNestingTreeSubgraphNode(SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
  91. /**
  92. Returns the layer reference corresponding to a vertex descriptor in the subgraph
  93. @pre none
  94. @param SubgraphOrderingGraphVertexDescriptor
  95. vertex descriptor to be set
  96. @param SubgraphOrderingGraphType
  97. reference to ordered subgraph
  98. @return LayerNode*
  99. @throws LayoutException
  100. */
  101. LayerNode* getVertexLayerNodeRef(SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
  102. // double getVertexAverageBarryCenter(SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph );
  103. /**
  104. Returns whether a vertex is layer node or not
  105. @pre none
  106. @param SubgraphOrderingGraphVertexDescriptor
  107. Vertex Descriptors
  108. @param SubgraphOrderingGraphType
  109. reference to ordered subgraph
  110. @return bool
  111. @throws none
  112. */
  113. bool isSubgraphOrderingVertexIsLayerNode(SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
  114. /**
  115. This function gets if the edge is spanning tree edge property is true or false
  116. @pre
  117. -# gSubgraphOrderingGraph.find_edge(eEdge) == true
  118. @param eEdge
  119. subgraph ordering graph edge
  120. @param gSubgraphOrderingGraph
  121. subgraph ordering graph
  122. @return boolean true - if the edge is spanning tree edge property is true otherwise false
  123. @throws none
  124. */
  125. bool getIsEdgeInSpanningTree(SubgraphOrderingGraphEdgeDescriptor eEdge , SubgraphOrderingGraphType& gSubgraphOrderingGraph);
  126. /**
  127. Prints a textual representation of ordered subgraph. Used for debugging purposes only.
  128. @pre none
  129. @param SubgraphOrderingGraphType
  130. reference to ordered subgraph
  131. @return none
  132. @throws none
  133. */
  134. void printGraph(SubgraphOrderingGraphType& gGraph);
  135. //@}
  136. };
  137. #endif // SUBGRAPHORDERINGGRAPH_H