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.

Definition at line 342 of file mathplot.h.

#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.

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.

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

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.

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 mpInfoCoords, and mpInfoLegend.

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 mpInfoCoords, and mpInfoLegend.

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.

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.

wxPoint mpInfoLayer::m_reference [protected]

Holds the reference point for movements.

Definition at line 403 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.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:46:17 UTC 2011