LayersSubgraphSorter.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef LAYERSSUBGRAPHSORTER_H
  2. #define LAYERSSUBGRAPHSORTER_H
  3. #include <GraphLayoutLibrary_global.h>
  4. #include <HierarchicalLayoutGenerator/SubgraphOrderingGraph.h>
  5. #include <HierarchicalLayoutGenerator/HierarchicalLayoutTypedefs.h>
  6. /**
  7. * @brief The LayersSubgraphSorter class
  8. *
  9. * The class provides helpers to sort layers in hierarchhical layout.
  10. */
  11. class GRAPHLAYOUTLIBRARYSHARED_EXPORT LayersSubgraphSorter
  12. {
  13. private:
  14. MapLayerIdToLayerRef * m_mapLayeredGraphRef; /*!< Reference to map of layer id to reference */
  15. NestingTreeSubgraphNode * m_rootNestingTreeNodeRef; /*!< Reference to nesting tree node reference */
  16. public:
  17. /** @name Creators
  18. * The methods under this section are responsible for constructing
  19. * an instance of type LayersSubgraphSorter.
  20. */
  21. //@{
  22. /**
  23. Constructs new object of type LayersSubgraphSorter.
  24. @pre none
  25. @param none
  26. @return none
  27. @throw none
  28. */
  29. LayersSubgraphSorter();
  30. /**
  31. Constructs new object of type LayersSubgraphSorter.
  32. @pre none
  33. @param rootNestingTreeNode
  34. reference of NestingTreeSubgraphNode
  35. @param layeredGraph
  36. reference of MapLayerIdToLayerRef
  37. @return none
  38. @throw none
  39. */
  40. LayersSubgraphSorter(NestingTreeSubgraphNode& rootNestingTreeNode , MapLayerIdToLayerRef &layeredGraph);
  41. //@}
  42. /** @name Queries
  43. * The methods under this section are responsible for accessing
  44. * an instance of type LayersSubgraphSorter.
  45. */
  46. //@{
  47. /*! Generate SubgraphOrdering Graph
  48. *Give topological order to vertices according to Subgraph Ordering Graph
  49. *Sort Layered Graph According to Subgraph Ordering Graph */
  50. void printStructures()
  51. {
  52. qDebug() << " Layered Graph From Layer Sorter";
  53. IteratorMapLayerIdToLayerRef iterLayer(*m_mapLayeredGraphRef);
  54. while(iterLayer.hasNext())
  55. {
  56. iterLayer.next();
  57. int iKey = iterLayer.key();
  58. qDebug() << iKey;
  59. }
  60. }
  61. //@}
  62. private:
  63. //Remove cycles in Subgraph Ordering Graphs
  64. };
  65. #endif // LAYERSSUBGRAPHSORTER_H