dyng
|
Base class for writing to Grav files. More...
#include <draw.hxx>
Data Structures | |
struct | Color |
An RGB color. More... | |
Public Types | |
enum | NodeShape { Disc, Circ } |
The shape of a node. | |
Public Member Functions | |
GravWriter (const Net &net, const std::string &name) | |
Create a GravWriter for a network. More... | |
virtual | ~GravWriter () |
Destructor. | |
virtual bool | append () const |
Returns true iff the graph to be written should be appended. More... | |
virtual bool | node (index_type nodeid, Color &color, NodeShape &shape, std::string &desc)=0 |
Get node info. | |
virtual bool | arc (index_type arcid, double &cost, double &flow, Color &color, std::string &desc)=0 |
Get arc info. | |
virtual void | write (std::ostream &out) |
Write the graph to the given output stream. | |
Protected Attributes | |
const Net & | _net |
the network to be drawn | |
const std::string | _name |
name of the graph in the grav file | |
Base class for writing to Grav files.
Dyng::GravWriter::GravWriter | ( | const Net & | net, |
const std::string & | name | ||
) |
Create a GravWriter for a network.
net | the dynamic network |
name | the name of the graph in the grav file |
|
virtual |
Returns true iff the graph to be written should be appended.
If a graph is appended (to a previously written graph), the node and arc commands are considered augmentations to the previous graph. Otherwise the graph is considered a new graph.
The default implementation always returns true.
Reimplemented in Dyng::FlowGravWriter, and Dyng::CorridorGravWriter.