LayerNode.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. #ifndef LAYERNODE_H
  2. #define LAYERNODE_H
  3. #include <Common/GraphType.h>
  4. #include <HierarchicalLayoutGenerator/NestingTreeSubgraphNode.h>
  5. #include <QMultiMap>
  6. class NestingTreeSubgraphNode;
  7. /**
  8. * @brief The LayerNode class
  9. *
  10. * The class provides helpers to manage layer node in hierarchical layout.
  11. */
  12. class GRAPHLAYOUTLIBRARYSHARED_EXPORT LayerNode
  13. {
  14. private:
  15. /*! Every layer node should have link to
  16. * its parent node; it is useful Splitting Long Edges */
  17. NestingTreeSubgraphNode *m_parentNestingTreeSubgraphNode;
  18. /*! All properties are to be accessed using this Global Vertex Descriptor
  19. * and main graph */
  20. VertexDescriptor m_vGlobalVertex;
  21. /*! iTopological Order according to subgraph ordering graph */
  22. int m_iTopologocalOrder;
  23. /*! Vertex descriptor from Subgraph Ordering Graph */
  24. int m_iSubgraphOrderingGraphVertexIndex;
  25. public:
  26. /** @name Creators
  27. * The methods under this section are responsible for constructing
  28. * an instance of type LayerNode.
  29. */
  30. //@{
  31. /**
  32. Constructs new object of type LayerNode.
  33. @pre none
  34. @param none
  35. @return none
  36. @throw none
  37. */
  38. LayerNode();
  39. /**
  40. Constructs new object of type LayerNode.
  41. @pre none
  42. @param vGlobalVertex
  43. instance of VertexDescriptor
  44. @return none
  45. @throw none
  46. */
  47. LayerNode(VertexDescriptor vGlobalVertex);
  48. /**
  49. Constructs new object of type LayerNode.
  50. @pre none
  51. @param parentNestingTreeSubgraphNode
  52. reference of NestingTreeSubgraphNode
  53. @return none
  54. @throw none
  55. */
  56. LayerNode(NestingTreeSubgraphNode& parentNestingTreeSubgraphNode);
  57. /**
  58. Constructs new object of type LayerNode.
  59. @pre none
  60. @param parentNestingTreeSubgraphNode
  61. reference of NestingTreeSubgraphNode
  62. @param vGlobalVertex
  63. instance of VertexDescriptor
  64. @return none
  65. @throw none
  66. */
  67. LayerNode(NestingTreeSubgraphNode& parentNestingTreeSubgraphNode ,
  68. VertexDescriptor vGlobalVertex);
  69. //@}
  70. /** @name Modifiers
  71. * The methods under this section are responsible for modifying
  72. * an instance of LayerNode.
  73. */
  74. //@{
  75. /**
  76. This function sets parent Nesting Tree Subgraph Node of current LayerNode
  77. @pre none
  78. @param parentNestingTreeSubgraphNode
  79. parent Nesting Tree Subgraph Node of current LayerNode
  80. @return none
  81. @throws none
  82. */
  83. void setParentNestingTreeSubgraphNode(NestingTreeSubgraphNode& parentNestingTreeSubgraphNode);
  84. /**
  85. This function sets global vertex which current LayerNode should represent
  86. @pre none
  87. @param vGlobalVertex
  88. global vertex index to which current LayerNode should represent
  89. @return none
  90. @throws none
  91. */
  92. void setVertex(VertexDescriptor vGlobalVertex);
  93. /**
  94. This function sets parent Nesting Tree Subgraph Node and global vertex which current LayerNode should represent
  95. @pre none
  96. @param vGlobalVertex
  97. global vertex index to which current LayerNode should represent
  98. @return none
  99. @throws none
  100. */
  101. void setValues(NestingTreeSubgraphNode& parentNestingTreeSubgraphNode ,
  102. VertexDescriptor vGlobalVertex);
  103. /**
  104. This function sets Topological Order of current Layer Node
  105. @pre none
  106. @param iTopologicalOrder
  107. integer value for Layer Node Topological Order
  108. @return none
  109. @throws none
  110. */
  111. int setTopologicalOrder(int iTopologicalOrder);
  112. /**
  113. This function sets the Vertex Index from its SubgraphOrderingGraph
  114. @pre none
  115. @param iSubgraphOrderingGraphVertexIndex
  116. vertex index of LayerNode from its SubgraphOrderingGraph
  117. @return none
  118. @throws none
  119. */
  120. void setSubgraphOrderingGraphVertex(int iSubgraphOrderingGraphVertexIndex);
  121. //@}
  122. /** @name Queries
  123. * The methods under this section are responsible for accessing
  124. * an instance of type LayerNode.
  125. */
  126. //@{
  127. /**
  128. This function gets parent Nesting Tree Subgraph Node of current LayerNode
  129. @pre none
  130. @param none
  131. @return none
  132. @throws none
  133. */
  134. NestingTreeSubgraphNode &getParentNestingTreeSubgraphNode();
  135. /**
  136. This function gets global vertex which current LayerNode represents
  137. @pre none
  138. @param none
  139. @return none
  140. @throws none
  141. */
  142. VertexDescriptor getVertex();
  143. /**
  144. This function gets Topological Order of current Layer Node
  145. @pre none
  146. @param none
  147. @return integer Topological Order of current Layer Node
  148. @throws none
  149. */
  150. int getTopologicalOrder();
  151. /**
  152. This function gets the Vertex Index of this LayerNode in its SubgraphOrderingGraph
  153. @pre none
  154. @param vGlobalVertex
  155. global vertex index to which current LayerNode should represent
  156. @return none
  157. @throws none
  158. */
  159. int getSubgraphOrderingGraphVertex();
  160. /**
  161. This function prints the vertex name
  162. @pre none
  163. @param none
  164. @return none
  165. @throws none
  166. */
  167. void printName();
  168. //@}
  169. };
  170. #endif // LAYERNODE_H