53class CombinatorialEmbedding;
72 Deg1RestoreInfo() : m_eOriginal(nullptr), m_deg1Original(nullptr), m_adjRef(nullptr) { }
75 : m_eOriginal(eOrig), m_deg1Original(deg1Orig), m_adjRef(adjRef) { }
116 node v(
int i)
const {
return m_ccInfo.v(i); }
119 edge e(
int i)
const {
return m_ccInfo.e(i); }
122 int startNode()
const {
return m_ccInfo.startNode(m_currentCC); }
125 int startNode(
int cc)
const {
return m_ccInfo.startNode(cc); }
128 int stopNode()
const {
return m_ccInfo.stopNode(m_currentCC); }
131 int stopNode(
int cc)
const {
return m_ccInfo.stopNode(cc); }
134 int startEdge()
const {
return m_ccInfo.startEdge(m_currentCC); }
137 int stopEdge()
const {
return m_ccInfo.stopEdge(m_currentCC); }
186 return (edgeTypeOf(e) & cliquePattern()) == cliquePattern();
216 return typeOf(v) == Graph::NodeType::vertex || typeOf(v) == Graph::NodeType::associationClass;
230 m_nodeTypes[v] |= UMLNodeTypeConstants::TerCrossing << UMLNodeTypeOffsets::Tertiary;
238 return (m_nodeTypes[v] & (UMLNodeTypeConstants::TerCrossing << UMLNodeTypeOffsets::Tertiary))
296 case Graph::EdgeType::association:
297 m_edgeTypes[e] =
static_cast<edgeType>(UMLEdgeTypeConstants::PrimAssociation);
299 case Graph::EdgeType::generalization:
300 m_edgeTypes[e] =
static_cast<edgeType>(UMLEdgeTypeConstants::PrimGeneralization);
302 case Graph::EdgeType::dependency:
303 m_edgeTypes[e] =
static_cast<edgeType>(UMLEdgeTypeConstants::PrimDependency);
317 bool check = (((m_edgeTypes[e] & UMLEdgeTypePatterns::Primary)
318 & UMLEdgeTypeConstants::PrimGeneralization)
319 == UMLEdgeTypeConstants::PrimGeneralization);
325 setPrimaryType(e, UMLEdgeTypeConstants::PrimGeneralization);
328 m_eType[e] = EdgeType::generalization;
333 bool check = (((m_edgeTypes[e] & UMLEdgeTypePatterns::Primary)
334 & UMLEdgeTypeConstants::PrimDependency)
335 == UMLEdgeTypeConstants::PrimDependency);
341 setPrimaryType(e, UMLEdgeTypeConstants::PrimDependency);
344 m_eType[e] = EdgeType::dependency;
349 setPrimaryType(e, UMLEdgeTypeConstants::PrimAssociation);
352 m_eType[e] = EdgeType::association;
361 m_edgeTypes[e] |= expansionPattern();
364 m_expansionEdge[e] = 1;
369 return (m_edgeTypes[e] & expansionPattern()) == expansionPattern();
384 return (m_edgeTypes[e] & assClassPattern()) == assClassPattern();
397 return ((m_edgeTypes[e] & UMLEdgeTypePatterns::Fourth & brotherPattern())
398 >> UMLEdgeTypeOffsets::Fourth)
399 == UMLEdgeTypeConstants::Brother;
404 return ((m_edgeTypes[e] & UMLEdgeTypePatterns::Fourth & halfBrotherPattern())
405 >> UMLEdgeTypeOffsets::Fourth)
406 == UMLEdgeTypeConstants::HalfBrother;
413 m_edgeTypes[e] &= et;
414 return m_edgeTypes[e];
419 m_edgeTypes[e] |= et;
420 return m_edgeTypes[e];
425 m_edgeTypes[e] &= 0xfffffff0;
426 m_edgeTypes[e] |= (UMLEdgeTypePatterns::Primary & et);
431 setPrimaryType(e,
static_cast<edgeType>(et));
436 m_edgeTypes[e] &= 0xffffff0f;
437 m_edgeTypes[e] |= (UMLEdgeTypePatterns::Secondary & (et << UMLEdgeTypeOffsets::Secondary));
442 m_edgeTypes[e] &= (UMLEdgeTypePatterns::All & et);
443 return m_edgeTypes[e];
448 m_edgeTypes[e] |= et;
449 return m_edgeTypes[e];
455 m_edgeTypes[e] |= (et << UMLEdgeTypeOffsets::User);
461 return (m_edgeTypes[e] & (et << UMLEdgeTypeOffsets::User))
462 == (et << UMLEdgeTypeOffsets::User);
487 return (m_eType[e] == Graph::expand);
489 return m_expansionEdge[e] == 2;
505 return m_pGraphAttributes->width();
511 return m_pGraphAttributes->width(v);
517 return m_pGraphAttributes->height();
523 return m_pGraphAttributes->height(v);
529 return m_pGraphAttributes->type(e);
535 return *m_pGraphAttributes;
545 virtual void expand(
bool lowDegreeExpand =
false);
629 GraphCopy::removeEdgePathEmbedded(E, eOrig, newFaces);
693 return static_cast<edgeType>(UMLEdgeTypeConstants::PrimGeneralization);
697 return static_cast<edgeType>(UMLEdgeTypeConstants::PrimAssociation);
701 return UMLEdgeTypeConstants::SecExpansion << UMLEdgeTypeOffsets::Secondary;
705 return UMLEdgeTypeConstants::AssClass << UMLEdgeTypeOffsets::Tertiary;
709 return UMLEdgeTypeConstants::Brother << UMLEdgeTypeOffsets::Fourth;
713 return UMLEdgeTypeConstants::HalfBrother << UMLEdgeTypeOffsets::Fourth;
717 return UMLEdgeTypeConstants::SecClique << UMLEdgeTypeOffsets::Secondary;
Declaration and implementation of ArrayBuffer class.
Edge types and patterns for planar representations.
Includes declaration of graph class.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Declaration of graph copy classes.
Declaration of node types and patterns for planar representations.
Declaration of singly linked lists and iterators.
Basic declarations, included by all source files.
Class for adjacency list elements.
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Combinatorial embeddings of planar graphs with modification functionality.
Class for the representation of edges.
Info structure for maintaining connected components.
Stores additional attributes of a graph (like layout information).
Copies of graphs supporting edge splitting.
Data type for general directed graphs (adjacency list representation).
NodeType
The type of nodes.
EdgeType
The type of edges (only used in derived classes).
Representation of a graph's grid layout.
Stores a layout of a graph (coordinates of nodes, bend points of edges).
Doubly linked lists (maintaining the length of the list).
Class for the representation of nodes.
Orthogonal representation of an embedded graph.
Planarized representations (of a connected component) of a graph.
const CCsInfo & ccInfo() const
Returns the connected components info structure.
edgeType edgeTypePrimaryAND(edge e, edgeType et)
Sets primary type of e to bitwise AND of et's primary value and old value.
EdgeArray< edgeType > m_edgeTypes
EdgeType typeOrig(edge e) const
Returns the type of original edge e.
void setExpansionEdge(edge e, int expType)
Sets the expansion edge type of e to expType.
const NodeArray< double > & heightOrig() const
Gives access to the node array of the heights of original nodes.
node newCopy(node vOrig, Graph::NodeType vType)
Creates a new node with node type vType in the planarized representation.
edgeType edgeTypePrimaryOR(edge e, edgeType et)
Sets primary type of e to bitwise OR of et's primary value and old value.
edge e(int i) const
Returns edge i in the list of all original edges.
edgeType edgeTypeOf(edge e) const
Returns the new type field of e.
void setDependency(edge e)
Classifies edge e as dependency (primary type).
int m_currentCC
The index of the current component.
void initCC(int cc)
Initializes the planarized representation for connected component cc.
void insertEdgePath(edge eOrig, const SList< adjEntry > &crossedEdges)
Re-inserts edge eOrig by "crossing" the edges in crossedEdges.
void removeEdgePathEmbedded(CombinatorialEmbedding &E, edge eOrig, FaceSet &newFaces)
Removes the complete edge path for edge eOrig while preserving the embedding.
EdgeArray< edge > m_eAuxCopy
int stopNode() const
Returns the index of (one past) the last node in this connected component.
EdgeArray< int > m_expansionEdge
edgeType halfBrotherPattern() const
edgeType generalizationPattern() const
EdgeType typeOf(edge e) const
Returns the type of edge e.
adjEntry & boundaryAdj(node v)
Returns a reference to the adjacency entry of the first edge of the inserted boundary at a center nod...
node v(int i) const
Returns node i in the list of all original nodes.
Graph::NodeType & typeOf(node v)
Returns a reference to the type of node v.
int startNode(int cc) const
Returns the index of the first node in connected component cc.
void writeGML(const char *fileName, const OrthoRep &OR, const GridLayout &drawing)
NodeArray< NodeType > m_vType
Simple node types.
edgeType associationPattern() const
edgeType & edgeTypes(edge e)
Returns a reference to the new type field of e.
void setPrimaryType(edge e, edgeType et)
Sets primary edge type of edge e to primary edge type in et (deletes old primary value).
bool isExpansionEdge(edge e) const
Returns if e is an expansion edge.
edge insertCrossing(edge &crossingEdge, edge crossedEdge, bool topDown)
Inserts crossings between two copy edges.
edgeType cliquePattern() const
int startEdge() const
Returns the index of the first edge in this connected component.
EdgeArray< EdgeType > m_eType
bool isHalfBrother(edge e) const
Returns true if edge e is classified as half-brother.
void collapseVertices(const OrthoRep &OR, Layout &drawing)
Graph::NodeType typeOf(node v) const
Returns the type of node v.
NodeArray< nodeType > m_nodeTypes
Node types for extended semantic information.
void removeCrossing(node v)
const NodeArray< double > & widthOrig() const
Gives access to the node array of the widths of original nodes.
void writeGML(std::ostream &os, const OrthoRep &OR, const GridLayout &drawing)
double heightOrig(node v) const
Returns the height of original node v.
bool isCliqueBoundary(edge e) const
void insertEdgePathEmbedded(edge eOrig, CombinatorialEmbedding &E, const SList< adjEntry > &crossedEdges)
Same as insertEdgePath, but for embedded graphs.
int numberOfCCs() const
Returns the number of connected components in the original graph.
edgeType expansionPattern() const
adjEntry expandAdj(node v) const
Returns the adjacency entry of a node of an expanded face.
bool isBoundary(edge e) const
Returns true iff edge e is a clique boundary.
void expandLowDegreeVertices(OrthoRep &OR)
void collapseVertices(const OrthoRep &OR, GridLayout &drawing)
int stopEdge() const
Returns the index of (one past) the last edge in this connected component.
void removeDeg1Nodes(ArrayBuffer< Deg1RestoreInfo > &S, const NodeArray< bool > &mark)
Removes all marked degree-1 nodes from the graph copy and stores restore information in S.
void setExpansion(edge e)
Classifies edge e as expansion edge (secondary type).
int startNode() const
Returns the index of the first node in this connected component.
edgeType edgeTypeAND(edge e, edgeType et)
Sets type of edge e to current type (bitwise) AND et.
const GraphAttributes * m_pGraphAttributes
Pointer to graph attributes of original graph.
NodeArray< adjEntry > m_boundaryAdj
NodeArray< node > m_expandedNode
For all expansion nodes, save expanded node.
PlanRep(const Graph &G)
Creates a planarized representation of graph G.
virtual edge split(edge e) override
Splits edge e.
bool isDependency(edge e) const
Returns true iff edge e is classified as dependency.
edge newCopy(node v, adjEntry adjAfter, edge eOrig)
Creates a new edge in the planarized representation.
int currentCC() const
Returns the index of the current connected component (-1 if not yet initialized).
node expandedNode(node v) const
void setType(edge e, EdgeType et)
Set both type values of e at once.
void restoreDeg1Nodes(ArrayBuffer< Deg1RestoreInfo > &S, List< node > °1s)
Restores degree-1 nodes previously removed with removeDeg1Nodes().
bool isExpansion(edge e) const
Returns true iff edge e is classified as expansion edge.
void setAssociation(edge e)
Classifies edge e as association (primary type).
void setSecondaryType(edge e, edgeType et)
Sets secondary edge type of edge e to primary edge type in et.
bool isVertex(node v) const
Returns true if the node represents a "real" object in the original graph.
int numberOfNodesInCC(int cc) const
Returns the number of nodes in connected component cc.
void setPrimaryType(edge e, UMLEdgeTypeConstants et)
Sets primary edge type of edge e to primary edge type in et (deletes old primary value).
void setGeneralization(edge e)
Classifies edge e as generalization (primary type).
void setUserType(edge e, edgeType et)
Sets user defined type locally.
void setAssClass(edge e)
Classifies edge e as connection at an association class (tertiary type).
void setHalfBrother(edge e)
Classifies edge e as connection between ... (fourth level type).
adjEntry boundaryAdj(node v) const
Returns the adjacency entry of the first edge of the inserted boundary at a center node (original) of...
double widthOrig(node v) const
Returns the width of original node v.
PlanRep(const GraphAttributes &AG)
Creates a planarized representation of graph AG.
void insertBoundary(node center, adjEntry &adjExternal)
bool isUserType(edge e, edgeType et) const
Returns user defined type.
EdgeArray< edgeType > m_oriEdgeTypes
const GraphAttributes & getGraphAttributes() const
Returns the graph attributes of the original graph (the pointer may be 0).
void setCliqueBoundary(edge e)
NodeArray< adjEntry > m_expandAdj
bool isBrother(edge e) const
Returns true if edge e is classified as brother.
void setCopyType(edge eCopy, edge eOrig)
edgeType edgeTypeOR(edge e, edgeType et)
Sets type of edge e to current type (bitwise) OR et.
EdgeType & typeOf(edge e)
Returns a reference to the type of edge e.
bool isCrossingType(node v) const
Returns true iff node v is classified as a crossing.
nodeType nodeTypeOf(node v)
Returns the extended node type of v.
adjEntry & expandAdj(node v)
edgeType assClassPattern() const
int stopNode(int cc) const
Returns the index of (one past) the last node in connected component cc.
bool isAssClass(edge e) const
Returns true iff edge e is classified as connection at an association class.
void setBrother(edge e)
Classifies edge e as connection between hierarchy neighbours (fourth level type).
bool isDegreeExpansionEdge(edge e) const
Returns if e is a degree expansion edge.
edgeType & oriEdgeTypes(edge e)
Returns a reference to the type of original edge e.
void setEdgeTypeOf(edge e, edgeType et)
Sets the new type field of edge e to et.
bool isGeneralization(edge e) const
Returns true iff edge e is classified as generalization.
virtual void expand(bool lowDegreeExpand=false)
int expansionType(edge e) const
Returns the expansion edge type of e.
edgeType brotherPattern() const
edge newCopy(node v, adjEntry adjAfter, edge eOrig, CombinatorialEmbedding &E)
Creates a new edge in the planarized representation while updating the embedding E.
void setCrossingType(node v)
Classifies node v as a crossing.
int numberOfNodesInCC() const
Returns the number of nodes in the current connected component.
void setExpandedNode(node v, node w)
Singly linked lists (maintaining the length of the list).
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
The namespace for all OGDF objects.
Information for restoring degree-1 nodes.
adjEntry m_adjRef
the reference adjacency entry for restoring the edge
Deg1RestoreInfo(edge eOrig, node deg1Orig, adjEntry adjRef)
node m_deg1Original
the original deg-1 node
edge m_eOriginal
the original edge leading to the deg-1 node