123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- #ifndef SUBGRAPHORDERINGGRAPH_H
- #define SUBGRAPHORDERINGGRAPH_H
- #include <GraphLayoutLibrary_global.h>
- #include <HierarchicalLayoutGenerator/SubgraphOrderingGraphType.h>
- /**
- * @brief The SubgraphOrderingGraphWrapper class
- *
- * The class provides helpers to manage subgraph ordering in hierarchical layout.
- */
- class GRAPHLAYOUTLIBRARYSHARED_EXPORT SubgraphOrderingGraphWrapper
- {
- public:
- SubgraphOrderingGraphType *m_gSubgraphOrderingGraph; /*!< Pointer reference to ordered subgraph */
- /** @name Creators
- * The methods under this section are responsible for constructing
- * an instance of type SubgraphOrderingGraphWrapper.
- */
- //@{
- /**
- Constructs new object of type SubgraphOrderingGraphWrapper.
- @pre none
- @param none
- @return none
- @throw none
- */
- SubgraphOrderingGraphWrapper();
- //@}
- /** @name Modifiers
- * The methods under this section are responsible for modifying
- * an instance of SubgraphOrderingGraphWrapper.
- */
- //@{
- /**
- Sets a vertex of graph as nesting tree subgraph node and sets layer node as false
- @pre none
- @param NestingTreeSubgraphNode
- reference to nesting tree subgraph node
- @param SubgraphOrderingGraphVertexDescriptor
- vertex descriptor to be set
- @param SubgraphOrderingGraphType
- reference to ordered subgraph
- @return none
- @throws LayoutException
- */
- void setVertexNestingTreeSubgraphNodeRef(NestingTreeSubgraphNode* nestingTreeNodeRef , SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
-
- /**
- Assigns the layer reference to a vertex descriptor in the subgraph
- @pre none
- @param LayerNode*
- pointer to layer node reference
- @param SubgraphOrderingGraphVertexDescriptor
- vertex descriptor to be set
- @param SubgraphOrderingGraphType
- reference to ordered subgraph
- @return none
- @throws LayoutException
- */
- void setVertexLayerNodeRef(LayerNode* layerNodeRef , SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
-
- // void setVertexAverageBarryCenter(double dAverageBarryCenter , SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
-
- /**
- This function set the property that 'IsEdge' is in spanning tree. This helps to detect edges in spanning tree
- @pre
- -# gSubgraphOrderingGraph.find_edge(eEdge) == true
- @param bIsSpannigTreeEdge
- boolean value to set to edge's bIsSpanningTreeEdge property
- @param eEdge
- subgraph ordering graph edge
- @param gSubgraphOrderingGraph
- subgraph ordering graph
- @return none
- @throws none
- */
- void setIsEdgeInSpanningTree(bool bIsSpannigTreeEdge , SubgraphOrderingGraphEdgeDescriptor eEdge , SubgraphOrderingGraphType& gSubgraphOrderingGraph);
- //@}
-
- /** @name Queries
- * The methods under this section are responsible for accessing
- * an instance of type SubgraphOrderingGraphWrapper.
- */
- //@{
- /**
- Returns nesting tree subgraph node of a vertex descriptor in SubgraphOrderingGraphType
- @pre none
- @param SubgraphOrderingGraphVertexDescriptor
- vertex descriptor to be set
- @param SubgraphOrderingGraphType
- reference to ordered subgraph
- @return none
- @throws LayoutException
- */
- NestingTreeSubgraphNode* getVertexNestingTreeSubgraphNode(SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
-
- /**
- Returns the layer reference corresponding to a vertex descriptor in the subgraph
- @pre none
- @param SubgraphOrderingGraphVertexDescriptor
- vertex descriptor to be set
- @param SubgraphOrderingGraphType
- reference to ordered subgraph
- @return LayerNode*
- @throws LayoutException
- */
- LayerNode* getVertexLayerNodeRef(SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
-
- // double getVertexAverageBarryCenter(SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph );
-
- /**
- Returns whether a vertex is layer node or not
- @pre none
- @param SubgraphOrderingGraphVertexDescriptor
- Vertex Descriptors
- @param SubgraphOrderingGraphType
- reference to ordered subgraph
- @return bool
- @throws none
- */
- bool isSubgraphOrderingVertexIsLayerNode(SubgraphOrderingGraphVertexDescriptor vVertex , SubgraphOrderingGraphType &gSubgraphOrderingGraph);
- /**
- This function gets if the edge is spanning tree edge property is true or false
- @pre
- -# gSubgraphOrderingGraph.find_edge(eEdge) == true
- @param eEdge
- subgraph ordering graph edge
- @param gSubgraphOrderingGraph
- subgraph ordering graph
- @return boolean true - if the edge is spanning tree edge property is true otherwise false
- @throws none
- */
- bool getIsEdgeInSpanningTree(SubgraphOrderingGraphEdgeDescriptor eEdge , SubgraphOrderingGraphType& gSubgraphOrderingGraph);
-
- /**
- Prints a textual representation of ordered subgraph. Used for debugging purposes only.
- @pre none
- @param SubgraphOrderingGraphType
- reference to ordered subgraph
- @return none
- @throws none
- */
- void printGraph(SubgraphOrderingGraphType& gGraph);
- //@}
-
- };
- #endif // SUBGRAPHORDERINGGRAPH_H
|