smtk::plotter_2d Class Reference

an interactive 2D plotter that links with your code
Reference Tutorial Example Code
smtk::plotter_2d interactive phase space plotter
damped_SHO.cpp
damped_pendulum.cpp
lotka_volterra.cpp
multi_plot.cpp
More...

Inheritance diagram for smtk::plotter_2d:

Inheritance graph
[legend]
List of all members.

Public Member Functions

plotter_2dadd_input (long double *x, const char *label)
plotter_2dadd_input (long double *x, const char **labels, int num=1)
plotter_2dadd_input (double *x, const char *label)
plotter_2dadd_input (double *x, const char **labels, int num=1)
plotter_2dadd_input (float *x, const char *label)
plotter_2dadd_input (float *x, const char **labels, int num=1)
bool is_invalid (void) const
 see if the object is invalid
bool is_valid (void) const
 see if the object is valid
 plotter_2d (int *argc=0, char ***argv=0)
plotter_2drun (void)
plotter_2dset_callbacks (int num_plots, double *(*init)(double x, double y, bool &do_draw), double *(*step)(bool &do_draw, bool &show_line))
plotter_2dset_line_width (int width)
plotter_2dset_point_width (int width)
plotter_2dset_scale (double x_min, double x_max, double y_min, double y_max)
plotter_2dset_window_title (const char *title)
plotter_2dstop (void)
virtual ~plotter_2d (void)

Protected Member Functions

template<class T>
invalidate (T t)
 invalidate the object
void invalidate (void)
 invalidate the object
template<class T>
validate (T t)
 validate the object
void validate (void)
 validate the object

Detailed Description

an interactive 2D plotter that links with your code
Reference Tutorial Example Code
smtk::plotter_2d interactive phase space plotter
damped_SHO.cpp
damped_pendulum.cpp
lotka_volterra.cpp
multi_plot.cpp

This class provides a 2D graphical user interface (GUI) display for your code. You can use it to, for example, make an interactive phase space plotter. The GUI will provide a way to control your simulation with minimal coding. The idea of this is to abstract a 2D display that provides additional functionality to a users simple simulation code. This can be use to provide a interactive 2D display for a interactive processes like: - phase space of ODE solver, - interactive map solver, and - bifurcation diagrams.


Constructor & Destructor Documentation

plotter_2d::plotter_2d ( int *  argc = 0,
char ***  argv = 0 
)

Parameters:
argc is passed to the GUI (graphical user interface) initialization function.
argv is passed to the GUI initialization function.

plotter_2d::~plotter_2d ( void   )  [virtual]

Close window and clean memory.


Member Function Documentation

plotter_2d & plotter_2d::add_input ( long double *  x,
const char *  label 
)

Add an input GUI (graphical user interface) to control the value of a long double.

Parameters:
x a pointer to the long double to control the value of.
label a pointer to label string.
Returns:
a reference to the this object.

plotter_2d & plotter_2d::add_input ( long double *  x,
const char **  labels,
int  num = 1 
)

Add an many input GUI (graphical user interface) to control the value of many long doubles.

Parameters:
x a pointer to the long double to control the value of.
labels a pointer to an array of label strings.
num the number of values to widgetize.
Returns:
a reference to the this object.

plotter_2d & plotter_2d::add_input ( double *  x,
const char *  label 
)

Add an input GUI (graphical user interface) to control the value of a double.

Parameters:
x a pointer to the double to control the value of.
label a pointer to label string.
Returns:
a reference to the this object.

plotter_2d & plotter_2d::add_input ( double *  x,
const char **  labels,
int  num = 1 
)

Add an many input GUI (graphical user interface) to control the value of many doubles.

Parameters:
x a pointer to the double to control the value of.
labels a pointer to an array of label strings.
num the number of values to widgetize.
Returns:
a reference to the this object.

plotter_2d & plotter_2d::add_input ( float *  x,
const char *  label 
)

Add an input GUI (graphical user interface) to control the value of a float.

Parameters:
x a pointer to the float to control the value of.
label a pointer to label string.
Returns:
a reference to the this object.

plotter_2d & plotter_2d::add_input ( float *  x,
const char **  labels,
int  num = 1 
)

Add an many input GUI (graphical user interface) to control the value of many floats.

Parameters:
x a pointer to the float to control the value of.
labels a pointer to an array of label strings.
num the number of values to widgetize.
Returns:
a reference to the this object.

template<class T>
T smtk::validation::invalidate ( t  )  [inline, protected, inherited]

invalidate the object

Make the object invalid.

Returns:
t the argument the user passed.

void smtk::validation::invalidate ( void   )  [inline, protected, inherited]

invalidate the object

Make the object invalid.

bool smtk::validation::is_invalid ( void   )  const [inline, inherited]

see if the object is invalid

Returns:
true if the object is invalid, and false if not.

bool smtk::validation::is_valid ( void   )  const [inline, inherited]

see if the object is valid

Returns:
true if the object is valid, and false if not.

plotter_2d & plotter_2d::run ( void   ) 

Run the GUI (graphical user interface). This not return until the GUI is closed.

Returns:
a reference to the this object.

plotter_2d & plotter_2d::set_callbacks ( int  num_plots,
double *(*)(double x, double y, bool &do_draw)  init,
double *(*)(bool &do_draw, bool &show_line)  step 
)

Parameters:
num_plots is the number of x-y points that are in the returned double array.
init is the callback that will be called each time the plotting starts.
step is the callback that will be called again and again until it is stopped. The show_line will be passed to the step callback function each time it's called. If the step callback function sets show_line to false than the line will to be drawn between this step point and the last step point. If do_draw is set to false when the step callback is called than the will be no points or lines drawn from that call.
Returns:
a reference to the this object.

plotter_2d & plotter_2d::set_line_width ( int  width  ) 

In order to be effective, this must be called after the set_callbacks().

Parameters:
width is the width to set all lines in the plotter. If width is less than 0 then there will be no lines drawn.
Returns:
a reference to the this object.

plotter_2d & plotter_2d::set_point_width ( int  width  ) 

In order to be effective, this must be called after the set_callbacks().

Parameters:
width is the width to set all points in the plotter. If width is less than 0 then there will be no points drawn.
Returns:
a reference to the this object.

plotter_2d & plotter_2d::set_scale ( double  x_min,
double  x_max,
double  y_min,
double  y_max 
)

Parameters:
x_min is the minimum x value in the 2D display when the window first opens.
x_max is the maximum x value in the 2D display when the window first opens.
y_min is the minimum y value in the 2D display when the window first opens.
y_max is the maximum y value in the 2D display when the window first opens.
Returns:
a reference to the this object.

plotter_2d & plotter_2d::set_window_title ( const char *  title  ) 

Returns:
a reference to the this object.

plotter_2d & plotter_2d::stop ( void   ) 

Stop the step callback from being called and stop drawing. This does the same thing as hitting the stop button.

Returns:
a reference to the this object.

template<class T>
T smtk::validation::validate ( t  )  [inline, protected, inherited]

validate the object

Make the object valid.

Returns:
t the argument the user passed.

void smtk::validation::validate ( void   )  [inline, protected, inherited]

validate the object

Make the object valid.


The documentation for this class was generated from the following files:
Generated on Sat Aug 11 22:25:57 2007 for Simulation Toolkit (SmTk) by  doxygen 1.5.2