123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- #ifndef SPRINGEMBEDDERVARIABLESIZENODES_H
- #define SPRINGEMBEDDERVARIABLESIZENODES_H
- #include<Common/GraphType.h>
- #include<Common/BoostGraphWrapper.h>
- #include <ForceBasedLayout/SpringEmbedder.h>
- #include "MembershipInitializer.h"
- #include <HierarchicalLayoutGenerator/HierarchicalLayouter.h>
- #include <Common/LayoutEnum.h>
- #include <Common/GraphType.h>
- #include <ForceBasedLayout/Reingold.h>
- #include <boost/geometry.hpp>
- #include <boost/geometry/geometries/segment.hpp>
- #include <boost/geometry/algorithms/intersection.hpp>
- #include <ForceBasedLayout/Postprocessing.h>
- #include <ForceBasedLayout/RelaxInterEdges.h>
- #include<LayoutException/LayoutExceptionConstants.h>
- #include<ForceBasedLayout/Constants.h>
- #include<ForceBasedLayout/VertexOverlapRemoval.h>
- /**
- * @brief The ClusteredSpringEmbedder class
- *
- * The class provides helpers for spring embedder algorithm on clustered graph.
- */
- class GRAPHLAYOUTLIBRARYSHARED_EXPORT ClusteredSpringEmbedder
- {
- public:
- SubGraph *m_gSubgraph = NULL; /*!< Pointer to subgraph */
- SubGraph m_gMaingraph; /*!< Copy of Main graph*/
- BoostGraphWrapper m_bGraphWrapper; /*!< Single graph wrapper object to access properties */
- /** @name Creators
- * The methods under this section are responsible for constructing
- * an instance of type ClusteredSpringEmbedder.
- */
- //@{
- /**
- Constructs new object of type ClusteredSpringEmbedder.
- @pre none
- @param none
- @return none
- @throw none
- */
- ClusteredSpringEmbedder();
- //@}
- /** @name Modifiers
- * The methods under this section are responsible for modifying
- * an instance of ClusteredSpringEmbedder.
- */
- //@{
- /** For each subgraph of received graph.
- @pre
- -# gMaingraph != NULL
- @param iIterations
- number of iterations for algorithm
- @param gMaingraph
- reference to main graph
- @return none
- @throw LayoutException
- */
- void springForEachCluster(SubGraph& gMaingraph,int iIterations);
- //@}
- private:
- /** Perform main algo steps iterations time
- @pre
- -# gMainGraph != NULL
- -# gSubgraph != NULL
- @param gMaingraph
- reference to main graph
- @param gSubgraph
- reference to Subgraph
- @param iIterations
- number of iterations
- @return none
- @throw none
- */
- void springStep(SubGraph& gSubgraph,SubGraph& gMaingraph,int iIterations);
- /** Relax only immediate nodes one step at a time
- @pre
- -# gMainGraph != NULL
- @param gSubgraph
- reference to graph
- @return none
- @throw none
- */
- void springRelaxImmediate(SubGraph& gSubgraph);
- /** Repel only immediate nodes one step at a time
- @pre
- -# gMainGraph != NULL
- @param gSubgraph
- reference to graph
- @return none
- @throw none
- */
- void springRepelImmediate(SubGraph& gSubgraph);
- /** Move the nodes one step in their bounds only
- @pre
- -# gMainGraph != NULL
- @param gSubgraph
- reference to graph
- @return none
- @throw none
- */
- void springMoveRestricted(SubGraph& gSubgraph);
- /** Repel only immediate nodes with immediate clusters one step at a time.
- @pre
- -# gMainGraph != NULL
- @param gSubgraph
- reference to graph
- @return none
- @throw none
- */
- void springRepelFromClusters(SubGraph& gSubgraph);
- /** Repel only immediate nodes with immediate clusters one step at a time.
- @pre
- -# gMaingraph != NULL
- @param gSubgraph
- Reference to sub graph
- @return none
- @throw none
- */
- void springRepelClustersToCluster(SubGraph& gSubgraph);
- /** Relax all the inter edges such of received subgraph such that it does not cross clusters,
- * generally will be of less power of force.
- @pre
- -# gMaingraph != NULL
- @param gMaingraph
- Reference to main graph
- @return none
- @throw LayoutException
- */
- void springRelaxInterEdges(SubGraph& gMaingraph );
- /** For each subgraph of received graph move clusters.
- @pre
- -# gsubgraph != NULL
- @param gsubgraph
- reference to graph
- @return none
- @throw LayoutException
- */
- void springMoveClusters(SubGraph& gsubgraph);
- /** For each subgraph of received graph. check whether clusters
- * needed to be expanded.
- @pre
- none
- @param none
- @return none
- @throw none
- */
- void springSetVerticesDisplacementZero();
- /** Testing method for recursive type of algorithm which starts lay out
- * from inner subgraph to outer.
- *
- @pre
- -# gMaingraph != NULL
- @param gMaingraph
- reference to graph
- @return none
- @throw none
- */
- void springTestRecursive(SubGraph& gMaingraph);
- /** Repel only immediate clusters with immediate clusters one step at a time.
- @pre
- -# gMainGraph != NULL
- @param gSubgraph
- reference to graph
- @return none
- @throw none
- */
- void springTestRepelClusterToCluster(SubGraph &gSubgraph);
- };
- #endif // SPRINGEMBEDDERVARIABLESIZENODES_H
|