|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
42 class GraphAttributes;
44 namespace fast_multipole_embedder {
52 ArrayGraph(uint32_t maxNumNodes, uint32_t maxNumEdges);
89 template<
typename CoordinateType,
typename LengthType,
typename SizeType>
99 for (
node v : G.nodes) {
109 for (
edge e : G.edges) {
133 template<
typename CoordinateType>
136 for (
node v : G.nodes) {
205 inline uint32_t
twinNodeIndex(uint32_t currEdgeAdjIndex, uint32_t nodeIndex)
const {
211 for (uint32_t i =
begin; i <=
end; i++) {
223 void transform(
float translate,
float scale);
The namespace for all OGDF objects.
Stores additional attributes of a graph (like layout information).
void deallocate()
Deallocate all arrays.
Includes declaration of graph class.
uint32_t nextEdgeAdjIndex(uint32_t index) const
Returns the index of the next pair of index.
uint32_t twinNode(uint32_t index) const
Returns the other node (not index).
ArrayGraph()
Constructor. Does not allocate memory for the members.
uint32_t firstEdgeAdjIndex(uint32_t nodeIndex) const
Returns the index of the first pair of the node with index nodeIndex in m_nodeAdj.
float avgNodeSize() const
Average node size.
EdgeAdjInfo * m_edgeAdj
Information about adjacent nodes.
Information about incident edges (16 bytes).
uint32_t twinNodeIndex(uint32_t currEdgeAdjIndex, uint32_t nodeIndex) const
Returns the other node (not nodeIndex) of the pair with index currEdgeAdjIndex.
HypergraphRegistry< HypernodeElement >::iterator begin(const HypergraphRegistry< HypernodeElement > &self)
uint32_t numNodes() const
Returns the number of nodes.
float * nodeXPos()
Returns the x coord array for all nodes.
void readFrom(const GraphAttributes &GA, const EdgeArray< float > &edgeLength, const NodeArray< float > &nodeSize)
Updates an ArrayGraph from GraphAttributes with the given edge lengths and node sizes and creates the...
float * m_nodeXPos
The x coordinates.
float * m_desiredEdgeLength
Edge lengths.
const NodeAdjInfo * nodeInfo() const
Returns the NodeAdjInfo array for all nodes.
uint32_t m_numEdges
Number of edges in the graph.
float avgDesiredEdgeLength() const
Average edge length.
uint32_t firstEntry
The first pair in the edges chain.
const float * desiredEdgeLength() const
Returns the edge length array for all edges.
void allocate(uint32_t numNodes, uint32_t numEdges)
Allocate all arrays.
const NodeAdjInfo & nodeInfo(uint32_t i) const
Returns the adjacency information for the node at index i in m_nodeAdj.
float * m_nodeYPos
The y coordinates.
float * nodeMoveRadius()
Returns the node movement radius array for all nodes.
NodeAdjInfo & nodeInfo(uint32_t i)
Returns the adjacency information for the node at index i in m_nodeAdj.
Decralation of GraphElement and GraphList classes.
const float * nodeYPos() const
Returns the y coord array for all nodes.
double m_desiredAvgEdgeLength
Avg.
void for_all_nodes(uint32_t begin, uint32_t end, std::function< void(uint32_t)> func)
Calls func on all nodes with indices from begin to end.
float * desiredEdgeLength()
Returns the edge length array for all edges.
void clear()
Clear the arrays.
const EdgeAdjInfo * edgeInfo() const
Returns the EdgeAdjInfo array for all edges.
node source() const
Returns the source node of the edge.
const EdgeAdjInfo & edgeInfo(uint32_t i) const
Returns the adjacency information for the edge at index i in m_edgeAdj.
RegisteredArray for nodes, edges and adjEntries of a graph.
Data type for general directed graphs (adjacency list representation).
Datastructures for edge chains itself and the edge chains of nodes.
uint32_t m_numNodes
Number of nodes in the graph.
float * nodeSize()
Returns the node size array for all nodes.
const float * nodeXPos() const
Returns the x coord array for all nodes.
NodeAdjInfo * nodeInfo()
Returns the NodeAdjInfo array for all nodes.
uint32_t degree
Total count of pairs where is either the first or second node.
float * nodeYPos()
Returns the y coord array for all nodes.
const float * nodeSize() const
Returns the node size array for all nodes.
HypergraphRegistry< HypernodeElement >::iterator end(const HypergraphRegistry< HypernodeElement > &self)
Information about an edge (16 bytes).
uint32_t numEdges() const
Returns the number of edges.
~ArrayGraph()
Destructor. Deallocates the memory via OGDF_FREE_16 if needed.
Class for the representation of edges.
void writeTo(const Graph &G, NodeArray< CoordinateType > &xPos, NodeArray< CoordinateType > &yPos)
Store the data back to NodeArray arrays with the given coordinate type.
void pushBackEdge(uint32_t a, uint32_t b, float desiredEdgeLength)
Internal function used by readFrom.
NodeAdjInfo * m_nodeAdj
Information about adjacent edges.
float * m_nodeMoveRadius
Maximum node movement lengths.
float * m_nodeSize
Sizes of the nodes.
node target() const
Returns the target node of the edge.
Class for the representation of nodes.
void transform(float translate, float scale)
Transforms all positions via shifting them by translate and afterwards scaling by scale.
void readFrom(const Graph &G, NodeArray< CoordinateType > &xPos, NodeArray< CoordinateType > &yPos, const EdgeArray< LengthType > &edgeLength, const NodeArray< SizeType > &nodeSize)
Updates an ArrayGraph with the given positions, edge lengths and node sizes and creates the edges.
EdgeAdjInfo * edgeInfo()
Returns the EdgeAdjInfo array for all edges.
void centerGraph()
Transforming all positions such that the new center is at (0,0).
EdgeAdjInfo & edgeInfo(uint32_t i)
Returns the adjacency information for the edge at index i in m_edgeAdj.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
uint32_t nextEdgeAdjIndex(uint32_t currEdgeAdjIndex, uint32_t nodeIndex) const
Returns the index of the next pair of currEdgeAdjIndex of the node with index nodeIndex.
void writeTo(GraphAttributes &GA)
Store the data back in GraphAttributes.