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

Detailed Description

Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rectangular info box in transparent overlay over plot layers.

It is used to implement objects like legends.

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

Inheritance diagram for mpInfoLayer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 mpInfoLayer ()
 Default constructor.
 mpInfoLayer (wxRect rect, const wxBrush *brush=wxTRANSPARENT_BRUSH)
 Complete constructor.
virtual ~mpInfoLayer ()
 Destructor.
virtual void UpdateInfo (mpWindow &w, wxEvent &event)
 Updates the content of the info box.
virtual bool HasBBox ()
 mpInfoLayer has not bounding box.
virtual void Plot (wxDC &dc, mpWindow &w)
 Plot method.
virtual bool IsInfo ()
 Specifies that this is an Info box layer.
virtual bool Inside (wxPoint &point)
 Checks whether a point is inside the info box rectangle.
virtual void Move (wxPoint delta)
 Moves the layer rectangle of given pixel deltas.
virtual void UpdateReference ()
 Updates the rectangle reference point.
wxPoint GetPosition ()
 Returns the position of the upper left corner of the box (in pixels)
wxSize GetSize ()
 Returns the size of the box (in pixels)
const wxRect & GetRectangle ()
 Returns the current rectangle coordinates.
virtual double GetMinX ()
 Get inclusive left border of bounding box.
virtual double GetMaxX ()
 Get inclusive right border of bounding box.
virtual double GetMinY ()
 Get inclusive bottom border of bounding box.
virtual double GetMaxY ()
 Get inclusive top border of bounding box.
wxString GetName () const
 Get layer name.
const wxFont & GetFont () const
 Get font set for this layer.
const wxPen & GetPen () const
 Get pen set for this layer.
void SetContinuity (bool continuity)
 Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points).
bool GetContinuity () const
 Gets the 'continuity' property of the layer.
void ShowName (bool show)
 Shows or hides the text label with the name of the layer (default is visible).
void SetName (wxString name)
 Set layer name.
void SetFont (wxFont &font)
 Set layer font.
void SetPen (wxPen pen)
 Set layer pen.
void SetDrawOutsideMargins (bool drawModeOutside)
 Set Draw mode: inside or outside margins.
bool GetDrawOutsideMargins ()
 Get Draw mode: inside or outside margins.
wxBitmap GetColourSquare (int side=16)
 Get a small square bitmap filled with the colour of the pen used in the layer.
mpLayerType GetLayerType ()
 Get layer type: a Layer can be of different types: plot lines, axis, info boxes, etc, this method returns the right value.
bool IsVisible ()
 Checks whether the layer is visible or not.
void SetVisible (bool show)
 Sets layer visibility.
const wxBrush & GetBrush () const
 Get brush set for this layer.
void SetBrush (wxBrush brush)
 Set layer brush.

Protected Attributes

wxRect m_dim
 The bounding rectangle of the box. It may be resized dynamically by the Plot method.
wxPoint m_reference
 Holds the reference point for movements.
wxBrush m_brush
 The brush to be used for the background.
int m_winX
int m_winY
 Holds the mpWindow size. Used to rescale position when window is resized.
wxFont m_font
 Layer's font.
wxPen m_pen
 Layer's pen.
wxString m_name
 Layer's name.
bool m_continuous
 Specify if the layer will be plotted as a continuous line or a set of points.
bool m_showName
 States whether the name of the layer must be shown (default is true).
bool m_drawOutsideMargins
 select if the layer should draw only inside margins or over all DC
mpLayerType m_type
 Define layer type, which is assigned by constructor.
bool m_visible
 Toggles layer visibility.

Constructor & Destructor Documentation

mpInfoLayer::mpInfoLayer ( )

Default constructor.

mpInfoLayer::mpInfoLayer ( wxRect  rect,
const wxBrush *  brush = wxTRANSPARENT_BRUSH 
)

Complete constructor.

Parameters:
rectSets the initial size rectangle of the layer.
brushpointer to a fill brush. Default is transparent
virtual mpInfoLayer::~mpInfoLayer ( ) [virtual]

Destructor.


Member Function Documentation

const wxBrush& mpLayer::GetBrush ( ) const [inline, inherited]

Get brush set for this layer.

Returns:
brush.

Definition at line 314 of file mathplot.h.

