#include <QtDisplay.h>
Inheritance diagram for QtDisplay:
The purpose of this class is to provide an interface for Python running in a different thread from the application. It locks the QApplication object before forwarding messages to the contained PlotterBase object. It unlocks the QApplication object upon return.
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>
Definition at line 54 of file QtDisplay.h.
Public Member Functions | |
void | addDataRep (PyFunctionRep *pyFuncRep) |
Adds a Function (as PyFunctionRep). | |
void | addDataRep (PyDataRep *pyRep) |
Adds a DataRep created within Python. | |
void | addDataRep (const std::string &type, const DataSource *ntuple, const std::vector< std::string > &bindings) |
Creates and adds a DataRep to the display. | |
void | addDataRepStacked (const std::string &type, const DataSource *ntuple, const std::vector< std::string > &bindings) |
Adds a DataRep to the display by stacking, i.e. | |
void | addFunction (FunctionBase *function) |
Adds a Function (as a FunctionBase object). | |
void | addObserver (hippodraw::Observer *observer) |
Adds an observer to PlotterBase object. | |
void | addValues (const std::vector< double > &v) |
Adds the values to the display. | |
PyDataSource * | createDataArray () const |
Creates a data array wrapper for the contents of the display. | |
NTuple * | createNTuple () const |
Creates and returns an NTuple representing the display. | |
int | currentView () |
Return the current view index. | |
void | deleteView (int index) |
Delete a view by index. | |
PlotterBase * | display () |
Returns the wrapped display object. | |
double | getBinWidth (const std::string &axis) const |
Returns the bin width on the specified axis. | |
PyDataRep * | getDataRep () |
Returns the selected DataRep in the plotter. | |
const std::vector< PyDataRep * > & | getDataReps () const |
Returns a vector of all DataReps in the plotter. | |
const std::string & | getLabel (const std::string &axis) const |
Returns the label on the specified axis. | |
int | getLog (const std::string &axis) |
Return 1 if the specified axis is logrithmically scaled. | |
std::vector< double > | getRange (const std::string &axis) |
Get the Range of the specified axis. | |
const std::string & | getTitle () const |
Returns the title of the display. | |
int | nextView (bool stepForward=true) |
Cycle through each set of plot ranges, thereby changing the view with each call. | |
double | numberOfEntries () const |
Return the number of entries in the display. | |
int | numViews () |
Return the number of stored views. | |
int | plotterId () const |
Return the Id to the plotter object. | |
QtDisplay (PlotterBase *plotter) | |
Create a display from a pointer to an existing PlotterBase object. | |
QtDisplay (const std::string &type, boost::python::list, const std::vector< std::string > &bindings) | |
Create a display by creating a ListTuple with the list objects contained in the list. | |
QtDisplay (const std::string &type, boost::python::tuple, const std::vector< std::string > &bindings) | |
Create a display by creating a ListTuple with the list objects contained in the tuple. | |
QtDisplay (const std::string &type, const QtRootNTuple &nt, const std::vector< std::string > &bindings, boost::python::list indices) | |
Create a display bound to RootNTuple using a vector of axis bindings and indices to array of TLeaf. | |
QtDisplay (const std::string &type, const QtRootNTuple &nt, const std::vector< std::string > &bindings) | |
Create a display bound to RootNTuple using a vector of axis bindings, transparently wrapping the createDisplay private method. | |
QtDisplay (const std::string &type, const PyDataSource &nt, const std::vector< std::string > &bindings) | |
Create a display bound to a PyDataSource object using a vector of axis bindings, transparently wrapping the createDisplay private method. | |
QtDisplay (const std::string &type, const DataSource &nt, const std::vector< std::string > &bindings) | |
Create a display using a vector of axis bindings, transparently wrapping the createDisplay private method. | |
QtDisplay (const std::string &type) | |
Create a display that has no DataSource bindings. | |
void | reset () |
Resets all bins. | |
void | resize () |
Restore the X and Y dimensions of the display to their saved values. | |
int | saveView () |
Save the current set of plot ranges which define a "view" for this plot. | |
void | setAspectRatio (double ratio) |
Sets the aspect ratio. | |
void | setAutoRanging (const std::string &axis, bool flag) |
Sets the auto ranging flag on specified axis. | |
void | setAutoTicks (const std::string &axis, bool yes) |
Sets the ticks to be automatic or manual. | |
void | setBinWidth (const std::string &axis, double width) |
Sets the bin width on the specified axis. | |
void | setBinWidth (const std::string &axis, double width, bool save=false) |
Sets the bin width on the specified axis. | |
void | setColorMap (const std::string &name) |
Set the color map by name. | |
void | setContourLevels (const std::vector< double > &levels) |
Set the contour levels if a ContourPointRep. | |
void | setLabel (const std::string &axis, const std::string &label) |
Sets the label on the corresponding axis. | |
void | setLog (const std::string &axis, int flag) |
Sets the specified axis to Logrithmic binning (if applicable ) and display. | |
void | setNumberOfBins (const std::string &axis, unsigned int number) |
Sets the number of bins. | |
void | setOffset (const std::string &axis, double offset) |
Sets the offset of the bins on the specified axis. | |
void | setPointRep (RepBase *rep) |
Sets the PointRep for the display. | |
void | setRange (const std::string &axis, double low, double high) |
Sets the Range on the specified axis. | |
void | setRange (const std::string &axis, double low, double high, bool save=false) |
Sets the Range on the specified axis. | |
void | setTicks (const std::string &axis, const std::vector< double > &values, const std::vector< std::string > &labels) |
Sets the axis ticks to specified points and values. | |
void | setTitle (const std::string &title) |
Sets the title of the display. | |
void | setTransform (const std::string &name) |
Sets the Transform. | |
void | setView (int index) |
Set the view by index. | |
void | unlock () |
Unlock the QApplication in case of exception. | |
void | update () |
Updates the display. | |
~QtDisplay () | |
Protected Member Functions | |
QtDisplay () | |
A default constructor for derived classes. | |
Protected Attributes | |
PlotterBase * | m_plotter |
The contained PlotterBase object. | |
Private Member Functions | |
void | createDisplay (const std::string &type, const DataSource &nt, const std::vector< std::string > &bindings) |
Create a QtDisplay. | |
Private Attributes | |
std::map< std::string, double > | m_binWidths |
The saved X and Y bin widths to be used with the resize() method. | |
std::vector< PyDataRep * > | m_pyDataReps |
A vector to store the PyDataRep pointers to be returned by reference via the getDataReps() method. | |
std::map< std::string, std::pair< double, double > > | m_ranges |
The saved X and Y ranges to be used with the resize() method. |
|
A default constructor for derived classes.
Definition at line 585 of file QtDisplay.cxx. |
|
Create a display that has no DataSource bindings.
Definition at line 591 of file QtDisplay.cxx. References createDisplay(), DisplayController::instance(), m_plotter, and unlock(). |
|
Create a display using a vector of axis bindings, transparently wrapping the createDisplay private method.
Definition at line 609 of file QtDisplay.cxx. References createDisplay(). |
|
Create a display bound to a PyDataSource object using a vector of axis bindings, transparently wrapping the createDisplay private method.
Definition at line 616 of file QtDisplay.cxx. References createDisplay(), and PyDataSource::dataSource(). |
|
Create a display bound to RootNTuple using a vector of axis bindings, transparently wrapping the createDisplay private method.
Definition at line 625 of file QtDisplay.cxx. References createDisplay(), and QtRootNTuple::expandIfNeeded(). |
|
Create a display bound to RootNTuple using a vector of axis bindings and indices to array of TLeaf.
Definition at line 634 of file QtDisplay.cxx. References QtRootNTuple::createBinding(), createDisplay(), QtRootNTuple::expandIfNeeded(), and num_util::size(). |
|
Create a display by creating a ListTuple with the list objects contained in the tuple.
Definition at line 451 of file QtDisplay.cxx. References createDisplay(), DataSourceController::instance(), DisplayController::instance(), m_plotter, num_util::size(), and unlock(). |
|
Create a display by creating a ListTuple with the list objects contained in the list.
Definition at line 518 of file QtDisplay.cxx. References createDisplay(), DataSourceController::instance(), DisplayController::instance(), m_plotter, num_util::size(), and unlock(). |
|
Create a display from a pointer to an existing PlotterBase object.
Definition at line 673 of file QtDisplay.cxx. |
|
Definition at line 675 of file QtDisplay.cxx. |
|
Adds a Function (as PyFunctionRep).
Definition at line 725 of file QtDisplay.cxx. References DisplayController::addDataRep(), PyFunctionRep::getRep(), DisplayController::instance(), and m_plotter. |
|
Adds a DataRep created within Python.
Definition at line 715 of file QtDisplay.cxx. References DisplayController::addDataRep(), PyDataRep::getDataRep(), DisplayController::instance(), and m_plotter. |
|
Creates and adds a DataRep to the display.
Definition at line 689 of file QtDisplay.cxx. References DisplayController::addDataRep(), DisplayController::instance(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Adds a DataRep to the display by stacking, i.e. sharing X axis but not the Y axis. Definition at line 703 of file QtDisplay.cxx. References DisplayController::addDataRepStacked(), DisplayController::instance(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Adds a Function (as a FunctionBase object).
Definition at line 737 of file QtDisplay.cxx. References DisplayController::addDataRep(), FunctionController::createFunctionRep(), PlotterBase::getDataRep(), DisplayController::instance(), FunctionController::instance(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Adds an observer to PlotterBase object.
Definition at line 1160 of file QtDisplay.cxx. References m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Adds the values to the display.
Definition at line 1040 of file QtDisplay.cxx. References m_plotter, and unlock(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Creates a data array wrapper for the contents of the display.
Definition at line 1189 of file QtDisplay.cxx. References createNTuple(), FunctionController::instance(), m_plotter, and unlock(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Create a QtDisplay. The type of QtDisplay will be looked up in the DataRepFactory. It will be connected to the ntuple nt. The bindings is represented by bindings. This is the function that does the work and is called by the constructors. Definition at line 426 of file QtDisplay.cxx. References DisplayController::createDisplay(), DisplayController::instance(), and m_plotter. Referenced by QtDisplay(). |
|
Creates and returns an NTuple representing the display.
Definition at line 1049 of file QtDisplay.cxx. References FunctionController::instance(), m_plotter, and unlock(). Referenced by createDataArray(), and hippodraw::Python::export_QtDisplay(). |
|
Return the current view index.
Definition at line 841 of file QtDisplay.cxx. References PlotterBase::currentView(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Delete a view by index.
Definition at line 830 of file QtDisplay.cxx. References PlotterBase::deleteView(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Returns the wrapped display object.
Definition at line 680 of file QtDisplay.cxx. References m_plotter. Referenced by PyCanvas::addDisplay(), QtCut::addTarget(), QtCut::addTargets(), PyCanvas::addText(), PyCanvas::addTextAt(), PyFunctionRep::addTo(), PyCanvas::findSelectedView(), and PyCanvas::removeDisplay(). |
|
Returns the bin width on the specified axis.
Definition at line 942 of file QtDisplay.cxx. References PlotterBase::getBinWidth(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Returns the selected DataRep in the plotter.
Definition at line 1011 of file QtDisplay.cxx. References PlotterBase::activePlotIndex(), PlotterBase::getDataRep(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Returns a vector of all DataReps in the plotter.
Definition at line 1021 of file QtDisplay.cxx. References PlotterBase::getDataRep(), PlotterBase::getNumDataReps(), m_plotter, and m_pyDataReps. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Returns the label on the specified axis.
Definition at line 902 of file QtDisplay.cxx. References hippodraw::Axes::convert(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Return 1 if the specified axis is logrithmically scaled.
Definition at line 993 of file QtDisplay.cxx. References DisplayController::getLog(), DisplayController::instance(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Get the Range of the specified axis.
Definition at line 775 of file QtDisplay.cxx. References hippodraw::Axes::convert(), PlotterBase::getRange(), Range::high(), Range::low(), m_plotter, and num_util::type(). Referenced by QtCut::cutRange(), hippodraw::Python::export_QtDisplay(), and saveView(). |
|
Returns the title of the display.
Definition at line 852 of file QtDisplay.cxx. References PlotterBase::getTitle(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Cycle through each set of plot ranges, thereby changing the view with each call.
Definition at line 813 of file QtDisplay.cxx. References m_plotter, and PlotterBase::nextView(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Return the number of entries in the display.
Definition at line 1062 of file QtDisplay.cxx. References PlotterBase::activeProjector(), ProjectorBase::getNumberOfEntries(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Return the number of stored views.
Definition at line 826 of file QtDisplay.cxx. References m_plotter, and PlotterBase::numViews(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Return the Id to the plotter object.
Definition at line 1117 of file QtDisplay.cxx. References m_plotter, and PlotterBase::plotterId(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Resets all bins.
Definition at line 916 of file QtDisplay.cxx. References m_plotter, and unlock(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Restore the X and Y dimensions of the display to their saved values.
Definition at line 1070 of file QtDisplay.cxx. References DisplayController::getLog(), DisplayController::instance(), m_binWidths, m_plotter, m_ranges, PlotterBase::setAutoRanging(), PlotterBase::setBinWidth(), setLog(), and PlotterBase::setRange(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Save the current set of plot ranges which define a "view" for this plot.
Definition at line 785 of file QtDisplay.cxx. References getRange(), m_plotter, m_ranges, std::make_pair(), and PlotterBase::saveView(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Sets the aspect ratio.
Definition at line 1033 of file QtDisplay.cxx. References m_plotter, and PlotterBase::setAspectRatio(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Sets the auto ranging flag on specified axis.
Definition at line 1003 of file QtDisplay.cxx. References hippodraw::Axes::convert(), m_plotter, PlotterBase::setAutoRanging(), and num_util::type(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Sets the ticks to be automatic or manual.
Definition at line 1178 of file QtDisplay.cxx. References m_plotter, and unlock(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Sets the bin width on the specified axis. This version is needed since Boost.Python cannot accommodate default arguments directly. Definition at line 947 of file QtDisplay.cxx. References setBinWidth(). |
|
Sets the bin width on the specified axis.
Definition at line 923 of file QtDisplay.cxx. References m_binWidths, m_plotter, and PlotterBase::setBinWidth(). Referenced by hippodraw::Python::export_QtDisplay(), and setBinWidth(). |
|
Set the color map by name.
Definition at line 1126 of file QtDisplay.cxx. References std::find(), BinToColorFactory::instance(), and m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
Set the contour levels if a ContourPointRep.
Definition at line 872 of file QtDisplay.cxx. References PlotterBase::activePlotIndex(), PlotterBase::getDataRep(), DataRep::getProjector(), m_plotter, RepBase::name(), Observable::notifyObservers(), and PlotterBase::representation(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Sets the label on the corresponding axis.
Definition at line 893 of file QtDisplay.cxx. References hippodraw::Axes::convert(), m_plotter, and PlotterBase::setLabel(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Sets the specified axis to Logrithmic binning (if applicable ) and display.
Definition at line 982 of file QtDisplay.cxx. References hippodraw::Axes::convert(), DisplayController::instance(), m_plotter, DisplayController::setLog(), and num_util::type(). Referenced by hippodraw::Python::export_QtDisplay(), and resize(). |
|
Sets the number of bins.
Definition at line 909 of file QtDisplay.cxx. References m_plotter, and PlotterBase::setNumberOfBins(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Sets the offset of the bins on the specified axis.
Definition at line 951 of file QtDisplay.cxx. References hippodraw::Axes::convert(), DisplayController::instance(), m_plotter, DisplayController::setOffset(), and num_util::type(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Sets the PointRep for the display.
Definition at line 858 of file QtDisplay.cxx. References m_plotter, and PlotterBase::setRepresentation(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Sets the Range on the specified axis. This version is needed since Boost.Python cannot accommodate default arguments directly. Definition at line 770 of file QtDisplay.cxx. References setRange(). |
|
Sets the Range on the specified axis.
Definition at line 753 of file QtDisplay.cxx. References m_plotter, m_ranges, std::make_pair(), and PlotterBase::setRange(). Referenced by hippodraw::Python::export_QtDisplay(), and setRange(). |
|
Sets the axis ticks to specified points and values.
Definition at line 1167 of file QtDisplay.cxx. References m_plotter, and unlock(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Sets the title of the display.
Definition at line 845 of file QtDisplay.cxx. References m_plotter, and PlotterBase::setTitle(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Sets the Transform.
Definition at line 961 of file QtDisplay.cxx. References DisplayController::instance(), m_plotter, and DisplayController::setTransform(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Set the view by index.
Definition at line 801 of file QtDisplay.cxx. References m_plotter, and PlotterBase::setView(). Referenced by hippodraw::Python::export_QtDisplay(). |
|
Unlock the QApplication in case of exception.
Definition at line 978 of file QtDisplay.cxx. Referenced by addValues(), createDataArray(), createNTuple(), hippodraw::Python::export_QtDisplay(), QtDisplay(), reset(), setAutoTicks(), and setTicks(). |
|
Updates the display.
Definition at line 1149 of file QtDisplay.cxx. References m_plotter. Referenced by hippodraw::Python::export_QtDisplay(). |
|
The saved X and Y bin widths to be used with the resize() method.
Definition at line 67 of file QtDisplay.h. Referenced by resize(), and setBinWidth(). |
|
|
A vector to store the PyDataRep pointers to be returned by reference via the getDataReps() method.
Definition at line 61 of file QtDisplay.h. Referenced by getDataReps(). |
|
The saved X and Y ranges to be used with the resize() method.
Definition at line 64 of file QtDisplay.h. Referenced by resize(), saveView(), and setRange(). |