Version: 0.6.0

#include <axis.h>

Inheritance diagram for Axis:
Collaboration diagram for Axis:

Public Member Functions

 Axis (AXIS_LOCATION location)
 
AXIS_LOCATION GetLocation ()
 
bool IsVertical ()
 
bool IsHorizontal ()
 
void SetMargins (wxCoord marginMin, wxCoord marginMax)
 
size_t GetDatasetCount ()
 
DatasetGetDataset (size_t index)
 
void SetZoomPanMode ()
 
void SetWindowWidth (double winWidth)
 
double GetWindowWidth ()
 
void SetWindowPosition (double winPos)
 
double GetWindowPosition ()
 
void SetUseWindow (bool useWin)
 
void SetWindow (double winPos, double winWidth)
 
bool IntersectsWindow (double v0, double v1)
 
void GetWindowBounds (double &winMin, double &winMax)
 
void AddDataset (Dataset *dataset)
 
virtual void GetDataBounds (double &minValue, double &maxValue) const =0
 
virtual wxCoord GetExtent (wxDC &dc)=0
 
virtual bool IsVisible (double value)
 
virtual double BoundValue (double value)
 
virtual wxCoord ToGraphics (wxDC &dc, int minCoord, int gRange, double value)
 
virtual double ToData (wxDC &dc, int minCoord, int gRange, wxCoord g)
 
virtual void UpdateBounds ()=0
 
virtual void Draw (wxDC &dc, wxRect rc)=0
 
virtual void DrawGridLines (wxDC &dc, wxRect rcData)=0
 
- Public Member Functions inherited from Observable< AxisObserver >
void AddObserver (AxisObserver *_observer)
 
void RemoveObserver (AxisObserver *_observer)
 

Protected Member Functions

virtual bool AcceptDataset (Dataset *dataset)=0
 
 FIRE_WITH_THIS (AxisChanged)
 
 FIRE_WITH_THIS (BoundsChanged)
 

Protected Attributes

DatasetArray m_datasets
 
wxPen m_gridLinesPen
 
wxCoord m_marginMin
 
wxCoord m_marginMax
 
double m_winPos
 
double m_winWidth
 
bool m_useWin
 
- Protected Attributes inherited from Observable< AxisObserver >
std::vector< AxisObserver * > observers
 

Friends

class Plot
 
class AxisShare
 

Additional Inherited Members

- Public Types inherited from Observable< AxisObserver >
typedef AxisObserver Observer
 
- Public Attributes inherited from Observable< AxisObserver >
std::vector< AxisObserver * >
::iterator 
OIt
 

Detailed Description

Base class for all axes. Axis has following attributes:

  1. Location - where axis arranged on plot, can be: AXIS_LEFT, AXIS_RIGHT, AXIS_TOP, AXIS_BOTTOM.
  2. Margins - distance from plot edges to axis labels.
  3. Window - visible subset of data. Window has width and position. Width means how much data points is visible at once, position is first data item visible.

Constructor & Destructor Documentation

Axis::Axis ( AXIS_LOCATION  location)

Constructs new axis.

Parameters
locationaxis location (cannot be changed after axis created)

Member Function Documentation

virtual bool Axis::AcceptDataset ( Dataset dataset)
protectedpure virtual

Checks whether dataset can be accepted by this axis. Must be implemented by derivative classes. XXX: maybe remove this method later.

Parameters
datasetdataset to be checked
Returns
true - if dataset can be accepted, false overwise

Implemented in AxisShare, NumberAxis, CompDateAxis, DateAxis, and CategoryAxis.

Here is the caller graph for this function:

void Axis::AddDataset ( Dataset dataset)
inline

internal. Don't use from programs.

Here is the call graph for this function:

double Axis::BoundValue ( double  value)
virtual

Returns nearest boundary value.

Parameters
valueout of bounds value, for which will be returned boundary value
Returns
nearest boundary value

Reimplemented in AxisShare, and LogarithmicNumberAxis.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void Axis::Draw ( wxDC &  dc,
wxRect  rc 
)
pure virtual

Performs axis drawing.

Parameters
dcdevice context
rcrectangle where to draw

Implemented in AxisShare, LabelAxis, and CompDateAxis.

Here is the caller graph for this function:

virtual void Axis::DrawGridLines ( wxDC &  dc,
wxRect  rcData 
)
pure virtual

Draws grid lines for axis.

Parameters
dcdevice context
rcdata area rectangle of plot

Implemented in AxisShare, LabelAxis, and CompDateAxis.

Here is the caller graph for this function:

virtual void Axis::GetDataBounds ( double &  minValue,
double &  maxValue 
) const
pure virtual

