Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

TxPlotData Class Reference

-- Class to hold data to be plotted in a GUI-accessible format. More...

#include <TxPlotData.h>

Inheritance diagram for TxPlotData::

TxAttributeSet TxLinePlotData TxPlotDataAux TestLinePlotData TxLinePlotDataAux TxLinePlotDataAux List of all members.

Public Methods

 TxPlotData ()
 default constructor. More...

 TxPlotData (int nr, int nc)
 constructor specifying the number of rows and columns. More...

virtual ~TxPlotData ()
 virtual destructor. More...

virtual TXSTD::string getClassID () const
 Get class identifier for run-time identification. More...

virtual void restart ()
 clean up object and begin again. More...

int getComplete ()
 get flag indicating whether generation of plot data is complete. More...

virtual void paramsChanged ()
 Hook called after parameters in hash table have changed. More...

virtual void optionsChanged ()
 Hook called after options in hash table have changed. More...

virtual void stringsChanged ()
 Hook called after strings in hash table have changed. More...

virtual int moreData ()=0
 Get more data points. More...

virtual void calcLims ()=0
 Calculate all plot limits as needed. More...

virtual int getNumPlots () const=0
 get the number of plots to be generated. More...

virtual const TXSTD::string getTitle (int) const=0
 get the title of the i'th plot. More...

virtual const TXSTD::string getXLabel (int) const=0
 get the horizontal axis label of the i'th plot. More...

virtual double getXMin (int i) const=0
 get the minimum horizontal value for the data of the i'th plot. More...

virtual double getXMinPlot (int) const=0
 get the minimum horizontal axis value for the i'th plot. More...

virtual double getXMax (int) const=0
 get the maximum horizontal value for the data of the i'th plot. More...

virtual double getXMaxPlot (int) const=0
 get the maximum horizontal axis value for the i'th plot. More...

virtual const TXSTD::string getYLabel (int) const=0
 get the vertical axis label of the i'th plot. More...

virtual double getYMin (int) const=0
 get the minimum vertical value for the data of the i'th plot. More...

virtual double getYMinPlot (int) const=0
 get the minimum vertical axis value for the i'th plot. More...

virtual double getYMax (int) const=0
 get the maximum vertical value for the data of the i'th plot. More...

virtual double getYMaxPlot (int) const=0
 get the maximum vertical axis value for the i'th plot. More...

int getMaxNumRows () const
 get the maximum number of rows, where each row corresponds to a data set. More...

int getMaxNumColumns () const
 get the maximum number of columns, where each column corresponds to a particular point. More...

int getNumRows () const
 get the actual number of rows, where each row corresponds to a data set. More...

int getNumColumns () const
 get the actual number of columns, where each column corresponds to a particular point. More...

double getData (int i, int j) const
 get the data point from row i and column j. More...

const double* getDataPtr (int i, int j) const
 get a constant pointer to the data point in row i and column j. More...


Protected Methods

void setComplete (int iflag=1)
 set flag to indicate that generation of plot data is complete. More...

void setMaxNumRows (int)
 set the maximum number of rows for the entire plotting data set. More...

void setMaxNumColumns (int)
 set the maximum number of columns for the entire plotting data set. More...

void setNumRows (int)
 set the actual number of rows for the plotting data set. More...

void setNumColumns (int)
 set the actual number of columns for the plotting data set. More...

double& getDataRef (int i, int j) const
 get a reference to the data point in row i and column j. More...

void setData (int, int, double)
 set the value for the data point in specified row and column. More...

void setRow (int i, double *)
 set the data for all of the specified row (double* better have a valid dimension). More...

void setRow (int, double *, int, int)
 set values for data in specified column interval of specified row. More...

void appendRow (double *d)
 append an entire new row of data (double* better have a valid dimension). More...

void setColumn (int i, double *)
 set the data for all of the specified column (double* better have a valid dimension). More...

void setColumn (int i, double *dptr, int rmn, int rmx)
 set values for data in specified row interval of specified column. More...

void appendColumn (double *d)
 append an entire new column of data. More...


Private Methods

 TxPlotData (TxPlotData &)
 prevent public use of the copy constructor. More...

const TxPlotData& operator= (const TxPlotData &)
 prevent public use of the assignment operator. More...


Private Attributes

int size
 specifies allocated memory. More...

int maxNumRows
 maximum number of rows, where each row constitutes a separate data set. More...

int maxNumCols
 maximum number of columns, where each column corresponds to a data point. More...

double* data
 pointer to the data that will be plotted. More...

int numRows
 actual number of rows, where each row constitutes a separate data set. More...

int numCols
 number of columns filled so far, where each column corresponds to a data point. More...

int completed
 Boolean signifying completion. More...


Static Private Attributes

double chgMemRatio
 Memory changes by this ratio at each request for a change in row or column sizes. More...

double version
 version of the library. More...


Detailed Description

-- Class to hold data to be plotted in a GUI-accessible format.

