#include <CPyPlot.hpp>
Public Types | |
enum | plotTypes { PLOT_SCATTER, PLOT_GRID, PLOT_RENDER, PLOT_PARTDATA } |
Signals | |
void | testsignal () |
Public Member Functions | |
CPyPlot (QWidget *parent, string xname="x", string yname="y", int type=0) | |
virtual | ~CPyPlot () |
Destructor. | |
virtual void | calculate (Matrix< float > *thedata=0) |
void | plot () |
void | addLimitingValue (Cvals *limitType, double limMin, double limMax) |
NOT IMPLEMENTED. | |
void | printArguments () |
void | setRun (int run) |
void | setFile (int file) |
int | getRun () const |
int | getFile () const |
int | getType () const |
virtual string | getWindowTitle () |
int | getNumPlots () const |
string | getXname () const |
string | getYname () const |
void | setXLimits (const double &xmin, const double &xmax) |
void | setYLimits (const double &ymin, const double &ymax) |
void | setLimits (const double &xmin, const double &xmax, const double &ymin, const double &ynax) |
Set the limits for the x- and y axes. | |
double | getXmin () const |
double | getXmax () const |
double | getYmin () const |
double | getYmax () const |
void | xLimits (double &xmin, double &xmax) |
void | yLimits (double &ymin, double &ymax) |
void | limits (double &xmin, double &xmax, double &ymin, double &ymax) |
void | setNParticles (const int &npart) |
int | getNParticles () const |
string | getPlotType () const |
void | emitsignal () |
Static Public Member Functions | |
static void | createNewPlot (const plotData &pd) |
Create a plot based on pd. | |
static CPyPlot * | getPlotPtr (const int &num) |
Protected Member Functions | |
virtual bool | do_plotting () |
void | addArgument (const string &name, const int &value) |
void | addArgument (const string &name, const double &value) |
void | addArgument (const string &name, const string &value) |
add a string to the argument list dictionary | |
void | addArgument (const string &name, PyObject *ref) |
PyObject * | getDict () const |
void | setPlotType (string type) |
void | resizeEvent (QResizeEvent *revent) |
Static Protected Member Functions | |
static void | importArray () |
import_array wrapper | |
Protected Attributes | |
int | type_ |
bool | calculated_ |
string | plotType_ |
QWidget * | pyWidget_ |
QMdiSubWindow * | mdiWin_ |
Private Attributes | |
vector< struct limit_data > | limitData |
int | run_ |
int | file_ |
int | number_ |
int | _nparticles |
string | xname_ |
string | yname_ |
double | xmin_ |
double | xmax_ |
double | ymin_ |
double | ymax_ |
PyObject * | argDict_ |
Static Private Attributes | |
static int | numPlots_ = 0 |
static vector< CPyPlot * > | plots_ |
static bool | _arraysImported = false |
base class for python plots. Generally you should derive from this class and implement a new class with specific functionality (e.g. 2D color plots, line plots, ...
You should override calculate and do_plotting. They used to be pure virtual but that gave problems when swigging this class.
enum CPyPlot::plotTypes |
< enumeration for the possible plot types
CPyPlot::CPyPlot | ( | QWidget * | myparent, | |
string | xname = "x" , |
|||
string | yname = "y" , |
|||
int | type = 0 | |||
) |
Constructor
void CPyPlot::addArgument | ( | const string & | name, | |
PyObject * | ref | |||
) | [protected] |
add a PyObject to the argument list dictionary
void CPyPlot::addArgument | ( | const string & | name, | |
const double & | value | |||
) | [protected] |
add a double to the argument list dictionary. Note: when using a name (key) that already exists the previous value is overwritten.
void CPyPlot::addArgument | ( | const string & | name, | |
const int & | value | |||
) | [protected] |
add an integer to the argument list dictionary
void CPyPlot::addLimitingValue | ( | Cvals * | limitType, | |
double | limMin, | |||
double | limMax | |||
) |
NOT IMPLEMENTED.
A condition for the particles to be elligible for plotting is added: the return value of limitType should lay between limMin and limMax
limitType | specifies where the program finds the value for each particle |
void CPyPlot::createNewPlot | ( | const plotData & | pd | ) | [static] |
Create a plot based on pd.
Based on the data inside pd a new plot is created.
string CPyPlot::getWindowTitle | ( | ) | [virtual] |
provides a default title, is virtual so can be overridden
void CPyPlot::plot | ( | ) |
first calls do_plotting, then sets some final attributes (e.g. window title) and then create the QWidget
void CPyPlot::printArguments | ( | ) |
print all the arguments currently in the argument list dictionary
void CPyPlot::setXLimits | ( | const double & | xmin, | |
const double & | xmax | |||
) |
Set the limits for the x axis
void CPyPlot::setYLimits | ( | const double & | ymin, | |
const double & | ymax | |||
) |
Set the limits for the y axis
int CPyPlot::_nparticles [private] |
number of particles present on the plot
PyObject* CPyPlot::argDict_ [private] |
pointer to a tuble, used as argument to the python function
int CPyPlot::file_ [private] |
number of the current snapshot
vector<struct limit_data> CPyPlot::limitData [private] |
Stores information about limiting values
QMdiSubWindow* CPyPlot::mdiWin_ [protected] |
Qt mdi window we are on
int CPyPlot::number_ [private] |
(unique) number of this plot (first: 0)
string CPyPlot::plotType_ [protected] |
What type is this plot? (e.g. colorplot, scatterplot, ...)
QWidget* CPyPlot::pyWidget_ [protected] |
Qt widget created by python (contains the plot)
int CPyPlot::run_ [private] |
number of the simulation
int CPyPlot::type_ [protected] |
type of the particles on the plot
Reimplemented in CPyScatterPlot.