#include <mathplot.h>
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. |
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)
mpFXYVector::mpFXYVector | ( | wxString | name = wxEmptyString , |
|
int | flags = mpALIGN_NE | |||
) |
name | Label | |
flags | Label alignment, pass one of mpALIGN_NE, mpALIGN_NW, mpALIGN_SW, mpALIGN_SE. |
References mpLAYER_PLOT.
void mpFXYVector::Clear | ( | ) |
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] |
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 | |||
) |
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().