#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. | |
virtual | ~UMLGraph () |
Destructor. | |
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. | |
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. | |
virtual void | init (const Graph &G, long initAttr) override |
Initializes the graph attributes for graph G . | |
virtual void | init (Graph &G, long initAttr) |
node | modelAssociationClass (AssociationClass *ac) |
void | modelAssociationClasses () |
Inserts representation for association class in underlying graph. | |
void | setUpwards (adjEntry a, bool b) |
Sets status of edges to be specially embedded (if alignment) | |
void | undoAssociationClass (AssociationClass *ac) |
Removes the modeling of the association class without removing the information. | |
void | undoAssociationClasses () |
bool | upwards (adjEntry a) const |
void | writeGML (const char *fileName) |
Writes attributed graph in GML format to file fileName. | |
void | writeGML (std::ostream &os) |
Writes attributed graph in GML format to output stream os. | |
Structural changes | |
void | insertGenMergers () |
Merges generalizations at a common superclass. | |
node | doInsertMergers (node v, SList< edge > &inGens) |
Inserts mergers per node with given edges. | |
void | undoGenMergers () |
Public Member Functions inherited from ogdf::GraphAttributes | |
GraphAttributes () | |
Constructs graph attributes for no associated graph (default constructor). | |
GraphAttributes (const Graph &G, long attr=nodeGraphics|edgeGraphics) | |
Constructs graph attributes associated with the graph G . | |
GraphAttributes (const GraphAttributes &)=default | |
Copy constructor. | |
GraphAttributes & | operator= (const GraphAttributes &)=default |
Copy assignment operator. | |
virtual | ~GraphAttributes () |
long | attributes () const |
Returns currently accessible attributes. | |
bool | has (long attr) const |
Returns true iff all attributes in attr are available. | |
void | init (long attr) |
Re-initializes the graph attributes while maintaining the associated graph. | |
void | addAttributes (long attr) |
Enables attributes specified by attr and allocates required memory. | |
void | destroyAttributes (long attr) |
Disables attributes specified by attr and releases available memory. | |
const Graph & | constGraph () const |
Returns a reference to the associated graph. | |
bool | directed () const |
Returns if the graph is directed. | |
bool & | directed () |
Returns if the graph is directed. | |
double | x (node v) const |
Returns the x-coordinate of node v . | |
double & | x (node v) |
Returns the x-coordinate of node v . | |
double | y (node v) const |
Returns the y-coordinate of node v . | |
double & | y (node v) |
Returns the y-coordinate of node v . | |
double | z (node v) const |
Returns the z-coordinate of node v . | |
double & | z (node v) |
Returns the z-coordinate of node v . | |
double | xLabel (node v) const |
Returns the label x-coordinate of node v . | |
double & | xLabel (node v) |
Returns the label x-coordinate of node v . | |
double | yLabel (node v) const |
Returns the label y-coordinate of node v . | |
double & | yLabel (node v) |
Returns the label y-coordinate of node v . | |
double | zLabel (node v) const |
Returns the label z-coordinate of node v . | |
double & | zLabel (node v) |
Returns the label z-coordinate of node v . | |
double | width (node v) const |
Returns the width of the bounding box of node v . | |
double & | width (node v) |
Returns the width of the bounding box of node v . | |
const NodeArray< double > & | width () const |
Returns a reference to the node array m_width. | |
NodeArray< double > & | width () |
Returns a reference to the node array #m_width. | |
double | height (node v) const |
Returns the height of the bounding box of node v . | |
double & | height (node v) |
Returns the height of the bounding box of node v . | |
const NodeArray< double > & | height () const |
Returns a reference to the node array m_height. | |
NodeArray< double > & | height () |
Returns a reference to the node array m_height. | |
Shape | shape (node v) const |
Returns the shape type of node v . | |
Shape & | shape (node v) |
Returns the shape type of node v . | |
StrokeType | strokeType (node v) const |
Returns the stroke type of node v . | |
StrokeType & | strokeType (node v) |
Returns the stroke type of node v . | |
const Color & | strokeColor (node v) const |
Returns the stroke color of node v . | |
Color & | strokeColor (node v) |
Returns the stroke color of node v . | |
float | strokeWidth (node v) const |
Returns the stroke width of node v . | |
float & | strokeWidth (node v) |
Returns the stroke width of node v . | |
FillPattern | fillPattern (node v) const |
Returns the fill pattern of node v . | |
FillPattern & | fillPattern (node v) |
Returns the fill pattern of node v . | |
const Color & | fillColor (node v) const |
Returns the fill color of node v . | |
Color & | fillColor (node v) |
Returns the fill color of node v . | |
const Color & | fillBgColor (node v) const |
Returns the background color of fill patterns for node v . | |
Color & | fillBgColor (node v) |
Returns the background color of fill patterns for node v . | |
const string & | label (node v) const |
Returns the label of node v . | |
string & | label (node v) |
Returns the label of node v . | |
const string & | templateNode (node v) const |
Returns the template name of node v . | |
string & | templateNode (node v) |
Returns the template name of node v . | |
int | weight (node v) const |
Returns the weight of node v . | |
int & | weight (node v) |
Returns the weight of node v . | |
Graph::NodeType | type (node v) const |
Returns the type of node v . | |
Graph::NodeType & | type (node v) |
Returns the type of node v . | |
int | idNode (node v) const |
Returns the user ID of node v . | |
int & | idNode (node v) |
Returns the user ID of node v . | |
const DPolyline & | bends (edge e) const |
Returns the list of bend points of edge e . | |
DPolyline & | bends (edge e) |
Returns the list of bend points of edge e . | |
EdgeArrow | arrowType (edge e) const |
Returns the arrow type of edge e . | |
EdgeArrow & | arrowType (edge e) |
Returns the arrow type of edge e . | |
StrokeType | strokeType (edge e) const |
Returns the stroke type of edge e . | |
StrokeType & | strokeType (edge e) |
Returns the stroke type of edge e . | |
const Color & | strokeColor (edge e) const |
Returns the stroke color of edge e . | |
Color & | strokeColor (edge e) |
Returns the stroke color of edge e . | |
float | strokeWidth (edge e) const |
Returns the stroke width of edge e . | |
float & | strokeWidth (edge e) |
Returns the stroke width of edge e . | |
const string & | label (edge e) const |
Returns the label of edge e . | |
string & | label (edge e) |
Returns the label of edge e . | |
int | intWeight (edge e) const |
Returns the (integer) weight of edge e . | |
int & | intWeight (edge e) |
Returns the (integer) weight of edge e . | |
double | doubleWeight (edge e) const |
Returns the (real number) weight of edge e . | |
double & | doubleWeight (edge e) |
Returns the (real number) weight of edge e . | |
Graph::EdgeType | type (edge e) const |
Returns the type of edge e . | |
Graph::EdgeType & | type (edge e) |
Returns the type of edge e . | |
uint32_t | subGraphBits (edge e) const |
Returns the edgesubgraph value of an edge e . | |
uint32_t & | subGraphBits (edge e) |
Returns the edgesubgraph value of an edge e . | |
bool | inSubGraph (edge e, int n) const |
Checks whether edge e belongs to basic graph n . | |
void | addSubGraph (edge e, int n) |
Adds edge e to basic graph n . | |
void | removeSubGraph (edge e, int n) |
Removes edge e from basic graph n . | |
virtual void | scale (double sx, double sy, bool scaleNodes=true) |
Scales the layout by (sx ,sy ). | |
virtual void | scale (double s, bool scaleNodes=true) |
Scales the layout by s . | |
virtual void | translate (double dx, double dy) |
Translates the layout by (dx ,dy ). | |
virtual void | translateToNonNeg () |
Translates the layout such that the lower left corner is at (0,0). | |
virtual void | flipVertical () |
Flips the layout vertically within its bounding box. | |
virtual void | flipVertical (const DRect &box) |
Flips the (whole) layout vertically such that the part in box remains in this area. | |
virtual void | flipHorizontal () |
Flips the layout horizontally within its bounding box. | |
virtual void | flipHorizontal (const DRect &box) |
Flips the (whole) layout horizontally such that the part in box remains in this area. | |
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 ). | |
virtual void | scaleAndTranslate (double s, double dx, double dy, bool scaleNodes=true) |
Scales the layout by s and then translates it by (dx ,dy ). | |
virtual void | rotateRight90 () |
Rotates the layout by 90 degree (in clockwise direction) around the origin. | |
virtual void | rotateLeft90 () |
Rotates the layout by 90 degree (in counter-clockwise direction) around the origin. | |
template<typename T > | |
bool | isUniformForNodes (NodeAttributeGetter< T > attribute) const |
Checks whether a certain attribute has the same value for all nodes. | |
template<typename T > | |
bool | isUniformForEdges (EdgeAttributeGetter< T > attribute) const |
Checks whether a certain attribute has the same value for all edges. | |
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. | |
DPoint | point (node v) const |
Returns a DPoint corresponding to the x- and y-coordinates of v . | |
void | transferToOriginal (GraphAttributes &origAttr) const |
Copies attributes of this to origAttr . | |
void | transferToCopy (GraphAttributes ©Attr) const |
Copies attributes of this to copyAttr . | |
virtual DRect | boundingBox () const |
Returns the bounding box of the graph. | |
template<class Rectangle = DRect> | |
void | nodeBoundingBoxes (NodeArray< Rectangle > &boundingBoxes) const |
Computes the bounding rectangle for each node. | |
void | setAllWidth (double w) |
Sets the width of all nodes to w . | |
void | setAllHeight (double h) |
Sets the height of all nodes to h . | |
void | clearAllBends () |
Removes all edge bends. | |
void | removeUnnecessaryBendsHV () |
Removes unnecessary bend points in orthogonal segements. | |
void | addNodeCenter2Bends (int mode=1) |
Adds additional bend points to all edges for connecting their endpoints. | |
bool | isAssociationClass (node v) const |
Returns true iff v represents an association class. | |
int | hierarchyList (List< List< node > * > &list) const |
Returns a list of all inheritance hierarchies in the graph. | |
int | hierarchyList (List< List< edge > * > &list) const |
Returns a list of all inheritance hierarchies in the graph. | |
Private Attributes | |
EdgeArray< AssociationClass * > | m_assClass |
association class for list | |
SListPure< AssociationClass * > | m_assClassList |
saves all accociation classes | |
EdgeArray< node > | m_associationClassModel |
modelled classes are stored | |
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 | |
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) | |
Cliques | |
double | m_cliqueCenterSize |
default size of inserted clique replacement center nodes | |
SListPure< node > | m_centerNodes |
center nodes introduced at clique replacement | |
EdgeArray< bool > | m_replacementEdge |
used to mark clique replacement edges | |
NodeArray< DRect > | m_cliqueCircleSize |
save the bounding box size of the circular drawing of the clique at center | |
NodeArray< DPoint > | m_cliqueCirclePos |
save the position of the node in the circular drawing of the clique | |
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. | |
void | undoStars () |
Undo clique replacements. | |
void | undoStar (node center, bool restoreAllEdges) |
Boolean switches restore of all hidden edges in single clique call. | |
DRect | cliqueRect (node v) |
Returns the size of a circular drawing for a clique around center v. | |
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. | |
const SListPure< node > & | centerNodes () |
void | setDefaultCliqueCenterSize (double i) |
Default size of inserted clique replacement center nodes. | |
double | getDefaultCliqueCenterSize () |
bool | isReplacement (edge e) |
Returns true if edge was inserted during clique replacement. | |
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 | |
template<typename T > | |
using | EdgeAttributeGetter = T(GraphAttributes::*)(edge) const |
type of edge attribute getter functions | |
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). | |
static const long | edgeGraphics |
Corresponds to edge attribute bends(edge). | |
static const long | edgeIntWeight |
Corresponds to edge attribute intWeight(edge). | |
static const long | edgeDoubleWeight |
Corresponds to edge attribute doubleWeight(edge). | |
static const long | edgeLabel |
Corresponds to edge attribute label(edge). | |
static const long | nodeLabel |
Corresponds to node attribute label(node). | |
static const long | edgeType |
Corresponds to edge attribute type(edge). | |
static const long | nodeType |
Corresponds to node attribute type(node). | |
static const long | nodeId |
Corresponds to node attribute idNode(node). | |
static const long | edgeArrow |
Corresponds to edge attribute arrowType(edge). | |
static const long | edgeStyle |
Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge). | |
static const long | nodeStyle |
Corresponds to node attributes strokeColor(node), strokeType(node), strokeWidth(node), fillPattern(node), fillColor(node), and fillBgColor(node). | |
static const long | nodeTemplate |
Corresponds to node attribute templateNode(node). | |
static const long | edgeSubGraphs |
Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge, int) const, and removeSubGraph(edge, int). | |
static const long | nodeWeight |
Corresponds to node attribute weight(node). | |
static const long | threeD |
Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only. | |
static const long | nodeLabelPosition |
Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node). | |
static const long | all |
Enables all available flags. | |
Protected Attributes inherited from ogdf::GraphAttributes | |
long | m_attributes |
bit vector of currently used attributes | |
EdgeArray< DPolyline > | m_bends |
list of bend points of an edge | |
bool | m_directed |
whether or not the graph is directed | |
EdgeArray< double > | m_doubleWeight |
(real number) weight of an edge | |
EdgeArray< EdgeArrow > | m_edgeArrow |
arrow type of an edge | |
EdgeArray< string > | m_edgeLabel |
label of an edge | |
EdgeArray< Stroke > | m_edgeStroke |
stroke of an edge | |
EdgeArray< Graph::EdgeType > | m_eType |
type of an edge (association or generalization) | |
NodeArray< double > | m_height |
height of a nodes's bounding box | |
EdgeArray< int > | m_intWeight |
(integer) weight of an edge | |
NodeArray< Fill > | m_nodeFill |
fill of a node | |
NodeArray< int > | m_nodeId |
user ID of a node | |
NodeArray< int > | m_nodeIntWeight |
(integer) weight of a node | |
NodeArray< string > | m_nodeLabel |
label of a node | |
NodeArray< double > | m_nodeLabelPosX |
x-coordinate of a node label | |
NodeArray< double > | m_nodeLabelPosY |
y-coordinate of a node label | |
NodeArray< double > | m_nodeLabelPosZ |
z-coordinate of a node label | |
NodeArray< Shape > | m_nodeShape |
shape of a node | |
NodeArray< Stroke > | m_nodeStroke |
stroke of a node | |
NodeArray< string > | m_nodeTemplate |
name of template of a node | |
const Graph * | m_pGraph |
associated graph | |
EdgeArray< uint32_t > | m_subGraph |
is element of subgraphs given by bitvector | |
NodeArray< Graph::NodeType > | m_vType |
type (vertex, dummy, generalizationMerger) | |
NodeArray< double > | m_width |
width of a node's bounding box | |
NodeArray< double > | m_x |
x-coordinate of a node | |
NodeArray< double > | m_y |
y-coordinate of a node | |
NodeArray< double > | m_z |
z-coordinate of a node | |
Definition at line 40 of file UMLGraph.h.
|
inline |
Definition at line 45 of file UMLGraph.h.
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 189 of file UMLGraph.h.
|
inline |
Definition at line 187 of file UMLGraph.h.
Definition at line 125 of file UMLGraph.h.
Definition at line 105 of file UMLGraph.h.
Returns the size of a circular drawing for a clique around center v.
Definition at line 103 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 192 of file UMLGraph.h.
Inserts mergers per node with given edges.
|
inline |
Definition at line 130 of file UMLGraph.h.
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 74 of file UMLGraph.h.
G | is the new associated graph. |
initAttr | specifies the set of attributes that can be accessed. |
Definition at line 64 of file UMLGraph.h.
void ogdf::UMLGraph::insertGenMergers | ( | ) |
Merges generalizations at a common superclass.
Returns true if edge was inserted during clique replacement.
Definition at line 133 of file UMLGraph.h.
|
inline |
Definition at line 222 of file UMLGraph.h.
|
inline |
Inserts representation for association class in underlying graph.
Definition at line 214 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 |
Default size of inserted clique replacement center nodes.
Definition at line 128 of file UMLGraph.h.
Sets status of edges to be specially embedded (if alignment)
Definition at line 150 of file UMLGraph.h.
|
inline |
Removes the modeling of the association class without removing the information.
Definition at line 242 of file UMLGraph.h.
|
inline |
Definition at line 233 of file UMLGraph.h.
void ogdf::UMLGraph::undoGenMergers | ( | ) |
Boolean switches restore of all hidden edges in single clique call.
void ogdf::UMLGraph::undoStars | ( | ) |
Undo clique replacements.
Definition at line 152 of file UMLGraph.h.
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 311 of file UMLGraph.h.
|
private |
saves all accociation classes
Definition at line 310 of file UMLGraph.h.
modelled classes are stored
Definition at line 312 of file UMLGraph.h.
center nodes introduced at clique replacement
Definition at line 296 of file UMLGraph.h.
|
private |
default size of inserted clique replacement center nodes
Definition at line 295 of file UMLGraph.h.
save the position of the node in the circular drawing of the clique
Definition at line 303 of file UMLGraph.h.
save the bounding box size of the circular drawing of the clique at center
Definition at line 301 of file UMLGraph.h.
|
private |
Definition at line 327 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 323 of file UMLGraph.h.
Definition at line 307 of file UMLGraph.h.
|
private |
Definition at line 280 of file UMLGraph.h.
used to mark clique replacement edges
Definition at line 299 of file UMLGraph.h.
|
private |
used to classify edges for embedding with alignment
Definition at line 318 of file UMLGraph.h.