[an error occurred while processing this directive]
Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Plot2DWindow Class Reference

a basic plot widget. More...

#include <Plot2D.h>

List of all members.

Public Member Functions

 Plot2DWindow (wxWindow *parent, int id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
 ~Plot2DWindow ()
void SetPoints (std::vector< hugin_utils::FDiff2D > &)
 set the curve points manually
template<class Functor>
void Plot (Functor &f, double startx, double endx, int nPoints=100)
 plot a function
void SetAxis (double xstart, double xend, double ystart, double yend)
 set axis limits manually
void AutoSizeAxis ()
 calculate the axis limits based on the current curve
void SetXSpacing (double x)
 set the spacing factor between the x and y labels
void SetYSpacing (double y)
void SetAxisDivLen (int x)
 size of tick marks on the axis
void SetBorder (int x, int y)
 width/height of border around the plot space
void AxisEqual (bool b)
 equal scaling factor on x and y axis
void SetAutosize (bool a)
 controls if the axis limits should be updated after each plot command

Protected Member Functions

wxPoint ToScreen (const hugin_utils::FDiff2D &p, const hugin_utils::FDiff2D &scale) const
void OnPaint (wxPaintEvent &event)
void Paint (wxDC &dc)
void PaintAxis (wxDC &dc, const hugin_utils::FDiff2D &scale)
double AxisRound (double d) const
void Invalidate ()

Protected Attributes

std::vector< hugin_utils::FDiff2Dm_points
double x_min
double y_min
double x_max
double y_max
double m_XSpacing
double m_YSpacing
int m_axisDivLen
bool m_axisEqual
bool m_autosize
int m_borderLeft
int m_borderRight
int m_borderTop
int m_borderBottom
wxPen m_curvePen
wxPen m_axisPen
wxPen m_gridPen

Detailed Description

a basic plot widget.

Can plot only one curve. the axis limits can be set or calculated automatically.

The contrib/plot stuff shipped with wxWidgets has a very strange behaviour and design. I can't think of a situtation where using it can be used...

This based on code I recycled from some university assignment I wrote several years ago.

Constructor & Destructor Documentation

Plot2DWindow::Plot2DWindow wxWindow *  parent,
int  id = -1,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = 0

Plot2DWindow::~Plot2DWindow  ) 

Member Function Documentation

void Plot2DWindow::AutoSizeAxis  ) 

calculate the axis limits based on the current curve

void Plot2DWindow::AxisEqual bool  b  )  [inline]

equal scaling factor on x and y axis

double Plot2DWindow::AxisRound double  d  )  const [protected]

void Plot2DWindow::Invalidate  )  [protected]

void Plot2DWindow::OnPaint wxPaintEvent &  event  )  [protected]

void Plot2DWindow::Paint wxDC &  dc  )  [protected]

void Plot2DWindow::PaintAxis wxDC &  dc,
const hugin_utils::FDiff2D scale

template<class Functor>
void Plot2DWindow::Plot Functor &  f,
double  startx,
double  endx,
int  nPoints = 100

plot a function

void Plot2DWindow::SetAutosize bool  a  )  [inline]

controls if the axis limits should be updated after each plot command

void Plot2DWindow::SetAxis double  xstart,
double  xend,
double  ystart,
double  yend

set axis limits manually

void Plot2DWindow::SetAxisDivLen int  x  ) 

size of tick marks on the axis

void Plot2DWindow::SetBorder int  x,
int  y

width/height of border around the plot space

void Plot2DWindow::SetPoints std::vector< hugin_utils::FDiff2D > &   ) 

set the curve points manually

void Plot2DWindow::SetXSpacing double  x  )  [inline]

set the spacing factor between the x and y labels

void Plot2DWindow::SetYSpacing double  y  )  [inline]

wxPoint Plot2DWindow::ToScreen const hugin_utils::FDiff2D p,
const hugin_utils::FDiff2D scale
const [protected]

Member Data Documentation

bool Plot2DWindow::m_autosize [protected]

int Plot2DWindow::m_axisDivLen [protected]

bool Plot2DWindow::m_axisEqual [protected]

wxPen Plot2DWindow::m_axisPen [protected]

int Plot2DWindow::m_borderBottom [protected]

int Plot2DWindow::m_borderLeft [protected]

int Plot2DWindow::m_borderRight [protected]

int Plot2DWindow::m_borderTop [protected]

wxPen Plot2DWindow::m_curvePen [protected]

wxPen Plot2DWindow::m_gridPen [protected]

std::vector<hugin_utils::FDiff2D> Plot2DWindow::m_points [protected]

double Plot2DWindow::m_XSpacing [protected]

double Plot2DWindow::m_YSpacing [protected]

double Plot2DWindow::x_max [protected]

double Plot2DWindow::x_min [protected]

double Plot2DWindow::y_max [protected]

double Plot2DWindow::y_min [protected]

The documentation for this class was generated from the following files:

Generated on Mon Sep 20 01:01:34 2010 for Hugintrunk by doxygen