25 #ifndef DIALECT_PLANARISE_H 26 #define DIALECT_PLANARISE_H 31 #include "libvpsc/rectangle.h" 33 #include "libdialect/commontypes.h" 34 #include "libdialect/constraints.h" 54 std::pair<Event*, Event*>
getEvents(
void);
58 void addSep(SepMatrix &m)
const;
75 enum class EventType {
84 Event(EdgeSegment *seg, Node_SP endpt, EventType type);
88 Event(
double varCoord, Node_SP node, EventType type);
90 Node_SP getNode(
void) {
return endpt; }
113 typedef std::vector<EdgeSegment*> EdgeSegments;
114 typedef std::vector<Event*> Events;
115 typedef std::vector<Nodes> NodeGroups;
117 struct OrthoPlanariserOptions {
123 bool generateConstraints =
true;
167 void setOpts(
const OrthoPlanariserOptions &opts) { m_opts = opts; }
175 removeEdgeOverlaps();
178 removeEdgeCrossings();
183 return m_planarGraph;
194 void removeEdgeOverlaps(
void);
200 void removeEdgeCrossings(
void);
203 void buildSegments(Graph_SP G);
205 void deleteSegments(
void);
213 NodeGroups computeNodeGroups(EdgeSegments segs);
222 Nodes computeCrossings(
void);
224 OrthoPlanariserOptions m_opts;
226 EdgeSegments m_edgeSegments;
228 Graph_SP m_givenGraph;
229 Graph_SP m_overlapFreeGraph;
230 Graph_SP m_planarGraph;
236 #endif // DIALECT_PLANARISE_H void setOpts(const OrthoPlanariserOptions &opts)
Set the options.
Definition: planarise.h:167
OrthoPlanariser(const Graph_SP &G)
Standard constructor.
Definition: planarise.h:137
Node_SP openingNode
The node that sits at the end where the lower bound on the variable coordinate occurs: ...
Definition: planarise.h:69
double upperBound
The upper bound on the coordinate that does change:
Definition: planarise.h:67
bool CompareActiveEvents(Event *a, Event *b)
Definition: planarise.cpp:268
Represents an axis-aligned segment of an orthogonal connector route.
Definition: planarise.h:41
Graph_SP planarise(void)
Compute a planarisation of the given Graph.
Definition: planarise.h:171
double lowerBound
The lower bound on the coordinate that does change:
Definition: planarise.h:65
libdialect: A library for computing human-like orthogonal network (DiAlEcT) layouts.
Definition: cola.h:44
Definition: planarise.h:130
std::pair< Event *, Event * > getEvents(void)
Generate the two Events, in order, representing the opening and closing of this segment.
Definition: planarise.cpp:90
EdgeSegment(Node_SP node1, Node_SP node2)
Standard constructor.
Definition: planarise.cpp:48
Node_SP closingNode
The node that sits at the end where the upper bound on the variable coordinate occurs: ...
Definition: planarise.h:71
double constCoord
The value of the coordinate that does not change:
Definition: planarise.h:63
Dim
Indicates the x- or y-dimension.
Definition: rectangle.h:41
void setNewClosingNode(Node_SP u)
Substitute a new Node as the closing node of the segment. This is useful during our scan line process...
Definition: planarise.cpp:84
vpsc::Dim orientation
The orientation of the segment (horizontal or vertical):
Definition: planarise.h:61
void addSep(SepMatrix &m) const
Update a SepMatrix with a constraint requiring this segment to remain aligned and at least its curren...
Definition: planarise.cpp:98