Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DisplayController Class Reference

#include <DisplayController.h>

Collaboration diagram for DisplayController:

Collaboration graph
[legend]
List of all members.

Detailed Description

A singleton class that is the interface between GUI and the displays.

It frequently implements the application logic which should neither be in the GUI nor in the display objects.

Todo:
DisplayController shouldn't need to know about the DataRepFactory.
Should probably move methods that use it to DataRepController.

Todo:
Shouldn't const_cast<BinToColor *> the return value from getValueRep() of the plotter object in the setValueBrkPt member function.
A member function returning a non const pointer to a BinToColor object should be implemented in the PlotterBase class and that should be used in the setValueBrkPt member function.

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

Sanket B. Malde <sanket@slac.stanford.edu>

Matan Shacham <matan@slac.stanford.edu>

Oded Wurman <owurman@stanford.edu>

Definition at line 63 of file DisplayController.h.

Public Member Functions

DataRepactiveDataRep (const PlotterBase *plotter) const
 Returns the active DataRep object for the DataRep objects contained in the plotter.
int activeDataRepIndex (const PlotterBase *plotter) const
 Returns the active DataRep index for the DataRep objects contained in the plotter.
DataRepaddDataRep (PlotterBase *plotter, const std::string &name, const DataSource *ntuple, const std::vector< std::string > &bindings) const
 Creates a new DataRep object with class name name and adds it to the existing plotter.
void addDataRep (PlotterBase *, DataRep *) const
 Adds the DataRep to the PlotterBase object by including it.