wxBitmap mpLayer::GetColourSquare ( int  side = 16) [inherited]

Get a small square bitmap filled with the colour of the pen used in the layer.

Useful to create legends or similar reference to the layers.

Parameters:
sideside length in pixels
Returns:
a wxBitmap filled with layer's colour
bool mpLayer::GetContinuity ( ) const [inline, inherited]

Gets the 'continuity' property of the layer.

See also:
SetContinuity

Definition at line 266 of file mathplot.h.

bool mpLayer::GetDrawOutsideMargins ( ) [inline, inherited]

Get Draw mode: inside or outside margins.

Returns:
The draw mode

Definition at line 293 of file mathplot.h.

const wxFont& mpLayer::GetFont ( ) const [inline, inherited]

Get font set for this layer.

Returns:
Font

Definition at line 251 of file mathplot.h.

mpLayerType mpLayer::GetLayerType ( ) [inline, inherited]

Get layer type: a Layer can be of different types: plot lines, axis, info boxes, etc, this method returns the right value.

Returns:
An integer indicating layer type

Definition at line 302 of file mathplot.h.

virtual double mpLayer::GetMaxX ( ) [inline, virtual, inherited]

Get inclusive right border of bounding box.

Returns:
Value

Reimplemented in mpBitmapLayer, mpMovableObject, and mpFXYVector.

Definition at line 188 of file mathplot.h.

virtual double mpLayer::GetMaxY ( ) [inline, virtual, inherited]

Get inclusive top border of bounding box.

Returns:
Value

Reimplemented in mpBitmapLayer, mpMovableObject, and mpFXYVector.

Definition at line 198 of file mathplot.h.

virtual double mpLayer::GetMinX ( ) [inline, virtual, inherited]

Get inclusive left border of bounding box.

Returns:
Value

Reimplemented in mpBitmapLayer, mpMovableObject, and mpFXYVector.

Definition at line 183 of file mathplot.h.

virtual double mpLayer::GetMinY ( ) [inline, virtual, inherited]

Get inclusive bottom border of bounding box.

Returns:
Value

Reimplemented in mpBitmapLayer, mpMovableObject, and mpFXYVector.

Definition at line 193 of file mathplot.h.

wxString mpLayer::GetName ( ) const [inline, inherited]

Get layer name.

Returns:
Name

Definition at line 246 of file mathplot.h.

const wxPen& mpLayer::GetPen ( ) const [inline, inherited]

Get pen set for this layer.

Returns:
Pen

Definition at line 256 of file mathplot.h.

wxPoint mpInfoLayer::GetPosition ( )

Returns the position of the upper left corner of the box (in pixels)

Returns:
The rectangle position
const wxRect& mpInfoLayer::GetRectangle ( ) [inline]

Returns the current rectangle coordinates.

Returns:
The info layer rectangle

Definition at line 399 of file mathplot.h.

wxSize mpInfoLayer::GetSize ( )

Returns the size of the box (in pixels)

Returns:
The rectangle size
virtual bool mpInfoLayer::HasBBox ( ) [inline, virtual]

mpInfoLayer has not bounding box.

See also:
mpLayer::HasBBox
Returns:
always FALSE

Reimplemented from mpLayer.

Definition at line 364 of file mathplot.h.

virtual bool mpInfoLayer::Inside ( wxPoint &  point) [virtual]

Checks whether a point is inside the info box rectangle.

Parameters:
pointThe point to be checked
Returns:
true if the point is inside the bounding box
virtual bool mpInfoLayer::IsInfo ( ) [inline, virtual]

Specifies that this is an Info box layer.

Returns:
always TRUE
See also:
mpLayer::IsInfo

Reimplemented from mpLayer.

Definition at line 375 of file mathplot.h.

bool mpLayer::IsVisible ( ) [inline, inherited]

Checks whether the layer is visible or not.

Returns:
true if visible

Definition at line 306 of file mathplot.h.

virtual void mpInfoLayer::Move ( wxPoint  delta) [virtual]

Moves the layer rectangle of given pixel deltas.

Parameters:
deltaThe wxPoint container for delta coordinates along x and y. Units are in pixels.
virtual void mpInfoLayer::Plot ( wxDC &  dc,
mpWindow w 
) [virtual]

