MRPT logo

mrpt::gui::CDisplayWindowPlots Class Reference

Create a GUI window and display plots with MATLAB-like interfaces and commands. More...

#include <mrpt/gui/CDisplayWindowPlots.h>

Inheritance diagram for mrpt::gui::CDisplayWindowPlots:

mrpt::utils::CSerializable

List of all members.

Public Member Functions

void * getWxObject ()
 Read-only access to the wxDialog object.
void notifyChildWindowDestruction ()
 Called by wx main thread to set m_hwnd to NULL.
 CDisplayWindowPlots (const std::string &windowCaption=std::string(), unsigned int initialWidth=350, unsigned int initialHeight=300)
 Constructor.
 ~CDisplayWindowPlots ()
 Destructor.
bool isOpen ()
 Returns false if the user has already closed the window.
void resize (unsigned int width, unsigned int height)
 Resizes the window, stretching the image to fit into the display area.
void setPos (int x, int y)
 Changes the position of the window on the screen.
int waitForKey ()
 Waits for any key to be pushed on the image or the console, and returns the key code.
bool keyHit () const
 Returns true if a key has been pushed, without blocking waiting for a new key being pushed.
void clearKeyHitFlag ()
 Assure that "keyHit" will return false until the next pushed key.
void setWindowTitle (const std::string &str)
 Changes the window title text.
void enableMousePanZoom (bool enabled)
 Enable/disable the feature of pan/zoom with the mouse (default=enabled).
void plot (const vector_float &x, const vector_float &y, const std::string &lineFormat, const std::string &plotName=std::string("plotXY"))
 Adds a new layer with a 2D plot based on two vectors of X and Y points, using a MATLAB-like syntax.