TxPlotData holds the data for a plot. It is intended that derived classes will hold the format data for different kinds of plots, e.g., TxLinePlotData. Further derived classes will insert the data. Because TxPlotData is intended to work in a nonthreaded GUI environment, the derived classes should arrange to calculate and insert part of the data each time there is a call to moreData(). When the user is done inserting data, setComplete() should be called to signify this.

The basic structure provides a mechanism for holding data, adding to that data, enlarging the memory holding that data, etc.

Copyright 1996, 1997, 1998 by Tech-X Corporation

Author:
John R. Cary

Version:
Id:
TxPlotData.h,v 1.1 2001/09/21 21:35:29 kgl Exp

Definition at line 48 of file TxPlotData.h.


Constructor & Destructor Documentation

TxPlotData::TxPlotData ( )
 

default constructor.

TxPlotData::TxPlotData ( int nr,
int nc )
 

constructor specifying the number of rows and columns.

Parameters:
nr   the number of rows
nc   the number of columns

TxPlotData::~TxPlotData ( ) [virtual]
 

virtual destructor.

TxPlotData::TxPlotData ( TxPlotData & ) [private]
 

prevent public use of the copy constructor.


Member Function Documentation

void TxPlotData::appendColumn ( double * d ) [inline, protected]
 

append an entire new column of data.

Parameters:
d   the new column of data (better have correct dimension)

Definition at line 264 of file TxPlotData.h.

void TxPlotData::appendRow ( double * d ) [inline, protected]
 

append an entire new row of data (double* better have a valid dimension).

Definition at line 241 of file TxPlotData.h.

void TxPlotData::calcLims ( ) [pure virtual]
 

Calculate all plot limits as needed.

Reimplemented in TxLinePlotData.

Referenced by TxLinePlotData::calcLims().

TXSTD::string TxPlotData::getClassID ( ) const [inline, virtual]
 

Get class identifier for run-time identification.

Returns:
the class ID

Reimplemented in TestLinePlotData, TxLinePlotData, and TxLinePlotDataAux.

Definition at line 75 of file TxPlotData.h.

int TxPlotData::getComplete ( ) [inline]
 

get flag indicating whether generation of plot data is complete.

Returns:
whether completed

Definition at line 87 of file TxPlotData.h.

double TxPlotData::getData ( int i,
int j ) const [inline]
 

get the data point from row i and column j.

Definition at line 197 of file TxPlotData.h.

const double * TxPlotData::getDataPtr ( int i,
int j ) const [inline]
 

get a constant pointer to the data point in row i and column j.

Definition at line 200 of file TxPlotData.h.

Referenced by TxLinePlotData::getDataRow(), TxLinePlotData::getXSeries(), and TxLinePlotData::getYSeries().

double & TxPlotData::getDataRef ( int i,
int j ) const [inline, protected]
 

get a reference to the data point in row i and column j.

Definition at line 227 of file TxPlotData.h.

int TxPlotData::getMaxNumColumns ( ) const [inline]
 

get the maximum number of columns, where each column corresponds to a particular point.

Definition at line 188 of file TxPlotData.h.

int TxPlotData::getMaxNumRows ( ) const [inline]
 

get the maximum number of rows, where each row corresponds to a data set.

Definition at line 185 of file TxPlotData.h.

Referenced by TxLinePlotData::getMaxNumSeries().

int TxPlotData::getNumColumns ( ) const [inline]
 

get the actual number of columns, where each column corresponds to a particular point.

Definition at line 194 of file TxPlotData.h.

Referenced by appendColumn(), and TxLinePlotData::getNumValuesCalculated().

int TxPlotData::getNumPlots ( ) const [pure virtual]
 

get the number of plots to be generated.

Returns:
the number

Reimplemented in TxLinePlotData.

int TxPlotData::getNumRows ( ) const [inline]
 

get the actual number of rows, where each row corresponds to a data set.

Definition at line 191 of file TxPlotData.h.

Referenced by appendRow().

const TXSTD::string TxPlotData::getTitle ( int i ) const [pure virtual]
 

get the title of the i'th plot.

Returns:
the title of the i'th plot

Reimplemented in TxLinePlotData.

const TXSTD::string TxPlotData::getXLabel ( int i ) const [pure virtual]
 

get the horizontal axis label of the i'th plot.

Returns:
the horizontal axis label of the i'th plot

Reimplemented in TxLinePlotData.

double TxPlotData::getXMax ( int i ) const [pure virtual]
 

get the maximum horizontal value for the data of the i'th plot.

Reimplemented in TxLinePlotData.

double TxPlotData::getXMaxPlot ( int i ) const [pure virtual]
 

get the maximum horizontal axis value for the i'th plot.

Reimplemented in TxLinePlotData.

double TxPlotData::getXMin ( int i ) const [pure virtual]
 

get the minimum horizontal value for the data of the i'th plot.

Parameters:
i   the index of the plot

Returns:
the minimum horizontal value

Reimplemented in TxLinePlotData.

double TxPlotData::getXMinPlot ( int i ) const [pure virtual]
 

get the minimum horizontal axis value for the i'th plot.

