97 double margin()
const {
return m_margin; }
112 const string &
width()
const {
return m_width; }
115 const string &
height()
const {
return m_height; }
167 std::ifstream is(filename);
168 return is.good() && reader(G, is);
179 std::ofstream os(filename);
180 return os.good() && writer(G, os);
251 std::ifstream is(filename);
252 return is.good() && reader(GA, G, is);
263 std::ofstream os(filename);
264 return os.good() && writer(GA, os);
496 #pragma mark PMDissGraph 609 #pragma mark Digraph6 675 #pragma mark MatrixMarket 793 #pragma mark ChallengeGraph 1330 return readSTP(attr, G, terminals, isTerminal, is);
1358 template<
typename T>
1367 bool res =
readSTP(attr, wG, terminals, isTerminal, is);
1369 wG.
setWeight(e, getEdgeWeightAttribute<T>(attr, e));
1395 const string &comments =
"");
1409 template<
typename T>
1414 const string &comments =
"")
1418 getEdgeWeightAttribute<T>(attr, e) = wG.
weight(e);
1420 return writeSTP(attr, terminals, os, comments);
1452 return readDMF(attr, graph, sink, source, is);
1467 template<
typename T>
1470 bool result =
readDMF(attr, graph, source, sink, is);
1471 weights.
init(graph);
1473 weights[e] = getEdgeWeightAttribute<T>(attr, e);
1490 return readDMF(attr, graph, source, sink, is);
1523 template<
typename T>
1533 getEdgeWeightAttribute<T>(attr, e) = weights[e];
1535 return writeDMF(attr, source, sink, os);
1628 if (value < 0 || value > 255) {
1632 setFunction(static_cast<uint8_t>(value));
1640 template<typename T, typename std::enable_if<std::is_integral<T>::value,
bool>
::type = 0>
1649 template<typename T, typename std::enable_if<std::is_floating_point<T>::value,
bool>::type = 0>
1660 template<typename T, typename std::enable_if<std::is_integral<T>::value,
bool>::type = 0>
1671 template<typename T, typename std::enable_if<std::is_floating_point<T>::value,
bool>::type = 0>
Representation of a graph's grid layout.
bool(*)(const ClusterGraph &, std::ostream &) ClusterWriterFunc
Type of cluster graph writer functions working on streams.
static int getEdgeWeightFlag()
Returns GraphAttributes::edgeIntWeight.
static bool readDigraph6(Graph &G, std::istream &is, bool forceHeader=false)
Reads graph G in Digraph6 format from input stream is.
static bool readPLA(Graph &G, List< node > &hypernodes, List< edge > *shell, std::istream &is)
Reads a hypergraph (as point-based expansion) in PLA format from input stream is. ...
bool(*)(const ClusterGraphAttributes &, std::ostream &) ClusterAttrWriterFunc
Type of cluster graph attributes writer functions working on streams.
static std::ostream & indent(std::ostream &os, int depth)
Prints indentation for indentation depth to output stream os and returns os.
static bool writeDMF(const Graph &graph, const EdgeArray< T > &weights, const node source, const node sink, std::ostream &os)
Writes a maximum flow problem instance to a DIMACS maximum flow file.
bool(*)(GraphAttributes &, Graph &, std::istream &) AttrReaderFunc
Type of simple graph attributes reader functions working on streams.
std::ostream & lout(Level level=Level::Default) const
stream for logging-output (local)
static bool readBENCH(Graph &G, List< node > &hypernodes, List< edge > *shell, std::istream &is)
Reads a hypergraph (as point-based expansion) in BENCH format from input stream is.
static bool write(const GraphAttributes &GA, const string &filename, AttrWriterFunc writer)
Writes arbitrary format to a file specified by name.
static bool readGEXF(Graph &G, std::istream &is)
Reads graph G in GEXF format from input stream is.
static bool writeChaco(const Graph &G, std::ostream &os)
Writes graph G in Chaco format to output stream os.
void curviness(double value)
Sets the curviness of all edges (value ranges from 0 to 1).
virtual void clear()
Removes all nodes and all edges from the graph.
bool m_bezierInterpolation
static bool writeGraph6(const Graph &G, std::ostream &os)
Writes graph G in Graph6 format to output stream os.
static bool readPMDissGraph(Graph &G, std::istream &is)
Reads graph G in a simple format as used in Petra Mutzel's thesis from input stream is...
void init()
Reinitializes the array. Associates the array with no graph.
static bool writeDigraph6(const Graph &G, std::ostream &os)
Writes graph G in Digraph6 format to output stream os.
static bool readLEDA(Graph &G, std::istream &is)
Reads graph G in LEDA graph format from input stream is.
static bool readDMF(Graph &graph, std::istream &is)
Reads a maximum flow instance in DIMACS format.
static void setIndentWidth(int w)
Sets the indentation width to w.
Data type for general directed graphs (adjacency list representation).
static bool drawSVG(const GraphAttributes &A, std::ostream &os, const SVGSettings &settings)
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
static int & getEdgeWeightAttribute(GraphAttributes &attr, edge e)
Returns a reference to the intWeight()-value of attr for e.
double curviness() const
Returns the curviness of the edges (value ranges from 0 to 1).
static const long edgeIntWeight
Corresponds to edge attribute intWeight(edge).
static bool writeGEXF(const Graph &G, std::ostream &os)
Writes graph G in GEXF format to output stream os.
void setWeight(const edge e, T weight)
Utility class providing graph I/O in various exchange formats.
static bool writePMDissGraph(const Graph &G, std::ostream &os)
Writes graph G in a simple format as used in Petra Mutzel's thesis to output stream os...
static bool readDigraph6WithForcedHeader(Graph &G, std::istream &is)
static bool writeRudy(const GraphAttributes &A, std::ostream &os)
Writes graph with edge weights stored in A in Rudy format to output stream os.
Dynamic arrays indexed with edges.
static bool writeSparse6(const Graph &G, std::ostream &os)
Writes graph G in Sparse6 format to output stream os.
static bool writeGDF(const Graph &G, std::ostream &os)
Writes graph G in GDF format to output stream os.
static double & getEdgeWeightAttribute(GraphAttributes &attr, edge e)
Returns a reference to the doubleWeight()-value of attr for e.
static bool readGDF(Graph &G, std::istream &is)
Reads graph G in GDF format from input stream is.
static bool readGraph6(Graph &G, std::istream &is, bool forceHeader=false)
Reads graph G in Graph6 format from input stream is.
static bool readSTP(GraphAttributes &attr, Graph &G, List< node > &terminals, NodeArray< bool > &isTerminal, std::istream &is)
Reads a graph in SteinLib format from std::istream is.
static bool drawSVG(const GraphAttributes &A, std::ostream &os)
static bool readSparse6WithForcedHeader(Graph &G, std::istream &is)
static bool writeRome(const Graph &G, std::ostream &os)
Writes graph G in Rome-Lib format to output stream os.
static bool readGML(Graph &G, std::istream &is)
Reads graph G in GML format from input stream is.
T weight(const edge e) const
static bool writeDMF(const GraphAttributes &attr, const node source, const node sink, std::ostream &os)
Writes a maximum flow problem instance to a DIMACS maximum flow file.
Representation of clustered graphs.
static bool read(GraphAttributes &GA, Graph &G, const string &filename, AttrReaderFunc reader)
Reads arbitrary format from a file specified by name.
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
static void setIndentChar(char c)
Sets the indentation character to c.
static SVGSettings svgSettings
static bool writeTLP(const Graph &G, std::ostream &os)
Writes graph G in TLP format to output stream os.
static bool writeGML(const Graph &G, std::ostream &os)
Writes graph G in GML format to output stream os.
static bool readDMF(GraphAttributes &attr, Graph &graph, std::istream &is)
Reads a maximum flow instance in DIMACS format.
bool(*)(const Graph &, std::ostream &) WriterFunc
Type of simple graph writer functions working on streams.
static bool writeDL(const Graph &G, std::ostream &os)
Writes graph G in DL format to output stream os.
static char s_indentChar
Character used for indentation.
static bool setColorValue(int value, std::function< void(uint8_t)> setFunction)
Set a color value (R/G/B/A) based on an integer. Checks if the value is in the right range...
Declaration of class GridLayout.
static const long edgeDoubleWeight
Corresponds to edge attribute doubleWeight(edge).
Stores additional attributes of a graph (like layout information).
int intWeight(edge e) const
Returns the (integer) weight of edge e.
static bool writeGraphML(const Graph &G, std::ostream &os)
Writes graph G in GraphML format to output stream os.
Doubly linked lists (maintaining the length of the list).
Definition of exception classes.
const string & width() const
Returns the default width.
int fontSize() const
Returns the default font size (font height in pixels).
Class for the representation of edges.
static bool readDL(Graph &G, std::istream &is)
Reads graph G in DL format from input stream is.
static bool writeSTP(const EdgeWeightedGraph< T > &wG, const List< node > &terminals, std::ostream &os, const string &comments="")
Writes an Steiner problem instance to an STP file.
Stores additional attributes of a clustered graph (like layout information).
Declaration of class EdgeWeightedGraph.
static bool readSTP(GraphAttributes &attr, Graph &G, std::istream &is)
Reads a graph in SteinLib format from std::istream is.
static bool readSparse6(Graph &G, std::istream &is, bool forceHeader=false)
Reads graph G in Sparse6 format from input stream is.
const string & height() const
Returns the default height.
double margin() const
Returns the size of the margin around the drawing.
Class for the representation of nodes.
static bool readYGraph(Graph &G, std::istream &is)
Reads graph G in Y-graph format from input stream is.
static bool writeDOT(const Graph &G, std::ostream &os)
Writes graph G in DOT format to output stream os.
static bool readRudy(GraphAttributes &A, Graph &G, std::istream &is)
Reads graph G with edge weights stored in A in Rudy format from input stream is.
static bool writeChallengeGraph(const Graph &G, const GridLayout &gl, std::ostream &os)
Writes graph G with grid layout gl in GD-Challenge-format to output stream os.
static bool readTLP(Graph &G, std::istream &is)
Reads graph G in TLP format from input stream is.
void height(const string &height)
Sets the height.
static bool readRome(Graph &G, std::istream &is)
Reads graph G in Rome-Lib format from input stream is.
void fontSize(int fs)
Sets the default font size (font height in pixels) to fs.
bool(*)(Graph &, std::istream &) ReaderFunc
Type of simple graph reader functions working on streams.
void width(const string &width)
Sets the width.
Declares ClusterGraphAttributes, an extension of class GraphAttributes, to store clustergraph layout ...
static bool readGraphML(Graph &G, std::istream &is)
Reads graph G in GraphML format from input stream is.
void margin(double m)
Sets the size of the margin around the drawing to m.
static int s_indentWidth
Number of indent characters used for indentation.
static bool readChaco(Graph &G, std::istream &is)
Reads graph G in Chaco format from input stream is.
static bool readDMF(GraphAttributes &attr, Graph &graph, node &source, node &sink, std::istream &is)
Reads a maximum flow instance in DIMACS format.
bool(*)(ClusterGraph &, Graph &, std::istream &) ClusterReaderFunc
Type of cluster graph reader functions working on streams.
static bool readMatrixMarket(Graph &G, std::istream &inStream)
Reads graph G in Matrix Market exchange format from stream inStream.
static bool readDOT(Graph &G, std::istream &is)
Reads graph G in DOT format from input stream is.
Condensed settings for drawing SVGs.
Centralized global and local logging facility working on streams like std::cout.
bool bezierInterpolation() const
Returns whether Bézier-interpolation for curved edges is enabled.
static bool writeSTP(const GraphAttributes &attr, const List< node > &terminals, std::ostream &os, const string &comments="")
Writes an Steiner problem instance to an STP file.
static bool write(const Graph &G, const string &filename, WriterFunc writer)
Writes arbitrary format to a file specified by name.
static bool drawSVG(const ClusterGraphAttributes &A, std::ostream &os)
static bool readSTP(Graph &G, std::istream &is)
Reads a graph in SteinLib format from std::istream is.
static bool writeLEDA(const Graph &G, std::ostream &os)
Writes graph G in LEDA graph format to output stream os.
static int indentWidth()
Returns the currently used indentation width.
const string & fontFamily() const
Returns the default font family.
static bool readSTP(EdgeWeightedGraph< T > &wG, List< node > &terminals, NodeArray< bool > &isTerminal, std::istream &is)
Reads a SteinLib instance from an inputstream is and converts it into a weighted graph wG and a set o...
void fontFamily(const string &fm)
Sets the default font family to fm.
void fontColor(const string &fc)
Sets the default font color to fc.
void bezierInterpolation(bool enable)
Enables or disables Bézier-interpolation.
double doubleWeight(edge e) const
Returns the (real number) weight of edge e.
static bool readRudy(Graph &G, std::istream &is)
Reads graph G in Rudy format from input stream is.
The namespace for all OGDF objects.
const string & fontColor() const
Returns the default font color.
bool(*)(const GraphAttributes &, std::ostream &) AttrWriterFunc
Type of simple graph attributes writer functions working on streams.
static bool readChallengeGraph(Graph &G, GridLayout &gl, std::istream &is)
Reads graph G with grid layout gl in GD-Challenge-format from input stream is.
static bool writeEdgeListSubgraph(const Graph &G, const List< edge > &delEdges, std::ostream &os)
Writes graph G with subgraph defined by delEdges to stream os.
static char indentChar()
Returns the currently used indentation character.
bool(*)(ClusterGraphAttributes &, ClusterGraph &, Graph &, std::istream &) ClusterAttrReaderFunc
Type of cluster graph attributes reader functions working on streams.
static bool readGraph6WithForcedHeader(Graph &G, std::istream &is)
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static bool read(Graph &G, const string &filename, ReaderFunc reader=GraphIO::read)
Reads arbitrary format from a file specified by name.
static bool readDMF(Graph &graph, EdgeArray< T > &weights, node &source, node &sink, std::istream &is)
Reads a maximum flow instance in DIMACS format.
static bool readEdgeListSubgraph(Graph &G, List< edge > &delEdges, std::istream &is)
Reads graph G with subgraph defined by delEdges from stream is.