ReducedNestingTreeNode.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. #ifndef REDUCEDNESTINGTREENODE_H
  2. #define REDUCEDNESTINGTREENODE_H
  3. #include <HierarchicalLayoutGenerator/LayerNode.h>
  4. #include <QMultiMap>
  5. #include <HierarchicalLayoutGenerator/NestingTreeSubgraphNode.h>
  6. #include <Common/ConstantType.h>
  7. /**
  8. * @brief The ReducedNestingTreeNode class
  9. *
  10. *
  11. */
  12. class GRAPHLAYOUTLIBRARYSHARED_EXPORT ReducedNestingTreeNode
  13. {
  14. private:
  15. //Boolean for is Layer Node
  16. ConstantType<bool> m_constBIsLayerNode;
  17. /*!< Layer node counter */
  18. ConstantType<int> m_iLayerNodeCount;
  19. public:
  20. /** @name Creators
  21. * The methods under this section are responsible for constructing
  22. * an instance of type ReducedNestingTreeNode.
  23. */
  24. //@{
  25. ReducedNestingTreeNode();
  26. //@}
  27. typedef QMultiMap<double , ReducedNestingTreeNode*> MapAvgPosToChildRNTNode; /*!< Multimap average position to reduced nesting trees */
  28. typedef QMapIterator<double , ReducedNestingTreeNode*> IteratorMapAvgPosToChildRNTNode; /*!< Iterator to Multimap of average position to reduced nesting trees */
  29. MapAvgPosToChildRNTNode m_mapChildrenRNTNodes; /*!< Child Reduced Nesting Tree Nodes */
  30. double m_dAveragePosition; /*!< Average Position */
  31. NestingTreeSubgraphNode *m_nestingTreeNode; /*!< Pointer Reference to nesting tree node object */
  32. LayerNode *m_layerNode; /*!< Pointer Reference to layer node object */
  33. /**
  34. This function gives the type of reduced nesting node is LayerNode - true or false
  35. @pre none
  36. @param none
  37. @return the type of reduced nesting node is LayerNode - true or false
  38. @throws none
  39. */
  40. bool isLayerNode();
  41. /**
  42. This function adds new child ReducedNestingTreeNode and its average position
  43. @pre
  44. -# reducedNestingTreeNodeRef != NULL
  45. @param dAvgPosition
  46. average position of child ReducedNestingTreeNode
  47. @param reducedNestingTreeNodeRef
  48. pointer to child reduced nested tree node
  49. @return none
  50. @throws none
  51. */
  52. void addChildNode(double dAvgPosition , ReducedNestingTreeNode *reducedNestingTreeNodeRef);
  53. /**
  54. This function sets Layer Node to the current ReducedNestingTreeNode, sets the type of current node as LayerNode
  55. @pre
  56. -# layerNode != NULL;
  57. @param layerNode
  58. pointer to layer node
  59. @return none
  60. @throws none
  61. */
  62. void setLayerNode(LayerNode *layerNode);
  63. /**
  64. This function gets Layer Node value of the current ReducedNestingTreeNode
  65. @pre none
  66. @param none
  67. @return pointer to the LayerNode
  68. @throws none
  69. */
  70. LayerNode* getLayerNode();
  71. /**
  72. This function sets Nesting Tree Node to the current ReducedNestingTreeNode, sets the type of current node as NestingTreeNode
  73. @pre
  74. -# nestingTreeNode != NULL;
  75. @param nestingTreeNode
  76. pointer to nestingTreeNode
  77. @return none
  78. @throws none
  79. */
  80. void setNestingTreeNode(NestingTreeSubgraphNode *nestingTreeNode);
  81. /**
  82. This function gets NestingTreeNode value of the current ReducedNestingTreeNode
  83. @pre none
  84. @param none
  85. @return pointer to the NestingTreeNode
  86. @throws none
  87. */
  88. NestingTreeSubgraphNode* getNestingTreeNode();
  89. /**
  90. This function gets average position of current NestingTreeSubgraphNode
  91. @pre none
  92. @param none
  93. @return value of current NestingTreeSubgraphNode average position
  94. @throws none
  95. */
  96. double getAveragePosition();
  97. /**
  98. This function sets average position of current NestingTreeSubgraphNode
  99. @pre none
  100. @param dAveragePosition
  101. average position of current NestingTreeSubgraphNode
  102. @return none
  103. @throws none
  104. */
  105. void setAveragePosition(double dAveragePosition);
  106. /**
  107. This function gets child node count of current NestingTreeSubgraphNode
  108. @pre none
  109. @param none
  110. @return value of current NestingTreeSubgraphNode child node count
  111. @throws none
  112. */
  113. int getChildLayerNodeCount();
  114. /**
  115. This function sets child layer node count of current NestingTreeSubgraphNode
  116. @pre
  117. -# iLayerNodeCount >= 0
  118. @param none
  119. @return value of current NestingTreeSubgraphNode child layer node count
  120. @throws none
  121. */
  122. void setChildLayerNodeCount(int iLayerNodeCount);
  123. /**
  124. This function gives iterator for child nodes
  125. @pre none
  126. @param none
  127. @return java style iterator for child nodes
  128. @throws none
  129. */
  130. IteratorMapAvgPosToChildRNTNode getChildNodesIterator();
  131. };
  132. #endif // REDUCEDNESTINGTREENODE_H