Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | Related Pages

GraceTMPL::Graph Class Reference

Container for a graph holding some datasets. More...

#include <gracetmpl.h>

Inheritance diagram for GraceTMPL::Graph:

GraceTMPL::EnvironmentUser List of all members.

Public Member Functions

 Graph (Save *saver, int logplot=0)
 Initialize the graph with optional logplot preparation.

void setGraph (int i)
 Set the graph's number.

void addData (Data *d)
 Add a dataset to this graph.

std::vector< Data * > * data ()
 Returns all datasets of this graph.

void setXOffset (double x)
 Set the graph's x-offset.

void setYOffset (double y)
 Set the data's y-offset.

void setScaling (double s)
 Set a factor by which the data will be scaled.

double xoffset ()
 Query the graph's x-offset.

double yoffset ()
 Query the graph's y-offset.

double scale ()
 Query the factor by which the data will be scaled.

int correctLog ()
 Query if data will be corrected for logplots.

void addParam (const std::string &name, double value)
 Add a variable to the graph's local parameters.

void saveprep (const StringVecMap *daSets)
 Prepare graph for saving - ensures consistency.

void saveinfo (FILE *f, const StringVec *daGraph=0, const StringVecMap *daSets=0, const StringVecMap *daStrings=0)
 Save information strings info file.

void savedata (FILE *f, StringMap *literalData, int dataonly=0)
 Save all datasets linked to this graph.


Detailed Description

Container for a graph holding some datasets.

In the normal case of operation, this class would not be instantiated by the user. The preferred way to get a new graph object is to call GraceTMPL::Save::addData().

Also note that it's in the application's responsibility to clean up Data objects. Graph::~Graph() would not touch them!


Constructor & Destructor Documentation

GraceTMPL::Graph::Graph Save saver,
int  logplot = 0
 

Initialize the graph with optional logplot preparation.

The saver must be a GraceTMPL::Save instance. If it is omitted or given as 0 some things will not work as expected!

If logplot is specified as !=0 all datasets in the graph will be corrected for logarithmic plotting.


Member Function Documentation

void GraceTMPL::Graph::savedata FILE *  f,
StringMap literalData,
int  dataonly = 0
 

Save all datasets linked to this graph.

If dataonly is specified as !=0, no ' ...' will be used to address the target graph number. This is a mandatory behaviour for bare dataset saving.

Todo:
Make this a stream

void GraceTMPL::Graph::saveinfo FILE *  f,
const StringVec daGraph = 0,
const StringVecMap daSets = 0,
const StringVecMap daStrings = 0
 

Save information strings info file.

DaGraph contains the information strings relevant for this graph.

DaSet contains the information strings relevant for this dataset.

DaStrings containes the string definition templates used to format the graph's parameter strings.

If DaGraph is empty or a NULL pointer NO information is being written to the file. This is a mandatory behaviour for bare dataset saving.

Todo:
Make this a stream

void GraceTMPL::Graph::setGraph int  i  )  [inline]
 

Set the graph's number.

This method is used internally to set the graph's number corresponding to g0..gN.


The documentation for this class was generated from the following file:
Generated on Mon Sep 27 10:56:44 2004 for GraceTMPL by doxygen 1.3.2