|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
41 #define OGDF_LQ_M2L_MIN_BOUND 8
42 #define OGDF_LQ_WSPD_BRANCH_BOUND 16
43 #define OGDF_LQ_WSPD_BOUND 25
46 namespace fast_multipole_embedder {
121 for (uint32_t i = 0; i <
numNodes; i++) {
159 template<
typename Func>
176 template<
typename Func>
209 template<
typename F,
typename CondType = true_condition>
235 template<
typename F,
typename Cond>
241 template<
typename F,
typename CondType = true_condition>
267 template<
typename F,
typename Cond>
272 template<
typename WSPairFuncType,
typename DPairFuncType,
typename DNodeFuncType,
286 DNodeFuncType& dnf, BranchCondType& bc)
330 template<
typename A,
typename B,
typename C,
typename ConditionType>
332 ConditionType cond) {
336 template<
typename A,
typename B,
typename C>
441 LinearQuadtree(uint32_t n,
float* origXPos,
float* origYPos,
float* origSize);
509 float s = 0.00000001f;
512 float d_sq = dx * dx + dy * dy;
514 return d_sq > (s * 0.5 + 1) * (s * 0.5 + 1) * 2 * size * size;
543 void init(
float min_x,
float min_y,
float max_x,
float max_y);
561 mnr = mnr >> (
level * 2);
562 mnr = mnr << (
level * 2);
563 mortonNumberInv<uint64_t, uint32_t>(mnr, ix, iy);
The namespace for all OGDF objects.
void operator()(NodeID a)
const LinearQuadtree & tree
top down traversal of the subtree of a given node
uint32_t numberOfNodes() const
returns the number of nodes in this tree
void operator()(NodeID u)
PointID findFirstPointInCell(PointID somePointInCell) const
uint32_t numberOfDirectNodes() const
void setNumberOfPoints(NodeID nodeID, uint32_t numPoints)
sets the number of nodes containted in node nodeID
StoreWSPairFunctor StoreWSPairFunction()
top_down_traversal_functor< F > top_down_traversal(F f) const
creator
bottom_up_traversal_functor(const LinearQuadtree &t, F f, CondType c)
void operator()(NodeID u)
forall_points_functor(const LinearQuadtree &t, const Func &f)
NodeID directNode(uint32_t i) const
const LinearQuadtree & tree
forall_children_functor< F > forall_children(F f) const
creator
NodeID nodeOfPoint(PointID id) const
NodeID firstInnerNode() const
void operator()(NodeID u, NodeID v)
void addWSPD(NodeID s, NodeID t)
adds a well-separated pair to the wspd
LQNode * m_tree
the main tree array containing all nodes (including leaves)
simple functor for iterating over all points of a node
void operator()(NodeID u)
Class for the Well-Separated-Pairs-Decomposition (WSPD)
uint32_t numberOfInnerNodes() const
HypergraphRegistry< HypernodeElement >::iterator begin(const HypergraphRegistry< HypernodeElement > &self)
wspd_functor< A, B, C, ConditionType > forall_well_separated_pairs(A a, B b, C c, ConditionType cond)
float nodeX(NodeID nodeID) const
bool operator()(NodeID u)
void computeCoords(NodeID nodeIndex)
static pair_call_functor< F, A > pair_call(F f, A a)
creates a pair call resulting in a call f(a, *)
LQWSPair(NodeID c, NodeID d)
uint32_t numberOfDirectPairs() const
bool isFence(NodeID nodeID) const
sets the fence flag for node nodeID
void setNumberOfChilds(NodeID nodeID, uint32_t numChilds)
sets the number of children of a node
void operator()(NodeID u)
NodeID nextNode(NodeID nodeID) const
float * m_pointSize
point size in tree order
uint64_t sizeInBytes() const
forall_tree_nodes_functor< F > forall_tree_nodes(F f, NodeID begin, uint32_t num) const
creator
friend class LinearQuadtreeBuilderList
StoreDirectNodeFunctor(LinearQuadtree &t)
the builder for the LinearQuadtree
const LinearQuadtree & tree
float pointSize(PointID point) const
void addDirect(NodeID s)
add a direct node to the array list of direct nodes
uint32_t numberOfLeaves() const
float nodeY(NodeID nodeID) const
top_down_traversal_functor(const LinearQuadtree &t, F f, CondType c)
WSPairFuncType WSFunction
void initLeaf(NodeID leaf, PointID firstPoint, uint32_t numPoints, NodeID next)
StoreWSPairFunctor(LinearQuadtree &t)
uint32_t numberOfPoints(NodeID nodeID) const
returns the number of points contained in the subtree of node nodeID
void allocate(uint32_t n)
helper function for allocating the array's
StoreDirectNodeFunctor StoreDirectNodeFunction()
void setPointLeaf(PointID point, NodeID leaf)
float * m_nodeXPos
node x coord
Definition of utility functions for FME layout.
float * m_origSize
point size in graph order
bool isWS(NodeID a, NodeID b) const
void setFirstPoint(NodeID nodeID, PointID firstPoint)
void setPoint(PointID id, float x, float y, float r, uint32_t ref)
float * m_origXPos
point x coord in graph order
PointID firstPoint(NodeID nodeID) const
is_fence_condition_functor is_fence_condition() const
creator
NodeID pointLeaf(PointID point) const
forall_ordered_pairs_of_children_functor(const LinearQuadtree &t, F f)
bottom_up_traversal_functor< F, Cond > bottom_up_traversal(F f, Cond cond) const
creator
is_leaf_condition_functor(const LinearQuadtree &t)
void operator()(NodeID u)
double m_scaleInv
the inverse scale to transform
float nodeSize(NodeID nodeID) const
#define OGDF_LQ_WSPD_BOUND
NodeID child(NodeID nodeID, uint32_t i) const
returns the i th child index of node nodeID
uint32_t m_maxNumNodes
the maximum number of nodes (2*n here instead of 2*n-1)
condition functor for returning a constant boolean value
float * m_nodeSize
node size
is_leaf_condition_functor is_leaf_condition() const
creator
float pointX(PointID point) const
float * m_nodeYPos
node y coord
float m_min_y
the y coordinate of the bottom most point
StoreDirectPairFunctor StoreDirectPairFunction()
#define OGDF_LQ_M2L_MIN_BOUND
forall_tree_nodes_functor(const LinearQuadtree &t, F f, NodeID b, uint32_t num)
const LinearQuadtree & tree
top_down_traversal_functor< F, Cond > top_down_traversal(F f, Cond cond) const
creator
void init(float min_x, float min_y, float max_x, float max_y)
uint32_t m_numPoints
number of points this quadtree is based on
is_fence_condition_functor(const LinearQuadtree &t)
const LinearQuadtree & tree
BranchCondType BranchCondFunction
const LQPoint & point(PointID pointID) const
float m_max_x
the x coordinate of the right most point
void setNodeX(NodeID nodeID, float x)
void leafAppendPoint(NodeID leaf, PointID point)
appends an successing point by simply increasing childcount of a leaf. Assumes isLeaf
uint32_t m_numLeaves
number of leaves in the chain
forall_points_functor< Func > forall_points(const Func &func) const
creator
float pointY(PointID point) const
top_down_traversal_functor(const LinearQuadtree &t, F f)
LQPoint & point(PointID pointID)
NodeID level(NodeID nodeID) const
void setNodeY(NodeID nodeID, float y)
void operator()(NodeID u)
bottom_up_traversal_functor< F > bottom_up_traversal(F f) const
creator
void initInnerNode(NodeID nodeID, NodeID leftChild, NodeID rightChild, uint32_t level, NodeID next)
void nodeAppendChild(NodeID nodeID, NodeID child)
appends one child index. Assumes childCount < 4 and not leaf
forall_children_functor(const LinearQuadtree &t, F f)
bool LQPointComparer(const LinearQuadtree::LQPoint &a, const LinearQuadtree::LQPoint &b)
uint32_t m_numInnerNodes
number of inner nodes in the chain
double m_cellSize
the height and width of a grid cell
void setChild(NodeID nodeID, uint32_t i, NodeID c)
sets the i th child index of node nodeID
NodeID m_firstInner
first inner node in the inner node chain
wspd_functor(const LinearQuadtree &t, WSPairFuncType &wsf, DPairFuncType &dpf, DNodeFuncType &dnf)
simple functor for iterating over all nodes
void addDirectPair(NodeID s, NodeID t)
add a direct pair to the array list of direct pairs
bool operator()(NodeID u)
functor for iterating over all ordered pairs of children of a node
void setNextNode(NodeID nodeID, NodeID next)
DPairFuncType DPairFunction
float m_max_y
the y coordinate of the top most point
~LinearQuadtree(void)
destructor. tree mem will be released
void operator()(NodeID a, NodeID b)
const LinearQuadtree & tree
float * m_origYPos
point y coord in graph order
uint32_t numberOfWSP() const
double m_sideLengthPoints
the maximum of height and width
bool isLeaf(NodeID nodeID) const
returns true if the given node index is a leaf
const LinearQuadtree & tree
float * m_pointXPos
point x coord in tree order
Basic declarations, included by all source files.
bottom_up_traversal_functor(const LinearQuadtree &t, F f)
#define OGDF_LQ_WSPD_BRANCH_BOUND
HypergraphRegistry< HypernodeElement >::iterator end(const HypergraphRegistry< HypernodeElement > &self)
void deallocate()
helper function for releasing memory
NodeID root() const
returns the index of the root
uint32_t refOfPoint(PointID id) const
float * m_pointYPos
point y coord in tree order
Definitions of functors used in FME layout.
MortonNR mortonNr(PointID point) const
void nodeFence(NodeID nodeID)
LQPoint * m_points
the point order in tree order
float m_min_x
the x coordinate of the left most point
void setPoint(PointID id, float x, float y, float r)
StoreDirectPairFunctor(LinearQuadtree &t)
double m_sideLengthGrid
the resulting side length of the grid (constant)
NodeID directNodeB(uint32_t i) const
DNodeFuncType DNodeFunction
void updatePointPositionSize(PointID id)
LinearQuadtree(uint32_t n, float *origXPos, float *origYPos, float *origSize)
constructor. required tree mem will be allocated
void setLevel(NodeID nodeID, uint32_t level)
NodeID directNodeA(uint32_t i) const
NodeID m_firstLeaf
first leaf in the leaf chain
void operator()(NodeID a, NodeID b)
uint32_t numberOfPoints() const
returns the number of points in this tree
void clear()
resets the tree
NodeID m_root
the root of the tree
void setPoint(PointID id, float x, float y, uint32_t ref)
const LinearQuadtree & tree
const LinearQuadtree & tree
float * pointSize() const
bottom up traversal of the subtree of a given node
simple functor for iterating over all children of a node
uint32_t maxNumberOfNodes() const
the upper bound for a compressed quadtree (2*numPoints)
forall_ordered_pairs_of_children_functor< F > forall_ordered_pairs_of_children(F f) const
creator
wspd_functor(const LinearQuadtree &t, WSPairFuncType &wsf, DPairFuncType &dpf, DNodeFuncType &dnf, BranchCondType &bc)
void setNodeSize(NodeID nodeID, float size)
WSPD * m_WSPD
the wspd of this quadtree
uint32_t m_numDirectNodes
wspd_functor< A, B, C > forall_well_separated_pairs(A a, B b, C c)
uint32_t numberOfChilds(NodeID nodeID) const
returns the number of children of node nodeID. for an inner node this is 1..4 and can be accessed by ...