60 void writeGML(
const char *fileName)
const ;
61 void writeGML(ostream &os)
const;
69 return m_edgeToBasicArc[e];
91 void align(
bool b) {m_align = b;}
107 int costAssoc = 1,
bool align =
false);
144 virtual void writeLength(ostream &os,
edge e)
const = 0;
150 void insertPathVertices(
const PlanRep &PG);
151 void dfsInsertPathVertex(
157 void insertBasicArcs(
const PlanRep &PG);
174 template<
class ATYPE>
185 bool align =
false) :
190 m_length .init((
Graph&)*
this, sep);
191 m_extraNode.init((
Graph&)*
this,
false);
192 m_extraOfs .init((
Graph&)*
this, 0);
193 m_extraRep .init((
Graph&)*
this,
nullptr);
197 m_centerPriority =
true;
198 m_genToMedian =
true;
205 void writeGML(
const char *fileName)
const ;
206 void writeGML(ostream &os)
const;
229 return m_pathNode[v];
252 return m_extraNode[v];
257 return m_extraOfs[v];
262 return m_extraRep[v];
278 void insertVertexSizeArcs(
288 void insertVertexSizeArcs(
296 void insertVisibilityArcs(
302 void insertVisibilityArcs(
309 void setMinimumSeparation(
const PlanRep &PG,
328 bool areMulti(
edge e1,
edge e2)
const;
347 os <<
"[" << interval.
m_low <<
"," << interval.
m_high <<
368 ATYPE d = (*m_pPos)[x] - (*m_pPos)[y];
374 return (*m_pSec)[x] - (*m_pSec)[y];
387 void setBasicArcsZeroLength(
const PlanRep &PG);
429 m_extraNode[v] =
true;
443 m_vertexArcCost = c_vertexArcFactor*costGen;
444 if (m_centerPriority)
445 m_bungeeCost = c_bungeeFactor*costGen+1;
447 m_bungeeCost = c_bungeeFactor*4+1;
449 m_MedianArcCost = c_MedianFactor*m_vertexArcCost;
450 m_doubleBendCost = c_doubleBendFactor*m_vertexArcCost;
455 template<
class ATYPE>
457 template<
class ATYPE>
459 template<
class ATYPE>
462 template<
class ATYPE>
467 template<
class ATYPE>
476 if ((m_pOR->direction(adj) == m_arcDir ||
477 m_pOR->direction(adj) == m_oppArcDir) &&
481 m_length[m_edgeToBasicArc[adj]] = 0;
486 }
while(adj != adjFirst);
492 && (m_pOR->direction(adjFirst) == m_arcDir
493 || m_pOR->direction(adjFirst) == m_oppArcDir)) {
494 int numIncoming = faceSize - 3;
495 int median = (numIncoming / 2) + 1;
504 if (m_pOR->direction(adjFirst) == m_arcDir) {
511 for (
int i = 0; i < median; i++) {
516 node vCenter = newNode();
517 setExtra(vCenter, vMin, 0);
522 edge helper = newEdge(m_pathNode[vMin], vCenter);
523 m_length[helper] = 0;
528 edge e1 = newEdge(vCenter,upper);
530 m_cost[e1] = m_MedianArcCost;
533 edge e2 = newEdge(vCenter,lower);
535 m_cost[e2] = m_MedianArcCost;
542 template<
class ATYPE>
549 for (adj = cornerDir; m_pOR->direction(adj) == m_arcDir; adj = adj->
faceCycleSucc())
550 m_cost[m_edgeToBasicArc[adj]] = 0;
551 for (adj = cornerOppDir; m_pOR->direction(adj) == m_oppArcDir; adj = adj->
faceCycleSucc())
552 m_cost[m_edgeToBasicArc[adj]] = 0;
556 for (adj = cornerDir; m_pOR->direction(adj) == m_arcDir; adj = adj->
faceCycleSucc())
558 m_cost[m_edgeToBasicArc[adj]] = 0;
567 for (adj = cornerOppDir; m_pOR->direction(adj) == m_oppArcDir; adj = adj->
faceCycleSucc())
569 m_cost[m_edgeToBasicArc[adj]] = 0;
582 template<
class ATYPE>
595 const ATYPE overhang = rc.
overhang();
599 if (PG.
expandAdj(v) ==
nullptr)
continue;
603 resetGenMergerLengths(PG,PG.
expandAdj(v));
608 ATYPE size = sizeOrig[v];
613 ATYPE rcMin = overhang + rc(v,dirMin);
614 ATYPE rcMax = overhang + rc(v,dirMax);
622 setBoundaryCosts(cornerDir,cornerOppDir);
629 m_length[m_edgeToBasicArc[cornerDir]] = rcMin;
630 m_length[m_edgeToBasicArc[cornerMax->
faceCyclePred()]] = rcMax;
633 m_length[m_edgeToBasicArc[cornerDir]] = 0;
634 delEdge(m_edgeToBasicArc[cornerDir]);
638 m_length[m_edgeToBasicArc[cornerOppDir]] = rcMax;
639 m_length[m_edgeToBasicArc[cornerMin->
faceCyclePred()]] = rcMin;
642 m_length[m_edgeToBasicArc[cornerOppDir]] = 0;
643 delEdge(m_edgeToBasicArc[cornerOppDir]);
655 edge e = newEdge(vMin,vMax);
656 m_length[e] = rcMin + size + rcMax - 2*overhang;
657 m_cost [e] = 2*m_vertexArcCost;
662 ATYPE minHalf = size/2;
663 ATYPE maxHalf = size - minHalf;
664 ATYPE lenMin = rcMin + minHalf - overhang;
665 ATYPE lenMax = maxHalf + rcMax - overhang;
669 edge e1 = newEdge(vMin,vCenter);
670 m_length[e1] = lenMin;
671 m_cost [e1] = m_vertexArcCost;
673 edge e2 = newEdge(vCenter,vMax);
674 m_length[e2] = lenMax;
675 m_cost [e2] = m_vertexArcCost;
681 edge e1 = newEdge(vMin,vCenter);
682 m_length[e1] = lenMin;
683 m_cost [e1] = m_vertexArcCost;
685 edge e2 = newEdge(vCenter,vMax);
686 m_length[e2] = lenMax;
687 m_cost [e2] = m_vertexArcCost;
698 template<
class ATYPE>
704 edge arc = m_edgeToBasicArc[e];
705 if (arc ==
nullptr)
continue;
718 m_cost[arc] = m_doubleBendCost;
729 template<
class ATYPE>
737 setBasicArcsZeroLength(PG);
747 if (PG.
expandAdj(v) ==
nullptr)
continue;
751 resetGenMergerLengths(PG,PG.
expandAdj(v));
756 ATYPE size = sizeOrig[v];
766 m_length[m_edgeToBasicArc[adj]] = minDist.
epsilon(v,m_arcDir,0);
767 m_length[m_edgeToBasicArc[last]] = minDist.
epsilon(v,m_arcDir,1);
772 m_length[m_edgeToBasicArc[adj]] = minDist.
delta(v,m_arcDir,i);
778 m_length[m_edgeToBasicArc[adj]] = minDist.
epsilon(v,m_oppArcDir,0);
779 m_length[m_edgeToBasicArc[last]] = minDist.
epsilon(v,m_oppArcDir,1);
784 m_length[m_edgeToBasicArc[adj]] = minDist.
delta(v,m_oppArcDir,i);
805 ATYPE lenMin = size/2;
806 ATYPE lenMax = size - lenMin;
807 node vCenter = newNode();
808 setExtra(vCenter, cornerDir->
theNode(), lenMin);
810 edge e1 = newEdge(vMin,vCenter);
811 m_length[e1] = lenMin;
812 m_cost[e1] = m_vertexArcCost;
814 edge e2 = newEdge(vCenter,vMax);
815 m_length[e2] = lenMax;
816 m_cost[e2] = m_vertexArcCost;
824 node vBungee = newNode();
826 setExtra(vBungee, cornerDir->
theNode(), minDist.
epsilon(v,m_arcDir,0) );
828 edge eToBungee = newEdge(vMin, vBungee);
830 m_cost[eToBungee] = 0;
831 m_length[eToBungee] = minDist.
epsilon(v,m_arcDir,0);
833 edge eBungeeCenter = newEdge(vBungee, vCenter);
836 m_cost[eBungeeCenter] = m_bungeeCost;
837 m_length[eBungeeCenter] = 0;
840 edge eBungeeOut = newEdge(vBungee, m_pathNode[cornerDir->
twinNode()]);
843 m_cost[eBungeeOut] = m_bungeeCost;
844 m_length[eBungeeOut] = 0;
847 edge eFromOut = newEdge(m_pathNode[cornerDir->
twinNode()], vMax);
849 m_cost[eFromOut] = 0;
850 m_length[eFromOut] = minDist.
epsilon(v,m_arcDir,1);
858 node vBungee = newNode();
860 setExtra(vBungee, cornerDir->
theNode(), minDist.
epsilon(v,m_oppArcDir,0) );
862 edge eToBungee = newEdge(vMin, vBungee);
864 m_cost[eToBungee] = 0;
865 m_length[eToBungee] = minDist.
epsilon(v,m_oppArcDir,0);
867 edge eBungeeCenter = newEdge(vBungee, vCenter);
870 m_cost[eBungeeCenter] = m_bungeeCost;
871 m_length[eBungeeCenter] = 0;
874 edge eBungeeOut = newEdge(vBungee, m_pathNode[cornerOppDir->
twinNode()]);
877 m_cost[eBungeeOut] = m_bungeeCost;
878 m_length[eBungeeOut] = 0;
881 edge eFromOut = newEdge(m_pathNode[cornerOppDir->
twinNode()], vMax);
883 m_cost[eFromOut] = 0;
884 m_length[eFromOut] = minDist.
epsilon(v,m_oppArcDir,0);
891 edge e = newEdge(vMin,vMax);
893 m_cost[e] = 2*m_vertexArcCost;
900 ATYPE lenMin = size/2;
901 ATYPE lenMax = size - lenMin;
909 edge e1 = newEdge(vMin,vCenter);
910 m_length[e1] = lenMin;
911 m_cost [e1] = m_vertexArcCost;
913 edge e2 = newEdge(vCenter,vMax);
914 m_length[e2] = lenMax;
915 m_cost [e2] = m_vertexArcCost;
922 node vCenter = newNode();
923 setExtra(vCenter, cornerDir->
theNode(), lenMin);
925 edge e1 = newEdge(vMin,vCenter);
926 m_length[e1] = lenMin;
927 m_cost[e1] = m_vertexArcCost;
929 edge e2 = newEdge(vCenter,vMax);
930 m_length[e2] = lenMax;
931 m_cost[e2] = m_vertexArcCost;
936 node vBungee = newNode();
938 setExtra(vBungee, cornerDir->
theNode(), minDist.
epsilon(v,m_arcDir,0) );
940 edge eToBungee = newEdge(vMin, vBungee);
942 m_cost[eToBungee] = 0;
943 m_length[eToBungee] = minDist.
epsilon(v,m_arcDir,0);
945 edge eBungeeCenter = newEdge(vBungee, vCenter);
948 m_cost[eBungeeCenter] = m_bungeeCost;
949 m_length[eBungeeCenter] = 0;
952 edge eBungeeOut = newEdge(vBungee, m_pathNode[cornerDir->
twinNode()]);
955 m_cost[eBungeeOut] = m_bungeeCost;
956 m_length[eBungeeOut] = 0;
962 edge e1 = newEdge(vMin,vCenter);
963 m_length[e1] = lenMin;
964 m_cost [e1] = m_vertexArcCost;
966 edge e2 = newEdge(vCenter,vMax);
967 m_length[e2] = lenMax;
968 m_cost [e2] = m_vertexArcCost;
976 node vCenter = newNode();
977 setExtra(vCenter, cornerDir->
theNode(), lenMin);
979 edge e1 = newEdge(vMin,vCenter);
980 m_length[e1] = lenMin;
981 m_cost[e1] = m_vertexArcCost;
983 edge e2 = newEdge(vCenter,vMax);
984 m_length[e2] = lenMax;
985 m_cost[e2] = m_vertexArcCost;
989 node vBungee = newNode();
991 setExtra(vBungee, cornerDir->
theNode(), minDist.
epsilon(v,m_oppArcDir,0) );
993 edge eToBungee = newEdge(vMin, vBungee);
995 m_cost[eToBungee] = 0;
996 m_length[eToBungee] = minDist.
epsilon(v,m_oppArcDir,0);
998 edge eBungeeCenter = newEdge(vBungee, vCenter);
1001 m_cost[eBungeeCenter] = m_bungeeCost;
1002 m_length[eBungeeCenter] = 0;
1005 edge eBungeeOut = newEdge(vBungee, m_pathNode[cornerOppDir->
twinNode()]);
1008 m_cost[eBungeeOut] = m_bungeeCost;
1009 m_length[eBungeeOut] = 0;
1017 setBoundaryCosts(cornerDir,cornerOppDir);
1022 if (m_arcDir ==
OrthoDir::East) writeGML(
"eastvertexsizeinserted.gml");
1023 else writeGML(
"northvertexsizeinserted.gml");
1030 template<
class ATYPE>
1035 for(
edge e : edges) {
1036 c += cost(e) * (pos[e->target()] - pos[e->source()]);
1047 template<
class ATYPE>
1050 if (sweepLine.
empty())
1055 if((*it).m_high < (*it).m_low)
1058 ATYPE x = (*it).m_low;
1060 for(++it; it.
valid(); ++it) {
1061 if((*it).m_high < (*it).m_low)
1063 if ((*it).m_high > x)
1072 template<
class ATYPE>
1083 if(PG.
expandAdj(v) ==
nullptr)
continue;
1085 for(
int d = 0; d < 4; ++d) {
1091 insertVisibilityArcs(PG,posDir,posOrthDir,minDist);
1101 template<
class ATYPE>
1130 for(
node v : nodes) {
1133 if (m_path[v].empty())
continue;
1137 segPos[v] = posDir[*it];
1138 low[v] = high[v] = posOrthDir[*it];
1140 for(++it; it.
valid(); ++it) {
1141 ATYPE x = posOrthDir[*it];
1146 if (x > high[v]) high[v] = x;
1148 lowReal[v] = low[v];
1152 bool subtractSep =
true;
1153 if (nodeLow->
degree() == 2) {
1156 if(m_pOR->direction(adj) == m_arcDir || m_pOR->direction(adj) == m_oppArcDir) {
1163 m_pOR->direction(adj2) == m_pOR->direction(adjFound);
1165 if(posDir[adjFound->
theNode()] == posDir[adj2->twinNode()])
1166 subtractSep =
false;
1186 if(PG.
expandAdj(v) ==
nullptr)
continue;
1193 m_pOR->direction((isCaseA) ? adj : adj->
faceCycleSucc()) == dirMin;
1200 ATYPE delta = (isCaseA) ?
1201 min(abs(posOrthDir[adjPred->
theNode()] - posOrthDir[adjPred->
twinNode()]), m_sep) :
1202 min(abs(posOrthDir[adj->
theNode()] - posOrthDir[adj->
twinNode()]), m_sep);
1203 ATYPE boundary = (isCaseA) ?
1204 min(posOrthDir[adjPred->
theNode()], posOrthDir[adjPred->
twinNode()]) :
1211 m_pOR->angle(adjTwin) == 2)
1215 low[s1] = lowReal[s1] - delta;
1216 low[s2] = lowReal[s2] - delta;
1226 low[s1] = lowReal[s1] - delta;
1227 low[s2] = lowReal[s2] - delta;
1234 OrthoDir runDir = m_pOR->direction(adjCross);
1238 m_pOR->angle(adjTwin) == angleAtMin)
1242 node s = m_edgeToBasicArc[adjCross]->source();
1243 if(lowReal[s] != low[s])
1245 if(low[s] >= boundary)
1249 low[s] += m_sep - delta;
1262 }
while(m_pOR->direction(adjCross) == segDir ||
1263 m_pOR->direction(adjCross) == segOppDir);
1268 node sNext = m_edgeToBasicArc[adjCross]->opposite(s);
1270 if(segPos[sNext] != segPos[s])
1273 low[sNext] = lowReal[sNext];
1278 adjTwin = adjCross->
twin();
1280 if (runDir != m_pOR->direction(adjCross))
break;
1285 for (adj = (isCaseA) ? vi.
m_corner[
static_cast<int>(dirMax)]->faceCycleSucc() : vi.
m_corner[
static_cast<int>(dirMax)]->faceCycleSucc()->
faceCycleSucc();
1286 m_pOR->direction((isCaseA) ? adj->
faceCycleSucc() : adj) == dirMax;
1293 ATYPE delta = -posOrthDir[adj->
twinNode()] + posOrthDir[adj->
theNode()];
1296 ATYPE delta = (isCaseA) ?
1297 min(abs(posOrthDir[adj->
twinNode()] - posOrthDir[adj->
theNode()]), m_sep) :
1298 min(abs(posOrthDir[adjPred->
theNode()] - posOrthDir[adjPred->
twinNode()]), m_sep);
1299 ATYPE boundary = (isCaseA) ?
1312 low[s1] = lowReal[s1] - delta;
1313 low[s2] = lowReal[s2] - delta;
1317 m_pOR->angle(adjTwin) == 2)
1321 low[s1] = lowReal[s1] - delta;
1322 low[s2] = lowReal[s2] - delta;
1331 OrthoDir runDir = m_pOR->direction(adjCross);
1335 m_pOR->angle(adjTwin) == angleAtMax)
1337 node s = m_edgeToBasicArc[adjCross]->target();
1338 if(lowReal[s] != low[s])
1340 if(low[s] >= boundary)
1344 low[s] += m_sep - delta;
1359 }
while(m_pOR->direction(adjCross) == segDir ||
1360 m_pOR->direction(adjCross) == segOppDir);
1365 node sNext = m_edgeToBasicArc[adjCross]->opposite(s);
1367 if(segPos[sNext] != segPos[s])
1370 low[sNext] = lowReal[sNext];
1375 adjTwin = adjCross->
twin();
1378 if (runDir != m_pOR->direction(adjCross))
break;
1386 computeTopologicalSegmentNum(topNum);
1392 allNodes(sortedPathNodes);
1399 for(itV = sortedPathNodes.
begin(); itV.
valid(); ++itV)
1402 if (m_path[*itV].empty())
continue;
1403 OGDF_ASSERT_IF(DebugLevel::ExtendedChecking,checkSweepLine(sweepLine));
1407 for(it = sweepLine.
begin(); it.
valid(); ++it) {
1408 if ((*it).m_low < high[v])
1417 if((*it).m_high <= low[v]) {
1425 bool isItUpDel = ( ((*itUp).m_low >= low[v]) && ((*itUp).m_high <= high[v]) );
1427 for(; it.
valid() && (*it).m_low >= low[v]; it = itSucc) {
1429 if ((*it).m_high <= high[v]) {
1435 if (it == itUp && (*it).m_high > high[v]) {
1436 node w = (*it).m_pathNode;
1438 (*it).m_low = high[v];
1443 if ( (!isItUpDel) && itUp != it && (*itUp).m_low < high[v]) {
1444 (*itUp).m_low = high[v];
1448 if ((*it).m_high > low[v]) {
1449 (*it).m_high = low[v];
1462 removeRedundantVisibArcs(visibArcs);
1472 node seg = m_pathNode[v];
1474 if(m_pOR->direction(adj) != segDir)
continue;
1477 if (eOrig ==
nullptr)
continue;
1487 for(itT = visibArcs.
begin(); itT.
valid(); itT = itTSucc) {
1488 itTSucc = itT.
succ();
1489 node v = (*itT).x1(), w = (*itT).x2();
1492 if (correspEdge[v] && (correspEdge[v] == correspEdge[w]))
1494 if (itTPred.
valid())
1506 for(itT = visibArcs.
begin(); itT.
valid(); ++itT) {
1508 node v = (*itT).x1(), w = (*itT).x2();
1509 if (!(m_extraNode[v] || m_extraNode[w])) {
1511 node boundRepresentant1 = m_path[v].front();
1512 node boundRepresentant2 = m_path[w].front();
1513 node en1 = m_pPR->expandedNode(boundRepresentant1);
1514 node en2 = m_pPR->expandedNode(boundRepresentant2);
1516 if (!( ( en1 && en2 ) && ( en1 == en2) ))
1518 edge e = newEdge(v,w);
1522 m_length[e] = max(m_sep, minDist.
separation());
1526 writeGML(
"visibilityinserted.gml");
1532 OGDF_ASSERT_IF(DebugLevel::ExtendedChecking,checkSweepLine(sweepLine));
1541 template<
class ATYPE>
1545 for(
edge e : getGraph().edges) {
1546 node v = m_path[e->source()].front();
1547 node w = m_path[e->target()].front();
1548 if (pos[w] - pos[v] < length(e)) {
1549 cout <<
"feasibility check failed for edge " << e << endl;
1550 cout <<
" representatives: " << v <<
", " << w << endl;
1551 cout <<
" length: " << length(e) << endl;
1552 cout <<
" actual distance: " << pos[w] - pos[v] << endl;
1553 cout <<
" type of " << e <<
": ";
1576 template<
class ATYPE>
1579 ofstream os(filename);
1583 template<
class ATYPE>
1586 const Graph &G = *
this;
1591 os.setf(ios::showpoint);
1594 os <<
"Creator \"ogdf::CompactionConstraintGraphBase::writeGML\"\n";
1596 os <<
" directed 1\n";
1600 os <<
" id " << (
id[v] = nextId++) <<
"\n";
1602 if (m_extraNode[v]) {
1603 os <<
" label \"" <<
"0" <<
"\"\n";
1605 os <<
" label \"" << m_pPR->expandedNode(m_path[v].front()) <<
"\"\n";
1608 os <<
" graphics [\n";
1614 os <<
" fill \"#00FFFF\"\n";
1616 os <<
" fill \"#FFFF00\"\n";
1624 os <<
" source " <<
id[e->
source()] <<
"\n";
1625 os <<
" target " <<
id[e->
target()] <<
"\n";
1634 os <<
" graphics [\n";
1636 os <<
" type \"line\"\n";
1637 os <<
" arrow \"last\"\n";
1641 os <<
" fill \"#FF0000\"\n";
1644 os <<
" fill \"#0000FF\"\n";
1647 os <<
" fill \"#00FF00\"\n";
1650 os <<
" fill \"#FF0000\"\n";
1653 os <<
" fill \"#AF00FF\"\n";
1656 os <<
" fill \"#FF00FF\"\n";
1663 os <<
" LabelGraphics [\n";
1664 os <<
" type \"text\"\n";
1665 os <<
" fill \"#000000\"\n";
1666 os <<
" anchor \"w\"\n";
node target() const
Returns the target node of the edge.
node pathNodeOf(node v) const
Returns the segment (path node in constraint graph) containing v.
const Graph & getGraph() const
Returns underlying graph.
int m_MedianArcCost
draw merger gen at median of incoming generalizations
NodeArray< edge > m_originalEdge
save edge for the basic arcs
node extraRep(node v) const
Returns extraNode existing anchor representant.
#define OGDF_ASSERT_IF(minLevel, expr)
Assert condition expr if debug level is at least minLevel.
int m_doubleBendCost
try to minimize double bends
void delSucc(iterator itBefore)
Removes the succesor of itBefore.
edge theEdge() const
Returns the edge associated with this adjacency entry.
bool valid() const
Returns true iff the iterator points to an element.
void centerPriority(bool b)
Sets centerPriority (center single edges?)
bool fixOnBorder(edge e) const
Returns true if edge is subject to length fixation if length < sep.
void setBoundaryCosts(adjEntry cornerDir, adjEntry cornerOppDir)
void writeGML(const char *fileName) const
Output for debugging only.
void insertVertexSizeArcs(const PlanRep &PG, const NodeArray< ATYPE > &sizeOrig, const RoutingChannel< ATYPE > &rc)
Inserts arcs for respecting sizes of vertices and achieving desired placement of generalizations if v...
iterator pushBack(const E &x)
Adds element x at the end of the list.
Data type for general directed graphs (adjacency list representation).
bool extraNode(node v) const
Returns node status.
int m_bungeeCost
middle position distance penalty
#define OGDF_AUGMENT_COMPARER(type)
Add this macro to your class to turn it into a full comparer.
Declaration of orthogonal representation of planar graphs.
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Maintains input sizes for improvement compaction (deltas and epsilons)
ATYPE extraOfs(node v) const
Returns extraNode position, change to save mem, only need some entries.
NodeArray< node > m_pathNode
segment containing a node in PG
int totalAttached() const
void embed()
Embeds constraint graph such that all sources and sinks lie in a common face.
Information about a side of a vertex in UML diagrams.
#define OGDF_THROW(CLASS)
Replacement for throw.
int degree() const
Returns the degree of the node (indegree + outdegree).
const ATYPE & epsilon(node v, OrthoDir s, int i) const
adjEntry faceCyclePred() const
Returns the cyclic predecessor in face.
iterator begin()
Returns an iterator to the first element of the list.
Represents a constraint graph used for compaction.
EdgeArray< bool > m_alignmentArc
Basic arcs that have to be short for alignment (node to gen expander)
iterator insertAfter(const E &x, iterator it)
Inserts element x after it.
Orthogonal representation of an embedded graph.
static const int c_bungeeFactor
ConstraintEdgeType
Types of edges in the constraint graph.
Declaration of a base class for planar representations of graphs and cluster graphs.
Further information about the cages of vertices in UML diagrams.
Encapsulates a pointer to an ogdf::SList element.
const OrthoRep & getOrthoRep() const
Returns underlying OrthoRep.
NodeArray< bool > m_extraNode
Node does not represent drawing node as we dont have positions we save a drawing representant and an ...
Dynamic arrays indexed with edges.
SListIteratorBase< E, isConst > succ() const
Returns successor iterator.
adjEntry cyclicSucc() const
Returns the cyclic successor in the adjacency list.
Graph::NodeType typeOf(node v) const
Returns the type of node v.
Singly linked lists (maintaining the length of the list).
ListIteratorBase< E, isConst > succ() const
Returns successor iterator.
Declaration of class RoutingChannel which maintains required size of routing channels and separation...
void del(iterator it)
Removes it from the list.
adjEntry faceCycleSucc() const
Returns the cyclic successor in face.
const SListPure< node > & nodesIn(node v) const
Returns list of nodes contained in segment v.
bool m_centerPriority
should centering be more expensive than generalizations
EdgeArray< edge > m_edgeToBasicArc
basic arc representing an edge in PG
const NodeArray< ATYPE > * m_pPos
NodeArray< edge > m_pathToEdge
save the (single!) edge (segment) for a pathNode
const NodeArray< int > * m_pSec
int m_vertexArcCost
get small cages
Represents an interval on the sweep line.
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
adjEntry expandAdj(node v) const
Returns the adjacency entry of a node of an expanded face.
ATYPE separation() const
Returns the separation value.
iterator begin()
Returns an iterator to the first element of the list.
void quicksort()
Sorts the list using Quicksort.
bool checkSweepLine(const List< Interval > &sweepLine)
bool m_genToMedian
draw outgoing generalization from merger above ingoing gen.
iterator pushBack(const E &x)
Adds element x at the end of the list.
void embed()
Embeds constraint graph such that all sources and sinks lie in a common face.
Tuples of two elements (2-tuples).
CompactionConstraintGraph(const OrthoRep &OR, const PlanRep &PG, OrthoDir arcDir, ATYPE sep, int costGen=1, int costAssoc=1, bool align=false)
Construction.
Doubly linked lists (maintaining the length of the list).
bool verticalArc(edge e) const
Returns true if e is basic arc of vertical edge in PlanRepUML hierarchy.
Exception thrown when an algorithm realizes an internal bug that prevents it from continuing...
void setBasicArcsZeroLength(const PlanRep &PG)
static const int c_doubleBendFactor
double bends cost factor*vertexArcCost
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
Class for the representation of edges.
adjEntry twin() const
Returns the corresponding adjacency element associated with the same edge.
EdgeArray< int > m_border
only used for cage precompaction in flowcompaction computecoords
void popFront()
Removes the first element from the list.
void resetGenMergerLengths(const PlanRep &PG, adjEntry adjFirst)
Maintains input sizes for constructive compaction (size of routing channels, separation, cOverhang)
const PlanRep & getPlanRep() const
Class for the representation of nodes.
NodeArray< SListPure< node > > m_path
list of nodes contained in a segment
Encapsulates a pointer to a list element.
NodeArray< node > m_extraRep
existing representant of extranodes position anchor
bool onBorder(edge e) const
Returns true if edge lies on cage border.
SegmentComparer(const NodeArray< ATYPE > &segPos, const NodeArray< int > &secSort)
ATYPE length(edge e) const
Returns length of edge e.
const Graph & original() const
Returns a reference to the original graph.
node m_pathNode
corresponding segment
adjEntry cyclicPred() const
Returns the cyclic predecessor in the adjacency list.
EdgeArray< ATYPE > m_length
length of an edge
inserted to replace some reducible in fixzerolength
friend ostream & operator<<(ostream &os, const Interval &interval)
output operator
Comparer class used for sorting segments by increasing position (given by segPos) such that two overl...
static OrthoDir prevDir(OrthoDir d)
Returns the previous OrthoDir (in a clockwise manner)
ATYPE computeTotalCosts(const NodeArray< ATYPE > &pos) const
Computes the total costs for coordintes given by pos, i.e., the sum of the weighted lengths of edges ...
static OrthoDir nextDir(OrthoDir d)
Returns the next OrthoDir (in a clockwise manner)
bool isFeasible(const NodeArray< ATYPE > &pos)
Performs feasibility test for position assignment pos, i.e., checks if the segment positions given by...
void setExtra(node v, node rep, ATYPE ofs)
Node v has no representation in drawing, only internal representation.
static const int c_MedianFactor
median arcs cost factor*vertexArcCost
static const int c_vertexArcFactor
Declaration of class MinimumEdgeDistances which maintains minimum distances between attached edges at...
Interval(node v, ATYPE low, ATYPE high)
bool alignmentArc(edge e) const
Returns if arc is important for alignment. These are the arcs representing node to gen...
const ATYPE & delta(node v, OrthoDir s, int i) const
edge basicArc(edge e) const
Returns constraint arc representing input edge e in constraint graph.
NodeArray< ATYPE > m_extraOfs
offset of extra node to its rep, should change this
int compare(const node &x, const node &y) const
can be compacted to zero length
EdgeArray< int > m_cost
cost of an edge
can be compacted to zero length, can be fixed
void align(bool b)
Triggers alignment (=>some special edge handling to support al.)
edge pathToOriginal(node v)
node source() const
Returns the source node of the edge.
iterator insertBefore(const E &x, iterator it)
Inserts element x before it.
Base class implementing common behaviour of ogdf::CompactionConstraintGraph.
The namespace for all OGDF objects.
EdgeArray< bool > m_verticalGen
generalization that runs vertical relative to hierarchy
EdgeArray< ConstraintEdgeType > m_type
bool centerPriority()
Gets centerPriority (center single edges?)
virtual void writeLength(ostream &os, edge e) const override
NodeType
The type of nodes.
EdgeArray< bool > m_verticalArc
arc corresponding to such an edge
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
int cost(edge e) const
Returns cost of edge e.
void insertVisibilityArcs(const PlanRep &PG, const NodeArray< ATYPE > &posDir, const NodeArray< ATYPE > &posOppDir)
Inserts arcs connecting segments which can see each other in a drawing of the associated planarized r...
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
ATYPE m_high
lower and upper bound
bool empty() const
Returns true iff the list is empty.
bool valid() const
Returns true iff the iterator points to an element.
ConstraintEdgeType typeOf(edge e) const
Returns type of edge e.
node theNode() const
Returns the node whose adjacency list contains this element.
bool verticalGen(edge e) const
Returns true if e is vertical edge in PlanRepUML hierarchy.
Class for adjacency list elements.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Planarized representations (of a connected component) of a graph.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.