QtDisplay Class Reference

#include <QtDisplay.h>

Inheritance diagram for QtDisplay:

Inheritance graph
QtCut
[legend]
Collaboration diagram for QtDisplay:

Collaboration graph
PlotterBaseObserverObservableSizePointRect
[legend]
List of all members.

Detailed Description

Qt Displays wraps a derived class of PlotterBase.

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.

Requests:
@@@ Need to add methods that PyDataRep implements so user doesn't need to know about DataRep objects.
Requests:
@@@ Implement constructor that takes as first argument a DataSource/DataArray and if binding is one element, create Histogram, if two, create ColorPlot.
Requests:
Need to check each method that does a lock to see if an exception could be thrown. If yes, and no try/catch block, then application will hang.
Todo:
Too may try/catch blocks. All exception inherit from std::exception, so why not put one static function to take care of the exceptions and qApp lock/unlock.
Author:
James Chiang <jchiang@slac.stanford.edu>

Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 71 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.
void applyCut (QtDisplay *cut)
 Applies a cut to the wrapped PlotterBase.
void applyCuts (const std::vector< QtDisplay * > &cuts)
 Applies a cuts to the wrapped PlotterBase.
PyDataSourcecreateDataArray () const
 Creates a data array wrapper for the contents of the display.
PyNTuplecreateNTuple () const
 Creates and returns an PyNTuple representing the display.
int currentView ()
 Return the current view index.
void deleteView (int index)
 Delete a view by index.
PlotterBasedisplay ()
 Returns the wrapped display object.
double getBinWidth (const std::string &axis) const
 Returns the bin width on the specified axis.
PyDataRepgetDataRep ()
 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 logarithmically 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 indexes 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 (PyFunctionRep *rep)
 Creates a display for existing DataRep rep.
 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 Logarithmic 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

PlotterBasem_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.


Constructor & Destructor Documentation

QtDisplay (  )  [protected]

A default constructor for derived classes.

Definition at line 606 of file QtDisplay.cxx.

QtDisplay ( const std::string &  type  ) 

Create a display that has no DataSource bindings.

Definition at line 632 of file QtDisplay.cxx.

References QtDisplay::createDisplay(), DisplayController::instance(), QtDisplay::m_plotter, and PyApp::unlock().

QtDisplay ( PyFunctionRep rep  ) 

Creates a display for existing DataRep rep.

Definition at line 612 of file QtDisplay.cxx.