Returns data bounds.

Parameters
minValueoutput minimal data value
maxValueoutput maximal data value

Implemented in AxisShare, NumberAxis, CompDateAxis, DateAxis, and CategoryAxis.

Here is the caller graph for this function:

Dataset * Axis::GetDataset ( size_t  index)

Returns dataset, linked with this axis at specified index.

Parameters
indexdataset index
Returns
dataset at index

Here is the caller graph for this function:

size_t Axis::GetDatasetCount ( )

Returns dataset counts, linked with this axis.

Returns
dataset counts, linked with this axis
virtual wxCoord Axis::GetExtent ( wxDC &  dc)
pure virtual

Used to determine minimal size needed to draw axis contents, minimal width for vertical axes, minimal height for horizontal.

Parameters
dcdevice context
Returns
extent

Implemented in AxisShare, LabelAxis, and CompDateAxis.

Here is the caller graph for this function:

AXIS_LOCATION Axis::GetLocation ( )
inline

Returns axis location.

Returns
axis location

Here is the caller graph for this function:

void Axis::GetWindowBounds ( double &  winMin,
double &  winMax 
)
inline

Returns window bounds. If window is not used, simply returns data bounds.

Parameters
winMinout for window minimal
winMaxout for window maximal

Here is the call graph for this function:

double Axis::GetWindowPosition ( )
inline

Returns window position.

Returns
window position
double Axis::GetWindowWidth ( )
inline

Returns window width.

Returns
window width
bool Axis::IntersectsWindow ( double  v0,
double  v1 
)

Checks whether line in data space intersects window.

Parameters
v0line begin in data space
v0line end in data space
Returns
true if line intersects window

Here is the call graph for this function:

Here is the caller graph for this function:

bool Axis::IsHorizontal ( )
inline

Checks whether axis is horizontal.

Returns
true if axis is horizontal, false - overwise

Here is the call graph for this function:

bool Axis::IsVertical ( )
inline

Checks whether axis is vertical.

Returns
true if axis is vertical, false - overwise

Here is the caller graph for this function:

bool Axis::IsVisible ( double  value)
virtual

Checks whether data value is visible.

Parameters
valuevalue in data space
Returns
true if data value is visible

Reimplemented in AxisShare, and LogarithmicNumberAxis.

Here is the call graph for this function:

Here is the caller graph for this function:

void Axis::SetMargins ( wxCoord  marginMin,
wxCoord  marginMax 
)

Sets minimal/maximal margins for axis. Eg bottom/top for vertical axes, left/right for horizontal.

Parameters
marginMinnew minimal margin
marginMaxnew maximal margin
void Axis::SetUseWindow ( bool  useWin)
inline

Sets whether to use window.

Parameters
useWintrue to use window
void Axis::SetWindow ( double  winPos,
double  winWidth 
)
inline

Sets window params (position and width). Window params are in data space.

Parameters
winPosnew window position
winWidthnew window width

Here is the caller graph for this function:

void Axis::SetWindowPosition ( double  winPos)
inline

Sets window position. Window position is in data space.

Parameters
winPosnew window position

Here is the call graph for this function:

void Axis::SetWindowWidth ( double  winWidth)
inline

Sets window width. Window width is in data space.

Parameters
winWidthnew window width

Here is the call graph for this function:

double Axis::ToData ( wxDC &  dc,
int  minCoord,
int  gRange,
wxCoord  g 
)
virtual

Transforms coordinate from graphics space to data space.

Parameters
dcdevice context
minCoordminimal graphics space coordinate
gRangegraphics space range
valuevalue in data space
Returns
coordinate in data space

Reimplemented in AxisShare, LogarithmicNumberAxis, and CompDateAxis.

Here is the call graph for this function:

Here is the caller graph for this function:

wxCoord Axis::ToGraphics ( wxDC &  dc,
int  minCoord,
int  gRange,
double  value 
)
virtual

Transforms coordinate from data space to graphics space.

Parameters
dcdevice context
minCoordminimal graphics space coordinate
gRangegraphics space range
valuevalue in data space
Returns
value in graphics space

Reimplemented in AxisShare, CompDateAxis, and LogarithmicNumberAxis.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void Axis::UpdateBounds ( )
pure virtual

Performs axis bounds update after dataset/s change.

Implemented in AxisShare, CompDateAxis, DateAxis, CategoryAxis, LogarithmicNumberAxis, and NumberAxis.

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
  • /home/bishop/work/projects/nextgismanager/include/freechart/wx/axis/axis.h
  • /home/bishop/work/projects/nextgismanager/src/freechart/axis/axis.cpp