Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

HypergraphLayout.h
Go to the documentation of this file.
1 
40 #pragma once
41 
42 #include <ogdf/basic/Array.h>
43 #include <ogdf/basic/Graph.h>
44 #include <ogdf/basic/basic.h>
45 #include <ogdf/basic/geometry.h>
50 
51 #include <memory>
52 
53 namespace ogdf {
54 class GraphCopySimple;
55 class HypergraphAttributes;
56 class HypergraphAttributesES;
57 class PlanRep;
58 template<class E>
59 class List;
60 
62 public:
64  enum class Profile { Normal = 0x000001, ElectricCircuit = 0x000002 };
65 
66 private:
68  double m_ratio;
69 
72 
75 
77  // TODO: This might require some tweaks in Hypergraph class.
79 
82 
84  std::unique_ptr<LayoutPlanRepModule> m_planarLayoutModule;
85 
87  std::unique_ptr<CrossingMinimizationModule> m_crossingMinimizationModule;
88 
90  std::unique_ptr<EmbedderModule> m_embeddingModule;
91 
92 public:
93  // constructor
95 
96  // destructor
97  virtual ~HypergraphLayoutES() { }
98 
99  // Dynamic casting is currently not working as desired and hence we left
100  // the following call inherited from superclass empty.
101  virtual void call(HypergraphAttributes& HA) override;
102 
103 #if 0
104  void call(HypergraphAttributesES &HA);
105 #endif
106 
108  HypergraphLayoutES& operator=(const HypergraphLayoutES& hl);
109 
111  int crossings() const { return m_crossings; }
112 
114  double ratio() const { return m_ratio; }
115 
117  void setConstraintIO(bool pConstraintIO) { m_constraintIO = pConstraintIO; }
118 
120  void setProfile(Profile pProfile) { m_profile = pProfile; }
121 
135  void setPlanarLayoutModule(LayoutPlanRepModule* pPlanarLayoutModule) {
136  m_planarLayoutModule.reset(pPlanarLayoutModule);
137  }
138 
145  void setCrossingMinimizationModule(CrossingMinimizationModule* pCrossingMinimizationModule) {
146  m_crossingMinimizationModule.reset(pCrossingMinimizationModule);
147  }
148 
155  void setEmbeddingModule(EmbedderModule* pEmbeddingModule) {
156  m_embeddingModule.reset(pEmbeddingModule);
157  }
158 
160 
161 private:
162  void layout(HypergraphAttributesES& pHA);
163 
164 #if 0
165  void planarizeCC(PlanRep &ccPlanarRep, List<edge> &fixedShell);
166 #endif
167 
168  void packAllCC(const PlanRep& planarRep, const GraphCopySimple& gc, HypergraphAttributesES& pHA,
169  Array<DPoint>& bounding);
170 
171  void insertShell(GraphCopySimple& planarRep, List<node>& src, List<node>& tgt,
172  List<edge>& fixedShell);
173 
174  void removeShell(PlanRep& planarRep, NodePair& st);
175 
176  void applyProfile(HypergraphAttributesES& HA);
177 };
178 
179 }
ogdf::HypergraphAttributes
Stores additional attributes of a hypergraph.
Definition: HypergraphAttributes.h:60
ogdf::HypergraphLayoutES::m_constraintIO
bool m_constraintIO
Defines whether a drawing IO constraint is desired or not.
Definition: HypergraphLayout.h:74
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::HypergraphLayoutES::m_ratio
double m_ratio
The ration between width and height of a drawing.
Definition: HypergraphLayout.h:68
Graph.h
Includes declaration of graph class.
ogdf::HypergraphLayoutES::~HypergraphLayoutES
virtual ~HypergraphLayoutES()
Definition: HypergraphLayout.h:97
ogdf::PlanRep
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:69
geometry.h
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
ogdf::CrossingMinimizationModule
Base class for crossing minimization algorithms.
Definition: CrossingMinimizationModule.h:48
ogdf::HypergraphLayoutES::setProfile
void setProfile(Profile pProfile)
Sets the layout profile.
Definition: HypergraphLayout.h:120
ogdf::HypergraphAttributesES
Stores additional attributes of edge standard representation of a hypergraph.
Definition: HypergraphAttributes.h:145
ogdf::NodePair
Definition: Graph_d.h:2109
CrossingMinimizationModule.h
Declaration of CrossingMinimization Module, an interface for crossing minimization algorithms.
ogdf::HypergraphLayoutES::m_constraintPorts
bool m_constraintPorts
Defines whether inputs and outputs are placed on different "sides".
Definition: HypergraphLayout.h:78
HypergraphLayoutModule.h
Declaration of an interface for hypergraph layout algorithms. Any hypergraph layout must follow this ...
ogdf::HypergraphLayoutES::m_profile
Profile m_profile
Defines the profile of the layout (eg. Electric Circuit).
Definition: HypergraphLayout.h:81
ogdf::GraphCopySimple
Copies of graphs with mapping between nodes and edges.
Definition: GraphCopy.h:261
ogdf::HypergraphLayoutES::m_planarLayoutModule
std::unique_ptr< LayoutPlanRepModule > m_planarLayoutModule
The module for computing the final layout.
Definition: HypergraphLayout.h:84
ogdf::HypergraphLayoutModule
Interface of hypergraph layout algorithms.
Definition: HypergraphLayoutModule.h:45
ogdf::HypergraphLayoutES::crossings
int crossings() const
Returns the number of crossings in computed layout.
Definition: HypergraphLayout.h:111
ogdf::HypergraphLayoutES::setEmbeddingModule
void setEmbeddingModule(EmbedderModule *pEmbeddingModule)
Sets the module option for embedding.
Definition: HypergraphLayout.h:155
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:219
ogdf::LayoutPlanRepModule
Interface for planar layout algorithms (used in the planarization approach).
Definition: LayoutPlanRepModule.h:48
ogdf::HypergraphLayoutES::m_embeddingModule
std::unique_ptr< EmbedderModule > m_embeddingModule
The module for embedding planarization.
Definition: HypergraphLayout.h:90
ogdf::List< edge >
ogdf::HypergraphLayoutES::Profile
Profile
Final appearance is driven by given profile.
Definition: HypergraphLayout.h:64
ogdf::HypergraphLayoutES::setConstraintIO
void setConstraintIO(bool pConstraintIO)
Sets the Input / Output drawing requirement.
Definition: HypergraphLayout.h:117
ogdf::HypergraphLayoutES::m_crossingMinimizationModule
std::unique_ptr< CrossingMinimizationModule > m_crossingMinimizationModule
The module for crossing minimization.
Definition: HypergraphLayout.h:87
ogdf::HypergraphLayoutES::ratio
double ratio() const
Returns the ratio between width and height of a drawing.
Definition: HypergraphLayout.h:114
ogdf::HypergraphLayoutES
Definition: HypergraphLayout.h:61
ogdf::EmbedderModule
Base class for embedder algorithms.
Definition: EmbedderModule.h:52
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
EmbedderModule.h
Defines ogdf::EmbedderModule.
ogdf::HypergraphLayoutES::m_crossings
int m_crossings
The number of crossings in the layout.
Definition: HypergraphLayout.h:71
Array.h
Declaration and implementation of Array class and Array algorithms.
LayoutPlanRepModule.h
Declaration of interface for planar layout algorithms (used in planarization approach).
ogdf::HypergraphLayoutES::setCrossingMinimizationModule
void setCrossingMinimizationModule(CrossingMinimizationModule *pCrossingMinimizationModule)
Sets the module option for crossing minimization.
Definition: HypergraphLayout.h:145
ogdf::HypergraphLayoutES::setPlanarLayoutModule
void setPlanarLayoutModule(LayoutPlanRepModule *pPlanarLayoutModule)
Sets the module option for the planar layout.
Definition: HypergraphLayout.h:135