#include <GraphAttributes.h>

Public Types | |
| enum | EdgeArrow { none, last, first, both, undefined } |
| Types for edge arrows. More... | |
| enum | EdgeStyle { esNoPen = 0, esSolid = 1, esDash = 2, esDot = 3, esDashdot = 4, esDashdotdot = 5 } |
| Types for line styles. More... | |
| enum | BrushPattern { bpNone = 0, bpSolid = 1, bpDense1 = 2, bpDense2 = 3, bpDense3 = 4, bpDense4 = 5, bpDense5 = 6, bpDense6 = 7, bpDense7 = 8, bpHorizontal = 9, bpVertical = 10, bpCross = 11, BackwardDiagonal = 12, ForwardDiagonal = 13, DiagonalCross = 14 } |
| Types for object brush patterns. More... | |
| enum | { nodeGraphics = 0x00001, edgeGraphics = 0x00002, nodeLevel = 0x00004, edgeIntWeight = 0x00008, edgeDoubleWeight = 0x00010, edgeLabel = 0x00020, nodeLabel = 0x00040, edgeType = 0x00080, nodeType = 0x00100, nodeColor = 0x00200, nodeId = 0x00400, edgeArrow = 0x00800, edgeColor = 0x01000, edgeStyle = 0x02000, nodeStyle = 0x04000, nodeTemplate = 0x08000, edgeSubGraph = 0x10000 } |
| Bits for specifying attributes. More... | |
| enum | { oval = 0x8001, rectangle = 0x8002 } |
| Bits for specifying node shapes. More... | |
Public Member Functions | |
| GraphAttributes () | |
| Constructs graph attributes for no associated graph (default constructor). | |
| GraphAttributes (const Graph &G, long initAttributes=nodeGraphics|edgeGraphics) | |
| Constructs graph attributes associated with the graph G. | |
| virtual | ~GraphAttributes () |
| virtual void | init (const Graph &G, long initAttr) |
| Initializes the graph attributes for graph G. | |
| long | attributes () const |
| Returns currently accessible attributes. | |
| void | initAttributes (long attr) |
| Initializes attributes in attr for usage. | |
| void | destroyAttributes (long attr) |
| Destroys attributes in attr. | |
| const Graph & | constGraph () const |
| Returns a reference to the associated graph. | |
| const String & | templateNode (node v) const |
| Returns the template name of node v. | |
| String & | templateNode (node v) |
| Returns the template name of node v. | |
| const double & | x (node v) const |
| Returns the x-coordinate of node v. | |
| double & | x (node v) |
| Returns the x-coordinate of node v. | |
| const double & | y (node v) const |
| Returns the y-coordinate of node v. | |
| double & | y (node v) |
| Returns the y-coordinate of node v. | |
| const NodeArray< double > & | width () const |
| Returns a reference to the NodeArray m_width. | |
| NodeArray< double > & | width () |
| Returns a refeence to the NodeArray m_width. | |
| const 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 > & | height () const |
| Returns a reference to the NodeArray m_height. | |
| NodeArray< double > & | height () |
| Returns a refeence to the NodeArray m_height. | |
| const 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 int & | level (node v) const |
| Returns the level of node v. | |
| int & | level (node v) |
| Returns the level of node v. | |
| const BrushPattern & | nodePattern (node v) const |
| Returns the brush pattern of node v. | |
| BrushPattern & | nodePattern (node v) |
| Returns the brush pattern of node v. | |
| const EdgeStyle & | styleNode (node v) const |
| Returns the line style of node \ v. | |
| EdgeStyle & | styleNode (node v) |
| Returns the line style of node \ v. | |
| const double & | lineWidthNode (node v) const |
| Returns the line width of node v. | |
| double & | lineWidthNode (node v) |
| Returns the line width of node v. | |
| const String & | nodeLine (node v) const |
| Returns the line color of node v. | |
| String & | nodeLine (node v) |
| Returns the line color 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. | |
| const int & | intWeight (edge e) const |
| Returns the (integer) weight of edge e. | |
| int & | intWeight (edge e) |
| Returns the (integer) weight of edge e. | |
| const 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. | |
| const double & | edgeWidth (edge e) const |
| Returns the line width of edge e. | |
| double & | edgeWidth (edge e) |
| Returns the line width of edge e. | |
| const String & | colorNode (node v) const |
| Returns the color of node v. | |
| String & | colorNode (node v) |
| Returns the color of node v. | |
| int | shapeNode (node v) const |
| Returns the shape type of node v. | |
| int & | shapeNode (node v) |
| Returns the shape type of node v. | |
| const String & | labelNode (node v) const |
| Returns the label of node \ v. | |
| String & | labelNode (node v) |
| Returns the label of node \ v. | |
| const String & | labelEdge (edge e) const |
| Returns the label of edge e. | |
| String & | labelEdge (edge e) |
| Returns the label 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. | |
| Graph::NodeType | type (node v) const |
| Returns the type of node v. | |
| Graph::NodeType & | type (node v) |
| Returns the type of node v. | |
| const int & | idNode (node v) const |
| Returns the user ID of node v. | |
| int & | idNode (node v) |
| Returns the user ID of node v. | |
| const EdgeArrow & | arrowEdge (edge e) const |
| Returns the arrow type of edge e. | |
| EdgeArrow & | arrowEdge (edge e) |
| Returns the arrow type of edge e. | |
| const EdgeStyle & | styleEdge (edge e) const |
| Returns the line style of an edge e. | |
| EdgeStyle & | styleEdge (edge e) |
| Returns the line style of an edge e. | |
| const String & | colorEdge (edge e) const |
| Returns the color of node v. | |
| String & | colorEdge (edge e) |
| Returns the color of node v. | |
| const unsigned int & | subGraphBits (edge e) const |
| Returns the edgesubgraph value of an edge e. | |
| unsigned int & | 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) |
| Addes edge e to basic graph n. | |
| void | removeSubGraph (edge e, int n) |
| Removes edge e from basic graph n. | |
| const DRect | boundingBox () const |
| Returns the bounding box of the graph. | |
| bool | isAssociationClass (node v) const |
| void | addNodeCenter2Bends (int mode=1) |
| void | clearAllBends () |
| 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. | |
| void | setAllWidth (double w) |
| Sets the width of all nodes to w. | |
| void | setAllHeight (double h) |
| Sets the height of all nodes to h. | |
| bool | readGML (Graph &G, const String &fileName) |
| Reads the graph from a GML file fileName. | |
| bool | readGML (Graph &G, istream &is) |
| Reads the graph from a GML input stream is. | |
| void | writeGML (const String &fileName) const |
| Writes the graph with its attributes in GML format to file fileName. | |
| void | writeGML (ostream &os) const |
| Writes the graph with its attributes in GML format to output stream os. | |
| bool | readXML (Graph &G, const String &fileName) |
| Reads the graph and attributes from the XML file fileName. | |
| bool | readXML (Graph &G, istream &is) |
| Reads the graph and attributes from the XML input stream is. | |
| void | writeXML (const String &fileName, const char *delimiter="", const char *offset="") const |
| Reads the graph from the XML input stream is. | |
| virtual void | writeXML (ostream &os, const char *delimiter="", const char *offset="") const |
| Reads the graph from the XML input stream is. | |
| bool | readRudy (Graph &G, const String &fileName) |
| Reads a graph in Rudy format from file fileName. | |
| bool | readRudy (Graph &G, istream &is) |
| Reads a graph in Rudy format from input stream is. | |
| void | writeRudy (const String &fileName) const |
| Writes the graph in Rudy format to file fileName. | |
| void | writeRudy (ostream &os) const |
| Writes the graph in Rudy format to output stream os. | |
| void | removeUnnecessaryBendsHV () |
| Removes unnecessary bend points in orthogonal segements. | |
Static Public Member Functions | |
| static EdgeStyle | intToStyle (int i) |
| Converts integer i to edge style. | |
| static BrushPattern | intToPattern (int i) |
| Converts integer i to brush pattern. | |
Protected Member Functions | |
| void | writeLongString (ostream &os, const String &str) const |
Protected Attributes | |
| const Graph * | m_pGraph |
| associated graph | |
| NodeArray< double > | m_x |
| x-coordinate of a node | |
| NodeArray< double > | m_y |
| y-coordinate pf a node | |
| NodeArray< double > | m_width |
| width of a node's bounding box | |
| NodeArray< double > | m_height |
| height of a nodes's bounding box | |
| NodeArray< String > | m_nodeLabel |
| label of a node | |
| NodeArray< String > | m_nodeColor |
| color of a node | |
| NodeArray< String > | m_nodeLine |
| line color of a node | |
| NodeArray< int > | m_nodeShape |
| shape of a node | |
| NodeArray< double > | m_nodeLineWidth |
| line width of a node | |
| NodeArray< BrushPattern > | m_nodePattern |
| brush pattern of a node | |
| NodeArray< EdgeStyle > | m_nodeStyle |
| line style of a node | |
| NodeArray< String > | m_nodeTemplate |
| name of template of a node | |
| NodeArray< int > | m_nodeId |
| user ID of a node | |
| NodeArray< int > | m_level |
| level of a node | |
| NodeArray< Graph::NodeType > | m_vType |
| EdgeArray< DPolyline > | m_bends |
| list of bend points of an edge | |
| EdgeArray< String > | m_edgeLabel |
| label of an edge | |
| EdgeArray< EdgeArrow > | m_edgeArrow |
| arrow type of an edge | |
| EdgeArray< EdgeStyle > | m_edgeStyle |
| line style of an edge | |
| EdgeArray< String > | m_edgeColor |
| line color of an edge | |
| EdgeArray< double > | m_edgeWidth |
| line width of an edge | |
| EdgeArray< Graph::EdgeType > | m_eType |
| type of an edge (association or generalization) | |
| EdgeArray< int > | m_intWeight |
| (integer) weight of an edge | |
| EdgeArray< double > | m_doubleWeight |
| (real number) weight of an edge | |
| EdgeArray< unsigned int > | m_subGraph |
| is element of subgraphs given by bitvector | |
| long | m_attributes |
| bit vector of currently used attributes | |
It is frequently necessary to associate additional attributes with a graph. The class GraphAttributes provides various such attributes and is the central place were such attributes are stored.
Attributes are simply stored in node or edge arrays; for memory consumption reasons, only a subset of these arrays is in fact initialized for the graph; non-initialized arrays require only a few bytes of extra memory.
Which arrays are initialized is specified by a bit vector; each bit in this bit vector corresponds to one or more attributes. E.g., nodeGraphics corresponds to the attributes m_x, m_y, m_width, and m_height; whereas edgeDoubleWeight only corresponds to the attribute m_doubleWeight.
Attributes can be initialized by the constructor GraphAttributes(const Graph &,long) or the function initAttributes(); attributes can also be deinitialized by calling destroyAttributes().
Definition at line 92 of file GraphAttributes.h.
Types for edge arrows.
| none | no edge arrows |
| last | edge arrow at target node of the edge |
| first | edge arrow at source node of the edge |
| both | edge arrow at target and source node of the edge |
| undefined |
Definition at line 96 of file GraphAttributes.h.
Types for line styles.
The line styles are preliminary the same as in QT.
| esNoPen | no line |
| esSolid | solid line |
| esDash | dashed line |
| esDot | dotted line |
| esDashdot | line style "dash dot dash dot ..." |
| esDashdotdot | line style "dash dot dot dash dot dot ..." |
Definition at line 108 of file GraphAttributes.h.
Types for object brush patterns.
The brush patterns are currently the same as the GDE project.
| bpNone | |
| bpSolid | |
| bpDense1 | |
| bpDense2 | |
| bpDense3 | |
| bpDense4 | |
| bpDense5 | |
| bpDense6 | |
| bpDense7 | |
| bpHorizontal | |
| bpVertical | |
| bpCross | |
| BackwardDiagonal | |
| ForwardDiagonal | |
| DiagonalCross |
Definition at line 137 of file GraphAttributes.h.
| anonymous enum |
Bits for specifying attributes.
Definition at line 225 of file GraphAttributes.h.
| anonymous enum |
| ogdf::GraphAttributes::GraphAttributes | ( | ) |
Constructs graph attributes for no associated graph (default constructor).
The associated graph can be set later with the init() function.
| ogdf::GraphAttributes::GraphAttributes | ( | const Graph & | G, | |
| long | initAttributes = nodeGraphics|edgeGraphics | |||
| ) |
Constructs graph attributes associated with the graph G.
| G | is the associated graph. | |
| initAttributes | specifies the set of attributes that can be accessed. |
| virtual ogdf::GraphAttributes::~GraphAttributes | ( | ) | [inline, virtual] |
Definition at line 265 of file GraphAttributes.h.
| static EdgeStyle ogdf::GraphAttributes::intToStyle | ( | int | i | ) | [inline, static] |
| static BrushPattern ogdf::GraphAttributes::intToPattern | ( | int | i | ) | [inline, static] |
| void ogdf::GraphAttributes::writeLongString | ( | ostream & | os, | |
| const String & | str | |||
| ) | const [protected] |
Writes string str into a GML file such that line length limits are respected and characters '\', '"' are correctly escaped.
| virtual void ogdf::GraphAttributes::init | ( | const Graph & | G, | |
| long | initAttr | |||
| ) | [virtual] |
Initializes the graph attributes for graph G.
| G | is the new associated graph. | |
| initAttr | specifies the set of attributes that can be accessed. |
| long ogdf::GraphAttributes::attributes | ( | ) | const [inline] |
| void ogdf::GraphAttributes::initAttributes | ( | long | attr | ) |
Initializes attributes in attr for usage.
| void ogdf::GraphAttributes::destroyAttributes | ( | long | attr | ) |
Destroys attributes in attr.
| const Graph& ogdf::GraphAttributes::constGraph | ( | ) | const [inline] |
| const double& ogdf::GraphAttributes::x | ( | node | v | ) | const [inline] |
| double& ogdf::GraphAttributes::x | ( | node | v | ) | [inline] |
| const double& ogdf::GraphAttributes::y | ( | node | v | ) | const [inline] |
| double& ogdf::GraphAttributes::y | ( | node | v | ) | [inline] |
| const NodeArray<double>& ogdf::GraphAttributes::width | ( | ) | const [inline] |
| NodeArray<double>& ogdf::GraphAttributes::width | ( | ) | [inline] |
| const double& ogdf::GraphAttributes::width | ( | node | v | ) | const [inline] |
| double& ogdf::GraphAttributes::width | ( | node | v | ) | [inline] |
| const NodeArray<double>& ogdf::GraphAttributes::height | ( | ) | const [inline] |
| NodeArray<double>& ogdf::GraphAttributes::height | ( | ) | [inline] |
| const double& ogdf::GraphAttributes::height | ( | node | v | ) | const [inline] |
| double& ogdf::GraphAttributes::height | ( | node | v | ) | [inline] |
| const int& ogdf::GraphAttributes::level | ( | node | v | ) | const [inline] |
| int& ogdf::GraphAttributes::level | ( | node | v | ) | [inline] |
| const BrushPattern& ogdf::GraphAttributes::nodePattern | ( | node | v | ) | const [inline] |
| BrushPattern& ogdf::GraphAttributes::nodePattern | ( | node | v | ) | [inline] |
| const double& ogdf::GraphAttributes::lineWidthNode | ( | node | v | ) | const [inline] |
| double& ogdf::GraphAttributes::lineWidthNode | ( | node | v | ) | [inline] |
| const int& ogdf::GraphAttributes::intWeight | ( | edge | e | ) | const [inline] |
| int& ogdf::GraphAttributes::intWeight | ( | edge | e | ) | [inline] |
| const double& ogdf::GraphAttributes::doubleWeight | ( | edge | e | ) | const [inline] |
| double& ogdf::GraphAttributes::doubleWeight | ( | edge | e | ) | [inline] |
| const double& ogdf::GraphAttributes::edgeWidth | ( | edge | e | ) | const [inline] |
| double& ogdf::GraphAttributes::edgeWidth | ( | edge | e | ) | [inline] |
| int ogdf::GraphAttributes::shapeNode | ( | node | v | ) | const [inline] |
| int& ogdf::GraphAttributes::shapeNode | ( | node | v | ) | [inline] |
| Graph::EdgeType ogdf::GraphAttributes::type | ( | edge | e | ) | const [inline] |
| Graph::EdgeType& ogdf::GraphAttributes::type | ( | edge | e | ) | [inline] |
| Graph::NodeType ogdf::GraphAttributes::type | ( | node | v | ) | const [inline] |
| Graph::NodeType& ogdf::GraphAttributes::type | ( | node | v | ) | [inline] |
| const int& ogdf::GraphAttributes::idNode | ( | node | v | ) | const [inline] |
| int& ogdf::GraphAttributes::idNode | ( | node | v | ) | [inline] |
| const unsigned int& ogdf::GraphAttributes::subGraphBits | ( | edge | e | ) | const [inline] |
| unsigned int& ogdf::GraphAttributes::subGraphBits | ( | edge | e | ) | [inline] |
| bool ogdf::GraphAttributes::inSubGraph | ( | edge | e, | |
| int | n | |||
| ) | const [inline] |
| void ogdf::GraphAttributes::addSubGraph | ( | edge | e, | |
| int | n | |||
| ) | [inline] |
| void ogdf::GraphAttributes::removeSubGraph | ( | edge | e, | |
| int | n | |||
| ) | [inline] |
| const DRect ogdf::GraphAttributes::boundingBox | ( | ) | const |
| bool ogdf::GraphAttributes::isAssociationClass | ( | node | v | ) | const [inline] |
We hide the internal representation of semantic node types from the user to be able to change this later (semantic node type member array). We are not allowed to set association classes manually, only by calling createAssociationClass().
Definition at line 446 of file GraphAttributes.h.
| void ogdf::GraphAttributes::addNodeCenter2Bends | ( | int | mode = 1 |
) |
According to the mode switch add either the node center points to the bends or the anchor point on the node boundary
| void ogdf::GraphAttributes::clearAllBends | ( | ) |
Returns a list of all inheritance hierarchies in the graph.
Inheritance hierarchies are identified by edges with type Graph::generalization.
| list | is a list of all hierarchies; each hierarchie is itself a list of all nodes in this hierarchy. |
Returns a list of all inheritance hierarchies in the graph.
Inheritance hierarchies are identified by edges with type Graph::generalization.
| list | is a list of all hierarchies; each hierarchie is itself a list of all edges in this hierarchy. |
| void ogdf::GraphAttributes::setAllWidth | ( | double | w | ) |
Sets the width of all nodes to w.
| void ogdf::GraphAttributes::setAllHeight | ( | double | h | ) |
Sets the height of all nodes to h.
Reads the graph from a GML file fileName.
| bool ogdf::GraphAttributes::readGML | ( | Graph & | G, | |
| istream & | is | |||
| ) |
Reads the graph from a GML input stream is.
| void ogdf::GraphAttributes::writeGML | ( | const String & | fileName | ) | const |
Writes the graph with its attributes in GML format to file fileName.
| void ogdf::GraphAttributes::writeGML | ( | ostream & | os | ) | const |
Writes the graph with its attributes in GML format to output stream os.
Reads the graph and attributes from the XML file fileName.
| bool ogdf::GraphAttributes::readXML | ( | Graph & | G, | |
| istream & | is | |||
| ) |
Reads the graph and attributes from the XML input stream is.
| void ogdf::GraphAttributes::writeXML | ( | const String & | fileName, | |
| const char * | delimiter = "", |
|||
| const char * | offset = "" | |||
| ) | const |
Reads the graph from the XML input stream is.
| virtual void ogdf::GraphAttributes::writeXML | ( | ostream & | os, | |
| const char * | delimiter = "", |
|||
| const char * | offset = "" | |||
| ) | const [virtual] |
Reads the graph from the XML input stream is.
Reads a graph in Rudy format from file fileName.
| bool ogdf::GraphAttributes::readRudy | ( | Graph & | G, | |
| istream & | is | |||
| ) |
Reads a graph in Rudy format from input stream is.
| void ogdf::GraphAttributes::writeRudy | ( | const String & | fileName | ) | const |
Writes the graph in Rudy format to file fileName.
| void ogdf::GraphAttributes::writeRudy | ( | ostream & | os | ) | const |
Writes the graph in Rudy format to output stream os.
| void ogdf::GraphAttributes::removeUnnecessaryBendsHV | ( | ) |
Removes unnecessary bend points in orthogonal segements.
Processes all edges and removes unnecessary bend points in the bend point list of the edge, i.e., bend points such that the preceding and succeeding bend point form a horizontal or vertical segement containing this bend point. This function is useful to remove redundant bend points in an orthogonal layout.
const Graph* ogdf::GraphAttributes::m_pGraph [protected] |
NodeArray<double> ogdf::GraphAttributes::m_x [protected] |
NodeArray<double> ogdf::GraphAttributes::m_y [protected] |
NodeArray<double> ogdf::GraphAttributes::m_width [protected] |
NodeArray<double> ogdf::GraphAttributes::m_height [protected] |
NodeArray<String> ogdf::GraphAttributes::m_nodeLabel [protected] |
NodeArray<String> ogdf::GraphAttributes::m_nodeColor [protected] |
NodeArray<String> ogdf::GraphAttributes::m_nodeLine [protected] |
NodeArray<int> ogdf::GraphAttributes::m_nodeShape [protected] |
NodeArray<double> ogdf::GraphAttributes::m_nodeLineWidth [protected] |
NodeArray<BrushPattern> ogdf::GraphAttributes::m_nodePattern [protected] |
NodeArray<EdgeStyle> ogdf::GraphAttributes::m_nodeStyle [protected] |
NodeArray<String> ogdf::GraphAttributes::m_nodeTemplate [protected] |
NodeArray<int> ogdf::GraphAttributes::m_nodeId [protected] |
NodeArray<int> ogdf::GraphAttributes::m_level [protected] |
NodeArray<Graph::NodeType> ogdf::GraphAttributes::m_vType [protected] |
Definition at line 205 of file GraphAttributes.h.
EdgeArray<DPolyline> ogdf::GraphAttributes::m_bends [protected] |
EdgeArray<String> ogdf::GraphAttributes::m_edgeLabel [protected] |
EdgeArray<EdgeArrow> ogdf::GraphAttributes::m_edgeArrow [protected] |
EdgeArray<EdgeStyle> ogdf::GraphAttributes::m_edgeStyle [protected] |
EdgeArray<String> ogdf::GraphAttributes::m_edgeColor [protected] |
EdgeArray<double> ogdf::GraphAttributes::m_edgeWidth [protected] |
EdgeArray<Graph::EdgeType> ogdf::GraphAttributes::m_eType [protected] |
EdgeArray<int> ogdf::GraphAttributes::m_intWeight [protected] |
EdgeArray<double> ogdf::GraphAttributes::m_doubleWeight [protected] |
EdgeArray<unsigned int> ogdf::GraphAttributes::m_subGraph [protected] |
long ogdf::GraphAttributes::m_attributes [protected] |