Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Protected Attributes

mpScaleY Class Reference


Detailed Description

Plot layer implementing a y-scale ruler.

If align is set to mpALIGN_CENTER, the ruler is fixed at X=0 in the coordinate system. If the align is set to mpALIGN_TOP or mpALIGN_BOTTOM, the axis is always drawn respectively at top or bottom of the window. A label is plotted at the top-right hand of the ruler. The scale numbering automatically adjusts to view and zoom factor.

Definition at line 747 of file mathplot.h.

#include <mrpt/otherlibs/mathplot/mathplot.h>

Inheritance diagram for mpScaleY:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 mpScaleY (wxString name=wxT("Y"), int flags=mpALIGN_CENTER, bool ticks=true)
virtual void Plot (wxDC &dc, mpWindow &w)
 Layer plot handler.
virtual bool HasBBox ()
 Check whether this layer has a bounding box.
void SetAlign (int align)
 Set Y axis alignment.
void SetTicks (bool ticks)
 Set Y axis ticks or grid.
bool GetTicks ()
 Get Y axis ticks or grid.
void SetLabelFormat (const wxString &format)
 Set Y axis Label format.
const wxString & SetLabelFormat ()
 Get Y axis Label format.

Protected Attributes

int m_flags
 Flag for axis alignment.
bool m_ticks
 Flag to toggle between ticks or grid.
wxString m_labelFormat
 Format string used to print labels.

Constructor & Destructor Documentation

mpScaleY::mpScaleY ( wxString  name = wxT("Y"),
int  flags = mpALIGN_CENTER,
bool  ticks = true 
)
Parameters:
nameLabel to plot by the ruler
flagsSet position of the scale respect to the window.
ticksSelect ticks or grid. Give TRUE (default) for drawing axis ticks, FALSE for drawing the grid

Member Function Documentation

bool mpScaleY::GetTicks ( ) [inline]

Get Y axis ticks or grid.

Returns:
TRUE if plot is drawing axis ticks, FALSE if the grid is active.

Definition at line 776 of file mathplot.h.

virtual bool mpScaleY::HasBBox ( ) [inline, virtual]

Check whether this layer has a bounding box.

This implementation returns FALSE thus making the ruler invisible to the plot layer bounding box calculation by mpWindow.

Reimplemented from mpLayer.

Definition at line 764 of file mathplot.h.

virtual void mpScaleY::Plot ( wxDC &  dc,
mpWindow w 
) [virtual]

Layer plot handler.

This implementation will plot the ruler adjusted to the visible area.

Implements mpLayer.

void mpScaleY::SetAlign ( int  align) [inline]

Set Y axis alignment.

Parameters:
alignalignment (choose between mpALIGN_BORDER_LEFT, mpALIGN_LEFT, mpALIGN_CENTER, mpALIGN_RIGHT, mpALIGN_BORDER_RIGHT)

Definition at line 768 of file mathplot.h.

void mpScaleY::SetLabelFormat ( const wxString &  format) [inline]

Set Y axis Label format.

Parameters:
formatThe format string

Definition at line 780 of file mathplot.h.

References mrpt::format().

const wxString& mpScaleY::SetLabelFormat ( ) [inline]

Get Y axis Label format.

Returns:
The format string

Definition at line 784 of file mathplot.h.

void mpScaleY::SetTicks ( bool  ticks) [inline]

Set Y axis ticks or grid.

Parameters:
ticksTRUE to plot axis ticks, FALSE to plot grid.

Definition at line 772 of file mathplot.h.


Member Data Documentation

int mpScaleY::m_flags [protected]

Flag for axis alignment.

Definition at line 784 of file mathplot.h.

wxString mpScaleY::m_labelFormat [protected]

Format string used to print labels.

Definition at line 789 of file mathplot.h.

bool mpScaleY::m_ticks [protected]

Flag to toggle between ticks or grid.

Definition at line 788 of file mathplot.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011