Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::GridLayoutMapped Class Reference

Extends GridLayout by a grid mapping mechanism. More...

#include <ogdf/basic/GridLayoutMapped.h>

+ Inheritance diagram for ogdf::GridLayoutMapped:

Public Member Functions

 GridLayoutMapped (const PlanRep &PG, const OrthoRep &OR, double separation, double cOverhang, int fineness=4)
 
NodeArray< int > & height ()
 
const NodeArray< int > & height () const
 
intheight (node v)
 
const intheight (node v) const
 
void remap (Layout &drawing) override
 Transforms the grid layout to a layout.
 
double toDouble (int i) const
 
int toGrid (double x) const
 
NodeArray< int > & width ()
 
const NodeArray< int > & width () const
 
intwidth (node v)
 
const intwidth (node v) const
 
- Public Member Functions inherited from ogdf::GridLayout
 GridLayout ()
 Creates an instance of a grid layout (associated with no graph).
 
 GridLayout (const Graph &G)
 Creates an instance of a grid layout associated with G.
 
virtual ~GridLayout ()
 Destruction.
 
EdgeArray< IPolyline > & bends ()
 Returns a reference to the array storing the bend points of edges.
 
const EdgeArray< IPolyline > & bends () const
 Returns a reference to the array storing the bend points of edges.
 
IPolylinebends (edge e)
 Returns a reference to the bend point list of edge e.
 
const IPolylinebends (edge e) const
 Returns a reference to the bend point list of edge e.
 
bool checkLayout ()
 Checks if the grid layout is reasonable.
 
void compactAllBends ()
 Removes all unnecessary bends.
 
void computeBoundingBox (int &xmin, int &xmax, int &ymin, int &ymax)
 Computes the bounding box of the grid layout.
 
IPolyline getCompactBends (edge e) const
 Returns the bend point list of edge e without unnecessary bends.
 
void init ()
 Initializes the grid layout for no graph (frees memory).
 
void init (const Graph &G)
 Initializes the grid layout for graph G.
 
int manhattanEdgeLength (edge e) const
 
int maxManhattanEdgeLength () const
 
int numberOfBends () const
 Computes the total number of bends in the grid layout.
 
IPolyline polyline (edge e) const
 Returns the polyline of edge e (including start and end point!).
 
double totalEdgeLength () const
 Computes the total (euclidean) edge length of the grid layout.
 
int totalManhattanEdgeLength () const
 Computes the total manhattan edge length of the grid layout.
 
NodeArray< int > & x ()
 Returns a reference to the array storing the x-coordinates of nodes.
 
const NodeArray< int > & x () const
 Returns a reference to the array storing the x-coordinates of nodes.
 
intx (node v)
 Returns a reference to the x-coordinate of node v.
 
const intx (node v) const
 Returns a reference to the x-coordinate of node v.
 
NodeArray< int > & y ()
 Returns a reference to the array storing the y-coordinates of nodes.
 
const NodeArray< int > & y () const
 Returns a reference to the array storing the y-coordinates of nodes.
 
inty (node v)
 Returns a reference to the y-coordinate of node v.
 
const inty (node v) const
 Returns a reference to the y-coordinate of node v.
 

Private Attributes

double m_fMapping
 
NodeArray< intm_gridHeight
 
NodeArray< intm_gridWidth
 
const PlanRepm_pPG
 

Static Private Attributes

static const int cGridScale
 scaling to allow correct edge anchors
 

Additional Inherited Members

- Static Public Member Functions inherited from ogdf::GridLayout
static double euclideanDistance (const IPoint &ip1, const IPoint &ip2)
 
static int manhattanDistance (const IPoint &ip1, const IPoint &ip2)
 
- Protected Attributes inherited from ogdf::GridLayout
EdgeArray< IPolylinem_bends
 The bend points of edges.
 
NodeArray< intm_x
 The x-coordinates of nodes.
 
NodeArray< intm_y
 The y-coordinates of nodes.
 

Detailed Description

Extends GridLayout by a grid mapping mechanism.

Definition at line 46 of file GridLayoutMapped.h.

Constructor & Destructor Documentation

◆ GridLayoutMapped()

ogdf::GridLayoutMapped::GridLayoutMapped ( const PlanRep PG,
const OrthoRep OR,
double  separation,
double  cOverhang,
int  fineness = 4 
)

Member Function Documentation

◆ height() [1/4]

NodeArray< int > & ogdf::GridLayoutMapped::height ( )
inline

Definition at line 73 of file GridLayoutMapped.h.

◆ height() [2/4]

const NodeArray< int > & ogdf::GridLayoutMapped::height ( ) const
inline

Definition at line 70 of file GridLayoutMapped.h.

◆ height() [3/4]

int & ogdf::GridLayoutMapped::height ( node  v)
inline

Definition at line 83 of file GridLayoutMapped.h.

◆ height() [4/4]

const int & ogdf::GridLayoutMapped::height ( node  v) const
inline

Definition at line 80 of file GridLayoutMapped.h.

◆ remap()

void ogdf::GridLayoutMapped::remap ( Layout drawing)
overridevirtual

Transforms the grid layout to a layout.

This implementation only copies the grid coordinates to drawing; the derived class GridLayoutMapped performs the actual transformation of coordinates.

Reimplemented from ogdf::GridLayout.

◆ toDouble()

double ogdf::GridLayoutMapped::toDouble ( int  i) const
inline

Definition at line 63 of file GridLayoutMapped.h.

◆ toGrid()

int ogdf::GridLayoutMapped::toGrid ( double  x) const
inline

Definition at line 60 of file GridLayoutMapped.h.

◆ width() [1/4]

NodeArray< int > & ogdf::GridLayoutMapped::width ( )
inline

Definition at line 68 of file GridLayoutMapped.h.

◆ width() [2/4]

const NodeArray< int > & ogdf::GridLayoutMapped::width ( ) const
inline

Definition at line 65 of file GridLayoutMapped.h.

◆ width() [3/4]

int & ogdf::GridLayoutMapped::width ( node  v)
inline

Definition at line 78 of file GridLayoutMapped.h.

◆ width() [4/4]

const int & ogdf::GridLayoutMapped::width ( node  v) const
inline

Definition at line 75 of file GridLayoutMapped.h.

Member Data Documentation

◆ cGridScale

const int ogdf::GridLayoutMapped::cGridScale
staticprivate

scaling to allow correct edge anchors

Definition at line 48 of file GridLayoutMapped.h.

◆ m_fMapping

double ogdf::GridLayoutMapped::m_fMapping
private

Definition at line 91 of file GridLayoutMapped.h.

◆ m_gridHeight

NodeArray<int> ogdf::GridLayoutMapped::m_gridHeight
private

Definition at line 88 of file GridLayoutMapped.h.

◆ m_gridWidth

NodeArray<int> ogdf::GridLayoutMapped::m_gridWidth
private

Definition at line 87 of file GridLayoutMapped.h.

◆ m_pPG

const PlanRep* ogdf::GridLayoutMapped::m_pPG
private

Definition at line 90 of file GridLayoutMapped.h.


The documentation for this class was generated from the following file: