53namespace edge_router {
61 for (
int i = 0; i < 4; i++) {
62 for (
int j = 0; j < 4; j++) {
76 lu = ll = ru = rl = tl = tr = bl = br = 0;
77 cage_x_size = cage_y_size = box_x_size = box_y_size = 0;
79 m_firstAdj = m_adj =
nullptr;
87 get_data(H, L, v, rc, nw, nh);
99 int bsi =
static_cast<int>(bs);
101 case OrthoDir::South:
103 result = m_ccoord[bsi] - m_coord[bsi];
105 case OrthoDir::North:
107 result = m_coord[bsi] - m_ccoord[bsi];
110 std::cout <<
"unknown direction in coordDistance" << std::flush;
123 return (
static_cast<int>(od) % 2 == 0) ? box_y_size : box_x_size;
127 return (
static_cast<int>(od) % 2 == 0) ? cage_y_size : cage_x_size;
131 int rc(
OrthoDir od)
const {
return m_rc[
static_cast<int>(od)]; }
159 return m_delta[
static_cast<int>(mainside)][
static_cast<int>(neighbour)];
164 return m_eps[
static_cast<int>(mainside)][
static_cast<int>(neighbour)];
169 return m_nbe[
static_cast<int>(s1)][
static_cast<int>(sneighbour)];
174 return m_flips[
static_cast<int>(s1)][
static_cast<int>(s2)];
183 return num_s_edges[
static_cast<int>(od)];
203 int bsidei =
static_cast<int>(bside);
204 int bneighbouri =
static_cast<int>(bneighbour);
206 case OrthoDir::North:
207 case OrthoDir::South:
208 if (dval > box_y_size) {
209 dval = int(floor(((
double)box_y_size / 2))) - m_eps[bsidei][bneighbouri];
214 if (dval > box_x_size) {
215 dval = int(floor(((
double)box_x_size / 2))) - m_eps[bsidei][bneighbouri];
221 m_delta[bsidei][bneighbouri] = dval;
225 m_eps[
static_cast<int>(mainside)][
static_cast<int>(neighbour)] = dval;
230 void set_num_bend_edges(box_side bs1, box_side bs2,
int num) {nbe[bs1][bs2] = num;}
235 m_gen_pos[
static_cast<int>(od)] = pos;
239 num_s_edges[
static_cast<int>(od)] = num;
244 cage_x_size = m_ccoord[
static_cast<int>(OrthoDir::South)]
245 - m_ccoord[
static_cast<int>(OrthoDir::North)];
246 cage_y_size = m_ccoord[
static_cast<int>(OrthoDir::East)]
247 - m_ccoord[
static_cast<int>(OrthoDir::West)];
269 int s_from_i =
static_cast<int>(s_from);
270 int s_to_i =
static_cast<int>(s_to);
271 m_routable[s_from_i][s_to_i] += num;
272 m_nbe[s_from_i][s_to_i] += num;
276 m_nbe[
static_cast<int>(s_from)][
static_cast<int>(s_to)] += num;
286 return m_routable[
static_cast<int>(s_from)][
static_cast<int>(s_to)];
301 int lu, ll, ru, rl, tl, tr,
bl, br;
307 int m_routable[4][4];
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Declaration of orthogonal representation of planar graphs.
Declaration of class RoutingChannel which maintains required size of routing channels and separation,...
Basic declarations, included by all source files.
Class for adjacency list elements.
Exception thrown when an algorithm realizes an internal bug that prevents it from continuing.
Representation of a graph's grid layout.
Doubly linked lists (maintaining the length of the list).
Encapsulates a pointer to a list element.
bool valid() const
Returns true iff the iterator points to an element.
Class for the representation of nodes.
Orthogonal representation of an embedded graph.
Maintains input sizes for constructive compaction (size of routing channels, separation,...
int num_routable(OrthoDir s_from, OrthoDir s_to) const
int coord(OrthoDir bs) const
Returns nodeboxside coordinates (real size)
List< edge > & inList(OrthoDir bs)
NodeInfo(OrthoRep &H, GridLayout &L, node v, adjEntry adj, RoutingChannel< int > &rc, NodeArray< int > &nw, NodeArray< int > &nh)
void num_bend_free_increment(OrthoDir s)
void setCageCoord(OrthoDir bs, int co)
bool has_gen(OrthoDir od)
int gen_pos(OrthoDir od) const
void compute_cage_size()
compute the size of the cage face and the node box
int & flips(OrthoDir s1, OrthoDir s2)
bool is_in_edge(OrthoDir od, int pos)
void inc_E_hook(OrthoDir s_from, OrthoDir s_to, int num=1)
List< bool > & inPoint(OrthoDir bs)
std::array< List< bool >, 4 > point_in
void set_coord(OrthoDir bs, int co)
int num_bend_free(OrthoDir s) const
std::array< List< edge >, 4 > in_edges
void set_gen_pos(OrthoDir od, int pos)
set position of generalization on each side
int eps(OrthoDir mainside, OrthoDir neighbour) const
void set_delta(OrthoDir bside, OrthoDir bneighbour, int dval)
int coordDistance(OrthoDir bs)
void inc_E(OrthoDir s_from, OrthoDir s_to, int num=1)
std::array< int, 4 > m_nbf
int cageSize(OrthoDir od) const
void set_eps(OrthoDir mainside, OrthoDir neighbour, int dval)
void set_num_edges(OrthoDir od, int num)
int delta(OrthoDir mainside, OrthoDir neighbour) const
int cageCoord(OrthoDir bs) const
Returns nodecageside coordinates (expanded size)
std::array< int, 4 > num_s_edges
std::array< int, 4 > m_rc
friend std::ostream & operator<<(std::ostream &O, const NodeInfo &inf)
int num_bend_edges(OrthoDir s1, OrthoDir sneighbour)
std::array< int, 4 > m_ccoord
void get_data(OrthoRep &O, GridLayout &L, node v, RoutingChannel< int > &rc, NodeArray< int > &nw, NodeArray< int > &nh)
int num_edges(OrthoDir od) const
int rc(OrthoDir od) const
Returns routing channel size.
std::array< int, 4 > m_gen_pos
int nodeSize(OrthoDir od) const
std::array< int, 4 > m_coord
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),...
Definition of exception classes.
#define OGDF_THROW(CLASS)
Replacement for throw.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
std::ostream & operator<<(std::ostream &O, const NodeInfo &inf)
The namespace for all OGDF objects.