void plot (const vector_double &x, const vector_double &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY"))
 Adds a new layer with a 2D plot based on two vectors of X and Y points, using a MATLAB-like syntax.
void plot (const vector_float &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY"))
 Adds a new layer with a 2D plot based on the vector Y, using a MATLAB-like syntax.
void plot (const vector_double &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY"))
void axis (float x_min, float x_max, float y_min, float y_max, bool aspectRatioFix=false)
 Set the view area according to the passed coordinated.
void axis_equal (bool enable=true)
 Enable/disable the fixed X/Y aspect ratio fix feature (default=disabled).
void axis_fit (bool aspectRatioFix=false)
 Fix automatically the view area according to existing graphs.
void plotEllipse (const float &mean_x, const float &mean_y, const CMatrixFloat &cov22, const float &quantiles, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotEllipse"))
 Plots a 2D ellipse given its mean, covariance matrix, and Each call to this function creates a new plot, unless the plot name coincides with an already existing plot: in this case the new values are used to update this existing layer (this also applies to using the default plot name).
void image (const utils::CMRPTImage &img, const float &x_left, const float &y_bottom, const float &x_width, const float &y_height, const std::string &plotName=std::string("plotEllipse"))
 Adds a bitmap image layer.

Public Attributes

synch::CSemaphore m_semThreadReady
 This semaphore will be signaled when the wx window is built and ready.
synch::CSemaphore m_semWindowDestroyed
 This semaphore will be signaled when the wx window is destroyed.

Protected Attributes

std::string m_caption
 The caption of the window:.
void_ptr_noncopy m_hwnd
 The window's handle.
volatile int m_keyPushed
 Auxiliary.
volatile int m_keyPushedCode

Friends

class CWindowDialogPlots


Detailed Description

Create a GUI window and display plots with MATLAB-like interfaces and commands.

See CDisplayWindowPlots::plot

Definition at line 55 of file CDisplayWindowPlots.h.


Constructor & Destructor Documentation

mrpt::gui::CDisplayWindowPlots::CDisplayWindowPlots ( const std::string &  windowCaption = std::string(),
unsigned int  initialWidth = 350,
unsigned int  initialHeight = 300 
)

Constructor.

mrpt::gui::CDisplayWindowPlots::~CDisplayWindowPlots (  ) 

Destructor.


Member Function Documentation

void mrpt::gui::CDisplayWindowPlots::axis ( float  x_min,
float  x_max,
float  y_min,
float  y_max,
bool  aspectRatioFix = false 
)

Set the view area according to the passed coordinated.

void mrpt::gui::CDisplayWindowPlots::axis_equal ( bool  enable = true  ) 

Enable/disable the fixed X/Y aspect ratio fix feature (default=disabled).

void mrpt::gui::CDisplayWindowPlots::axis_fit ( bool  aspectRatioFix = false  ) 

Fix automatically the view area according to existing graphs.

void mrpt::gui::CDisplayWindowPlots::clearKeyHitFlag (  )  [inline]

Assure that "keyHit" will return false until the next pushed key.

See also:
keyHit, waitForKey

Definition at line 134 of file CDisplayWindowPlots.h.

void mrpt::gui::CDisplayWindowPlots::enableMousePanZoom ( bool  enabled  ) 

Enable/disable the feature of pan/zoom with the mouse (default=enabled).

void* mrpt::gui::CDisplayWindowPlots::getWxObject (  )  [inline]

Read-only access to the wxDialog object.

Definition at line 74 of file CDisplayWindowPlots.h.

void mrpt::gui::CDisplayWindowPlots::image ( const utils::CMRPTImage img,
const float &  x_left,
const float &  y_bottom,
const float &  x_width,
const float &  y_height,
const std::string &  plotName = std::string("plotEllipse") 
)

Adds a bitmap image layer.

Each call to this function creates a new layer, unless the plot name coincides with an already existing plot: in this case the new values are used to update this existing layer (this also applies to using the default plot name).

See also:
axis, axis_equal, axis_fit

bool mrpt::gui::CDisplayWindowPlots::isOpen (  ) 

Returns false if the user has already closed the window.

bool mrpt::gui::CDisplayWindowPlots::keyHit (  )  const [inline]

Returns true if a key has been pushed, without blocking waiting for a new key being pushed.

See also:
waitForKey, clearKeyHitFlag

Definition at line 126 of file CDisplayWindowPlots.h.

void mrpt::gui::CDisplayWindowPlots::notifyChildWindowDestruction (  ) 

Called by wx main thread to set m_hwnd to NULL.

void mrpt::gui::CDisplayWindowPlots::plot ( const vector_double y,
const std::string &  lineFormat = std::string("b-"),
const std::string &  plotName = std::string("plotXY") 
)

void mrpt::gui::CDisplayWindowPlots::plot ( const vector_float y,
const std::string &  lineFormat = std::string("b-"),
const std::string &  plotName = std::string("plotXY") 
)

Adds a new layer with a 2D plot based on the vector Y, using a MATLAB-like syntax.

Each call to this function creates a new plot, unless the plot name coincides with an already existing plot: in this case the X & Y points are used to update this existing layer (this also applies to using the default plot name). The lineFormat string is a combination of the following characters:

  • Line styles:
    • '.': One point for each data point
    • '-': A continuous line
    • ':': A dashed line
  • Colors:
    • k: black
    • r: red
    • g: green
    • b: blue
    • m: magenta
    • c: cyan
  • Line width:
    • '1' to '9': The line width (default=1)

Examples:

  • 'r.' -> red points.
  • 'k3' or 'k-3' -> A black line with a line width of 3 pixels.
    See also:
    axis, axis_equal, axis_fit

void mrpt::gui::CDisplayWindowPlots::plot ( const vector_double x,
const vector_double y,
const std::string &  lineFormat = std::string("b-"),
const std::string &  plotName = std::string("plotXY") 
)

Adds a new layer with a 2D plot based on two vectors of X and Y points, using a MATLAB-like syntax.

Each call to this function creates a new plot, unless the plot name coincides with an already existing plot: in this case the X & Y points are used to update this existing layer (this also applies to using the default plot name). The lineFormat string is a combination of the following characters:

  • Line styles:
    • '.': One point for each data point
    • '-': A continuous line
    • ':': A dashed line
  • Colors:
    • k: black
    • r: red
    • g: green
    • b: blue
    • m: magenta
    • c: cyan
  • Line width:
    • '1' to '9': The line width (default=1)

Examples:

  • 'r.' -> red points.
  • 'k3' or 'k-3' -> A black line with a line width of 3 pixels.
    See also:
    axis, axis_equal, axis_fit

void mrpt::gui::CDisplayWindowPlots::plot ( const vector_float x,
const vector_float y,
const std::string &  lineFormat,
const std::string &  plotName = std::string("plotXY") 
)

Adds a new layer with a 2D plot based on two vectors of X and Y points, using a MATLAB-like syntax.

Each call to this function creates a new plot, unless the plot name coincides with an already existing plot: in this case the X & Y points are used to update this existing layer (this also applies to using the default plot name). The lineFormat string is a combination of the following characters:

  • Line styles:
    • '.': One point for each data point
    • '-': A continuous line
    • ':': A dashed line
  • Colors:
    • k: black
    • r: red
    • g: green
    • b: blue
    • m: magenta
    • c: cyan
  • Line width:
    • '1' to '9': The line width (default=1)

Examples:

  • 'r.' -> red points.
  • 'k3' or 'k-3' -> A black line with a line width of 3 pixels.
    See also:
    axis, axis_equal, axis_fit

void mrpt::gui::CDisplayWindowPlots::plotEllipse ( const float &  mean_x,
const float &  mean_y,
const CMatrixFloat cov22,
const float &  quantiles,
const std::string &  lineFormat = std::string("b-"),
const std::string &  plotName = std::string("plotEllipse") 
)

Plots a 2D ellipse given its mean, covariance matrix, and Each call to this function creates a new plot, unless the plot name coincides with an already existing plot: in this case the new values are used to update this existing layer (this also applies to using the default plot name).

For a description of lineFormat see CDisplayWindowPlots::plot. The "quantiles" value determines the confidence interval for the ellipse:

void mrpt::gui::CDisplayWindowPlots::resize ( unsigned int  width,
unsigned int  height 
)

Resizes the window, stretching the image to fit into the display area.

void mrpt::gui::CDisplayWindowPlots::setPos ( int  x,
int  y 
)

Changes the position of the window on the screen.

void mrpt::gui::CDisplayWindowPlots::setWindowTitle ( const std::string &  str  ) 

Changes the window title text.

int mrpt::gui::CDisplayWindowPlots::waitForKey (  ) 

Waits for any key to be pushed on the image or the console, and returns the key code.

Key codes are Virtual Key Codes from wxWidgets: http://docs.wxwidgets.org/stable/wx_keycodes.html


Friends And Related Function Documentation

friend class CWindowDialogPlots [friend]

Definition at line 60 of file CDisplayWindowPlots.h.


Member Data Documentation

The caption of the window:.

Definition at line 83 of file CDisplayWindowPlots.h.

The window's handle.

Definition at line 87 of file CDisplayWindowPlots.h.

Auxiliary.

Definition at line 91 of file CDisplayWindowPlots.h.

Definition at line 92 of file CDisplayWindowPlots.h.

This semaphore will be signaled when the wx window is built and ready.

Definition at line 65 of file CDisplayWindowPlots.h.

This semaphore will be signaled when the wx window is destroyed.

Definition at line 69 of file CDisplayWindowPlots.h.




Page generated by Doxygen 1.5.9 for MRPT 0.6.5 SVN:exported at Thu May 21 04:14:55 UTC 2009