SubgraphOrderingGraphType.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef SUBGRAPHORDERINGGRAPHTYPE_H
  2. #define SUBGRAPHORDERINGGRAPHTYPE_H
  3. #include <boost/graph/adjacency_list.hpp>
  4. #include <HierarchicalLayoutGenerator/SubgraphOrderingGraph.h>
  5. #include <HierarchicalLayoutGenerator/NestingTreeSubgraphNode.h>
  6. #include <QVector>
  7. class SubgraphOrderingGraphWrapper;
  8. /**
  9. * A structure to store the vertex propertie in ordering graph.
  10. */
  11. struct OrderingGraphVertexProperties
  12. {
  13. SubgraphOrderingGraphWrapper *gSubgraphOrderingGraph;
  14. NestingTreeSubgraphNode *nestingTreeSubgraphNode;
  15. LayerNode *layerNode;
  16. double dAverageBarryCenter;
  17. bool bIsLayerNode;
  18. OrderingGraphVertexProperties()
  19. {
  20. gSubgraphOrderingGraph = NULL;
  21. nestingTreeSubgraphNode = NULL;
  22. layerNode = NULL;
  23. dAverageBarryCenter = 0.0;
  24. bIsLayerNode = true;
  25. }
  26. };
  27. /**
  28. * A structure to store the edge propertie in ordering graph.
  29. */
  30. struct OrderingGraphEdgeProperties
  31. {
  32. bool bIsSpanningTreeEdge;
  33. OrderingGraphEdgeProperties()
  34. {
  35. bIsSpanningTreeEdge = false;
  36. }
  37. };
  38. // Graph Properties
  39. enum graph_custom_prop2_t
  40. {
  41. graph_custom_prop2
  42. };
  43. namespace boost
  44. {
  45. BOOST_INSTALL_PROPERTY(graph,custom_prop2);
  46. }
  47. struct OrderingGraphProperties
  48. {
  49. };
  50. typedef boost::adjacency_list< boost::listS,
  51. boost::vecS,
  52. boost::bidirectionalS,
  53. boost::property<boost::vertex_index_t, int ,
  54. OrderingGraphVertexProperties > ,
  55. boost::property<boost::edge_index_t,int , OrderingGraphEdgeProperties> ,
  56. boost::property<graph_custom_prop2_t,OrderingGraphProperties> >
  57. OrderingGraphType;
  58. typedef boost::subgraph< OrderingGraphType > SubgraphOrderingGraphType;
  59. //typedef OrderingGraphType SubgraphOrderingGraphType;
  60. /*!< graph_traits of SubgraphOrderingGraphType defined as SubgraphOrderingGraphTraits */
  61. typedef graph_traits<SubgraphOrderingGraphType> SubgraphOrderingGraphTraits;
  62. /*!< vertex_descriptor of SubgraphOrderingGraphType defined as SubgraphOrderingGraphVertexDescriptor */
  63. typedef SubgraphOrderingGraphTraits::vertex_descriptor SubgraphOrderingGraphVertexDescriptor;
  64. /*!< edge_descriptor of SubgraphOrderingGraphType defined as SubgraphOrderingGraphEdgeDescriptor */
  65. typedef SubgraphOrderingGraphTraits::edge_descriptor SubgraphOrderingGraphEdgeDescriptor;
  66. /*!< adjacency_iterator of SubgraphOrderingGraphType defined as AdjacencyIteratorSubgraphOrdeingGraph */
  67. typedef SubgraphOrderingGraphTraits::adjacency_iterator AdjacencyIteratorSubgraphOrdeingGraph;
  68. /*!< Vector of SubgraphOrderingGraphVertexDescriptor defined as VectorSubgraphOrderingGraphVertexDescriptor*/
  69. typedef QVector<SubgraphOrderingGraphVertexDescriptor> VectorSubgraphOrderingGraphVertexDescriptor;
  70. /*!< Vector Iterator of SubgraphOrderingGraphVertexDescriptor defined as IteratorVectorSubgraphOrderingGraphVertexDescriptor*/
  71. typedef QVectorIterator<SubgraphOrderingGraphVertexDescriptor> IteratorVectorSubgraphOrderingGraphVertexDescriptor;
  72. /*!< Vector of SubgraphOrderingGraphEdgeDescriptor defined as VectorSubgraphOrderingGraphEdgeDescriptor*/
  73. typedef QVector<SubgraphOrderingGraphEdgeDescriptor> VectorSubgraphOrderingGraphEdgeDescriptor;
  74. /*!< Vector iterator of SubgraphOrderingGraphEdgeDescriptor defined as IteratorVectorSubgraphOrderingGraphEdgeDescriptor*/
  75. typedef QVectorIterator<SubgraphOrderingGraphEdgeDescriptor> IteratorVectorSubgraphOrderingGraphEdgeDescriptor;
  76. #endif // SUBGRAPHORDERINGGRAPHTYPE_H