DataRepaddDataRepStacked (PlotterBase *plotter, const std::string &name, const DataSource *ntuple, 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.
LineDataRepaddLineRep (PlotterBase *, hippodraw::Axes::Type, double value)
 Adds a LineRep to the Plotter object.
LineDataRepaddLineRep (PlotterBase *, const std::string &axis, double value)
 Adds a LineDataRep to the Plotter object.
void addTextViewToList (std::vector< const ViewBase * > &dest, const std::vector< const ViewBase * > &src)
 Adds views from src to dest if they contain TextRep whose target is contained in dest.
bool areDataSourcesSaved (const PlotterBase *)
 Returns true if all the NTuple Objects used by the plotter are save to or read from a file.
const std::vector< std::string > & axisBindings (const PlotterBase *plotter, int index) const
 Returns the axis bindings for the indexed projector, if any, otherwise returns an empty vector.
const std::vector< std::string > & axisBindings (const PlotterBase *plotter) const
 Returns the axis bindings, if any, otherwise returns an empty vector.
const std::vector< std::string > & bindingOptions (const PlotterBase *plottter, int index)
 Returns the axis bindings options for the DataRep contained by the plotter at index index.
const std::vector< std::string > & bindingOptions (const std::string &type)
 Returns the axis binding options for a DataRep of type type.
PlotterBasecreateDisplay (const std::string &name, const DataSource &tuple, const std::vector< std::string > &bindings) const
 Creates a display object.
PlotterBasecreateDisplay (const std::string &name)
 Creates a display object.
void createNTuple (const PlotterBase *plotter)
 Creates a NTuple from the plotter.
DataRepcreateTextDataRep (const std::string &type, const std::string &text=std::string())
 Creates an object of a class derived from DataRep which is textual data representation of type type.
PlotterBasecreateTextPlotter (DataRep *datarep, const std::string &name, const std::string &text=std::string())
 Creates a plotter object for the DataRep with text representation of type name.
ViewBasecreateTextView (const ViewFactory *factory, PlotterBase *plotter, const std::string &name, const std::string &text=0)
 Creates an object which is a derived class of ViewBase.
ViewBasecreateTextView (const ViewFactory *factory, DataRep *rep, const std::string &name, const std::string &text=std::string())
 Creates an object which is a derived class of ViewBase.
double getAverage (const PlotterBase *plotter, hippodraw::Axes::Type axis, int index=0) const
 Returns the average value.
double getAverage (const PlotterBase *plotter, const std::string &axis, int index=0) const
 Returns the average value.
const std::vector< std::string > & getDataSourceLabels (const PlotterBase *plotter, int index)
 Returns the labels of the DataSource columns for the DataRep contained in the plotter at index index.
const std::stringgetDataSourceName (const PlotterBase *plotter, int index)
 Returns the name of the DataSource for the DataRep contained in the plotter at index index.
const std::vector< std::string > & getDisplayTypes () const
 Returns the types of displays available.
bool getLog (const PlotterBase *plotter, hippodraw::Axes::Type axis) const
 Returns true if the designated axis is on a logarithm scale.
bool getLog (const PlotterBase *plotter, const std::string &axis) const
 Returns true if the designated axis is on a logarithmic scale.
DataSourcegetNTuple (const PlotterBase *, int index)
 Returns the DataSource for the DataRep indexed by index.
const DataSourcegetNTuple (const PlotterBase *) const
 Returns the DataSource used by the selected DataRep, if any, otherwise return null pointer.
int getNumberOfEntries (const PlotterBase *plotter, int index=0) const
 Returns the number of entries.
unsigned int getRepStyle (const PlotterBase *plotter) const
 Returns the style of the point representation.
double getRMS (const PlotterBase *plotter, hippodraw::Axes::Type axis, int index=0) const
 Returns the root mean square along the specified axis for DataRep indexed by index.
double getRMS (const PlotterBase *plotter, const std::string &axis, int index=0) const
 Returns the root mean square along the specified axis for DataRep indexed by index.
const std::vector< std::string > & getTextTypes () const
 Returns the types of text displays.
const std::stringgetType (const PlotterBase *plotter, int index) const
 Returns the type of DataRep contained in the plotter at index index.
const std::vector< double > & getValueBrkPt (PlotterBase *plotter)
 Fetch slider values from the BinToColor model.
int getValueTransformIndex (PlotterBase *plotter)
 Returns the index to list of value to color transform names of the plotter.
const std::vector< std::string > & getValueTransformTypes () const
 Returns the types of value to color transforms available.
bool hasControlPoints (const PlotterBase *plotter) const
 Returns true if value to color transform has control points.
bool hasLineRep (const PlotterBase *plotter) const
 Returns true if active DataRep uses LinePointRep, otherwise returns false.
bool hasNTupleBindings (const PlotterBase *plotter, int index)
 Returns true if the DataRep contained by the plotter at index index has NTuple bindings.
bool hasSymbolRep (const PlotterBase *plotter) const
 Returns true if active DataRep uses SymbolPointRep, otherwise returns false.
bool isAxisBinned (PlotterBase *display, const std::string &axis)
 Tests if specified axis is binned.
bool isDataValid (const DataRep *) const
 Returns true only if all the data in a bound DataSource are valid.
bool isDataValid (const PlotterBase *) const
 Returns true only if all the data in a bound DataSource are valid.
float pointSize (const PlotterBase *) const
 Returns the size of the representation.
void remove (PlotterBase *)
 Deletes a PlotterBase object.
void removeTextObservers (const std::vector< const ViewBase * > &views)
 Removes TextRep Observer objects, if any, from its target.
void setActiveDataRepIndex (PlotterBase *plotter, int index)
 Sets the active DataRep index.
void setAllIntervalEnabled (const PlotterBase *plotter, bool yes)
 Sets the interval counting to yes of all the NTuple used by the plotter.
void setAxisBinding (PlotterBase *, const std::string &axis, const std::string &label)
 Sets the axis binding, if any, otherwise does nothing.
void setAxisBindings (PlotterBase *plotter, const std::vector< std::string > &labels) const
 Sets all the axis bindings, if any, otherwise does nothing.
void setBinWidth (PlotterBase *plotter, const std::string &axis, int parm, bool dragging)
 Sets the bin width Sets the bin width parameter from dragging slider.
void setBinWidth (DataRep *datarep, hippodraw::Axes::Type axis, double width)
 Sets the bin width of the DataRep object.
void setBinWidth (PlotterBase *plotter, hippodraw::Axes::Type axis, double width)
 Sets the bin width parameter.
void setBinWidth (PlotterBase *plotter, const std::string &axis, double width)
 Sets the bin width parameter.
void setErrorDisplayed (const PlotterBase *, hippodraw::Axes::Type axis, bool state) const
 Set the error display.
void setIntervalCount (const PlotterBase *plotter, unsigned int count)
 Sets the interval count on the the NTuple of the active DataRep of the plotter.
void setIntervalEnabled (const PlotterBase *plotter, bool yes)
 Sets the interval counting to yes on the NTuple of the active DataRep of the plotter.
void setLog (PlotterBase *plotter, hippodraw::Axes::Type axis, bool flag, XYTransform *transform)
 Sets a log scale on or off for the specified axis in special case that the transform object is a XYTransform.
void setLog (PlotterBase *plotter, hippodraw::Axes::Type axis, bool flag)
 Sets the log scale on or off for the specified axis for the plotter.
void setLog (PlotterBase *plotter, const std::string &axis, bool flag)
 Sets a log scale on or off for the specified axis for the plotter.
void setNTuple (PlotterBase *, const NTuple *) const
 Sets the ntuple on the selected DataRep, if it has ntuple bindings, otherwise does nothing.
void setOffset (PlotterBase *plotter, hippodraw::Axes::Type axis, double offset)
 Sets the offset parameter.
void setOffset (PlotterBase *plotter, const std::string &axis, int parm, bool dragging)
 Sets the offset from dragging slider.
void setRange (PlotterBase *plotter, hippodraw::Axes::Type axis, const Range &range)
 Sets the Range on specified axis.
void setRepresentation (PlotterBase *plotter, const std::string &point_rep)
 Sets the type of RepBase object to be used by the selected DataRep.
void setRepSize (PlotterBase *plotter, float size)
 Sets the size of the representation.
void setTransform (PlotterBase *plotter, const std::string &x, const std::string &y, const std::string &z)
 Creates and sets the new XYZ transform for the display.
void setTransform (PlotterBase *plotter, const std::string &x, const std::string &y)
 Creates and sets the new XY transform for the display.
void setTransform (PlotterBase *plotter, const std::string &name)
 Creates and sets a new transform for the display.
void setValueBrkPt (PlotterBase *plotter, const std::vector< double > &sv)
 Send slider values back to BinToColor model.
void setValueTransform (PlotterBase *plotter, int index, const std::vector< std::string > &usr_models, const std::vector< double > &brk_points, const std::vector< double > &flat_widths, const std::vector< double > &color_scales)
 Sets a new value transform for the plotter with optional adding of model.
void setValueTransform (PlotterBase *plotter, int index)
 Sets a new value transform for the plotter.
void stackDataRep (PlotterBase *, DataRep *) const
 Adds the DataRep to the PlotterBase object by stacking it.
 ~DisplayController ()
 The destructor.

Static Public Member Functions

static DisplayControllerinstance ()
 Returns the pointer to the singleton instance.

Private Member Functions

PlotterBasecreatePlotter (const DataRep *rep) const
 Returns a newly created PlotterBase object.
 DisplayController ()
 A default constructor for avoiding creation except by itself or with derived classes.
 DisplayController (const DisplayController &)
 A private copy constructor in order to avoid copying.
void fixLogIfBinned (const PlotterBase *, DataRep *rep) const
 Fixes the rep so it displays well on plotter.
NTupleProjectorgetBindingProjector (const PlotterBase *) const
 Returns projector that supports binding, if display has one, otherwise returns null pointer.
ProjectorBasegetProjector (const PlotterBase *display) const
 Returns the currently selected projector in the plot.
DataRepgetUniqueWithNTupleBindings (const PlotterBase *plotter)
 Returns the unique DataRep.
bool isCompatible (const PlotterBase *plotter, const std::string &reptype) const
 Returns true if adding a DataRep of type reptype to the PlotterBase @ plotter is compatible, otherwise returns false.
void setAxisModel (PlotterBase *plotter, hippodraw::Axes::Type axis, const std::string &type)
 Sets the axis model to type.
void setBinner (PlotterBase *plotter, hippodraw::Axes::Type axis, AxisModelBase *model)
 Sets the binner of of any Binning projectors to agree with AxisModel.
void setBinner (const PlotterBase *plotter, DataRep *rep, hippodraw::Axes::Type axis) const
 Sets the binner on the DataRep.

Private Attributes

std::string m_null_string
 A null string that is returned when reference to a valid string can not be found.
std::vector< std::stringm_null_vector
 A empty vector of strings.

Static Private Attributes

static DisplayControllers_instance = 0
 The pointer to the singleton object.


Constructor & Destructor Documentation

DisplayController::DisplayController const DisplayController  )  [private]
 

A private copy constructor in order to avoid copying.

DisplayController::DisplayController  )  [private]
 

A default constructor for avoiding creation except by itself or with derived classes.

Definition at line 88 of file DisplayController.cxx.

Referenced by instance().

DisplayController::~DisplayController  ) 
 

The destructor.

Definition at line 92 of file DisplayController.cxx.


Member Function Documentation

DataRep * DisplayController::activeDataRep const PlotterBase plotter  )  const
 

Returns the active DataRep object for the DataRep objects contained in the plotter.

If multiple DataRep objects are active, then returns an object that is not a FunctionRep if there is only one, otherwise returns null pointer.

Definition at line 557 of file DisplayController.cxx.

References activeDataRepIndex().

int DisplayController::activeDataRepIndex const PlotterBase plotter  )  const
 

Returns the active DataRep index for the DataRep objects contained in the plotter.

If multiple DataRep are active, then returns the index of non FunctionRep if there is only one, otherwise returns -1.

Definition at line 545 of file DisplayController.cxx.

References PlotterBase::activePlotIndex(), FunctionController::getUniqueNonFunctionIndex(), and FunctionController::instance().

Referenced by activeDataRep(), Inspector::contourLevelsTextBox_returnPressed(), Inspector::contourSlider_valueChanged(), Inspector::contourTextBox_returnPressed(), createTextView(), Inspector::cutNew(), Inspector::getDataCutList(), setErrorDisplayed(), setIntervalCount(), setIntervalEnabled(), setRepresentation(), Inspector::summaryNew(), Inspector::updateAxisTab(), and Inspector::updateDataCutsTab().

DataRep * DisplayController::addDataRep PlotterBase plotter,
const std::string name,
const DataSource ntuple,
const std::vector< std::string > &  bindings
const
 

Creates a new DataRep object with class name name and adds it to the existing plotter.

Connects the newly created DataRep to ntuple and sets the bindings to bindings. Returns DataRep if successful, otherwise returns a null pointer if the class name could not be found.

Note:
This method is used by the Inspector.

Definition at line 292 of file DisplayController.cxx.

References addDataRep(), DataRepController::createDataRep(), DataRepController::instance(), and isCompatible().

void DisplayController::addDataRep PlotterBase plotter,
DataRep rep
const
 

Adds the DataRep to the PlotterBase object by including it.

Bug:
Shouldn't need to call checkAxisScaling here since the CompositePlotter has already done it.
Remove call and test.

Definition at line 367 of file DisplayController.cxx.

References PlotterBase::addDataRep(), PlotterBase::checkAxisScaling(), fixLogIfBinned(), and DataRep::hasZeroRows().

Referenced by QtDisplay::addDataRep(), addDataRep(), QtDisplay::addFunction(), addLineRep(), and createDisplay().

DataRep * DisplayController::addDataRepStacked PlotterBase plotter,
const std::string name,
const DataSource ntuple,
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.

Connects the newly created DataRep to ntuple and sets the bindings to bindings. Returns DataRep if successful, otherwise returns a null pointer if the class name could not be found.

Note:
This method is used by the Inspector.

Definition at line 319 of file DisplayController.cxx.

References DataRepController::createDataRep(), DataRepController::instance(), isCompatible(), and stackDataRep().

Referenced by QtDisplay::addDataRepStacked(), and stackDataRep().

LineDataRep * DisplayController::addLineRep PlotterBase ,
hippodraw::Axes::Type  ,
double  value
 

Adds a LineRep to the Plotter object.

Definition at line 337 of file DisplayController.cxx.

References addDataRep().

LineDataRep * DisplayController::addLineRep PlotterBase ,
const std::string axis,
double  value
 

Adds a LineDataRep to the Plotter object.

Definition at line 347 of file DisplayController.cxx.

References hippodraw::Axes::convert(), and num_util::type().

void DisplayController::addTextViewToList std::vector< const ViewBase * > &  dest,
const std::vector< const ViewBase * > &  src
 

Adds views from src to dest if they contain TextRep whose target is contained in dest.

Definition at line 432 of file DisplayController.cxx.

References std::find(), PlotterBase::getDataRep(), PlotterBase::getNumDataReps(), TextPlotter::getParentDataRep(), and ViewBase::getPlotter().

Referenced by CanvasView::fillSelectedWithObservers().

bool DisplayController::areDataSourcesSaved const PlotterBase  ) 
 

Returns true if all the NTuple Objects used by the plotter are save to or read from a file.

Definition at line 807 of file DisplayController.cxx.

References getDataSourceName(), PlotterBase::getNumDataReps(), DataSourceController::instance(), and DataSourceController::isSaved().

Referenced by PlotterBaseXML::areDataSourcesSaved().

const vector< string > & DisplayController::axisBindings const PlotterBase plotter,
int  index
const
 

Returns the axis bindings for the indexed projector, if any, otherwise returns an empty vector.

Definition at line 611 of file DisplayController.cxx.

References NTupleProjector::getAxisBindings(), PlotterBase::getProjector(), and m_null_vector.

const vector< string > & DisplayController::axisBindings const PlotterBase plotter  )  const
 

Returns the axis bindings, if any, otherwise returns an empty vector.

Definition at line 577 of file DisplayController.cxx.

References PlotterBase::activeProjector(), NTupleProjector::getAxisBindings(), and m_null_vector.

const vector< string > & DisplayController::bindingOptions const PlotterBase plottter,
int  index
 

Returns the axis bindings options for the DataRep contained by the plotter at index index.

Definition at line 589 of file DisplayController.cxx.

References DataRepController::bindingOptions(), PlotterBase::getDataRep(), and DataRepController::instance().

const vector< string > & DisplayController::bindingOptions const std::string type  ) 
 

Returns the axis binding options for a DataRep of type type.

Definition at line 600 of file DisplayController.cxx.

References DataRepController::instance(), and DataRepFactory::instance().

PlotterBase * DisplayController::createDisplay const std::string name,
const DataSource tuple,
const std::vector< std::string > &  bindings
const
 

Creates a display object.

A DataRep of class name is created. The data rep is bound to NTuple tuple and the binding set by bindings. Returns a derived class of PlotterBase appropriate for the newly created data rep. If the class name could not be found, an exception is thrown.

Definition at line 250 of file DisplayController.cxx.

References addDataRep(), createPlotter(), FitsController::instance(), DataRepFactory::instance(), and Factory< Type >::prototype().

PlotterBase * DisplayController::createDisplay const std::string name  ) 
 

Creates a display object.

A Display of class name is created. It should be a class that is not bound to an NTuple. Returns a derived class of PlotterBase appropriate for the newly created data rep. If the class name could not be found, an exception is thrown.

Definition at line 227 of file DisplayController.cxx.

References addDataRep(), createPlotter(), hasNTupleBindings(), and DataRepController::instance().

Referenced by QtDisplay::createDisplay(), and main().

void DisplayController::createNTuple const PlotterBase plotter  ) 
 

Creates a NTuple from the plotter.

Creates a NTuple from the contents of DataRep in the plotter. The plotter must have a single active DataRep, otherwise nothing is created. The created NTuple is registered with the NTupleController.

Definition at line 1450 of file DisplayController.cxx.

References DataSourceController::instance().

PlotterBase * DisplayController::createPlotter const DataRep rep  )  const [private]
 

Returns a newly created PlotterBase object.

The DataRep prototype, rep, is used to selected the kind of plotter required by the rep.

Definition at line 272 of file DisplayController.cxx.

References PlotterFactory::instance(), and hippodraw::Axes::Z.

Referenced by createDisplay().

DataRep * DisplayController::createTextDataRep const std::string type,
const std::string text = std::string()
 

Creates an object of a class derived from DataRep which is textual data representation of type type.

Definition at line 508 of file DisplayController.cxx.

References Factory< Type >::create(), TextRepFactory::instance(), and RepBase::setText().

Referenced by createTextPlotter().

PlotterBase * DisplayController::createTextPlotter DataRep datarep,
const std::string name,
const std::string text = std::string()
 

Creates a plotter object for the DataRep with text representation of type name.

Uses the optional text if needed by the text representation.

Definition at line 522 of file DisplayController.cxx.

References TextPlotter::addDataRep(), createTextDataRep(), and TextPlotter::setParentDataRep().

Referenced by createTextView().

ViewBase * DisplayController::createTextView const ViewFactory factory,
PlotterBase plotter,
const std::string name,
const std::string text = 0
 

Creates an object which is a derived class of ViewBase.

The ViewFactory factory is used for its creation. A TextRepBase object corresponding to name is created for use by the view. The view is made an observer of plotter. The text is displayed if not null.

Definition at line 486 of file DisplayController.cxx.

References activeDataRepIndex(), createTextView(), and PlotterBase::getDataRep().

ViewBase * DisplayController::createTextView const ViewFactory factory,
DataRep rep,
const std::string name,
const std::string text = std::string()
 

Creates an object which is a derived class of ViewBase.

The ViewFactory factory is used for its creation. A TextRepBase object corresponding to name is created for use by the view. The target of the TextRepBase object is rep. The text is displayed if not null.

Definition at line 534 of file DisplayController.cxx.

References createTextPlotter(), and ViewFactory::createView().

Referenced by CanvasView::addTextDisplay(), CanvasView::addTextDisplayAt(), FunctionController::createFuncView(), and createTextView().

void DisplayController::fixLogIfBinned const PlotterBase ,
DataRep rep
const [private]
 

Fixes the rep so it displays well on plotter.

If the Plotter has an axis on the log scale, and if the corresponding axis of the DataRep is binned, then fix the DataRep so that binning is on a log scale.

Definition at line 356 of file DisplayController.cxx.

References setBinner(), hippodraw::Axes::X, and hippodraw::Axes::Y.

Referenced by addDataRep().

double DisplayController::getAverage const PlotterBase plotter,
hippodraw::Axes::Type  axis,
int  index = 0
const
 

Returns the average value.

Returns the average value for the DataRep indexed by index contained in the plotter. The average is taken along the axis axis. If index is out of range, raises an assertion.

Definition at line 648 of file DisplayController.cxx.

References getAverage(), and getProjector().

double DisplayController::getAverage const PlotterBase plotter,
const std::string axis,
int  index = 0
const
 

Returns the average value.

Returns the average value for the DataRep indexed by index contained in the plotter. The average is taken along the axis axis. If index is out of range, raises an assertion.

Definition at line 638 of file DisplayController.cxx.

References hippodraw::Axes::convert().

Referenced by getAverage().

NTupleProjector * DisplayController::getBindingProjector const PlotterBase plotter  )  const [private]
 

Returns projector that supports binding, if display has one, otherwise returns null pointer.

Todo:
Can replace much of this code by calling getUniqueWithNTupleBindings member function.

Definition at line 704 of file DisplayController.cxx.

References PlotterBase::getDataRep(), PlotterBase::getNumDataReps(), DataRep::getProjector(), and getProjector().

Referenced by getNTuple(), setAxisBindings(), and setNTuple().

const vector< string > & DisplayController::getDataSourceLabels const PlotterBase plotter,
int  index
 

Returns the labels of the DataSource columns for the DataRep contained in the plotter at index index.

Definition at line 846 of file DisplayController.cxx.

References PlotterBase::getDataRep(), DataSource::getLabels(), NTupleProjector::getNTuple(), DataRep::getProjector(), and m_null_vector.

const string & DisplayController::getDataSourceName const PlotterBase plotter,
int  index
 

Returns the name of the DataSource for the DataRep contained in the plotter at index index.

Definition at line 834 of file DisplayController.cxx.

References PlotterBase::getDataRep(), NTupleProjector::getNTupleName(), DataRep::getProjector(), and m_null_string.

Referenced by areDataSourcesSaved().

const vector< string > & DisplayController::getDisplayTypes  )  const
 

Returns the types of displays available.

Definition at line 218 of file DisplayController.cxx.

References DataRepFactory::instance().

bool DisplayController::getLog const PlotterBase plotter,
hippodraw::Axes::Type  axis
const
 

Returns true if the designated axis is on a logarithm scale.

Todo:
un-hard code this when we have XYZ transform?

Definition at line 960 of file DisplayController.cxx.

References PlotterBase::getTransform(), TransformBase::name(), hippodraw::Axes::X, XYTransform::xTransform(), hippodraw::Axes::Y, XYTransform::yTransform(), hippodraw::Axes::Z, and BinaryTransform::zTransform().

bool DisplayController::getLog const PlotterBase plotter,
const std::string axis
const
 

Returns true if the designated axis is on a logarithmic scale.

Definition at line 950 of file DisplayController.cxx.

References hippodraw::Axes::convert().

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

DataSource * DisplayController::getNTuple const PlotterBase ,
int  index
 

Returns the DataSource for the DataRep indexed by index.

Returns null pointer if DataRep does not having DataSource bindings.

Definition at line 761 of file DisplayController.cxx.

References PlotterBase::getDataRep(), getNTuple(), DataRep::getProjector(), and DataRep::hasNTupleBindings().

const DataSource * DisplayController::getNTuple const PlotterBase  )  const
 

Returns the DataSource used by the selected DataRep, if any, otherwise return null pointer.

Deprecated:
Should use method with index.

Definition at line 750 of file DisplayController.cxx.

References getBindingProjector(), and NTupleProjector::getNTuple().

Referenced by CutController::addCut(), CutController::getCutList(), getNTuple(), setAllIntervalEnabled(), setIntervalCount(), setIntervalEnabled(), Inspector::updateAxisTab(), Inspector::updateErrorEllipseTab(), and Inspector::updateFunctionsTab().

int DisplayController::getNumberOfEntries const PlotterBase plotter,
int  index = 0
const
 

Returns the number of entries.

Returns the number of entries of the Data Rep indexed by index contain in the plotter. If the index is out of range, an assertion is raised.

Definition at line 627 of file DisplayController.cxx.

References getProjector().

ProjectorBase * DisplayController::getProjector const PlotterBase display  )  const [private]
 

Returns the currently selected projector in the plot.

Definition at line 691 of file DisplayController.cxx.

References DataRep::getProjector(), and PlotterBase::selectedDataRep().

Referenced by getAverage(), getBindingProjector(), getNumberOfEntries(), getRMS(), and isDataValid().

unsigned int DisplayController::getRepStyle const PlotterBase plotter  )  const
 

Returns the style of the point representation.

Definition at line 1243 of file DisplayController.cxx.

Referenced by Inspector::updatePlotTab().

double DisplayController::getRMS const PlotterBase plotter,
hippodraw::Axes::Type  axis,
int  index = 0
const
 

Returns the root mean square along the specified axis for DataRep indexed by index.

Bug:
Only works for the X axis.

Definition at line 671 of file DisplayController.cxx.

References getProjector(), and getRMS().

double DisplayController::getRMS const PlotterBase plotter,
const std::string axis,
int  index = 0
const
 

Returns the root mean square along the specified axis for DataRep indexed by index.

Bug:
Only works for the X axis.

Definition at line 661 of file DisplayController.cxx.

References hippodraw::Axes::convert().

Referenced by getRMS().

const vector< string > & DisplayController::getTextTypes  )  const
 

Returns the types of text displays.

Definition at line 501 of file DisplayController.cxx.

References TextRepFactory::instance(), and Factory< Type >::names().

const string & DisplayController::getType const PlotterBase plotter,
int  index
const
 

Returns the type of DataRep contained in the plotter at index index.

Definition at line 682 of file DisplayController.cxx.

References PlotterBase::getDataRep(), and DataRep::name().

DataRep * DisplayController::getUniqueWithNTupleBindings const PlotterBase plotter  )  [private]
 

Returns the unique DataRep.

Returns a DataRep if only one of contained by the plotter has NTuple bindings or if only one is active, otherwise returns a null pointer.

Definition at line 861 of file DisplayController.cxx.

References std::count(), PlotterBase::getDataRep(), and hasNTupleBindings().

const vector< double > & DisplayController::getValueBrkPt PlotterBase plotter  ) 
 

Fetch slider values from the BinToColor model.

Definition at line 158 of file DisplayController.cxx.

References PlotterBase::getValueRep().

int DisplayController::getValueTransformIndex PlotterBase plotter  ) 
 

Returns the index to list of value to color transform names of the plotter.

Definition at line 184 of file DisplayController.cxx.

References getValueTransformTypes(), and num_util::size().

const vector< string > & DisplayController::getValueTransformTypes  )  const
 

Returns the types of value to color transforms available.

Definition at line 106 of file DisplayController.cxx.

References BinToColorFactory::instance().

Referenced by getValueTransformIndex().

bool DisplayController::hasControlPoints const PlotterBase plotter  )  const
 

Returns true if value to color transform has control points.

If PointRepBase object is one that transforms value to color and if the value to color transform can be varied, then returns true, otherwise returns false.

Definition at line 205 of file DisplayController.cxx.

bool DisplayController::hasLineRep const PlotterBase plotter  )  const
 

Returns true if active DataRep uses LinePointRep, otherwise returns false.

Definition at line 1223 of file DisplayController.cxx.

bool DisplayController::hasNTupleBindings const PlotterBase plotter,
int  index
 

Returns true if the DataRep contained by the plotter at index index has NTuple bindings.

Definition at line 824 of file DisplayController.cxx.

References PlotterBase::getDataRep(), and DataRep::hasNTupleBindings().

Referenced by createDisplay(), getUniqueWithNTupleBindings(), Inspector::setBinWidth(), and Inspector::updateAxisTab().

bool DisplayController::hasSymbolRep const PlotterBase plotter  )  const
 

Returns true if active DataRep uses SymbolPointRep, otherwise returns false.

Definition at line 1213 of file DisplayController.cxx.

DisplayController * DisplayController::instance  )  [static]
 

Returns the pointer to the singleton instance.

Definition at line 96 of file DisplayController.cxx.

References DisplayController(), and s_instance.

Referenced by CutController::addCut(), QtDisplay::addDataRep(), FunctionController::addDataRep(), PickTable::addDataRepButton(), Inspector::addDataRepButton_clicked(), QtDisplay::addDataRepStacked(), QtDisplay::addFunction(), CanvasView::addTextDisplay(), CanvasView::addTextDisplayAt(), PlotterBaseXML::areDataSourcesSaved(), Inspector::availPlotTypesActivated(), Inspector::axisLabelChanged(), Inspector::contourLevelsTextBox_returnPressed(), Inspector::contourSlider_valueChanged(), Inspector::contourTextBox_returnPressed(), QtDisplay::createDisplay(), FunctionController::createFuncView(), FunctionController::createNewEllipsoidDisplay(), FunctionController::createResidualsDisplay(), Inspector::cutNew(), Inspector::dataCreateNTuple(), CanvasView::deleteSelected(), Inspector::errorBars_toggled(), Inspector::fillCutsOn(), CanvasView::fillSelectedWithObservers(), Inspector::functionAdd(), Inspector::functionsFitToDataButton_clicked(), Inspector::functionsResetButton_clicked(), Inspector::getCutList(), CutController::getCutList(), Inspector::getDataCutList(), QtDisplay::getLog(), PyCanvas::getTextRepTypes(), Inspector::init(), Inspector::intervalStateChanged(), Inspector::intervalTextChanged(), Inspector::lineStyleButtonGroup_clicked(), Inspector::logScale_clicked(), main(), Inspector::newPlotButton_clicked(), Inspector::pointRepComboBox_activated(), QtDisplay::QtDisplay(), QtDisplay::resize(), PyDataRep::setBinWidth(), Inspector::setBinWidth(), CanvasView::setIntervalEnabled(), QtDisplay::setLog(), QtDisplay::setOffset(), Inspector::setOffset(), Inspector::setOffsetText(), QtDisplay::setTransform(), Inspector::setWidthText(), Inspector::sliderChanged(), Inspector::summaryNew(), Inspector::symbolPointSize_returnPressed(), Inspector::symbolTypeButtonGroup_clicked(), Inspector::updateAxisTab(), Inspector::updateCutVarGroupBox(), Inspector::updateDataCutsTab(), Inspector::updateErrorEllipseTab(), Inspector::updateFunctionsTab(), Inspector::updateLogBox(), Inspector::updatePlotTab(), Inspector::updatePlotTypes(), Inspector::updateSelectedPlotData(), Inspector::updateSelectedPlotType(), Inspector::updateSummaryTab(), and Inspector::valueChanged().

bool DisplayController::isAxisBinned PlotterBase display,
const std::string axis
 

Tests if specified axis is binned.

Returns true if only one DataRep is selected and it is binned on specified axis.

Definition at line 468 of file DisplayController.cxx.

References PlotterBase::activePlotIndex(), PlotterBase::activeProjector(), FunctionController::getUniqueNonFunctionIndex(), FunctionController::instance(), and ProjectorBase::isAxisBinned().

bool DisplayController::isCompatible const PlotterBase plotter,
const std::string datarep
const [private]
 

Returns true if adding a DataRep of type reptype to the PlotterBase @ plotter is compatible, otherwise returns false.

Bug:
Part of being compatible is same aspect ratio or none.

Definition at line 385 of file DisplayController.cxx.

References PlotterBase::hasAxis(), DataRepFactory::instance(), Factory< Type >::prototype(), and hippodraw::Axes::Z.

Referenced by addDataRep(), and addDataRepStacked().

bool DisplayController::isDataValid const DataRep  )  const
 

Returns true only if all the data in a bound DataSource are valid.

Definition at line 935 of file DisplayController.cxx.

References getProjector(), and isDataValid().

bool DisplayController::isDataValid const PlotterBase  )  const
 

Returns true only if all the data in a bound DataSource are valid.

Definition at line 922 of file DisplayController.cxx.

Referenced by isDataValid().

float DisplayController::pointSize const PlotterBase  )  const
 

Returns the size of the representation.

Definition at line 1204 of file DisplayController.cxx.

References PlotterBase::representation(), and RepBase::size().

void DisplayController::remove PlotterBase  ) 
 

Deletes a PlotterBase object.

Definition at line 1199 of file DisplayController.cxx.

void DisplayController::removeTextObservers const std::vector< const ViewBase * > &  views  ) 
 

Removes TextRep Observer objects, if any, from its target.

Definition at line 402 of file DisplayController.cxx.

References TextPlotter::getParentDataRep(), ViewBase::getPlotter(), and Observable::removeObserver().

Referenced by CanvasView::deleteSelected().

void DisplayController::setActiveDataRepIndex PlotterBase plotter,
int  index
 

Sets the active DataRep index.

Sets the active DataRep index and redraws the plot. If index is negative, sets all the contained DataRep objects to be active.

Definition at line 570 of file DisplayController.cxx.

void DisplayController::setAllIntervalEnabled const PlotterBase plotter,
bool  yes
 

Sets the interval counting to yes of all the NTuple used by the plotter.

Definition at line 797 of file DisplayController.cxx.

References getNTuple(), PlotterBase::getNumDataReps(), and NTuple::setIntervalEnabled().

void DisplayController::setAxisBinding PlotterBase ,
const std::string axis,
const std::string label
 

Sets the axis binding, if any, otherwise does nothing.

After setting the axis binding, set the plotter to auto-ranging and auto-ranges the data representations.

Definition at line 893 of file DisplayController.cxx.

References hippodraw::Axes::X, and hippodraw::Axes::Y.

void DisplayController::setAxisBindings PlotterBase plotter,
const std::vector< std::string > &  labels
const
 

Sets all the axis bindings, if any, otherwise does nothing.

Definition at line 909 of file DisplayController.cxx.

References getBindingProjector(), PlotterBase::setAutoRanging(), and NTupleProjector::setAxisBindings().

void DisplayController::setAxisModel PlotterBase plotter,
hippodraw::Axes::Type  axis,
const std::string type
[private]
 

Sets the axis model to type.

The string type should be "Linear" or "Log", otherwise an assertion is raised. If plotter doesn't have a axis model for axis, nothing is done.

Definition at line 1037 of file DisplayController.cxx.

References PlotterBase::getAxisModel(), PlotterBase::getPosRange(), AxisModelBase::isLog(), PlotterBase::setAxisModel(), setBinner(), AxisModelBase::setRangePos(), and std::swap().

Referenced by setLog().

void DisplayController::setBinner PlotterBase plotter,
hippodraw::Axes::Type  axis,
AxisModelBase model
[private]
 

Sets the binner of of any Binning projectors to agree with AxisModel.

Todo:
Remove this function when GUI has separate controls for displaying Log and binning log.

Definition at line 1023 of file DisplayController.cxx.

References PlotterBase::getDataRep(), PlotterBase::getNumDataReps(), and setBinner().

void DisplayController::setBinner const PlotterBase plotter,
DataRep rep,
hippodraw::Axes::Type  axis
const [private]
 

Sets the binner on the DataRep.

Sets the binner on the DataRep rep to agree with the axis scaling on plotter with respect to linear or logarithmic scale. If the rep is not using a binning projector, or if the rep is not binned on axis, then this member function does nothing.

Definition at line 989 of file DisplayController.cxx.

References DataRep::getProjector(), BinnerAxisFactory::instance(), ProjectorBase::isAxisBinned(), AxisModelBase::isLog(), BinningProjector::setBinnerOn(), BinnerAxis::setRange(), and hippodraw::Axes::Y.

Referenced by fixLogIfBinned(), setAxisModel(), and setBinner().

void DisplayController::setBinWidth PlotterBase plotter,
const std::string axis,
int  parm,
bool  dragging
 

Sets the bin width Sets the bin width parameter from dragging slider.

See also:
setBinWidth.

Definition at line 1344 of file DisplayController.cxx.