References QtDisplay::createDisplay(), DisplayController::instance(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

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.

Definition at line 652 of file QtDisplay.cxx.

References QtDisplay::createDisplay().

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.

Definition at line 659 of file QtDisplay.cxx.

References QtDisplay::createDisplay(), and PyDataSource::dataSource().

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.

Definition at line 668 of file QtDisplay.cxx.

References QtDisplay::createDisplay().

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 indexes to array of TLeaf.

Definition at line 676 of file QtDisplay.cxx.

References QtRootNTuple::createBinding(), QtDisplay::createDisplay(), num_util::size(), and PyApp::unlock().

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.

Definition at line 472 of file QtDisplay.cxx.

References QtDisplay::createDisplay(), DataSourceController::instance(), DisplayController::instance(), PyApp::lock(), QtDisplay::m_plotter, num_util::size(), and PyApp::unlock().

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.

Definition at line 539 of file QtDisplay.cxx.

References QtDisplay::createDisplay(), DataSourceController::instance(), DisplayController::instance(), PyApp::lock(), QtDisplay::m_plotter, num_util::size(), and PyApp::unlock().

QtDisplay ( PlotterBase plotter  ) 

Create a display from a pointer to an existing PlotterBase object.

Definition at line 716 of file QtDisplay.cxx.

~QtDisplay (  ) 

Definition at line 718 of file QtDisplay.cxx.


Member Function Documentation

void addDataRep ( PyFunctionRep pyFuncRep  ) 

Adds a Function (as PyFunctionRep).

Definition at line 766 of file QtDisplay.cxx.

References DisplayController::addDataRep(), PyFunctionRep::getRep(), DisplayController::instance(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

void addDataRep ( PyDataRep pyRep  ) 

Adds a DataRep created within Python.

Definition at line 756 of file QtDisplay.cxx.

References DisplayController::addDataRep(), PyDataRep::getDataRep(), DisplayController::instance(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

void addDataRep ( const std::string &  type,
const DataSource ntuple,
const std::vector< std::string > &  bindings 
)

Creates and adds a DataRep to the display.

Parameters:
type The type of DataRep. Will be used to search for the type in the DataRepFactory. If the type doesn't exist, nothing is created. No checks are made that the new DataRep is consistent for viewing with existing ones.
ntuple A pointer to the DataSource to be used.
bindings The labels of the columns in the DataSource to be used.

Definition at line 730 of file QtDisplay.cxx.

References DisplayController::addDataRep(), DisplayController::instance(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

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.

sharing X axis but not the Y axis.

Definition at line 744 of file QtDisplay.cxx.

References DisplayController::addDataRepStacked(), DisplayController::instance(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void addFunction ( FunctionBase function  ) 

Adds a Function (as a FunctionBase object).

Definition at line 780 of file QtDisplay.cxx.

References DisplayController::addDataRep(), FunctionController::createFunctionRep(), PlotterBase::getDataRep(), DisplayController::instance(), FunctionController::instance(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void addObserver ( hippodraw::Observer observer  ) 

Adds an observer to PlotterBase object.

Definition at line 1261 of file QtDisplay.cxx.

References QtDisplay::m_plotter.

Referenced by hippodraw::Python::export_QtDisplay().

void addValues ( const std::vector< double > &  v  ) 

Adds the values to the display.

Definition at line 1137 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void applyCut ( QtDisplay cut  ) 

Applies a cut to the wrapped PlotterBase.

If cut is a wrapper for a CutPlotter, then applies the cut to the wrapped PlotterBase object, otherwise an exception is thrown.

Definition at line 1309 of file QtDisplay.cxx.

References QtDisplay::display(), CutController::instance(), PyApp::lock(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void applyCuts ( const std::vector< QtDisplay * > &  cuts  ) 

Applies a cuts to the wrapped PlotterBase.

If the cuts are rappers for a CutPlotter, then applies the cuts to the wrapped PlotterBase object. If any of the cuts is not wrapper for a cut, an exception will be thrown.

Definition at line 1324 of file QtDisplay.cxx.

References QtDisplay::display(), CutController::instance(), PyApp::lock(), num_util::size(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

PyDataSource * createDataArray (  )  const

Creates a data array wrapper for the contents of the display.

Definition at line 1288 of file QtDisplay.cxx.

References QtDisplay::createNTuple(), FunctionController::instance(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void createDisplay ( const std::string &  type,
const DataSource nt,
const std::vector< std::string > &  bindings 
) [private]

Create a QtDisplay.

The type of QtDisplay will be looked up in the DataRepFactory. It will be connected to the DataSource nt. The bindings is represented by bindings. This is the function that does the work and is called by the constructors.

Definition at line 447 of file QtDisplay.cxx.

References DisplayController::createDisplay(), DisplayController::instance(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by QtDisplay::QtDisplay().

PyNTuple * createNTuple (  )  const

Creates and returns an PyNTuple representing the display.

Definition at line 1146 of file QtDisplay.cxx.

References FunctionController::instance(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by QtDisplay::createDataArray(), hippodraw::Python::export_QtCut(), and hippodraw::Python::export_QtDisplay().

int currentView (  ) 

Return the current view index.

Definition at line 906 of file QtDisplay.cxx.

References PlotterBase::currentView(), and QtDisplay::m_plotter.

Referenced by hippodraw::Python::export_QtDisplay().

void deleteView ( int  index  ) 

Delete a view by index.

Definition at line 895 of file QtDisplay.cxx.

References PlotterBase::deleteView(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

PlotterBase * display (  ) 

Returns the wrapped display object.

Definition at line 723 of file QtDisplay.cxx.

References QtDisplay::m_plotter.

Referenced by PyCanvas::addDisplay(), QtCut::addTarget(), QtCut::addTargets(), PyCanvas::addText(), PyCanvas::addTextAt(), PyCanvas::addTextAtAbs(), PyFunctionRep::addTo(), QtDisplay::applyCut(), QtDisplay::applyCuts(), PyCanvas::findSelectedView(), PyCanvas::getPickTable(), and PyCanvas::removeDisplay().

double getBinWidth ( const std::string &  axis  )  const

Returns the bin width on the specified axis.

Definition at line 1018 of file QtDisplay.cxx.

References PlotterBase::getBinWidth(), and QtDisplay::m_plotter.

Referenced by hippodraw::Python::export_QtDisplay().

PyDataRep * getDataRep (  ) 

Returns the selected DataRep in the plotter.

Definition at line 1096 of file QtDisplay.cxx.

References PlotterBase::activePlotIndex(), PlotterBase::getDataRep(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

const std::vector< PyDataRep * > & getDataReps (  )  const

Returns a vector of all DataReps in the plotter.

Definition at line 1112 of file QtDisplay.cxx.

References PlotterBase::getDataRep(), PlotterBase::getNumDataReps(), PyApp::lock(), QtDisplay::m_plotter, QtDisplay::m_pyDataReps, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

const std::string & getLabel ( const std::string &  axis  )  const

Returns the label on the specified axis.

Definition at line 971 of file QtDisplay.cxx.

References hippodraw::String::convert(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

int getLog ( const std::string &  axis  ) 

Return 1 if the specified axis is logarithmically scaled.

Definition at line 1076 of file QtDisplay.cxx.

References DisplayController::getLog(), DisplayController::instance(), and QtDisplay::m_plotter.

Referenced by hippodraw::Python::export_QtDisplay().

std::vector< double > getRange ( const std::string &  axis  ) 

Get the Range of the specified axis.

Definition at line 828 of file QtDisplay.cxx.

References hippodraw::String::convert(), PlotterBase::getRange(), Range::high(), PyApp::lock(), Range::low(), QtDisplay::m_plotter, num_util::type(), and PyApp::unlock().

Referenced by QtCut::cutRange(), hippodraw::Python::export_QtDisplay(), and QtDisplay::saveView().

const std::string & getTitle (  )  const

Returns the title of the display.

Definition at line 917 of file QtDisplay.cxx.

References PlotterBase::getTitle(), and QtDisplay::m_plotter.

Referenced by hippodraw::Python::export_QtDisplay().

int nextView ( bool  stepForward = true  ) 

Cycle through each set of plot ranges, thereby changing the view with each call.

Returns:
The index of the current view.
Parameters:
stepForward Direction to step through the views.

Definition at line 877 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, PlotterBase::nextView(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

double numberOfEntries (  )  const

Return the number of entries in the display.

Definition at line 1163 of file QtDisplay.cxx.

References PlotterBase::activeProjector(), ProjectorBase::getNumberOfEntries(), and QtDisplay::m_plotter.

Referenced by hippodraw::Python::export_QtDisplay().

int numViews (  ) 

Return the number of stored views.

Definition at line 891 of file QtDisplay.cxx.

References QtDisplay::m_plotter, and PlotterBase::numViews().

Referenced by hippodraw::Python::export_QtDisplay().

int plotterId (  )  const

Return the Id to the plotter object.

Note:
If returning an int, then gcc 2.95.3 has internal compiler error coming from Boost.Python.

Definition at line 1218 of file QtDisplay.cxx.

References QtDisplay::m_plotter, and PlotterBase::plotterId().

Referenced by hippodraw::Python::export_QtDisplay().

void reset (  ) 

Resets all bins.

Definition at line 992 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void resize (  ) 

Restore the X and Y dimensions of the display to their saved values.

Definition at line 1171 of file QtDisplay.cxx.

References DisplayController::getLog(), DisplayController::instance(), PyApp::lock(), QtDisplay::m_binWidths, QtDisplay::m_plotter, QtDisplay::m_ranges, PlotterBase::setAutoRanging(), PlotterBase::setBinWidth(), QtDisplay::setLog(), PlotterBase::setRange(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

int saveView (  ) 

Save the current set of plot ranges which define a "view" for this plot.

Returns:
The index of the saved view.

Definition at line 849 of file QtDisplay.cxx.

References QtDisplay::getRange(), QtDisplay::m_plotter, QtDisplay::m_ranges, and PlotterBase::saveView().

Referenced by hippodraw::Python::export_QtDisplay().

void setAspectRatio ( double  ratio  ) 

Sets the aspect ratio.

Definition at line 1128 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, PlotterBase::setAspectRatio(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setAutoRanging ( const std::string &  axis,
bool  flag 
)

Sets the auto ranging flag on specified axis.

Definition at line 1086 of file QtDisplay.cxx.

References hippodraw::String::convert(), PyApp::lock(), QtDisplay::m_plotter, PlotterBase::setAutoRanging(), num_util::type(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setAutoTicks ( const std::string &  axis,
bool  yes 
)

Sets the ticks to be automatic or manual.

Definition at line 1279 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setBinWidth ( const std::string &  axis,
double  width 
)

Sets the bin width on the specified axis.

This version is needed since Boost.Python cannot accommodate default arguments directly.

Definition at line 1025 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::setBinWidth(), and PyApp::unlock().

void setBinWidth ( const std::string &  axis,
double  width,
bool  save = false 
)

Sets the bin width on the specified axis.

Definition at line 999 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_binWidths, QtDisplay::m_plotter, PlotterBase::setBinWidth(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay(), and QtDisplay::setBinWidth().

void setColorMap ( const std::string &  name  ) 

Set the color map by name.

Definition at line 1227 of file QtDisplay.cxx.

References BinToColorFactory::instance(), PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setContourLevels ( const std::vector< double > &  levels  ) 

Set the contour levels if a ContourPointRep.

Definition at line 937 of file QtDisplay.cxx.

References PlotterBase::activePlotIndex(), PlotterBase::getDataRep(), PyApp::lock(), QtDisplay::m_plotter, RepBase::name(), Observable::notifyObservers(), PlotterBase::representation(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setLabel ( const std::string &  axis,
const std::string &  label 
)

Sets the label on the corresponding axis.

Definition at line 958 of file QtDisplay.cxx.

References hippodraw::String::convert(), PyApp::lock(), QtDisplay::m_plotter, PlotterBase::setLabel(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setLog ( const std::string &  axis,
int  flag 
)

Sets the specified axis to Logarithmic binning (if applicable ) and display.

Definition at line 1065 of file QtDisplay.cxx.

References hippodraw::String::convert(), DisplayController::instance(), PyApp::lock(), QtDisplay::m_plotter, DisplayController::setLog(), num_util::type(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay(), and QtDisplay::resize().

void setNumberOfBins ( const std::string &  axis,
unsigned int  number 
)

Sets the number of bins.

Definition at line 983 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, PlotterBase::setNumberOfBins(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setOffset ( const std::string &  axis,
double  offset 
)

Sets the offset of the bins on the specified axis.

Definition at line 1032 of file QtDisplay.cxx.

References hippodraw::String::convert(), DisplayController::instance(), PyApp::lock(), QtDisplay::m_plotter, DisplayController::setOffset(), num_util::type(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setPointRep ( RepBase rep  ) 

Sets the PointRep for the display.

Definition at line 923 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, PlotterBase::setRepresentation(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setRange ( const std::string &  axis,
double  low,
double  high 
)

Sets the Range on the specified axis.

This version is needed since Boost.Python cannot accommodate default arguments directly.

Definition at line 819 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::setRange(), and PyApp::unlock().

void setRange ( const std::string &  axis,
double  low,
double  high,
bool  save = false 
)

Sets the Range on the specified axis.

Definition at line 800 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, QtDisplay::m_ranges, PlotterBase::setRange(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay(), and QtDisplay::setRange().

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.

Definition at line 1268 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setTitle ( const std::string &  title  ) 

Sets the title of the display.

Definition at line 910 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, PlotterBase::setTitle(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setTransform ( const std::string &  name  ) 

Sets the Transform.

Definition at line 1044 of file QtDisplay.cxx.

References DisplayController::instance(), PyApp::lock(), QtDisplay::m_plotter, DisplayController::setTransform(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void setView ( int  index  ) 

Set the view by index.

Definition at line 865 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, PlotterBase::setView(), and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void unlock (  ) 

Unlock the QApplication in case of exception.

Definition at line 1061 of file QtDisplay.cxx.

References PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().

void update (  ) 

Updates the display.

Bug:
@@ For the script, autontuple.py, this method behaves strangely.

Definition at line 1250 of file QtDisplay.cxx.

References PyApp::lock(), QtDisplay::m_plotter, and PyApp::unlock().

Referenced by hippodraw::Python::export_QtDisplay().


Member Data Documentation

std::map<std::string, double > m_binWidths [private]

The saved X and Y bin widths to be used with the resize() method.

Definition at line 84 of file QtDisplay.h.

Referenced by QtDisplay::resize(), and QtDisplay::setBinWidth().

PlotterBase* m_plotter [protected]

The contained PlotterBase object.

Definition at line 97 of file QtDisplay.h.

Referenced by QtDisplay::addDataRep(), QtDisplay::addDataRepStacked(), QtDisplay::addFunction(), QtDisplay::addObserver(), QtCut::addTarget(), QtCut::addTargets(), QtDisplay::addValues(), QtCut::createCut(), QtDisplay::createDataArray(), QtDisplay::createDisplay(), QtDisplay::createNTuple(), QtDisplay::currentView(), QtCut::cutRange(), QtDisplay::deleteView(), QtDisplay::display(), QtCut::fillCutList(), QtDisplay::getBinWidth(), QtDisplay::getDataRep(), QtDisplay::getDataReps(), QtDisplay::getLabel(), QtDisplay::getLog(), QtDisplay::getRange(), QtDisplay::getTitle(), QtDisplay::nextView(), QtDisplay::numberOfEntries(), QtDisplay::numViews(), QtDisplay::plotterId(), QtCut::QtCut(), QtDisplay::QtDisplay(), QtDisplay::reset(), QtDisplay::resize(), QtDisplay::saveView(), QtDisplay::setAspectRatio(), QtDisplay::setAutoRanging(), QtDisplay::setAutoTicks(), QtDisplay::setBinWidth(), QtDisplay::setColorMap(), QtDisplay::setContourLevels(), QtCut::setCutRange(), QtCut::setEnabled(), QtDisplay::setLabel(), QtDisplay::setLog(), QtDisplay::setNumberOfBins(), QtDisplay::setOffset(), QtDisplay::setPointRep(), QtDisplay::setRange(), QtDisplay::setTicks(), QtDisplay::setTitle(), QtDisplay::setTransform(), QtDisplay::setView(), QtCut::toggleInverted(), and QtDisplay::update().

std::vector< PyDataRep * > m_pyDataReps [mutable, private]

A vector to store the PyDataRep pointers to be returned by reference via the getDataReps() method.

Definition at line 78 of file QtDisplay.h.

Referenced by QtDisplay::getDataReps().

std::map<std::string, std::pair <double, double> > m_ranges [private]

The saved X and Y ranges to be used with the resize() method.

Definition at line 81 of file QtDisplay.h.

Referenced by QtDisplay::resize(), QtDisplay::saveView(), and QtDisplay::setRange().


The documentation for this class was generated from the following files:
Generated for HippoDraw Class Library by doxygen