mpFXYVector Class Reference

#include <mathplot.h>

Inheritance diagram for mpFXYVector:
mpFXY mpLayer

List of all members.

Public Member Functions

 mpFXYVector (wxString name=wxEmptyString, int flags=mpALIGN_NE)
void SetData (const std::vector< double > &xs, const std::vector< double > &ys)
void Clear ()

Protected Member Functions

void Rewind ()
bool GetNextXY (double &x, double &y)
double GetMinX ()
double GetMinY ()
double GetMaxX ()
double GetMaxY ()

Protected Attributes

std::vector< double > m_xs
std::vector< double > m_ys
size_t m_index
double m_minX
double m_maxX
double m_minY
double m_maxY
int m_flags
 Holds label alignment.

Detailed Description

A class providing graphs functionality for a 2D plot (either continuous or a set of points), from vectors of data. This class can be used directly, the user does not need to derive any new class. Simply pass the data as two vectors with the same length containing the X and Y coordinates to the method SetData.

To generate a graph with a set of points, call

     layerVar->SetContinuity(false)

or

     layerVar->SetContinuity(true)

to render the sequence of coordinates as a continuous line.

(Added: Jose Luis Blanco, AGO-2007)


Constructor & Destructor Documentation

mpFXYVector::mpFXYVector ( wxString  name = wxEmptyString,
int  flags = mpALIGN_NE 
)
Parameters:
name Label
flags Label alignment, pass one of mpALIGN_NE, mpALIGN_NW, mpALIGN_SW, mpALIGN_SE.

References mpLAYER_PLOT.


Member Function Documentation

void mpFXYVector::Clear (  ) 

Clears all the data, leaving the layer empty.

See also:
SetData

References m_xs, and m_ys.

double mpFXYVector::GetMaxX (  )  [inline, protected, virtual]

Returns the actual maximum X data (loaded in SetData).

Reimplemented from mpLayer.

double mpFXYVector::GetMaxY (  )  [inline, protected, virtual]

Returns the actual maximum Y data (loaded in SetData).

Reimplemented from mpLayer.

double mpFXYVector::GetMinX (  )  [inline, protected, virtual]

Returns the actual minimum X data (loaded in SetData).

Reimplemented from mpLayer.

double mpFXYVector::GetMinY (  )  [inline, protected, virtual]

Returns the actual minimum Y data (loaded in SetData).

Reimplemented from mpLayer.

bool mpFXYVector::GetNextXY ( double &  x,
double &  y 
) [protected, virtual]

Get locus value for next N. Overridden in this implementation.

Parameters:
x Returns X value
y Returns Y value

Implements mpFXY.

References m_index, m_xs, and m_ys.

void mpFXYVector::Rewind (  )  [protected, virtual]

Rewind value enumeration with mpFXY::GetNextXY. Overridden in this implementation.

Implements mpFXY.

References m_index.

void mpFXYVector::SetData ( const std::vector< double > &  xs,
const std::vector< double > &  ys 
)

Changes the internal data: the set of points to draw. Both vectors MUST be of the same length. This method DOES NOT refresh the mpWindow; do it manually.

See also:
Clear

References m_maxX, m_maxY, m_minX, m_minY, m_xs, and m_ys.


Member Data Documentation

int mpFXYVector::m_flags [protected]

Holds label alignment.

Reimplemented from mpFXY.

size_t mpFXYVector::m_index [protected]

The internal counter for the "GetNextXY" interface

Referenced by GetNextXY(), and Rewind().

double mpFXYVector::m_maxX [protected]

Referenced by SetData().

double mpFXYVector::m_maxY [protected]

Referenced by SetData().

double mpFXYVector::m_minX [protected]

Loaded at SetData

Referenced by SetData().

double mpFXYVector::m_minY [protected]

Referenced by SetData().

std::vector<double> mpFXYVector::m_xs [protected]

The internal copy of the set of data to draw.

Referenced by Clear(), GetNextXY(), and SetData().

std::vector<double> mpFXYVector::m_ys [protected]

Referenced by Clear(), GetNextXY(), and SetData().


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

© 2003 David Schalig, 2007-2008 Davide Rondini. Generated on Sun Dec 13 12:39:25 2009 for wxMathPlot with Doxygen. Hosted on SourceForge.net Logo