dyng
Data Structures | Public Types | Public Member Functions | Protected Attributes
Dyng::GravWriter Class Referenceabstract

Base class for writing to Grav files. More...

#include <draw.hxx>

Inheritance diagram for Dyng::GravWriter:
Dyng::CorridorGravWriter Dyng::FlowGravWriter Dyng::PathGravWriter

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
 

Detailed Description

Base class for writing to Grav files.

Constructor & Destructor Documentation

◆ GravWriter()

Dyng::GravWriter::GravWriter ( const Net net,
const std::string &  name 
)

Create a GravWriter for a network.

Parameters
netthe dynamic network
namethe name of the graph in the grav file

Member Function Documentation

◆ append()

virtual bool Dyng::GravWriter::append ( ) const
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.


The documentation for this class was generated from the following file: