#include <ogdf/uml/UMLGraph.h>
Classes | |
class | AssociationClass |
Modelling of association classes. More... | |
Public Member Functions | |
UMLGraph () | |
UMLGraph (Graph &G, long initAttributes=0) | |
By default, all edges are associations. More... | |
virtual | ~UMLGraph () |
Destructor. More... | |
void | adjustHierarchyParents () |
Adjusts the parent field for all nodes after insertion of mergers. If insertion is done per node via doinsert, adjust has to be called afterwards. Otherwise, insertgenmergers calls it. More... | |
const AssociationClass * | assClass (edge e) const |
const SListPure< AssociationClass * > & | assClassList () const |
node | createAssociationClass (edge e, double width=1.0, double height=1.0) |
Adds association class to edge e. More... | |
virtual void | init (const Graph &G, long initAttr) override |
Initializes the graph attributes for graph G . More... | |
virtual void | init (Graph &G, long initAttr) |
node | modelAssociationClass (AssociationClass *ac) |
void | modelAssociationClasses () |
Inserts representation for association class in underlying graph. More... | |
void | setUpwards (adjEntry a, bool b) |
Sets status of edges to be specially embedded (if alignment) More... | |
void | undoAssociationClass (AssociationClass *ac) |
Removes the modeling of the association class without removing the information. More... | |
void | undoAssociationClasses () |
bool | upwards (adjEntry a) const |
void | writeGML (const char *fileName) |
Writes attributed graph in GML format to file fileName. More... | |
void | writeGML (std::ostream &os) |
Writes attributed graph in GML format to output stream os. More... | |
Structural changes | |
void | insertGenMergers () |
Merges generalizations at a common superclass. More... | |
node | doInsertMergers (node v, SList< edge > &inGens) |
Inserts mergers per node with given edges. More... | |
void | undoGenMergers () |
Public Member Functions inherited from ogdf::GraphAttributes | |
GraphAttributes () | |
Constructs graph attributes for no associated graph (default constructor). More... | |
GraphAttributes (const Graph &G, long attr=nodeGraphics|edgeGraphics) | |
Constructs graph attributes associated with the graph G . More... | |
virtual | ~GraphAttributes ()=default |
long | attributes () const |
Returns currently accessible attributes. More... | |
bool | has (long attr) const |
Returns true iff all attributes in attr are available. More... | |
void | init (long attr) |
Re-initializes the graph attributes while maintaining the associated graph. More... | |
void | addAttributes (long attr) |
Enables attributes specified by attr and allocates required memory. More... | |
void | destroyAttributes (long attr) |
Disables attributes specified by attr and releases available memory. More... | |
const Graph & | constGraph () const |
Returns a reference to the associated graph. More... | |
bool | directed () const |
Returns if the graph is directed. More... | |
bool & | directed () |
Returns if the graph is directed. More... | |
double | x (node v) const |
Returns the x-coordinate of node v . More... | |
double & | x (node v) |
Returns the x-coordinate of node v . More... | |
double | y (node v) const |
Returns the y-coordinate of node v . More... | |
double & | y (node v) |
Returns the y-coordinate of node v . More... | |
double | z (node v) const |
Returns the z-coordinate of node v . More... | |
double & | z (node v) |
Returns the z-coordinate of node v . More... | |
double | xLabel (node v) const |
Returns the label x-coordinate of node v . More... | |
double & | xLabel (node v) |
Returns the label x-coordinate of node v . More... | |
double | yLabel (node v) const |
Returns the label y-coordinate of node v . More... | |
double & | yLabel (node v) |
Returns the label y-coordinate of node v . More... | |
double | zLabel (node v) const |
Returns the label z-coordinate of node v . More... | |
double & | zLabel (node v) |
Returns the label z-coordinate of node v . More... | |
double | width (node v) const |
Returns the width of the bounding box of node v . More... | |
double & | width (node v) |
Returns the width of the bounding box of node v . More... | |
const NodeArray< double > & | width () const |
Returns a reference to the node array m_width. More... | |
NodeArray< double > & | width () |
Returns a reference to the node array #m_width. More... | |
double | height (node v) const |
Returns the height of the bounding box of node v . More... | |
double & | height (node v) |
Returns the height of the bounding box of node v . More... | |
const NodeArray< double > & | height () const |
Returns a reference to the node array m_height. More... | |
NodeArray< double > & | height () |
Returns a reference to the node array m_height. More... | |
Shape | shape (node v) const |
Returns the shape type of node v . More... | |
Shape & | shape (node v) |
Returns the shape type of node v . More... | |
StrokeType | strokeType (node v) const |
Returns the stroke type of node v . More... | |
StrokeType & | strokeType (node v) |
Returns the stroke type of node v . More... | |
const Color & | strokeColor (node v) const |
Returns the stroke color of node v . More... | |
Color & | strokeColor (node v) |
Returns the stroke color of node v . More... | |
float | strokeWidth (node v) const |
Returns the stroke width of node v . More... | |
float & | strokeWidth (node v) |
Returns the stroke width of node v . More... | |
FillPattern | fillPattern (node v) const |
Returns the fill pattern of node v . More... | |
FillPattern & | fillPattern (node v) |
Returns the fill pattern of node v . More... | |
const Color & | fillColor (node v) const |
Returns the fill color of node v . More... | |
Color & | fillColor (node v) |
Returns the fill color of node v . More... | |
const Color & | fillBgColor (node v) const |
Returns the background color of fill patterns for node v . More... | |
Color & | fillBgColor (node v) |
Returns the background color of fill patterns for node v . More... | |
const string & | label (node v) const |
Returns the label of node v . More... | |
string & | label (node v) |
Returns the label of node v . More... | |
const string & | templateNode (node v) const |
Returns the template name of node v . More... | |
string & | templateNode (node v) |
Returns the template name of node v . More... | |
int | weight (node v) const |
Returns the weight of node v . More... | |
int & | weight (node v) |
Returns the weight of node v . More... | |
Graph::NodeType | type (node v) const |
Returns the type of node v . More... | |
Graph::NodeType & | type (node v) |
Returns the type of node v . More... | |
int | idNode (node v) const |
Returns the user ID of node v . More... | |
int & | idNode (node v) |
Returns the user ID of node v . More... | |
const DPolyline & | bends (edge e) const |
Returns the list of bend points of edge e . More... | |
DPolyline & | bends (edge e) |
Returns the list of bend points of edge e . More... | |
EdgeArrow | arrowType (edge e) const |
Returns the arrow type of edge e . More... | |
EdgeArrow & | arrowType (edge e) |
Returns the arrow type of edge e . More... | |
StrokeType | strokeType (edge e) const |
Returns the stroke type of edge e . More... | |
StrokeType & | strokeType (edge e) |
Returns the stroke type of edge e . More... | |
const Color & | strokeColor (edge e) const |
Returns the stroke color of edge e . More... | |
Color & | strokeColor (edge e) |
Returns the stroke color of edge e . More... | |
float | strokeWidth (edge e) const |
Returns the stroke width of edge e . More... | |
float & | strokeWidth (edge e) |
Returns the stroke width of edge e . More... | |
const string & | label (edge e) const |
Returns the label of edge e . More... | |
string & | label (edge e) |
Returns the label of edge e . More... | |
int | intWeight (edge e) const |
Returns the (integer) weight of edge e . More... | |
int & | intWeight (edge e) |
Returns the (integer) weight of edge e . More... | |
double | doubleWeight (edge e) const |
Returns the (real number) weight of edge e . More... | |
double & | doubleWeight (edge e) |
Returns the (real number) weight of edge e . More... | |
Graph::EdgeType | type (edge e) const |
Returns the type of edge e . More... | |
Graph::EdgeType & | type (edge e) |
Returns the type of edge e . More... | |
uint32_t | subGraphBits (edge e) const |
Returns the edgesubgraph value of an edge e . More... | |
uint32_t & | subGraphBits (edge e) |
Returns the edgesubgraph value of an edge e . More... | |
bool | inSubGraph (edge e, int n) const |
Checks whether edge e belongs to basic graph n . More... | |
void | addSubGraph (edge e, int n) |
Adds edge e to basic graph n . More... | |
void | removeSubGraph (edge e, int n) |
Removes edge e from basic graph n . More... | |
virtual void | scale (double sx, double sy, bool scaleNodes=true) |
Scales the layout by (sx ,sy ). More... | |
virtual void | scale (double s, bool scaleNodes=true) |
Scales the layout by s . More... | |
virtual void | translate (double dx, double dy) |
Translates the layout by (dx ,dy ). More... | |
virtual void | translateToNonNeg () |
Translates the layout such that the lower left corner is at (0,0). More... | |
virtual void | flipVertical () |
Flips the layout vertically within its bounding box. More... | |
virtual void | flipVertical (const DRect &box) |
Flips the (whole) layout vertically such that the part in box remains in this area. More... | |
virtual void | flipHorizontal () |
Flips the layout horizontally within its bounding box. More... | |
virtual void | flipHorizontal (const DRect &box) |
Flips the (whole) layout horizontally such that the part in box remains in this area. More... | |
virtual void | scaleAndTranslate (double sx, double sy, double dx, double dy, bool scaleNodes=true) |
Scales the layout by (sx ,sy ) and then translates it by (dx ,dy ). More... | |
virtual void | scaleAndTranslate (double s, double dx, double dy, bool scaleNodes=true) |
Scales the layout by s and then translates it by (dx ,dy ). More... | |
virtual void | rotateRight90 () |
Rotates the layout by 90 degree (in clockwise direction) around the origin. More... | |
virtual void | rotateLeft90 () |
Rotates the layout by 90 degree (in counter-clockwise direction) around the origin. More... | |
template<typename T > | |
bool | isUniformForNodes (NodeAttributeGetter< T > attribute) const |
Checks whether a certain attribute has the same value for all nodes. More... | |
template<typename T > | |
bool | isUniformForEdges (EdgeAttributeGetter< T > attribute) const |
Checks whether a certain attribute has the same value for all edges. More... | |
bool | isUniform (long attributes) const |
Check whether all of the attributes associated with the bitflags in attributes (that are also enabled for this ogdf::GraphAttributes instance) are uniform, i.e. More... | |
DPoint | point (node v) const |
Returns a DPoint corresponding to the x- and y-coordinates of v . More... | |
void | transferToOriginal (GraphAttributes &origAttr) const |
Copies attributes of this to origAttr . More... | |
void | transferToCopy (GraphAttributes ©Attr) const |
Copies attributes of this to copyAttr . More... | |
virtual DRect | boundingBox () const |
Returns the bounding box of the graph. More... | |
template<class Rectangle = DRect> | |
void | nodeBoundingBoxes (NodeArray< Rectangle > &boundingBoxes) const |
Computes the bounding rectangle for each node. More... | |
void | setAllWidth (double w) |
Sets the width of all nodes to w . More... | |
void | setAllHeight (double h) |
Sets the height of all nodes to h . More... | |
void | clearAllBends () |
Removes all edge bends. More... | |
void | removeUnnecessaryBendsHV () |
Removes unnecessary bend points in orthogonal segements. More... | |
void | addNodeCenter2Bends (int mode=1) |
Adds additional bend points to all edges for connecting their endpoints. More... | |
bool | isAssociationClass (node v) const |
Returns true iff v represents an association class. More... | |
int | hierarchyList (List< List< node > * > &list) const |
Returns a list of all inheritance hierarchies in the graph. More... | |
int | hierarchyList (List< List< edge > * > &list) const |
Returns a list of all inheritance hierarchies in the graph. More... | |
Private Attributes | |
EdgeArray< AssociationClass * > | m_assClass |
association class for list More... | |
SListPure< AssociationClass * > | m_assClassList |
saves all accociation classes More... | |
EdgeArray< node > | m_associationClassModel |
modelled classes are stored More... | |
Graph::HiddenEdgeSet * | m_hiddenEdges |
SListPure< edge > | m_mergeEdges |
Graph * | m_pG |
Only set and updated in insertgenmergers | |
AdjEntryArray< bool > | m_upwardEdge |
used to classify edges for embedding with alignment More... | |
NodeArray< node > | m_hierarchyParent |
used to derive edge types for alignment in PlanRepUML (same hierarchyparent => edge connects (half)brothers; only set during insertgenmergers to avoid the extra computation) More... | |
Cliques | |
double | m_cliqueCenterSize |
default size of inserted clique replacement center nodes More... | |
SListPure< node > | m_centerNodes |
center nodes introduced at clique replacement More... | |
EdgeArray< bool > | m_replacementEdge |
used to mark clique replacement edges More... | |
NodeArray< DRect > | m_cliqueCircleSize |
save the bounding box size of the circular drawing of the clique at center More... | |
NodeArray< DPoint > | m_cliqueCirclePos |
save the position of the node in the circular drawing of the clique More... | |
void | replaceByStar (List< List< node >> &cliques) |
Replaces (dense) subgraphs given in list clique by inserting a center node connected to each node (=>star) and deleting all edges between nodes in clique returns center node. More... | |
void | undoStars () |
Undo clique replacements. More... | |
void | undoStar (node center, bool restoreAllEdges) |
Boolean switches restore of all hidden edges in single clique call. More... | |
DRect | cliqueRect (node v) |
Returns the size of a circular drawing for a clique around center v. More... | |
DPoint | cliquePos (node v) |
void | computeCliquePosition (List< node > &adjNodes, node center, double rectMin=-1.0) |
Compute positions for the nodes in adjNodes on a circle. More... | |
const SListPure< node > & | centerNodes () |
void | setDefaultCliqueCenterSize (double i) |
Default size of inserted clique replacement center nodes. More... | |
double | getDefaultCliqueCenterSize () |
bool | isReplacement (edge e) |
Returns true if edge was inserted during clique replacement. More... | |
node | replaceByStar (List< node > &clique, NodeArray< int > &cliqueNum) |
DRect | circularBound (node center) |
Additional Inherited Members | |
Public Types inherited from ogdf::GraphAttributes | |
template<typename T > | |
using | NodeAttributeGetter = T(GraphAttributes::*)(node) const |
type of node attribute getter functions More... | |
template<typename T > | |
using | EdgeAttributeGetter = T(GraphAttributes::*)(edge) const |
type of edge attribute getter functions More... | |
Static Public Attributes inherited from ogdf::GraphAttributes | |
static const long | nodeGraphics |
Corresponds to node attributes x(node), y(node), width(node), height(node), and shape(node). More... | |
static const long | edgeGraphics |
Corresponds to edge attribute bends(edge). More... | |
static const long | edgeIntWeight |
Corresponds to edge attribute intWeight(edge). More... | |
static const long | edgeDoubleWeight |
Corresponds to edge attribute doubleWeight(edge). More... | |
static const long | edgeLabel |
Corresponds to edge attribute label(edge). More... | |
static const long | nodeLabel |
Corresponds to node attribute label(node). More... | |
static const long | edgeType |
Corresponds to edge attribute type(edge). More... | |
static const long | nodeType |
Corresponds to node attribute type(node). More... | |
static const long | nodeId |
Corresponds to node attribute idNode(node). More... | |
static const long | edgeArrow |
Corresponds to edge attribute arrowType(edge). More... | |
static const long | edgeStyle |
Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge). More... | |
static const long | nodeStyle |
Corresponds to node attributes strokeColor(node), strokeType(node), strokeWidth(node), fillPattern(node), fillColor(node), and fillBgColor(node). More... | |
static const long | nodeTemplate |
Corresponds to node attribute templateNode(node). More... | |
static const long | edgeSubGraphs |
Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge, int) const, and removeSubGraph(edge, int). More... | |
static const long | nodeWeight |
Corresponds to node attribute weight(node). More... | |
static const long | threeD |
Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only. More... | |
static const long | nodeLabelPosition |
Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node). More... | |
static const long | all |
Enables all available flags. More... | |
Protected Attributes inherited from ogdf::GraphAttributes | |
long | m_attributes |
bit vector of currently used attributes More... | |
EdgeArray< DPolyline > | m_bends |
list of bend points of an edge More... | |
bool | m_directed |
whether or not the graph is directed More... | |
EdgeArray< double > | m_doubleWeight |
(real number) weight of an edge More... | |
EdgeArray< EdgeArrow > | m_edgeArrow |
arrow type of an edge More... | |
EdgeArray< string > | m_edgeLabel |
label of an edge More... | |
EdgeArray< Stroke > | m_edgeStroke |
stroke of an edge More... | |
EdgeArray< Graph::EdgeType > | m_eType |
type of an edge (association or generalization) More... | |
NodeArray< double > | m_height |
height of a nodes's bounding box More... | |
EdgeArray< int > | m_intWeight |
(integer) weight of an edge More... | |
NodeArray< Fill > | m_nodeFill |
fill of a node More... | |
NodeArray< int > | m_nodeId |
user ID of a node More... | |
NodeArray< int > | m_nodeIntWeight |
(integer) weight of a node More... | |
NodeArray< string > | m_nodeLabel |
label of a node More... | |
NodeArray< double > | m_nodeLabelPosX |
x-coordinate of a node label More... | |
NodeArray< double > | m_nodeLabelPosY |
y-coordinate of a node label More... | |
NodeArray< double > | m_nodeLabelPosZ |
z-coordinate of a node label More... | |
NodeArray< Shape > | m_nodeShape |
shape of a node More... | |
NodeArray< Stroke > | m_nodeStroke |
stroke of a node More... | |
NodeArray< string > | m_nodeTemplate |
name of template of a node More... | |
const Graph * | m_pGraph |
associated graph More... | |
EdgeArray< uint32_t > | m_subGraph |
is element of subgraphs given by bitvector More... | |
NodeArray< Graph::NodeType > | m_vType |
type (vertex, dummy, generalizationMerger) More... | |
NodeArray< double > | m_width |
width of a node's bounding box More... | |
NodeArray< double > | m_x |
x-coordinate of a node More... | |
NodeArray< double > | m_y |
y-coordinate of a node More... | |
NodeArray< double > | m_z |
z-coordinate of a node More... | |
Definition at line 48 of file UMLGraph.h.
|
inline |
Definition at line 53 of file UMLGraph.h.
|
explicit |
By default, all edges are associations.
|
virtual |
Destructor.
void ogdf::UMLGraph::adjustHierarchyParents | ( | ) |
Adjusts the parent field for all nodes after insertion of mergers. If insertion is done per node via doinsert, adjust has to be called afterwards. Otherwise, insertgenmergers calls it.
|
inline |
Definition at line 197 of file UMLGraph.h.
|
inline |
Definition at line 195 of file UMLGraph.h.
Definition at line 133 of file UMLGraph.h.
Definition at line 113 of file UMLGraph.h.
Returns the size of a circular drawing for a clique around center v.
Definition at line 111 of file UMLGraph.h.
void ogdf::UMLGraph::computeCliquePosition | ( | List< node > & | adjNodes, |
node | center, | ||
double | rectMin = -1.0 |
||
) |
Compute positions for the nodes in adjNodes on a circle.
Tries to keep the relative placement of the nodes in the clique rectangle (left, right,...) to avoid clique crossings of outgoing edges
|
inline |
Adds association class to edge e.
Definition at line 200 of file UMLGraph.h.
Inserts mergers per node with given edges.
|
inline |
Definition at line 138 of file UMLGraph.h.
|
inlineoverridevirtual |
Initializes the graph attributes for graph G
.
G | is the new associated graph. |
attr | specifies the set of attributes that can be accessed. |
Reimplemented from ogdf::GraphAttributes.
Definition at line 82 of file UMLGraph.h.
|
inlinevirtual |
G | is the new associated graph. |
initAttr | specifies the set of attributes that can be accessed. |
Definition at line 72 of file UMLGraph.h.
void ogdf::UMLGraph::insertGenMergers | ( | ) |
Merges generalizations at a common superclass.
|
inline |
Returns true if edge was inserted during clique replacement.
Definition at line 141 of file UMLGraph.h.
|
inline |
Definition at line 230 of file UMLGraph.h.
|
inline |
Inserts representation for association class in underlying graph.
Definition at line 222 of file UMLGraph.h.
Replaces (dense) subgraphs given in list clique by inserting a center node connected to each node (=>star) and deleting all edges between nodes in clique returns center node.
|
protected |
|
inline |
Default size of inserted clique replacement center nodes.
Definition at line 136 of file UMLGraph.h.
|
inline |
Sets status of edges to be specially embedded (if alignment)
Definition at line 158 of file UMLGraph.h.
|
inline |
Removes the modeling of the association class without removing the information.
Definition at line 250 of file UMLGraph.h.
|
inline |
Definition at line 241 of file UMLGraph.h.
void ogdf::UMLGraph::undoGenMergers | ( | ) |
void ogdf::UMLGraph::undoStar | ( | node | center, |
bool | restoreAllEdges | ||
) |
Boolean switches restore of all hidden edges in single clique call.
void ogdf::UMLGraph::undoStars | ( | ) |
Undo clique replacements.
|
inline |
Definition at line 160 of file UMLGraph.h.
void ogdf::UMLGraph::writeGML | ( | const char * | fileName | ) |
Writes attributed graph in GML format to file fileName.
void ogdf::UMLGraph::writeGML | ( | std::ostream & | os | ) |
Writes attributed graph in GML format to output stream os.
|
private |
association class for list
Definition at line 319 of file UMLGraph.h.
|
private |
saves all accociation classes
Definition at line 318 of file UMLGraph.h.
modelled classes are stored
Definition at line 320 of file UMLGraph.h.
center nodes introduced at clique replacement
Definition at line 304 of file UMLGraph.h.
|
private |
default size of inserted clique replacement center nodes
Definition at line 303 of file UMLGraph.h.
save the position of the node in the circular drawing of the clique
Definition at line 311 of file UMLGraph.h.
save the bounding box size of the circular drawing of the clique at center
Definition at line 309 of file UMLGraph.h.
|
private |
Definition at line 335 of file UMLGraph.h.
used to derive edge types for alignment in PlanRepUML (same hierarchyparent => edge connects (half)brothers; only set during insertgenmergers to avoid the extra computation)
Definition at line 331 of file UMLGraph.h.
Definition at line 315 of file UMLGraph.h.
|
private |
Definition at line 288 of file UMLGraph.h.
|
private |
used to mark clique replacement edges
Definition at line 307 of file UMLGraph.h.
|
private |
used to classify edges for embedding with alignment
Definition at line 326 of file UMLGraph.h.