105 node v(
int i)
const {
return m_ccInfo.v(i); }
108 edge e(
int i)
const {
return m_ccInfo.e(i); }
111 int startNode()
const {
return m_ccInfo.startNode(m_currentCC); }
117 int stopNode()
const {
return m_ccInfo.stopNode(m_currentCC); }
123 int startEdge()
const {
return m_ccInfo.startEdge(m_currentCC); }
126 int stopEdge()
const {
return m_ccInfo.stopEdge(m_currentCC); }
175 return (edgeTypeOf(e) & cliquePattern()) == cliquePattern();
205 return typeOf(v) == Graph::NodeType::vertex || typeOf(v) == Graph::NodeType::associationClass;
219 m_nodeTypes[v] |= UMLNodeTypeConstants::TerCrossing << UMLNodeTypeOffsets::Tertiary;
227 return (m_nodeTypes[v] & (UMLNodeTypeConstants::TerCrossing << UMLNodeTypeOffsets::Tertiary))
285 case Graph::EdgeType::association:
286 m_edgeTypes[e] =
static_cast<edgeType>(UMLEdgeTypeConstants::PrimAssociation);
288 case Graph::EdgeType::generalization:
289 m_edgeTypes[e] =
static_cast<edgeType>(UMLEdgeTypeConstants::PrimGeneralization);
291 case Graph::EdgeType::dependency:
292 m_edgeTypes[e] =
static_cast<edgeType>(UMLEdgeTypeConstants::PrimDependency);
306 bool check = (((m_edgeTypes[e] & UMLEdgeTypePatterns::Primary)
307 & UMLEdgeTypeConstants::PrimGeneralization)
308 == UMLEdgeTypeConstants::PrimGeneralization);
314 setPrimaryType(e, UMLEdgeTypeConstants::PrimGeneralization);
317 m_eType[e] = EdgeType::generalization;
322 bool check = (((m_edgeTypes[e] & UMLEdgeTypePatterns::Primary)
323 & UMLEdgeTypeConstants::PrimDependency)
324 == UMLEdgeTypeConstants::PrimDependency);
330 setPrimaryType(e, UMLEdgeTypeConstants::PrimDependency);
333 m_eType[e] = EdgeType::dependency;
338 setPrimaryType(e, UMLEdgeTypeConstants::PrimAssociation);
341 m_eType[e] = EdgeType::association;
350 m_edgeTypes[e] |= expansionPattern();
353 m_expansionEdge[e] = 1;
358 return (m_edgeTypes[e] & expansionPattern()) == expansionPattern();
373 return (m_edgeTypes[e] & assClassPattern()) == assClassPattern();
386 return ((m_edgeTypes[e] & UMLEdgeTypePatterns::Fourth & brotherPattern())
387 >> UMLEdgeTypeOffsets::Fourth)
388 == UMLEdgeTypeConstants::Brother;
393 return ((m_edgeTypes[e] & UMLEdgeTypePatterns::Fourth & halfBrotherPattern())
394 >> UMLEdgeTypeOffsets::Fourth)
395 == UMLEdgeTypeConstants::HalfBrother;
402 m_edgeTypes[e] &=
et;
403 return m_edgeTypes[e];
408 m_edgeTypes[e] |=
et;
409 return m_edgeTypes[e];
414 m_edgeTypes[e] &= 0xfffffff0;
415 m_edgeTypes[e] |= (UMLEdgeTypePatterns::Primary &
et);
425 m_edgeTypes[e] &= 0xffffff0f;
426 m_edgeTypes[e] |= (UMLEdgeTypePatterns::Secondary & (
et << UMLEdgeTypeOffsets::Secondary));
431 m_edgeTypes[e] &= (UMLEdgeTypePatterns::All &
et);
432 return m_edgeTypes[e];
437 m_edgeTypes[e] |=
et;
438 return m_edgeTypes[e];
444 m_edgeTypes[e] |= (
et << UMLEdgeTypeOffsets::User);
450 return (m_edgeTypes[e] & (
et << UMLEdgeTypeOffsets::User))
451 == (
et << UMLEdgeTypeOffsets::User);
476 return (m_eType[e] == Graph::expand);
478 return m_expansionEdge[e] == 2;
494 return m_pGraphAttributes->width();
500 return m_pGraphAttributes->width(v);
506 return m_pGraphAttributes->height();
512 return m_pGraphAttributes->height(v);
518 return m_pGraphAttributes->type(e);
524 return *m_pGraphAttributes;
682 return static_cast<edgeType>(UMLEdgeTypeConstants::PrimGeneralization);
686 return static_cast<edgeType>(UMLEdgeTypeConstants::PrimAssociation);
690 return UMLEdgeTypeConstants::SecExpansion << UMLEdgeTypeOffsets::Secondary;
694 return UMLEdgeTypeConstants::AssClass << UMLEdgeTypeOffsets::Tertiary;
698 return UMLEdgeTypeConstants::Brother << UMLEdgeTypeOffsets::Fourth;
702 return UMLEdgeTypeConstants::HalfBrother << UMLEdgeTypeOffsets::Fourth;
706 return UMLEdgeTypeConstants::SecClique << UMLEdgeTypeOffsets::Secondary;
Edge types and patterns for planar representations.
Declaration of graph copy classes.
Declaration of class GridLayout.
Declaration of class Layout.
Declaration of node types and patterns for planar representations.
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.
Dynamic arrays indexed with edges.
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).
Dynamic arrays indexed with nodes.
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.
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)
void removeEdgePathEmbedded(CombinatorialEmbedding &E, edge eOrig, FaceSet< false > &newFaces)
Removes the complete edge path for edge eOrig while preserving the embedding.
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).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
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