References PlotterBase::activePlotIndex(), PlotterBase::getNumDataReps(), PlotterBase::getProjector(), PlotterBase::setAutoRanging(), ProjectorBase::setBinWidth(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

void DisplayController::setBinWidth DataRep datarep,
hippodraw::Axes::Type  axis,
double  width
 

Sets the bin width of the DataRep object.

Sets the bin width of the DataRep object and informs its plotter.

Definition at line 1297 of file DisplayController.cxx.

References setBinWidth().

void DisplayController::setBinWidth PlotterBase plotter,
hippodraw::Axes::Type  axis,
double  width
 

Sets the bin width parameter.

If a single DataRep is on the display, or if a single DataRep on a multiple DataRep display is active, the bin width for that DataRep is set. If multiple DataRep objects are active, then each one has its bin width set. In the case of multiple DataRep objects width different bin widths, the default Y or Z axis label is set to "density", otherwise set to "entries / bin".

Todo:
Remove this function in favor of one with same name but taking string as argument.

Definition at line 1317 of file DisplayController.cxx.

References PlotterBase::activePlotIndex(), PlotterBase::getNumDataReps(), PlotterBase::getProjector(), PlotterBase::setAutoRanging(), and ProjectorBase::setBinWidth().

void DisplayController::setBinWidth PlotterBase plotter,
const std::string axis,
double  width
 

Sets the bin width parameter.

If a single DataRep is on the display, or if a single DataRep on a multiple DataRep display is active, the bin width for that DataRep is set. If multiple DataRep objects are active, then each one has its bin width set. In the case of multiple DataRep objects width different bin widths, the default Y or Z axis label is set to "density", otherwise set to "entries / bin".

Definition at line 1286 of file DisplayController.cxx.

References hippodraw::Axes::convert().

Referenced by setBinWidth().

void DisplayController::setErrorDisplayed const PlotterBase ,
hippodraw::Axes::Type  axis,
bool  state
const
 

Set the error display.

For the active DataRep contained by plotter, sets its error display on the axis axis to on, if state is true, otherwise turns it off.

Definition at line 1437 of file DisplayController.cxx.

References activeDataRepIndex().

void DisplayController::setIntervalCount const PlotterBase plotter,
unsigned int  count
 

Sets the interval count on the the NTuple of the active DataRep of the plotter.

Definition at line 773 of file DisplayController.cxx.

References activeDataRepIndex(), getNTuple(), and NTuple::setIntervalCount().

Referenced by Inspector::intervalTextChanged().

void DisplayController::setIntervalEnabled const PlotterBase plotter,
bool  yes
 

Sets the interval counting to yes on the NTuple of the active DataRep of the plotter.

Definition at line 785 of file DisplayController.cxx.

References activeDataRepIndex(), getNTuple(), and NTuple::setIntervalEnabled().

Referenced by Inspector::intervalStateChanged().

void DisplayController::setLog PlotterBase plotter,
hippodraw::Axes::Type  axis,
bool  flag,
XYTransform transform
 

Sets a log scale on or off for the specified axis in special case that the transform object is a XYTransform.

See also:
setLog(PlotterBase *, hippodraw::Axes::Type, bool )

Definition at line 1119 of file DisplayController.cxx.

References TransformFactory::createTransform(), TransformFactory::instance(), TransformBase::name(), setAxisModel(), PlotterBase::setTransform(), hippodraw::Axes::X, XYTransform::xTransform(), hippodraw::Axes::Y, XYTransform::yTransform(), hippodraw::Axes::Z, and BinaryTransform::zTransform().

void DisplayController::setLog PlotterBase plotter,
hippodraw::Axes::Type  axis,
bool  flag
 

Sets the log scale on or off for the specified axis for the plotter.

If flag is true, then the log scale is set on, otherwise a linear scale is set on. An XYTransform object is created and sent to the display.

Todo:
This function should go away in favor of one taking string for axis argument.

Definition at line 1087 of file DisplayController.cxx.

References PlotterBase::getTransform(), TransformFactory::instance(), setAxisModel(), setLog(), setTransform(), num_util::type(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

void DisplayController::setLog PlotterBase plotter,
const std::string axis,
bool  flag
 

Sets a log scale on or off for the specified axis for the plotter.

If flag is true, then the log scale is set on, otherwise a linear scale is set on. An XYTransform object is created and sent to the display.

Definition at line 1076 of file DisplayController.cxx.

References hippodraw::Axes::convert().

Referenced by FunctionController::createResidualsDisplay(), QtDisplay::setLog(), and setLog().

void DisplayController::setNTuple PlotterBase ,
const NTuple
const
 

Sets the ntuple on the selected DataRep, if it has ntuple bindings, otherwise does nothing.

Definition at line 734 of file DisplayController.cxx.

References Observable::addObserver(), getBindingProjector(), Observable::notifyObservers(), PlotterBase::selectedDataRep(), and NTupleProjector::setNTuple().

void DisplayController::setOffset PlotterBase plotter,
hippodraw::Axes::Type  axis,
double  offset
 

Sets the offset parameter.

Definition at line 1411 of file DisplayController.cxx.

References PlotterBase::activePlotIndex(), PlotterBase::getNumDataReps(), PlotterBase::getProjector(), and ProjectorBase::setOffset().

void DisplayController::setOffset PlotterBase plotter,
const std::string axis,
int  parm,
bool  dragging
 

Sets the offset from dragging slider.

Todo:
Use Axes::convert.

Todo:
Remove duplicated code compared to DisplayController::setBinWidth.

Definition at line 1379 of file DisplayController.cxx.

References PlotterBase::activePlotIndex(), PlotterBase::getNumDataReps(), PlotterBase::getProjector(), PlotterBase::setAutoRanging(), ProjectorBase::setOffset(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by QtDisplay::setOffset().

void DisplayController::setRange PlotterBase plotter,
hippodraw::Axes::Type  axis,
const Range range
 

Sets the Range on specified axis.

Also sets auto Ranging to off.

Definition at line 1275 of file DisplayController.cxx.

References PlotterBase::setAutoRanging(), and PlotterBase::setRange().

void DisplayController::setRepresentation PlotterBase plotter,
const std::string point_rep
 

Sets the type of RepBase object to be used by the selected DataRep.

Sets the type of RepBase object to be used by the selected DataRep. The type is specified by the string point_rep which should be one of the types available from the PointRepFactory. If point_rep is not found, the factory will throw an FactoryException. Preserves the Color of the previous point representation on the new one.

Definition at line 1259 of file DisplayController.cxx.

References activeDataRepIndex(), and PointRepFactory::instance().

void DisplayController::setRepSize PlotterBase plotter,
float  size
 

Sets the size of the representation.

Definition at line 1250 of file DisplayController.cxx.

References PlotterBase::selectedDataRep(), and DataRep::setRepSize().

void DisplayController::setTransform PlotterBase plotter,
const std::string x,
const std::string y,
const std::string z
 

Creates and sets the new XYZ transform for the display.

void DisplayController::setTransform PlotterBase plotter,
const std::string x,
const std::string y
 

Creates and sets the new XY transform for the display.

Definition at line 1186 of file DisplayController.cxx.

References TransformFactory::createTransform(), TransformFactory::instance(), and PlotterBase::setTransform().

void DisplayController::setTransform PlotterBase plotter,
const std::string name
 

Creates and sets a new transform for the display.

Definition at line 1171 of file DisplayController.cxx.

References TransformFactory::createTransform(), TransformFactory::instance(), and PlotterBase::setTransform().

Referenced by setLog(), and QtDisplay::setTransform().

void DisplayController::setValueBrkPt PlotterBase plotter,
const std::vector< double > &  sv
 

Send slider values back to BinToColor model.

Definition at line 167 of file DisplayController.cxx.

References PlotterBase::getValueRep().

void DisplayController::setValueTransform PlotterBase plotter,
int  index,
const std::vector< std::string > &  usr_models,
const std::vector< double > &  brk_points,
const std::vector< double > &  flat_widths,
const std::vector< double > &  color_scales
 

Sets a new value transform for the plotter with optional adding of model.

Definition at line 125 of file DisplayController.cxx.

References BinToColorFactory::instance().

void DisplayController::setValueTransform PlotterBase plotter,
int  index
 

Sets a new value transform for the plotter.

Definition at line 115 of file DisplayController.cxx.

References BinToColorFactory::instance().

void DisplayController::stackDataRep PlotterBase ,
DataRep
const
 

Adds the DataRep to the PlotterBase object by stacking it.

Definition at line 311 of file DisplayController.cxx.

References addDataRepStacked().

Referenced by addDataRepStacked().


Member Data Documentation

std::string DisplayController::m_null_string [private]
 

A null string that is returned when reference to a valid string can not be found.

Definition at line 74 of file DisplayController.h.

Referenced by getDataSourceName().

std::vector< std::string > DisplayController::m_null_vector [private]
 

A empty vector of strings.

This vector is returned by member functions that can not obtain a reference from a display.

Definition at line 78 of file DisplayController.h.

Referenced by axisBindings(), and getDataSourceLabels().

DisplayController * DisplayController::s_instance = 0 [static, private]
 

The pointer to the singleton object.

Definition at line 86 of file DisplayController.cxx.

Referenced by instance().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3