18 #include <boost/python.hpp> 22 #include "msdevstudio/MSconfig.h" 63 using std::runtime_error;
77 "A wrapper for the HippoDraw PlotterBase C++ class.\n " 78 " See HippoDraw's QtDisplay documentation for more details.",
79 init < const std::string & >
82 "Display ( string, DataSource, tuple ) -> Display\n" 84 "Constructor for a Display." 85 #else // gcc 2.95.3 crashes on the following... 86 "Display ( string ) -> Display\n" 87 "Display ( string, DataSource, tuple ) -> Display\n" 88 "Display ( string, DataArray, tuple ) - > Display\n" 89 "Display ( string, tuple, tuple ) -> Display\n" 90 "Display ( string, list, tuple ) -> Display\n" 91 "Display ( string, RootNTuple, tuple ) -> Display\n" 92 "Display ( string, RootNTuple, tuple, tuple ) -> Display\n" 94 "This method is used to create a Display object.\n" 95 "The first method is used for creating static version of\n" 96 "Histogram, etc., where the string is the type of DataRep.\n" 97 "The remaining methods are for dynamic versions.\n" 98 "The string argument is the type. The second argument\n" 99 "is the DataSource and the third argument is tuple of\n" 100 "string for the binding to the DataSource.\n" 101 "For the last method, the fourth argument is a tuple\n" 102 "of integers to access a RootNTuple array variable.\n\n" 103 "For the names of the types of DataRep classes available\n" 104 "call DataRep.names()." 108 .def ( init < PyFunctionRep * > () )
110 .def ( init <
const std::string &,
112 const std::vector< std::string > & > ()
113 [ with_custodian_and_ward < 1, 3 > ()] )
115 .def ( init <
const std::string &,
117 const std::vector< std::string > & > () )
119 .def ( init <
const std::string &,
120 boost::python::tuple,
121 const std::vector< std::string > & > () )
123 .def ( init <
const std::string &,
125 const std::vector< std::string > & > () )
128 .def ( init <
const std::string &,
130 const std::vector< std::string > & > () )
132 .def ( init <
const std::string &,
134 const std::vector< std::string > &,
135 boost::python::list > () )
138 .def (
"applyCut", &QtDisplay::applyCut,
139 "applyCut ( Cut ) -> None\n" 141 "Apply a Cut to the Display" )
143 .def (
"applyCuts", &QtDisplay::applyCuts,
144 "applyCuts ( sequence ) -> None\n" 146 "Apply each Cut in the sequence to the Display" )
148 .def (
"createNTuple", &QtDisplay::createNTuple,
149 return_value_policy < manage_new_object > (),
150 "createNTuple ( ) -> NTuple\n" 152 "Returns a NTuple representation of the Display's contents." )
154 .def (
"createDataArray", &QtDisplay::createDataArray,
155 return_value_policy < manage_new_object > (),
156 "createDataArray ( ) -> DataArray\n" 158 "Returns a DataArray representation of the Display's contents\n" 159 "(This method available if configured with numarray)" )
161 .def (
"setNumberOfBins", &QtDisplay::setNumberOfBins,
162 "setNumberOfBins ( string, value ) -> None\n" 164 "Sets the number of bins on named axis, e.g. 'x' to the given \n" 167 .def (
"setBinWidth",
168 (
void (
QtDisplay::*) (
const std::string &,
171 &QtDisplay::setBinWidth,
172 "Set the bin width, explicitly saving the value or not." )
174 .def (
"getBinWidth",
175 (
double (
QtDisplay::*) (
const std::string & ) )
176 &QtDisplay::getBinWidth,
177 "getBinWidth ( string ) -> value\n" 179 "Returns the bin width on axis specified as a string,\n" 182 .def (
"setBinWidth",
183 (
void (
QtDisplay::*) (
const std::string &,
185 &QtDisplay::setBinWidth,
186 "setBinWidth ( string, value ) -> None\n" 188 "Set the bin width to value on axis specified as a string,\n" 191 .def (
"reset", &QtDisplay::reset,
194 "Resets the contents of all bins. Only applicable to static\n" 197 .def (
"setOffset", &QtDisplay::setOffset,
198 "setOffset ( string, value ) -> None\n" 200 "Sets the offset of the bins relative to their current width on\n" 204 (
void (
QtDisplay::*) (
const std::string &,
206 &QtDisplay::setRange )
209 (
void (
QtDisplay::*) (
const std::string &,
210 double,
double,
bool) )
211 &QtDisplay::setRange,
212 "setRange ( string, value, value ) -> None\n" 213 "setRange ( string, value, value, Boolean ) -> None\n" 215 "Set the upper and lower bounds for the specified axis. For the\n" 216 "second form, also save them if the Boolean argument is true." )
219 .def (
"getRange", &QtDisplay::getRange,
220 "getRange ( string ) -> tuple\n" 222 "Returns the tuple representing the range for the axis specified\n" 223 "as a string, e.g., 'x'." )
225 .def (
"saveView", &QtDisplay::saveView,
226 "saveView ( ) -> int\n" 228 "Saves the current set of x and y ranges and " 229 "returns the index of the saved view." )
231 .def (
"setView", &QtDisplay::setView,
232 "setView ( int ) -> None\n" 234 "Set the view by its index." )
236 .def (
"nextView", &QtDisplay::nextView,
237 "nextView ( bool ) -> int\n" 239 "Cycle to the next view in the view buffer. " 240 "Set the argument to True to cycle for wards, " 241 "False to cycle back wards.\n" 242 "Returns the index of the new view." )
244 .def (
"numViews", &QtDisplay::numViews,
245 "numViews ( ) -> int\n" 247 "Return the number of stored views." )
249 .def (
"deleteView", &QtDisplay::deleteView,
250 "deleteView ( int ) -> None\n" 252 "Delete a view by index." )
254 .def (
"currentView", &QtDisplay::currentView,
255 "currentView ( ) -> int\n" 257 "Index of the current view." )
259 .def (
"setTitle", &QtDisplay::setTitle,
260 "setTitle ( string ) -> None\n" 262 "Sets the title of the display." )
264 .def (
"getTitle", &QtDisplay::getTitle,
265 return_value_policy < copy_const_reference > (),
266 "getTitle () -> string\n" 268 "Returns the current title. The title will be the title of\n" 269 "the DataSource unless it has been explicitly changed." )
271 .def (
"setLabel", &QtDisplay::setLabel,
272 "setLabel ( string, string ) -> None\n" 274 "Sets the label for the axis specified by first argument to value\n" 275 "of the second argument." )
277 .def (
"getLabel", &QtDisplay::getLabel,
278 return_value_policy< copy_const_reference > (),
279 "getLabel ( string ) -> string\n" 281 "Returns the label of the axis specified as a string,\n" 284 .def (
"getDataRep", &QtDisplay::getDataRep,
285 return_value_policy < manage_new_object > (),
286 "getDataRep ( ) -> DataRep\n" 288 "Returns a reference to the active DataRep or if all DataRep objects are\n" 289 "active, returns a reference to the first one." )
291 .def (
"getDataReps", &QtDisplay::getDataReps,
292 return_value_policy < copy_const_reference > (),
293 "getDataReps ( ) -> list\n" 295 "Returns a list of DataRep objects contained by the Display.." )
299 &QtDisplay::addDataRep,
300 "addDataRep ( DataRep ) -> Display\n" 301 "addDataRep ( Function ) -> Display\n" 302 "addDataRep ( string, DataSource, tuple ) -> Display\n" 304 "Adds a DataRep to the display sharing the same Y axis range\n" 305 "The first two methods adds existing DataRep or Function to the\n" 306 "Display. The third method creates and adds DataRep to the\n" 307 "Display. Arguments are same as Display constructor." )
310 (
void (
QtDisplay::*) (
const std::string &,
312 const std::vector <std::string > &) )
313 &QtDisplay::addDataRep )
317 &QtDisplay::addDataRep )
319 .def (
"addDataRepStacked",
320 (
void (
QtDisplay::*) (
const std::string &,
322 const std::vector <std::string > &) )
323 &QtDisplay::addDataRepStacked,
324 "addDataRepStacked ( string, DataSource, tuple ) -> Display\n" 326 "Creates and adds a DataRep with independent Y axis ranges.\n" 327 "The arguments are the same as Display constructor." )
330 .def (
"addFunction",
332 &QtDisplay::addFunction,
333 "addFunction ( FunctionBase ) -> None\n" 335 "Adds a FunctionBase object to the display by appropriately\n" 336 "wrapping it with a Function." )
337 #endif // BOOST_DEFECT 339 .def (
"setAutoRanging",
340 (
void (
QtDisplay::*) (
const std::string &,
342 &QtDisplay::setAutoRanging,
343 "setAutoRanging ( string, Boolean ) -> None\n" 345 "Sets auto-ranging on axis specified as a string, e.g. 'x',n" 348 .def (
"setLog", &QtDisplay::setLog,
349 "setLog ( string, Boolean ) -> None\n" 351 "Sets the axis specified by the first argument on log scale." )
353 .def (
"getLog", &QtDisplay::getLog,
354 "getLog ( string ) -> value\n" 356 "Returns True if axis specified as a string, e.g. 'x', is being\n" 357 "displayed on a logarithmic scale." )
359 .def (
"setTransform", &QtDisplay::setTransform,
360 "setTransform ( string ) -> None\n" 362 "Sets the transform object." )
364 .def (
"addValues", &QtDisplay::addValues,
365 "addValue ( tuple ) -> None\n" 367 "For static histograms, adds a value to the accumulation.\n" 368 "For 1D histogram, the tuple should contain one or two values,\n" 369 "the second used as a weight. For 2D histogram, the tuple should\n" 370 "contain two or three elements, the third being the weight.\n" 371 "non static Displays do nothing." )
373 .def (
"setPointRep", &QtDisplay::setPointRep,
374 "setPointRep ( RepBase ) -> None\n" 376 "Sets the point representation to be used." )
378 .def (
"setContourLevels", &QtDisplay::setContourLevels,
379 "setContourLevels ( sequence ) -> None\n" 381 "Sets the contour levels if the Display is using contour point\n" 382 "representation from the values in the sequence." )
384 .def (
"setAspectRatio", &QtDisplay::setAspectRatio,
385 "setAspectRatio ( value ) -> None\n" 387 "Sets the required aspect ratio of the Display to value, the\n" 388 "ratio of the width to the height." )
390 .def (
"numberOfEntries", &QtDisplay::numberOfEntries,
391 "numberOfEntries ( ) -> value\n" 393 "Returns the number of entries in the Display." )
395 .def (
"resize", &QtDisplay::resize,
396 "resize () -> None\n" 398 "Resizes the Display to its saved values." )
400 .def (
"plotterId", &QtDisplay::plotterId,
401 "plotterId () -> value\n" 403 "Returns a unique identifier for the Display." )
405 .def (
"setColorMap", &QtDisplay::setColorMap,
406 "setColorMap ( string ) -> None\n" 408 "Set the value-to-color map to one named by the argument.")
410 .def (
"update", &QtDisplay::update,
411 "update () -> None\n" 413 "Updates the display." )
415 .def (
"addObserver", &QtDisplay::addObserver,
416 "addObserver ( Observer ) -> None\n" 418 "Adds an Observer to the Display object." )
420 .def (
"setAutoTicks", &QtDisplay::setAutoTicks,
421 "setAutoTicks ( Boolean ) -> None\n" 423 "Set the ticks generation to be automatic (the default) or\n" 426 .def (
"setTicks", &QtDisplay::setTicks,
427 "setTicks ( string, sequence, sequence ) -> None\n" 429 "Sets the tick locations and labels. The first argument is the\n" 430 " axis, the second argument is a sequence containing the\n" 431 "locations, and the third argument is a sequence of tick labels." )
433 .def (
"unlock", &QtDisplay::unlock,
434 "unlock () -> None\n" 436 "Unlock the application thread." )
448 void QtDisplay::createDisplay (
const std::string &
type,
450 const std::vector < std::string > & bindings )
455 m_plotter = controller->
createDisplay ( type, nt, bindings );
466 catch (
const runtime_error & e ) {
473 QtDisplay (
const std::string &
type,
474 boost::python::tuple seq,
475 const std::vector < std::string > & labels )
479 object obj = seq.attr (
"__len__" ) ();
484 unsigned int size = extract < unsigned int > ( obj );
486 if ( size > labels.size () ) {
487 string what (
"Display: Too few labels" );
488 throw runtime_error ( what );
491 for (
unsigned int i = 0, j = 0; i <
size; i++, j++ ) {
492 boost::python::list l = extract < boost::python::list > ( seq[i] );
494 while ( labels[j] ==
"nil" ) {
496 if ( ! ( j < labels.size () ) ) {
497 string what (
"Display: Too few non 'nil' labels" );
498 throw runtime_error ( what );
502 ntuple -> addColumn ( labels[j], l );
505 catch (
const runtime_error & e ) {
514 m_plotter = dc -> createDisplay ( type, *ntuple, labels );
526 catch (
const runtime_error & e ) {
534 dsc -> registerNTuple ( ntuple );
540 QtDisplay (
const std::string &
type,
541 boost::python::list seq,
542 const std::vector < std::string > & labels )
546 object obj = seq.attr (
"__len__" ) ();
551 unsigned int size = extract < unsigned int > ( obj );
553 if ( size > labels.size () ) {
554 string what (
"Display: Too few labels" );
555 throw runtime_error ( what );
559 for (
unsigned int i = 0, j = 0; i <
size; i++, j++ ) {
560 boost::python::list l = extract < boost::python::list > ( seq[i] );
562 while ( labels[j] ==
"nil" ) {
564 if ( ! ( j < labels.size () ) ) {
565 string what (
"Display: Too few non 'nil' labels" );
566 throw runtime_error ( what );
570 ntuple -> addColumn ( labels[j], l );
573 catch (
const runtime_error & e ) {
582 m_plotter = dc -> createDisplay ( type, *ntuple, labels );
594 catch (
const runtime_error & e ) {
602 dsc -> registerNTuple ( ntuple );
607 QtDisplay::QtDisplay ()
618 DataRep * dr = rep -> getRep ();
655 const std::vector< std::string > & bindings )
662 const std::vector< std::string > & bindings )
671 const std::vector < std::string > & bindings )
679 const std::vector < std::string > & variables,
680 boost::python::list indices )
682 object obj = indices.attr (
"__len__" ) ();
683 unsigned int size = extract < unsigned int > ( obj );
685 if ( size != variables.size() ) {
686 const string what (
"Display: bindings and indexes not the same size." );
688 throw runtime_error ( what );
691 vector < vector < int > >
vec ( size );
692 for (
unsigned int i = 0; i <
size; i++ ) {
693 boost::python::list l = extract < boost::python::list > ( indices[i] );
694 object o = l.attr (
"__len__" ) ();
695 unsigned int len = extract < unsigned int > ( o );
696 for (
unsigned int j = 0; j < len; j++ ) {
697 unsigned int k = extract < unsigned int > ( l[j] );
698 vec[i].push_back ( k );
702 vector < string > bindings ( size );
704 for (
unsigned int i = 0; i <
size; i++ ) {
705 const string & label = variables [ i ];
706 const vector < int > & indexes = vec [ i ];
708 bindings [ i ] = name;
733 const std::vector < std::string > & bindings )
747 const std::vector < std::string > & bindings )
792 dataRep =
reinterpret_cast<DataRep *
>(funcRep);
797 #endif // BOOST_DEFECT 801 setRange (
const std::string & axis,
double low,
double high,
807 if (axis ==
"x" || axis ==
"X")
808 m_ranges[
"x"] = std::make_pair(low, high);
809 if (axis ==
"y" || axis ==
"Y")
810 m_ranges[
"y"] = std::make_pair(low, high);
820 setRange (
const std::string & axis,
double low,
double high )
833 std::vector<double> myRange;
837 myRange.push_back(axisRange.
low());
838 myRange.push_back(axisRange.
high());
852 std::vector<double> range_values;
853 std::vector<double> range =
getRange(
"x");
854 range_values.push_back(range[0]);
855 range_values.push_back(range[1]);
856 m_ranges[
"x"] = std::make_pair(range[0], range[1]);
859 range_values.push_back(range[0]);
860 range_values.push_back(range[1]);
861 m_ranges[
"y"] = std::make_pair(range[0], range[1]);
929 }
catch (
const std::runtime_error & e ) {
943 if ( rep->
name() == std::string(
"Contour") ) {
948 ->setContourValues(
const_cast<std::vector<double>&
>(levels),
960 const std::string & label )
1006 if (axis ==
"x" || axis ==
"X")
1008 if (axis ==
"y" || axis ==
"Y")
1071 bool yes = flag != 0;
1102 if ( index < 0 ) index = 0;
1111 const std::vector<PyDataRep *> &
1119 for (
int i = 0; i < nReps; i++) {
1231 const vector< std::string > & names = factory -> names();
1232 if ( std::find(names.begin(), names.end(), name) != names.end() ) {
1233 BinToColor * rep = factory -> create ( name );
1238 std::ostringstream message;
1239 message <<
"QtDisplay::setColorMap:\n" 1240 <<
"BinToColor rep '" << name <<
"' does not exist.\n" 1241 <<
"Valid rep names are \n\n";
1242 for (
unsigned int i = 0; i < names.size() ; i++) {
1243 message <<
"'" << names[i] <<
"'\n";
1245 throw std::runtime_error(message.str());
1270 const std::vector < double > & values,
1271 const std::vector < std::string > & labels )
1292 #ifdef HAVE_NUMARRAY 1303 runtime_error e (
"HippoDraw was not built with numeric Python support" );
1318 controller -> addCut ( cut_plotter, target_plotter );
1329 vector < PlotterBase * > cut_plotters;
1330 unsigned int size = cuts.size ();
1331 for (
unsigned int i = 0; i <
size; i++ ) {
1334 cut_plotters.push_back ( plotter );
1339 controller -> addCuts ( cut_plotters, target_plotter );
hippodraw::RepBase class interface
void setAspectRatio(double ratio)
Sets the aspect ratio.
void setView(int index)
Set the view by index.
hippodraw::ContourPointRep class interface
virtual ProjectorBase * activeProjector() const
Returns the active projector.
static DisplayController * instance()
Returns the pointer to the singleton instance.
void addDataRep(const std::string &type, const DataSource *ntuple, const std::vector< std::string > &bindings)
Creates and adds a DataRep to the display.
void addValues(const std::vector< double > &v)
Adds the values to the display.
virtual int plotterId() const
The unique ID number of this plotter.
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 setTransform(PlotterBase *plotter, const std::string &name)
Creates and sets a new transform for the display.
void setTransform(const std::string &name)
Sets the Transform.
PlotterBase * display()
Returns the wrapped display object.
std::vector< double > getRange(const std::string &axis)
Get the Range of the specified axis.
int saveView(const std::vector< double > &range_values)
Save the current set of plot ranges which define a "view" for this plot.
A PointRep class that draws a contour lines.
const std::string & name() const
Returns the name of the representation.
PlotterBase * m_plotter
The contained PlotterBase object.
Qt Displays wraps a derived class of PlotterBase.
void setPointRep(RepBase *rep)
Sets the PointRep for the display.
void setBinWidth(const std::string &axis, double width, bool save=false)
Sets the bin width on the specified axis.
virtual void setRepresentation(RepBase *pointrep)=0
Sets the representation.
FactoryException class interface.
void setRange(const std::string &axis, double low, double high, bool save=false)
Sets the Range on the specified axis.
int plotterId() const
Return the Id to the plotter object.
void setOffset(const std::string &axis, double offset)
Sets the offset of the bins on the specified axis.
hippodraw::PyNTuple class interface.
virtual void setLabel(const std::string &axis, const std::string &label)
Sets the label of specified axis to label.
virtual void setAutoRanging(const std::string &axis, bool flag)
Sets the auto-ranging.
hippodraw::ProjectorBase class interface.
void setAspectRatio(double ratio)
Sets the aspect ratio.
const std::string & getTitle() const
Returns the title of the display.
virtual void setNumberOfBins(const std::string &axis, unsigned int number)
Sets the number of bins.
const std::string & getTitle() const
Gets the title to be displayed.
void unlock()
Unlock the QApplication in case of exception.
void setLog(PlotterBase *plotter, const std::string &axis, bool flag)
Sets a log scale on or off for the specified axis for the plotter.
std::map< std::string, double > m_binWidths
The saved X and Y bin widths to be used with the resize() method.
void deleteView(int index)
Delete a view by index.
hippodraw::PyFunctionRep class interface.
static void lock()
Obtains a lock on the application's mutex.
hippodraw::BinToColor class interface
An exception class that is thrown when attempting an illegal operation on a PlotterBase object...
int numViews() const
Return the number of stored views.
void setNumberOfBins(const std::string &axis, unsigned int number)
Sets the number of bins.
hippodraw::PyDataRep class interface
int currentView() const
Return the current view index.
void setTitle(const std::string &title)
Sets the title to be displayed.
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.
double numberOfEntries() const
Return the number of entries in the display.
static void unlock()
Releases the lock on the application's mutex.
static BinToColorFactory * instance()
Returns a pointer to the singleton instance.
double high() const
Returns the maximum of the range object.
virtual int getNumDataReps() const
Returns the number of DataRep objects contained in the plot.
int nextView(bool stepForward=true)
Cycle through each set of plot ranges, thereby changing the view with each call.
hippodraw::DataRep class interface.
hippodraw::DataRep * addDataRepStacked(PlotterBase *plotter, const std::string &name, const DataSource *source, const std::vector< std::string > &bindings) const
Creates a new DataRep object with class name name and adds it to the existing plotter by stacking it...
A singleton class that is the interface between GUI and the displays.
virtual void notifyObservers() const
Notifies Observer objects of a change.
int nextView(bool stepForward=true)
Cycle through each set of plot ranges, thereby changing the view with each call.
void addFunction(FunctionBase *function)
Adds a Function (as a FunctionBase object)
hippodraw::ListTuple class interface.
hippodraw::QtRootNTuple class interface.
void deleteView(int index)
Delete a view by index.
void export_QtDisplay()
Exports the QtDisplay class to Python.
void resize()
Restore the X and Y dimensions of the display to their saved values.
virtual int activePlotIndex() const
Returns the index of the active plotter.
int numViews()
Return the number of stored views.
virtual double getBinWidth(Axes::Type axis) const
Returns the bin width.
DataSourceController class interface.
void setAutoRanging(const std::string &axis, bool flag)
Sets the auto ranging flag on specified axis.
FunctionRep * createFunctionRep(const std::string &name, DataRep *rep)
Returns a newly created FunctionRep object with function of type name and target rep.
The base class for data representations.
void applyCuts(const std::vector< QtDisplay * > &cuts)
Applies a cuts to the wrapped PlotterBase.
PyDataSource * createDataArray() const
Creates a data array wrapper for the contents of the display.
Base class for DataSource.
This class is the public interface the what the user sees as the DataRep object from Python...
hippodraw::PyApp class interface.
intp size(numeric::array arr)
QtDisplay()
A default constructor for derived classes.
PlotterException class interface.
The base class for the point representation hierarchy.
void setView(int index)
Set the view by index.
hippodraw::FunctionController class interface
void setColorMap(const std::string &name)
Set the color map by name.
void setAutoTicks(const std::string &axis, bool yes)
Sets the ticks to be automatic or manual.
void setLog(const std::string &axis, int flag)
Sets the specified axis to Logarithmic binning (if applicable ) and display.
double low() const
Returns the minimum of the range object.
BinToColorFactory class interface.
hippodraw::DataRep * getRep() const
Returns the wrapped FunctionRep object.
Type convert(const std::string &axis)
Converts from string representation ot Axes::Type representation.
static FunctionController * instance()
Returns the pointer to the singleton instance.
A wrapper for NTuple, so that when NTuple is used in Qt based application, the application object can...
void createDisplay(const std::string &type, const DataSource &nt, const std::vector< std::string > &bindings)
Create a QtDisplay.
std::vector< PyDataRep *> m_pyDataReps
A vector to store the PyDataRep pointers to be returned by reference via the getDataReps() method...
The base class for the PlotterBase hierarchy.
A DataSource class implemented with std::vector<double> to store the column data. ...
void setLabel(const std::string &axis, const std::string &label)
Sets the label on the corresponding axis.
virtual void setBinWidth(Axes::Type axis, double width)
Sets the bin width.
PyArray_TYPES type(numeric::array arr)
DisplayController class interface declaration.
virtual void setRange(Axes::Type axis, const Range &range, bool scaled=false, bool adjust_width=true)
Sets the range on the specified axis.
Expresses a range of values.
hippodraw::PyDataSource class interface
The base class for the Projector hierarchy.
A factory for creation of objects whose class is derived from BinToColor.
double getBinWidth(const std::string &axis) const
Returns the bin width on the specified axis.
int saveView()
Save the current set of plot ranges which define a "view" for this plot.
A function that can be added to a DataRep and used in a fitter.
const std::vector< PyDataRep * > & getDataReps() const
Returns a vector of all DataReps in the plotter.
An exception class that is thrown when the factory fails to find the request class by its name...
PyDataRep * getDataRep()
Returns the selected DataRep in the plotter.
A DataSource class implemented with a Python list to store the column data.
virtual ProjectorBase * getProjector() const
Returns the Projector object controlling the data.
void reset()
Resets all bins.
hippodraw::PlotterBase class interface.
void applyCut(QtDisplay *cut)
Applies a cut to the wrapped PlotterBase.
void setTitle(const std::string &title)
Sets the title of the display.
void addDataRep(PlotterBase *, hippodraw::DataRep *) const
Adds the DataRep to the PlotterBase object by including it.
virtual RepBase * representation() const =0
Returns the representation used by the plotter.
A singleton class is the interface between an application and the list of FunctionRep objects contain...
int currentView()
Return the current view index.
void update()
Updates the display.
A singleton class that handles the application logic for cuts.
virtual const Range & getRange(Axes::Type axis, bool scaled) const
Returns the range on the specified axis.
hippodraw::FunctionWrap class interface.
static CutController * instance()
Returns the pointer to the singleton instance.
hippodraw::CutController class interface
hippodraw::QtDisplay class interface.
PyNTuple * createNTuple() const
Creates and returns an PyNTuple representing the display.
bool getLog(const PlotterBase *plotter, const std::string &axis) const
Returns true if the designated axis is on a logarithmic scale.
An xception class that is thrown when attempting to bind a DataRep to a NTuple with a column name tha...
This class is the public Python interface wrap for the FunctionRep class.
A wrapper for RootNTuple, so that when RootNTuple is used in Qt based application, the application object can be locked and unlocked before calling any ROOT functions.
A singleton class that is the interface between GUI and the DataSource objects.
This class is the public interface to a DataSource object that the user sees as the DataArray object ...
void addObserver(hippodraw::Observer *observer)
Adds an observer to PlotterBase object.
virtual DataRep * getDataRep(int index) const
Returns the specified DataRep or null pointer if it doesn't exits.
hippodraw::DataRep * getDataRep()
The get method.
std::string createBinding(const std::string &name, const std::vector< int > &indices) const
int getLog(const std::string &axis)
Return 1 if the specified axis is logarithmically scaled.
void setContourLevels(const std::vector< double > &levels)
Set the contour levels if a ContourPointRep.
A derived class of DataRep which is a base class for displaying a function.
The base class for the value to the color transformation.
Part of an implementation of the Observable Observer pattern based on the example implementation in t...
PlotterBase * createDisplay(const std::string &name)
Creates a display object.
const std::string & getLabel(const std::string &axis) const
Returns the label on the specified axis.
void setOffset(PlotterBase *plotter, const std::string &axis, int parm, bool dragging)
Sets the offset from dragging slider.
const DataSource & dataSource() const
Return a reference to the underlying DataSource.
virtual int getNumberOfEntries() const =0
Returns the total number of entries that went into creating the projected values. ...
std::map< std::string, std::pair< double, double > > m_ranges
The saved X and Y ranges to be used with the resize() method.