Reimplemented in TxLinePlotData.

const TXSTD::string TxPlotData::getYLabel ( int i ) const [pure virtual]
 

get the vertical axis label of the i'th plot.

Reimplemented in TxLinePlotData.

double TxPlotData::getYMax ( int i ) const [pure virtual]
 

get the maximum vertical value for the data of the i'th plot.

Reimplemented in TxLinePlotData.

double TxPlotData::getYMaxPlot ( int i ) const [pure virtual]
 

get the maximum vertical axis value for the i'th plot.

Reimplemented in TxLinePlotData.

double TxPlotData::getYMin ( int i ) const [pure virtual]
 

get the minimum vertical value for the data of the i'th plot.

Reimplemented in TxLinePlotData.

double TxPlotData::getYMinPlot ( int i ) const [pure virtual]
 

get the minimum vertical axis value for the i'th plot.

Reimplemented in TxLinePlotData.

int TxPlotData::moreData ( ) [pure virtual]
 

Get more data points.

Return nonzero if further data remains to be calculated. This approach is required because the GUI is not yet threaded.

Reimplemented in TestLinePlotData.

const TxPlotData & TxPlotData::operator= ( const TxPlotData & ) [private]
 

prevent public use of the assignment operator.

Reimplemented in TxLinePlotData.

void TxPlotData::optionsChanged ( ) [virtual]
 

Hook called after options in hash table have changed.

Reimplemented in TxLinePlotData, and TxLinePlotDataAux.

void TxPlotData::paramsChanged ( ) [virtual]
 

Hook called after parameters in hash table have changed.

Reimplemented in TxLinePlotData, and TxLinePlotDataAux.

void TxPlotData::restart ( ) [virtual]
 

clean up object and begin again.

Reimplemented in TxLinePlotData.

void TxPlotData::setColumn ( int i,
double * dptr,
int rmn,
int rmx ) [protected]
 

set values for data in specified row interval of specified column.

Parameters:
i   the column to set data of
dptr   pointer to the data for setting
rmn   the first row to set
rmx   one more than the last row to set

void TxPlotData::setColumn ( int i,
double * ) [protected]
 

set the data for all of the specified column (double* better have a valid dimension).

Referenced by appendColumn().

void TxPlotData::setComplete ( int iflag = 1 ) [inline, protected]
 

set flag to indicate that generation of plot data is complete.

Definition at line 210 of file TxPlotData.h.

void TxPlotData::setData ( int,
int,
double ) [protected]
 

set the value for the data point in specified row and column.

void TxPlotData::setMaxNumColumns ( int ) [protected]
 

set the maximum number of columns for the entire plotting data set.

Referenced by TxLinePlotData::setMaxDataPoints().

void TxPlotData::setMaxNumRows ( int ) [protected]
 

set the maximum number of rows for the entire plotting data set.

Referenced by TxLinePlotData::setMaxNumSeries().

void TxPlotData::setNumColumns ( int ) [protected]
 

set the actual number of columns for the plotting data set.

Referenced by TxLinePlotData::setNumValuesCalculated().

void TxPlotData::setNumRows ( int ) [protected]
 

set the actual number of rows for the plotting data set.

void TxPlotData::setRow ( int,
double *,
int,
int ) [protected]
 

set values for data in specified column interval of specified row.

The specified double* better have the appropriate dimension.

void TxPlotData::setRow ( int i,
double * ) [protected]
 

set the data for all of the specified row (double* better have a valid dimension).

Referenced by appendRow().

void TxPlotData::stringsChanged ( ) [virtual]
 

Hook called after strings in hash table have changed.

Reimplemented in TxLinePlotData, and TxLinePlotDataAux.


Member Data Documentation

double TxPlotData::chgMemRatio [static, private]
 

Memory changes by this ratio at each request for a change in row or column sizes.

Definition at line 283 of file TxPlotData.h.

int TxPlotData::completed [private]
 

Boolean signifying completion.

Definition at line 305 of file TxPlotData.h.

double * TxPlotData::data [private]
 

pointer to the data that will be plotted.

Definition at line 295 of file TxPlotData.h.

int TxPlotData::maxNumCols [private]
 

maximum number of columns, where each column corresponds to a data point.

Definition at line 292 of file TxPlotData.h.

int TxPlotData::maxNumRows [private]
 

maximum number of rows, where each row constitutes a separate data set.

Definition at line 289 of file TxPlotData.h.

int TxPlotData::numCols [private]
 

number of columns filled so far, where each column corresponds to a data point.

Definition at line 302 of file TxPlotData.h.

int TxPlotData::numRows [private]
 

actual number of rows, where each row constitutes a separate data set.

Definition at line 298 of file TxPlotData.h.

int TxPlotData::size [private]
 

specifies allocated memory.

Definition at line 286 of file TxPlotData.h.

double TxPlotData::version [static, private]
 

version of the library.

Definition at line 308 of file TxPlotData.h.


The documentation for this class was generated from the following file: Copyright Tech-X Corporation, all rights reserved.