Plot method.

Can be overidden by derived classes.

Parameters:
dcthe device content where to plot
wthe window to plot
See also:
mpLayer::Plot

Implements mpLayer.

Reimplemented in mpInfoLegend, and mpInfoCoords.

void mpLayer::SetBrush ( wxBrush  brush) [inline, inherited]

Set layer brush.

Parameters:
brushbrush, will be copied to internal class member

Definition at line 318 of file mathplot.h.

void mpLayer::SetContinuity ( bool  continuity) [inline, inherited]

Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points).

See also:
GetContinuity

Definition at line 261 of file mathplot.h.

void mpLayer::SetDrawOutsideMargins ( bool  drawModeOutside) [inline, inherited]

Set Draw mode: inside or outside margins.

Default is outside, which allows the layer to draw up to the mpWindow border.

Parameters:
drawModeOutsideThe draw mode to be set

Definition at line 289 of file mathplot.h.

void mpLayer::SetFont ( wxFont &  font) [inline, inherited]

Set layer font.

Parameters:
fontFont, will be copied to internal class member

Definition at line 280 of file mathplot.h.

void mpLayer::SetName ( wxString  name) [inline, inherited]

Set layer name.

Parameters:
nameName, will be copied to internal class member

Definition at line 275 of file mathplot.h.

void mpLayer::SetPen ( wxPen  pen) [inline, inherited]

Set layer pen.

Parameters:
penPen, will be copied to internal class member

Definition at line 285 of file mathplot.h.

void mpLayer::SetVisible ( bool  show) [inline, inherited]

Sets layer visibility.

Parameters:
showvisibility bool.

Definition at line 310 of file mathplot.h.

void mpLayer::ShowName ( bool  show) [inline, inherited]

Shows or hides the text label with the name of the layer (default is visible).

Definition at line 270 of file mathplot.h.

virtual void mpInfoLayer::UpdateInfo ( mpWindow w,
wxEvent &  event 
) [virtual]

Updates the content of the info box.

Should be overidden by derived classes. Update may behave in different ways according to the type of event which called it.

Parameters:
wparent mpWindow from which to obtain informations
eventThe event which called the update.

Reimplemented in mpInfoLegend, and mpInfoCoords.

virtual void mpInfoLayer::UpdateReference ( ) [virtual]

Updates the rectangle reference point.

Used by internal methods of mpWindow to correctly move mpInfoLayers.


Member Data Documentation

wxBrush mpInfoLayer::m_brush [protected]

The brush to be used for the background.

Reimplemented from mpLayer.

Definition at line 404 of file mathplot.h.

bool mpLayer::m_continuous [protected, inherited]

Specify if the layer will be plotted as a continuous line or a set of points.

Definition at line 325 of file mathplot.h.

wxRect mpInfoLayer::m_dim [protected]

The bounding rectangle of the box. It may be resized dynamically by the Plot method.

Definition at line 399 of file mathplot.h.

bool mpLayer::m_drawOutsideMargins [protected, inherited]

select if the layer should draw only inside margins or over all DC

Definition at line 327 of file mathplot.h.

wxFont mpLayer::m_font [protected, inherited]

Layer's font.

Definition at line 318 of file mathplot.h.

wxString mpLayer::m_name [protected, inherited]

Layer's name.

Definition at line 324 of file mathplot.h.

wxPen mpLayer::m_pen [protected, inherited]

Layer's pen.

Definition at line 322 of file mathplot.h.

wxPoint mpInfoLayer::m_reference [protected]

Holds the reference point for movements.

Definition at line 403 of file mathplot.h.

bool mpLayer::m_showName [protected, inherited]

States whether the name of the layer must be shown (default is true).

Definition at line 326 of file mathplot.h.

mpLayerType mpLayer::m_type [protected, inherited]

Define layer type, which is assigned by constructor.

Definition at line 328 of file mathplot.h.

bool mpLayer::m_visible [protected, inherited]

Toggles layer visibility.

Definition at line 329 of file mathplot.h.

int mpInfoLayer::m_winX [protected]

Definition at line 405 of file mathplot.h.

int mpInfoLayer::m_winY [protected]

Holds the mpWindow size. Used to rescale position when window is resized.

Definition at line 405 of file mathplot.h.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011