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

PlotterBase Class Reference

#include <PlotterBase.h>

Inheritance diagram for PlotterBase:

Inheritance graph
[legend]
Collaboration diagram for PlotterBase:

Collaboration graph
[legend]
List of all members.

Detailed Description

The base class for the PlotterBase hierarchy.

Objects of this class are responsible for drawing the axis, titles, labels, etc., but not the data points. The class creates and maintains models for its axis which are of class AxisModelBase.

Requests:
@ Ric reports that the axis labels are hard to read.
Especially the Y axis. Perhaps they should be made a bit bigger.

Requests:
@@ Less white space between plots.
IN conjunction with request for easier to read labels.

Requests:
Make title of plot optional and not the default.
Use the space for plotting.

Author:
Stephane Bonneaud <gandalf@slac.stanford.edu>

Jim Chiang < jchiang@slac.stanford.edu>

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

Joy Rajiv <jrajiv@stanford.edu>

Oded Wurman <owurman@stanford.edu>

Definition at line 57 of file PlotterBase.h.

Public Types

typedef void(hippodraw::Observer::* Action )(const Observable *)
 The member function of the Observer that is called.
typedef std::list< hippodraw::Observer * > ObserverList_t
 The type of STL container to maintain list of Observer objects.

Public Member Functions

virtual int activePlotIndex () const
 Returns the index of the active plotter.
virtual ProjectorBaseactiveProjector () const
 Returns the active projector.
virtual void addDataRep (DataRep *rep)
 Adds a DataRep object to the plotter.
void addObserver (hippodraw::Observer *)
 Adds an Observer to the Observer list.
virtual void addValues (const std::vector< double > &v)
 Adds data values to the plot.
virtual void autoScale ()
 Auto scales the Range of the axes using preferred Range from the points plotters.
virtual void checkAxisScaling ()
 Check if Axis needs to be scaled or not.
virtual PlotterBaseclone ()=0
 The clone function returns an object of its own kind which is a copy of this object at this moment.
virtual NTuplecreateNTuple () const =0
 Creates an NTuple representation of the plotted data.
virtual NTuplecreatePickTuple ()
 Creates a NTuple for a PickTable.
int currentView () const
 Return the current view index.
void deleteView (int index)
 Delete a view by index.
virtual void drawCrossHairs (ViewBase *view)
 Draws cross-hairs.
virtual void drawIn (ViewBase *view)=0
 Starts the drawing in view view.
virtual bool errorDisplay (hippodraw::Axes::Type axis) const =0
 Returns the state of error bar display on specified axis.
virtual void fillCutList (std::vector< const TupleCut * > &cuts) const
 Fills the cuts vector with the TupleCut objects contained by the DataRep objects, if any.
virtual void fillPickedPoint (double mx, double my, std::vector< double > &picked) const
 Fills the picked data point.
virtual double getAspectRatio () const
 Returns the aspect ratio.
virtual AxisModelBasegetAxisModel (hippodraw::Axes::Type axis) const
 Returns the AxisModelBase derived class for the specified axis.
double getBinWidth (const std::string &axis) const
 Returns the bin width.
virtual double getBinWidth (hippodraw::Axes::Type axis) const
 Returns the bin width.
virtual bool getCurrentRangeSaved ()
 Returns current_range_saved member t.
virtual DataRepgetDataRep (int index) const
 Returns the specified DataRep or null pointer if it doesn't exits.
virtual double getHighRangeOnX () const
 Returns the high end of the X axis range.
virtual const std::stringgetInternalLabel (hippodraw::Axes::Type axis) const
 Returns the internal label.
virtual const std::stringgetInternalTitle () const
 Returns the internal title.
virtual const std::stringgetLabel (hippodraw::Axes::Type) const
 Returns the label for the specified axis.
virtual double getLowRangeOnX () const
 Returns the low end of the X axis range.
HippoRectangle getMarginRect () const
 Returns the margin space where drawing takes place.
virtual int getNumberOfEntries () const
 Returns the number of entries in the contained DataRep.
virtual int getNumDataReps () const
 Returns the number of DataRep objects contained in the plot.
int getNumOfEntries () const
 Returns the number of entries in the contained DataRep.
const ObserverList_tgetObservers () const
 Returns the list of observers.
double getOffset (const std::string &axis) const
 Returns the offset on designated axis, similarly to getBinWidth.
virtual double getOffset (hippodraw::Axes::Type axis) const
 Returns the offset on designated axis, similarly to getBinWidth.
virtual int getParentDataRepIndex () const
 Returns the index of the parent DataRep.
virtual PlotterBasegetParentPlotter () const
 Returns the parent plotter.
virtual double getPosRange (hippodraw::Axes::Type axis) const
 Returns the smallest positive number from the data.
virtual ProjectorBasegetProjector (int i) const
 Returns the projector at index i.
virtual const RangegetRange (hippodraw::Axes::Type axis, bool scaled) const
 Returns the range on the specified axis.
virtual DataRepgetTarget () const
 Returns the target DataRep contained by the plotter.
const std::stringgetTitle () const
 Gets the title to be displayed.
virtual TransformBasegetTransform () const
 Returns the transform object used by the plotter.
const HippoRectanglegetUserRect () const
 Returns the data space rectangle.
virtual const BinToColorgetValueRep () const
 Returns the value to color representation.
virtual double getZValue (double x, double y, bool scaled=true) const
 Get the z value at the specified point (x,y).
virtual bool hasAxis (hippodraw::Axes::Type axis) const
 Returns true if the plotter has an axis of specified type.
virtual bool hasNTupleBindings () const =0
 Returns true if the plotter has NTuple binding, otherwise returns false.
virtual bool hasZoomY () const
 Returns true if the plotter has zoom feature on the Y axis, otherwise returns false.
virtual int indexOf (const DataRep *rep) const
 Returns the index of the DataRep.
virtual bool isAutoRanging (hippodraw::Axes::Type axis) const
 Returns true if auto-ranging is enabled, otherwise returns false.
virtual bool isTargetable () const
 Returns true if receiving object is target-able.
virtual void marginToUserXY (double mx, double my, bool scaled, double &ux, double &uy) const =0
 Converts from the drawing space to the data space.
virtual void matrixTranspose (bool yes)
 Transpose the X and Y axis of matrix representation.
const std::stringname () const
 Returns the name of the plotter.
int nextView (bool stepForward=true)
 Cycle through each set of plot ranges, thereby changing the view with each call.
virtual void notifyObservers () const
 Notifies Observer objects of a change.
int numViews () const
 Return the number of stored views.
virtual int plotterId () const
 The unique ID number of this plotter.
virtual void removeDataRep (DataRep *)
 Removes the DataRep from the plot.
void removeObserver (hippodraw::Observer *)
 Removes an Observer from the Observer list.
virtual const ColorrepColor () const =0
 Returns the color used for the representation.
virtual RepBaserepresentation () const =0
 Returns the representation used by the plotter.
virtual void reset ()
 Resets the bins.
int saveView (const std::vector< double > &range_values)
 Save the current set of plot ranges which define a "view" for this plot.
int saveViewAtIndex (const std::vector< double > &range_values, unsigned int i)
 Save the current set of plot ranges which define a "view" for this plot.at the position i.
virtual DataRepselectedDataRep () const
 Returns the selected DataRep.
virtual void setActivePlot (int index, bool redraw)
 Sets the active plot.
void setAspectRatio (double ratio)
 Sets the aspect ratio.
virtual void setAutoRanging (bool flag)
 Sets the auto-ranging status for all axes to flag.
virtual void setAutoRanging (hippodraw::Axes::Type axis, bool flag)
 Sets the auto-ranging.
virtual void setAutoRanging (const std::string &axis, bool flag)
 Sets the auto-ranging.
virtual void setAutoTicks (const std::string &, bool on)
 Sets automatic ticks on or off.
virtual void setAutoTicks (hippodraw::Axes::Type axis, bool yes)
 Sets automatic generation of axis ticks.
virtual void setAutoTicksOnX (bool yes)
 Sets automatic generation of axis ticks on X axis.
virtual void setAxisModel (AxisModelBase *, hippodraw::Axes::Type)=0
 Sets the AxisModel on the specified axis.
virtual void setBinWidth (const std::string &axis, double width)
 Sets the bin width.
virtual void setBinWidth (hippodraw::Axes::Type axis, double width)
 Sets the bin width.
void setCrossX (double val)
 Set the crossX value.
void setCrossY (double val)
 Set the crossY value.
virtual void setCurrentRangeSaved (bool flag)
 Sets current_range_saved member to flag.
virtual void setCutRangeAt (const Range &range, unsigned int i)
 Sets the Range of a TupleCut object.
virtual void setEnableZ (bool yes=true)
 Enables the Z axis, if plotter has one.
virtual void setErrorDisplay (hippodraw::Axes::Type axis, bool)=0
 Sets the display of the error bars on or off.
virtual void setHighRange (hippodraw::Axes::Type axis, int parm, bool dragging)
 Sets the high end of the Range of data displayed.
virtual void setLabel (hippodraw::Axes::Type, const std::string &value)
 Sets the label of the specified axis to value.
virtual void setLabel (const std::string &axis, const std::string &label)
 Sets the label of specified axis to label.
virtual void setLowRange (hippodraw::Axes::Type axis, int parm, bool dragging)
 Sets the low end of the Range of data displayed.
virtual void setNumberOfBins (hippodraw::Axes::Type axis, unsigned int number)
 Sets the number of bins.
virtual void setNumberOfBins (const std::string &axis, unsigned int number)
 Sets the number of bins.
virtual void setOffset (const std::string &axis, double offset)
 Sets the bin offset.
virtual void setOffset (hippodraw::Axes::Type axis, double offset)
 Sets the offset.
virtual void setOffsets (double xoffset, double yoffset)
 Sets the offsets on the x and y axis.
virtual void setParentDataRepIndex (int index)
 Sets the index of the parent DataRep.
virtual void setParentPlotter (PlotterBase *plotter)
 Sets the parent plotter.
void setRange (const std::string &axis, double low, double high)
 Sets the range on the specified axis.
virtual void setRange (hippodraw::Axes::Type axis, const Range &range, bool scaled=false, bool adjust_width=true)
 Sets the range on the specified axis.
virtual void setRepColor (const Color &)=0
 Sets the representation's color.
virtual void setRepresentation (RepBase *pointrep)=0
 Sets the representation.
virtual void setTicks (const std::string &axis, const std::vector< double > &values, const std::vector< std::string > &labels)
 Sets the ticks on specified axis.
virtual void setTicks (hippodraw::Axes::Type axis, const std::vector< AxisTick > &ticks)
 Sets the ticks for the specified axis.
virtual void setTicksOnX (const std::vector< double > &values, const std::vector< std::string > &labels)
 Sets the ticks for the X axis.
void setTitle (const std::string &title)
 Sets the title to be displayed.
virtual void setTransform (TransformBase *)
 Sets the transform object.
virtual void setValueRep (BinToColor *rep)
 Sets the object that will do the value to color transform, if any.
void setView (int index)
 Set the view by index.
void toggleActivePlot ()
 Toggles the active DataRep, if 2 or more are contained by the plotter.
virtual void update ()=0
 Updates the plotter.
virtual void update (const Observable *)
 Sends notification to it's Observer ViewBase object that redrawing is needed.
virtual float userToInvertedMarginY (double y) const =0
 Converts the user Y coordinate into the top-left based margin Y coordinate.
virtual float userToMarginColor (double c) const
 Converts the user Z coordinate into the margin color (X) coordinate.
virtual float userToMarginX (double x) const =0
 Converts the user X coordinate into the margin X coordinate.
virtual float userToMarginY (double x) const =0
 Converts the user Y coordinate into the margin Y coordinate.
virtual bool wantsPixmap () const
 Informs caller if the plotter prefers to use a pixmap or not.
virtual void willDelete (const Observable *)
 Notifies this Observer object that one of its Observable objects is about to be deleted.
virtual ~PlotterBase ()
 The virtual destructor.

Protected Member Functions

bool hasAutoScaled () const
 Returns true if the axes have already been auto-scaled.
void notifyObservers (Action action) const
 An internal method to iterate over all observers and to send the message action.
 PlotterBase (const PlotterBase &plotter)
 The copy constructor.
 PlotterBase (const std::string &name)
 A constructor taking name of type of plotter as argument.
 PlotterBase ()
 Default constructor needed to ensure m_plotterId is set.

Protected Attributes

bool current_range_saved
 Returns true if the current range on the axes have been saved.
double m_aspect_ratio
 The aspect ratio.
double m_crossX
 The x position of the cross hair.
double m_crossY
 The y position of the cross hair.
int m_currentView
 Index of the current view.
HippoRectangle m_margin_rect
 The rectangle area in which the projected points are plotted.
std::string m_name
 The name of the type of plotter.
int m_parent_datarep_index
 Parent DataRep index.
PlotterBasem_parent_plotter
 Parent plotter.
int m_plotterId
 A unique plotter id.
std::string m_title
 The main label; the title of the plot.
HippoRectangle m_user_rect
 The abstract data space.
std::vector< std::vector<
double > > 
m_views
 A vector of x and y ranges to be used as a circular buffer allowing one to cycle through the saved plot "views".

Static Protected Attributes

static int s_plotters
 Reference count for creating plotter ids.

Private Member Functions

void setPlotterId ()
virtual void setScaleFactor (hippodraw::Axes::Type axis, double factor)
 Sets the scale factor on the specified axis.
virtual void setScaling (hippodraw::Axes::Type axis, bool on=true)
 Sets the scaling attribute of the AxisModelBase object.


Member Typedef Documentation

typedef void( hippodraw::Observer::* Observable::Action)(const Observable *) [inherited]
 

The member function of the Observer that is called.

Definition at line 83 of file Observable.h.

typedef std::list< hippodraw::Observer * > Observable::ObserverList_t [inherited]
 

The type of STL container to maintain list of Observer objects.

Definition at line 46 of file Observable.h.


Constructor & Destructor Documentation

PlotterBase::PlotterBase  )  [protected]
 

Default constructor needed to ensure m_plotterId is set.

Definition at line 35 of file PlotterBase.cxx.

References current_range_saved, and setPlotterId().

PlotterBase::PlotterBase const std::string name  )  [protected]
 

A constructor taking name of type of plotter as argument.

Definition at line 50 of file PlotterBase.cxx.

References current_range_saved, and setPlotterId().

PlotterBase::PlotterBase const PlotterBase plotter  )  [protected]
 

The copy constructor.

Definition at line 64 of file PlotterBase.cxx.

References current_range_saved, and setPlotterId().

PlotterBase::~PlotterBase  )  [virtual]
 

The virtual destructor.

It is responsible for deleting the axis models.

Definition at line 78 of file PlotterBase.cxx.


Member Function Documentation

int PlotterBase::activePlotIndex  )  const [virtual]
 

Returns the index of the active plotter.

Returns 0 if only one plot is in the display, or only one plot is supported.

Reimplemented in XyPlotter.

Definition at line 175 of file PlotterBase.cxx.

Referenced by DisplayController::activeDataRepIndex(), CutController::addCut(), FunctionController::addFunction(), Inspector::colorSelect_clicked(), Inspector::functionsRemoveButton_clicked(), QtDisplay::getDataRep(), FunctionController::getFunctionRep(), getTitle(), DisplayController::isAxisBinned(), DisplayController::setBinWidth(), QtDisplay::setContourLevels(), DisplayController::setOffset(), setTitle(), and toggleActivePlot().

ProjectorBase * PlotterBase::activeProjector  )  const [virtual]
 

Returns the active projector.

That is, the one that should receive commands to it.

Reimplemented in XyPlotter.

Definition at line 129 of file PlotterBase.cxx.

Referenced by DisplayController::axisBindings(), DisplayController::isAxisBinned(), and QtDisplay::numberOfEntries().

void PlotterBase::addDataRep DataRep rep  )  [virtual]
 

Adds a DataRep object to the plotter.

The implementation in this base class does nothing. This function will be overridden by plotters that implement having DataRep objects.

Reimplemented in Cut1DPlotter, Cut2DPlotter, TextPlotter, and XyPlotter.

Definition at line 164 of file PlotterBase.cxx.

Referenced by DisplayController::addDataRep(), and FunctionController::addFunctionRep().

void Observable::addObserver hippodraw::Observer  )  [inherited]
 

Adds an Observer to the Observer list.

Definition at line 49 of file Observable.cxx.

References Observable::m_list.

Referenced by CutPlotter::addCutTarget(), XyPlotter::addDataRep(), FunctionRep::FunctionRep(), BinningProjector::normalizeTo(), DataRepController::setAxisBindings(), DisplayController::setNTuple(), CutPlotter::setNTuple(), and TextPlotter::setParentDataRep().

void PlotterBase::addValues const std::vector< double > &  v  )  [virtual]
 

Adds data values to the plot.

This method is provided as a convenience when the plotter contains a single DataRep that responds to addValues. For example a static histogram would respond to it. The implementation here does nothing, so needs to be overridden by a derived class.

Reimplemented in XyPlotter.

Definition at line 508 of file PlotterBase.cxx.

void PlotterBase::autoScale  )  [virtual]
 

Auto scales the Range of the axes using preferred Range from the points plotters.

Sets the auto scaled flag to true. The implementation in the base class does nothing.

Reimplemented in XyPlotter.

Definition at line 303 of file PlotterBase.cxx.

Referenced by setAutoRanging().

void PlotterBase::checkAxisScaling  )  [virtual]
 

Check if Axis needs to be scaled or not.

Reimplemented in XyPlotter.

Definition at line 472 of file PlotterBase.cxx.

Referenced by DisplayController::addDataRep(), and toggleActivePlot().

virtual PlotterBase* PlotterBase::clone  )  [pure virtual]
 

The clone function returns an object of its own kind which is a copy of this object at this moment.

Implemented in Cut1DPlotter, Cut2DPlotter, TextPlotter, and XyPlotter.

virtual NTuple* PlotterBase::createNTuple  )  const [pure virtual]
 

Creates an NTuple representation of the plotted data.

Derived classes should create a representation appropriate for their plotting. The NTuple should contain the coordinates, the error on the coordinates, the values and the error on the values.

Implemented in TextPlotter, and XyPlotter.

NTuple * PlotterBase::createPickTuple  )  [virtual]
 

Creates a NTuple for a PickTable.

The implementation in this base class returns a null pointer. Derived classes may override this member function to create a PickTable appropriate for their class.

Reimplemented in XyPlotter.

Definition at line 536 of file PlotterBase.cxx.

int PlotterBase::currentView  )  const
 

Return the current view index.

Definition at line 829 of file PlotterBase.cxx.

References m_currentView.

Referenced by QtDisplay::currentView().

void PlotterBase::deleteView int  index  ) 
 

Delete a view by index.

Definition at line 812 of file PlotterBase.cxx.

References m_views, and setView().

Referenced by QtDisplay::deleteView().

void PlotterBase::drawCrossHairs ViewBase view  )  [virtual]
 

Draws cross-hairs.

Draws cross-hairs at the mouse hot spot, if applicable. The implementation in this base class does nothing. Derived classes may override this function.

Reimplemented in XyPlotter.

Definition at line 501 of file PlotterBase.cxx.

virtual void PlotterBase::drawIn ViewBase view  )  [pure virtual]
 

Starts the drawing in view view.

This is the initial method that is called.

Implemented in TextPlotter, and XyPlotter.

Referenced by ViewBase::drawSelf().

virtual bool PlotterBase::errorDisplay hippodraw::Axes::Type  axis  )  const [pure virtual]
 

Returns the state of error bar display on specified axis.

Implemented in TextPlotter, and XyPlotter.

Referenced by Inspector::updatePlotTab().

void PlotterBase::fillCutList std::vector< const TupleCut * > &  cuts  )  const [virtual]
 

Fills the cuts vector with the TupleCut objects contained by the DataRep objects, if any.

This base class implementation does nothing.

Reimplemented in XyPlotter.

Definition at line 836 of file PlotterBase.cxx.

void PlotterBase::fillPickedPoint double  mx,
double  my,
std::vector< double > &  picked
const [virtual]
 

Fills the picked data point.

Fills the vector picked with the picked data set. This method should be overridden by derived classes that support picked data. This base class implementation does nothing.

Reimplemented in XyPlotter.

Definition at line 543 of file PlotterBase.cxx.

double PlotterBase::getAspectRatio  )  const [virtual]
 

Returns the aspect ratio.

The aspect ratio is the ratio of the width to the height that should be used when drawing the plotter. If the aspect ratio has been set to a non-zero value, the return that ratio. Otherwise, return the aspect ratio preferred by the contained TransformBase object. The implementation in this base class always returns 0.0.

Reimplemented in XyPlotter.

Definition at line 515 of file PlotterBase.cxx.

AxisModelBase * PlotterBase::getAxisModel hippodraw::Axes::Type  axis  )  const [virtual]
 

Returns the AxisModelBase derived class for the specified axis.

The implementation in this base class returns a null pointer.

Reimplemented in XyPlotter.

Definition at line 110 of file PlotterBase.cxx.

Referenced by PlotterBaseXML::createAxisModel(), PlotterBaseXML::createAxisModels(), and DisplayController::setAxisModel().

double PlotterBase::getBinWidth const std::string axis  )  const
 

Returns the bin width.

The implementation in the base class converts the string to an hippodraw::Axes::Type and calls the virtual function getBinWidth ( hippodraw::Axes::Type );. It is declared as a convenience to the developer since bin width is a common attribute.

Definition at line 428 of file PlotterBase.cxx.

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

double PlotterBase::getBinWidth hippodraw::Axes::Type  axis  )  const [virtual]
 

Returns the bin width.

The implementation in the base class does nothing. It is declared as a convenience to the developer since bin width is a common attribute.

Reimplemented in XyPlotter.

Definition at line 437 of file PlotterBase.cxx.

Referenced by QtDisplay::getBinWidth(), getBinWidth(), Inspector::setBinWidth(), and Inspector::updateAxisTab().

bool PlotterBase::getCurrentRangeSaved  )  [virtual]
 

Returns current_range_saved member t.

Definition at line 857 of file PlotterBase.cxx.

References current_range_saved.

DataRep * PlotterBase::getDataRep int  index  )  const [virtual]
 

Returns the specified DataRep or null pointer if it doesn't exits.

Reimplemented in TextPlotter, and XyPlotter.

Definition at line 144 of file PlotterBase.cxx.

Referenced by CutController::addCut(), QtDisplay::addFunction(), FunctionController::addFunction(), DisplayController::addTextViewToList(), DisplayController::bindingOptions(), CutController::connectDataRep(), Inspector::contourLevelsTextBox_returnPressed(), Inspector::contourSlider_valueChanged(), Inspector::contourTextBox_returnPressed(), PlotterBaseXML::createChildren(), DisplayController::createTextView(), FunctionController::findFunctions(), DisplayController::getBindingProjector(), QtDisplay::getDataRep(), QtDisplay::getDataReps(), DisplayController::getDataSourceLabels(), DisplayController::getDataSourceName(), DisplayController::getNTuple(), getTitle(), DisplayController::getType(), FunctionController::getUniqueNonFunctionIndex(), DisplayController::getUniqueWithNTupleBindings(), DisplayController::hasNTupleBindings(), PlotTable::initialize(), PickTable::PickTable(), DisplayController::setBinner(), QtDisplay::setContourLevels(), setTitle(), Inspector::updateDataCutsTab(), and Inspector::updateFunctionsTab().

double PlotterBase::getHighRangeOnX  )  const [virtual]
 

Returns the high end of the X axis range.

Deprecated:
This method is only used by the SIP built Python extension module and is kept only for running experiments.

Definition at line 654 of file PlotterBase.cxx.

References getRange(), Range::high(), and hippodraw::Axes::X.

const string & PlotterBase::getInternalLabel hippodraw::Axes::Type  axis  )  const [virtual]
 

Returns the internal label.

The internal label is either the label set by a client, or one of %x, %y, or %z for the corresponding axis. The later ones mean that the object should return the corresponding label of the DataSource. The implementation in this base class returns an empty string.

Reimplemented in XyPlotter.

Definition at line 296 of file PlotterBase.cxx.

Referenced by PlotterBaseXML::createElement().

const string & PlotterBase::getInternalTitle  )  const [virtual]
 

Returns the internal title.

The internal title is either the title set by a client, or %t. The later ones mean that the object should return the corresponding title of the DataSource, if bound to one.

Definition at line 289 of file PlotterBase.cxx.

References m_title.

Referenced by PlotterBaseXML::createElement().

const string & PlotterBase::getLabel hippodraw::Axes::Type   )  const [virtual]
 

Returns the label for the specified axis.

The implementation in this base class returns an empty string.

Reimplemented in XyPlotter.

Definition at line 280 of file PlotterBase.cxx.

Referenced by PlotTable::initialize().

double PlotterBase::getLowRangeOnX  )  const [virtual]
 

Returns the low end of the X axis range.

Definition at line 645 of file PlotterBase.cxx.

References getRange(), Range::low(), and hippodraw::Axes::X.

HippoRectangle PlotterBase::getMarginRect  )  const
 

Returns the margin space where drawing takes place.

Definition at line 405 of file PlotterBase.cxx.

References m_margin_rect.

Referenced by ViewBase::getMarginRect(), QtViewImp::getMarginRect(), OpenGLView::toViewY(), and EpsView::toViewY().

int PlotterBase::getNumberOfEntries  )  const [virtual]
 

Returns the number of entries in the contained DataRep.

Reimplemented in XyPlotter.

Definition at line 460 of file PlotterBase.cxx.

Referenced by getNumOfEntries().

int PlotterBase::getNumDataReps  )  const [virtual]
 

Returns the number of DataRep objects contained in the plot.

Implementation in this base return 0.

Reimplemented in TextPlotter, and XyPlotter.

Definition at line 139 of file PlotterBase.cxx.

Referenced by DisplayController::addTextViewToList(), DisplayController::areDataSourcesSaved(), PlotterBaseXML::createChildren(), FunctionController::findFunctions(), DisplayController::getBindingProjector(), QtDisplay::getDataReps(), FunctionController::getUniqueNonFunctionIndex(), DisplayController::setAllIntervalEnabled(), DisplayController::setBinner(), DisplayController::setBinWidth(), DisplayController::setOffset(), and toggleActivePlot().

int PlotterBase::getNumOfEntries  )  const
 

Returns the number of entries in the contained DataRep.

Note:
This method is to workaround of SIP handling of virtual functions. It calls the virtual function getNumberOfEntries().

Definition at line 467 of file PlotterBase.cxx.

References getNumberOfEntries().

const Observable::ObserverList_t & Observable::getObservers  )  const [inherited]
 

Returns the list of observers.

Definition at line 57 of file Observable.cxx.

References Observable::m_list.

double PlotterBase::getOffset const std::string axis  )  const
 

Returns the offset on designated axis, similarly to getBinWidth.

Definition at line 451 of file PlotterBase.cxx.

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

double PlotterBase::getOffset hippodraw::Axes::Type  axis  )  const [virtual]
 

Returns the offset on designated axis, similarly to getBinWidth.

Reimplemented in XyPlotter.

Definition at line 444 of file PlotterBase.cxx.

Referenced by getOffset(), Inspector::setOffset(), and Inspector::updateAxisTab().

int PlotterBase::getParentDataRepIndex  )  const [virtual]
 

Returns the index of the parent DataRep.

Returns -1 if there exist none

Definition at line 554 of file PlotterBase.cxx.

References m_parent_datarep_index.

Referenced by PlotterBaseXML::createElement().

PlotterBase * PlotterBase::getParentPlotter  )  const [virtual]
 

Returns the parent plotter.

Returns 0 if there exist none

Definition at line 564 of file PlotterBase.cxx.

References m_parent_plotter.

Referenced by PlotterBaseXML::createElement(), and FunctionController::refreshEllipsoidDisplay().

double PlotterBase::getPosRange hippodraw::Axes::Type  axis  )  const [virtual]
 

Returns the smallest positive number from the data.

Reimplemented in XyPlotter.

Definition at line 479 of file PlotterBase.cxx.

Referenced by DisplayController::setAxisModel().

ProjectorBase * PlotterBase::getProjector int  i  )  const [virtual]
 

Returns the projector at index i.

Todo:
Remove this method when no longer used.

Reimplemented in XyPlotter.

Definition at line 134 of file PlotterBase.cxx.

Referenced by DisplayController::axisBindings(), DisplayController::setBinWidth(), and DisplayController::setOffset().

const Range & PlotterBase::getRange hippodraw::Axes::Type  axis,
bool  scaled
const [virtual]
 

Returns the range on the specified axis.

Returns the range of the data being plotted on the axis axis. If scaled is true, uses the scaled range.

See also:
AxisModelBase::getRange. The implementation in this base class returns an empty Range.

Reimplemented in XyPlotter.

Definition at line 340 of file PlotterBase.cxx.

Referenced by Inspector::axisZoomPanCheckBox_clicked(), Inspector::cutHighSlider_sliderReleased(), Inspector::cutLowSlider_sliderReleased(), getHighRangeOnX(), getLowRangeOnX(), QtDisplay::getRange(), Inspector::setDragOn(), Inspector::setHighRange(), Inspector::setHighText(), Inspector::setLowRange(), Inspector::setLowText(), Inspector::updateAxisTab(), and Inspector::updateCutControlValues().

DataRep * PlotterBase::getTarget  )  const [virtual]
 

Returns the target DataRep contained by the plotter.

The implementation in the base class returns a null pointer because it never contains a target-able DataRep.

Reimplemented in XyPlotter.

Definition at line 677 of file PlotterBase.cxx.

const string & PlotterBase::getTitle  )  const
 

Gets the title to be displayed.

Definition at line 251 of file PlotterBase.cxx.

References activePlotIndex(), getDataRep(), and m_title.

Referenced by XyPlotter::createPickTuple(), XyPlotter::drawIn(), QtDisplay::getTitle(), PlotTable::initialize(), and Inspector::updatePlotTab().

TransformBase * PlotterBase::getTransform  )  const [virtual]
 

Returns the transform object used by the plotter.

The implementation in this base class returns a null pointer.

Reimplemented in XyPlotter.

Definition at line 119 of file PlotterBase.cxx.

Referenced by Inspector::autoScale_clicked(), PlotterBaseXML::createChildren(), DisplayController::getLog(), Inspector::setHighRange(), DisplayController::setLog(), and Inspector::updateAxisTab().

const HippoRectangle & PlotterBase::getUserRect  )  const
 

Returns the data space rectangle.

Definition at line 400 of file PlotterBase.cxx.

References m_user_rect.

Referenced by ViewBase::getUserRect().

const BinToColor * PlotterBase::getValueRep  )  const [virtual]
 

Returns the value to color representation.

If the Z value is represented graphically, then return the object that controls the binary value to graphic attribute. This base class implementation returns a null pointer.

Reimplemented in XyPlotter.

Definition at line 187 of file PlotterBase.cxx.

Referenced by DisplayController::getValueBrkPt(), and DisplayController::setValueBrkPt().

double PlotterBase::getZValue double  x,
double  y,
bool  scaled = true
const [virtual]
 

Get the z value at the specified point (x,y).

Returns 0.0. Derived classes that support Z coordinates should override this method and returns the z value of the point at x and y. If scaled is true, returns the z value multiplied by the scale factor, otherwise returns the true value.

Definition at line 484 of file PlotterBase.cxx.

bool PlotterBase::hasAutoScaled  )  const [protected]
 

Returns true if the axes have already been auto-scaled.

Reimplemented in XyPlotter.

Definition at line 124 of file PlotterBase.cxx.

bool PlotterBase::hasAxis hippodraw::Axes::Type  axis  )  const [virtual]
 

Returns true if the plotter has an axis of specified type.

The implementation in this base class always returns false.

Reimplemented in XyPlotter.

Definition at line 95 of file PlotterBase.cxx.

Referenced by PlotterBaseXML::createChildren(), PlotTable::initialize(), and DisplayController::isCompatible().

virtual bool PlotterBase::hasNTupleBindings  )  const [pure virtual]
 

Returns true if the plotter has NTuple binding, otherwise returns false.

Implemented in CutPlotter, TextPlotter, and XyPlotter.

bool PlotterBase::hasZoomY  )  const [virtual]
 

Returns true if the plotter has zoom feature on the Y axis, otherwise returns false.

Reimplemented in XyPlotter.

Definition at line 102 of file PlotterBase.cxx.

int PlotterBase::indexOf const DataRep rep  )  const [virtual]
 

Returns the index of the DataRep.

Returns the index of the DataRep rep if it is contained by the receiving object, otherwise returns -1. This base class implementation always returns -1. .

Reimplemented in XyPlotter.

Definition at line 684 of file PlotterBase.cxx.

bool PlotterBase::isAutoRanging hippodraw::Axes::Type  axis  )  const [virtual]
 

Returns true if auto-ranging is enabled, otherwise returns false.

The implementation in this base class always returns false.

Reimplemented in XyPlotter.

Definition at line 229 of file PlotterBase.cxx.

bool PlotterBase::isTargetable  )  const [virtual]
 

Returns true if receiving object is target-able.

The plotter is target-able if one and only one target-able DataRep contained by the plotter is in selected state. The implementation in this base class returns false because it never contains a target-able DataRep.

See also:
DataRep::isTargetable () const

Reimplemented in XyPlotter.

Definition at line 670 of file PlotterBase.cxx.

virtual void PlotterBase::marginToUserXY double  mx,
double  my,
bool  scaled,
double &  ux,
double &  uy
const [pure virtual]
 

Converts from the drawing space to the data space.

Converts the drawing space coordinates mx and my, to the data space. The results are return via ux and uy. Applies the scale factor of an axis if scaled is true.

Implemented in TextPlotter, and XyPlotter.

void PlotterBase::matrixTranspose bool  yes  )  [virtual]
 

Transpose the X and Y axis of matrix representation.

If X-Y representation of is matrix represented as a vector with shape, then transpose the X and Y axis. Otherwise, do nothing.

Note:
The implementation in this base class does nothing.

Reimplemented in XyPlotter.

Definition at line 663 of file PlotterBase.cxx.

const string & PlotterBase::name  )  const
 

Returns the name of the plotter.

See also:
m_name.

Definition at line 82 of file PlotterBase.cxx.

References m_name.

Referenced by PlotterBaseXML::createElement(), and XyPlotter::createPickTuple().

int PlotterBase::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 765 of file PlotterBase.cxx.

References m_currentView, m_views, and setView().

Referenced by QtDisplay::nextView().

void Observable::notifyObservers Action  action  )  const [protected, inherited]
 

An internal method to iterate over all observers and to send the message action.

Definition at line 69 of file Observable.cxx.

References std::bind2nd(), std::for_each(), Observable::m_list, and std::mem_fun().

void Observable::notifyObservers  )  const [virtual, inherited]
 

Notifies Observer objects of a change.

If interval counting is disabled, then Observer::Update is sent immediately. If interval counting is enabled, then the current count is incremented. If the current count is equal to the interval count, then the Observer::update message is sent and the current count reset to 0.

Reimplemented in NTuple, FitsNTuple, RootNTuple, NumArrayTuple, ListTuple, and RootNTuple.

Definition at line 90 of file Observable.cxx.

References hippodraw::Observer::update().

Referenced by XyPlotter::addDataRep(), XyPlotter::addDataRepStacked(), FunctionController::addFunctionRep(), RTuple::addRow(), StHist2DProjector::addValues(), StHist1DProjector::addValues(), XyPlotter::autoScale(), Inspector::contourLevelsTextBox_returnPressed(), Inspector::contourSlider_valueChanged(), Inspector::contourTextBox_returnPressed(), FunctionRep::fitFunction(), NumArrayTuple::notifyObservers(), NTuple::notifyObservers(), ListTuple::notifyObservers(), RootNTuple::notifyObservers(), FitsNTuple::notifyObservers(), XyPlotter::removeDataRep(), FunctionRep::restoreParameters(), CutPlotter::setActive(), XyPlotter::setAutoRanging(), QtDisplay::setContourLevels(), CutPlotter::setCutColor(), XyPlotter::setCutEnabled(), XyPlotter::setCutInverted(), XyPlotter::setCutRangeAt(), ProjectorBase::setDirty(), DataRep::setErrorDisplay(), XyPlotter::setHighRange(), XyPlotter::setLabel(), setLabel(), DataSource::setLabelAt(), DataSource::setLabels(), XyPlotter::setLowRange(), DataSource::setName(), DisplayController::setNTuple(), FunctionRep::setParameters(), DataRep::setRepColor(), DyHistogram::setRepresentation(), DataRep::setRepresentation(), DataRep::setRepSize(), DataRep::setRepStyle(), XyPlotter::setScaling(), setTitle(), DataSource::setTitle(), XyPlotter::setTransform(), XyPlotter::setValueRep(), update(), NTupleProjector::update(), DataRep::update(), CutPlotter::update(), BinningProjector::update(), CutPlotter::updateTargets(), DataRep::~DataRep(), DataSource::~DataSource(), NTuple::~NTuple(), and RTuple::~RTuple().

int PlotterBase::numViews  )  const
 

Return the number of stored views.

Definition at line 805 of file PlotterBase.cxx.

References m_views.

Referenced by QtDisplay::numViews().

int PlotterBase::plotterId  )  const [virtual]
 

The unique ID number of this plotter.

Definition at line 718 of file PlotterBase.cxx.

References m_plotterId.

Referenced by QtDisplay::plotterId().

void PlotterBase::removeDataRep DataRep  )  [virtual]
 

Removes the DataRep from the plot.

The base class implementation does nothing.

Todo:
Remove this and the addDataRep member functions from this class.

Reimplemented in XyPlotter.

Definition at line 180 of file PlotterBase.cxx.

Referenced by FunctionController::removeFunction().

void Observable::removeObserver hippodraw::Observer  )  [inherited]
 

Removes an Observer from the Observer list.

Definition at line 63 of file Observable.cxx.

References Observable::m_list.

Referenced by BinningProjector::normalizeTo(), CutPlotter::removeFromTarget(), DisplayController::removeTextObservers(), NTupleProjector::setNTuple(), FunctionRep::willDelete(), FunctionRep::~FunctionRep(), and NTupleProjector::~NTupleProjector().

virtual const Color& PlotterBase::repColor  )  const [pure virtual]
 

Returns the color used for the representation.

Implemented in TextPlotter, and XyPlotter.

Referenced by Inspector::colorSelect_clicked(), and Inspector::updatePlotTab().

virtual RepBase* PlotterBase::representation  )  const [pure virtual]
 

Returns the representation used by the plotter.

Implemented in TextPlotter, and XyPlotter.

Referenced by DisplayController::pointSize(), and QtDisplay::setContourLevels().

void PlotterBase::reset  )  [virtual]
 

Resets the bins.

Reimplemented in XyPlotter.

Definition at line 393 of file PlotterBase.cxx.

int PlotterBase::saveView const std::vector< double > &  range_values  ) 
 

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

Returns:
index of the saved view.
Parameters:
range_values A vector of 4 elements containing the x and y ranges.

Definition at line 725 of file PlotterBase.cxx.

References m_currentView, and m_views.

Referenced by QtDisplay::saveView().

int PlotterBase::saveViewAtIndex const std::vector< double > &  range_values,
unsigned int  i
 

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

The views from position i onwards are deleted

Returns:
index of the saved view.
Parameters:
range_values A vector of 4 elements containing the x and y ranges.
i the position at which range_values should be inserted at.

Definition at line 740 of file PlotterBase.cxx.

References m_currentView, and m_views.

DataRep * PlotterBase::selectedDataRep  )  const [virtual]
 

Returns the selected DataRep.

That is, the one that should receive commands to it. If multiple DataRep objects are selected, return a null pointer.

Reimplemented in XyPlotter.

Definition at line 149 of file PlotterBase.cxx.

Referenced by DisplayController::getProjector(), DisplayController::setNTuple(), and DisplayController::setRepSize().

void PlotterBase::setActivePlot int  index,
bool  redraw
[virtual]
 

Sets the active plot.

Redraws the plot if redraw is true.

Reimplemented in XyPlotter.

Definition at line 170 of file PlotterBase.cxx.

Referenced by FunctionController::addFunction(), PyCanvas::addText(), PyCanvas::addTextAt(), Inspector::functionsRemoveButton_clicked(), and toggleActivePlot().

void PlotterBase::setAspectRatio double  ratio  ) 
 

Sets the aspect ratio.

Set the ratio of the width to the height that should be used when drawing the plotter. A value of 0.0 indicates that any ratio is acceptable.

Definition at line 522 of file PlotterBase.cxx.

References m_aspect_ratio.

Referenced by FitsController::checkForImage(), and QtDisplay::setAspectRatio().

void PlotterBase::setAutoRanging bool  flag  )  [virtual]
 

Sets the auto-ranging status for all axes to flag.

Reimplemented in XyPlotter.

Definition at line 223 of file PlotterBase.cxx.

void PlotterBase::setAutoRanging hippodraw::Axes::Type  axis,
bool  flag
[virtual]
 

Sets the auto-ranging.

Sets auto-ranging status for the axis to flag and auto-ranges all axis which has that status set. The implementation in this base class does nothing.

Reimplemented in XyPlotter.

Definition at line 218 of file PlotterBase.cxx.

void PlotterBase::setAutoRanging const std::string axis,
bool  flag
[virtual]
 

Sets the auto-ranging.

Sets auto-ranging status for the axis to flag and auto-ranges all axis which has that status set.

Definition at line 201 of file PlotterBase.cxx.

References autoScale(), and hippodraw::Axes::convert().

Referenced by Inspector::axisZoomPanCheckBox_clicked(), QtDisplay::resize(), QtDisplay::setAutoRanging(), DisplayController::setAxisBindings(), DisplayController::setBinWidth(), Inspector::setHighRange(), Inspector::setLowRange(), DisplayController::setOffset(), and DisplayController::setRange().

void PlotterBase::setAutoTicks const std::string ,
bool  on
[virtual]
 

Sets automatic ticks on or off.

Definition at line 603 of file PlotterBase.cxx.

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

void PlotterBase::setAutoTicks hippodraw::Axes::Type  axis,
bool  yes
[virtual]
 

Sets automatic generation of axis ticks.

This base class does nothing. Derived classes may interpret this function.

Reimplemented in XyPlotter.

Definition at line 583 of file PlotterBase.cxx.

Referenced by setAutoTicks(), and setAutoTicksOnX().

void PlotterBase::setAutoTicksOnX bool  yes  )  [virtual]
 

Sets automatic generation of axis ticks on X axis.

This base class does nothing. Derived classes may interpret this function.

Note:
This member function is temporary fix to memory leak problem in passing string with SIP.

Definition at line 596 of file PlotterBase.cxx.

References setAutoTicks(), and hippodraw::Axes::X.

virtual void PlotterBase::setAxisModel AxisModelBase ,
hippodraw::Axes::Type 
[pure virtual]
 

Sets the AxisModel on the specified axis.

Implemented in TextPlotter, and XyPlotter.

Referenced by PlotterBaseXML::createAxisModels(), and DisplayController::setAxisModel().

void PlotterBase::setBinWidth const std::string axis,
double  width
[virtual]
 

Sets the bin width.

Sets the bin width parameter of the plot. Not all plots have a bin width parameter. Since histogram-ming plots are commonly used, this method has been declared as a convenience to script writers. The implementation is this base class does nothing.

Definition at line 369 of file PlotterBase.cxx.

References hippodraw::Axes::convert(), and setBinWidth().

void PlotterBase::setBinWidth hippodraw::Axes::Type  axis,
double  width
[virtual]
 

Sets the bin width.

Sets the bin width of the contained ProjectorBase objects to width along axis axis. The implementation in this class does nothing. The

See also:
PrjectorBase::setBinWidth.

Reimplemented in XyPlotter.

Definition at line 356 of file PlotterBase.cxx.

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

void PlotterBase::setCrossX double  val  ) 
 

Set the crossX value.

Definition at line 489 of file PlotterBase.cxx.

References m_crossX.

Referenced by QtViewImp::setCrossX().

void PlotterBase::setCrossY double  val  ) 
 

Set the crossY value.

Definition at line 494 of file PlotterBase.cxx.

References m_crossY.

Referenced by QtViewImp::setCrossY().

void PlotterBase::setCurrentRangeSaved bool  flag  )  [virtual]
 

Sets current_range_saved member to flag.

Definition at line 850 of file PlotterBase.cxx.

References current_range_saved.

Referenced by CanvasView::contentsMouseReleaseEvent().

void PlotterBase::setCutRangeAt const Range range,
unsigned int  i
[virtual]
 

Sets the Range of a TupleCut object.

Sets the Range of a TupleCut object, if any. This base class implementation does nothing.

Reimplemented in CutPlotter, and XyPlotter.

Definition at line 843 of file PlotterBase.cxx.

Referenced by Inspector::cutText_returnPressed().

void PlotterBase::setEnableZ bool  yes = true  )  [virtual]
 

Enables the Z axis, if plotter has one.

Implementation here does nothing.

Reimplemented in XyPlotter.

Definition at line 576 of file PlotterBase.cxx.

Referenced by PlotterBaseXML::createPlotter().

virtual void PlotterBase::setErrorDisplay hippodraw::Axes::Type  axis,
bool 
[pure virtual]
 

Sets the display of the error bars on or off.

Todo:
Remove this function when no longer in use.

Implemented in TextPlotter, and XyPlotter.

void PlotterBase::setHighRange hippodraw::Axes::Type  axis,
int  parm,
bool  dragging
[virtual]
 

Sets the high end of the Range of data displayed.

The implementation is this base class does nothing.

Reimplemented in XyPlotter.

Definition at line 331 of file PlotterBase.cxx.

Referenced by Inspector::setHighRange().

void PlotterBase::setLabel hippodraw::Axes::Type  ,
const std::string value
[virtual]
 

Sets the label of the specified axis to value.

The implementation in this base class does nothing.

Reimplemented in XyPlotter.

Definition at line 274 of file PlotterBase.cxx.

void PlotterBase::setLabel const std::string axis,
const std::string label
[virtual]
 

Sets the label of specified axis to label.

The default is to take the label from bound NTuple column. Invoking this member function overrides that. To return to taking the label from the NTuple column, label should be set to "%l".

Note:
This method is only used with the SIP based Python extension module.

Definition at line 263 of file PlotterBase.cxx.

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

Referenced by QtDisplay::setLabel().

void PlotterBase::setLowRange hippodraw::Axes::Type  axis,
int  parm,
bool  dragging
[virtual]
 

Sets the low end of the Range of data displayed.

The implementation in this base class does nothing.

Reimplemented in XyPlotter.

Definition at line 325 of file PlotterBase.cxx.

Referenced by Inspector::setLowRange().

void PlotterBase::setNumberOfBins hippodraw::Axes::Type  axis,
unsigned int  number
[virtual]
 

Sets the number of bins.

Sets the number of bins of the contained ProjectorBase objects to number along the axis axis. The implementation in this class does nothing.

See also:
ProbjectorBase::setNumberOfBins.

Reimplemented in XyPlotter.

Definition at line 349 of file PlotterBase.cxx.

void PlotterBase::setNumberOfBins const std::string axis,
unsigned int  number
[virtual]
 

Sets the number of bins.

Sets the number of bins of the plot. Not all plots have a bin attribute. Since histogram-ming plots are commonly used, this method has been declared as a convenience to script writers.

Definition at line 385 of file PlotterBase.cxx.

References hippodraw::Axes::convert().

Referenced by QtDisplay::setNumberOfBins().

void PlotterBase::setOffset const std::string axis,
double  offset
[virtual]
 

Sets the bin offset.

Sets the bin offset parameter of the plot. Not all plots have a bin parameter. Since histogram-ming plots are commonly used, this method has been declared as a convenience to script writers. The implementation is this base class does nothing.

Definition at line 377 of file PlotterBase.cxx.

References hippodraw::Axes::convert(), and setOffset().

void PlotterBase::setOffset hippodraw::Axes::Type  axis,
double  offset
[virtual]
 

Sets the offset.

Sets the edges of the bins to be offset from its current value by the amount offset along the axis axis. The implementation in this class does nothing.

Reimplemented in XyPlotter.

Definition at line 362 of file PlotterBase.cxx.

Referenced by FitsController::checkForImage(), setOffset(), and setOffsets().

void PlotterBase::setOffsets double  xoffset,
double  yoffset
[virtual]
 

Sets the offsets on the x and y axis.

Definition at line 548 of file PlotterBase.cxx.

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

void PlotterBase::setParentDataRepIndex int  index  )  [virtual]
 

Sets the index of the parent DataRep.

Definition at line 559 of file PlotterBase.cxx.

References m_parent_datarep_index.

void PlotterBase::setParentPlotter PlotterBase plotter  )  [virtual]
 

Sets the parent plotter.

Definition at line 569 of file PlotterBase.cxx.

References m_parent_plotter.

void PlotterBase::setPlotterId  )  [private]
 

Definition at line 710 of file PlotterBase.cxx.

References m_plotterId, and s_plotters.

Referenced by PlotterBase().

void PlotterBase::setRange const std::string axis,
double  low,
double  high
 

Sets the range on the specified axis.

Creates a Range object from the low and high arguments. The Range is the scaled range. It calls setRange ( hippodraw::Axes::Type, Range, bool ) with third argument true.

Definition at line 310 of file PlotterBase.cxx.

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

void PlotterBase::setRange hippodraw::Axes::Type  axis,
const Range range,
bool  scaled = false,
bool  adjust_width = true
[virtual]
 

Sets the range on the specified axis.

Sets the Range on the axis axis to range. The TransformBase object contained by this object may adjust the range to fall within its limits. If scaled is true, then the Range object's value is a scaled range, otherwise it is the true range. if adjust_width is true, the bin width, if applicable, is adjusts so one has the same number of bins after the range is set, otherwise, the bin width is not changed. The implementation in this base class does nothing.

Bug:
Setting an range to 0, 100M on plot with empty NTuple causes unknown exception.
Probably calculating too many bins.

Reimplemented in XyPlotter.

Definition at line 320 of file PlotterBase.cxx.

Referenced by QtDisplay::resize(), Inspector::setHighRange(), Inspector::setHighText(), Inspector::setLowRange(), Inspector::setLowText(), QtDisplay::setRange(), setRange(), DisplayController::setRange(), and setView().

virtual void PlotterBase::setRepColor const Color  )  [pure virtual]
 

Sets the representation's color.

Implemented in TextPlotter, and XyPlotter.

Referenced by Inspector::colorSelect_clicked().

virtual void PlotterBase::setRepresentation RepBase pointrep  )  [pure virtual]
 

Sets the representation.

Derived classes must implement this member function. Their interpretation of a representation varies. For example, the representation could be a plotting symbol or a line.

Bug:
This method is confusing because programmer may not know if it means PointRep or DataRep.

Implemented in TextPlotter, and XyPlotter.

Referenced by QtDisplay::setPointRep().

void PlotterBase::setScaleFactor hippodraw::Axes::Type  axis,
double  factor
[private, virtual]
 

Sets the scale factor on the specified axis.

The implementation in this base class does nothing.

Definition at line 418 of file PlotterBase.cxx.

void PlotterBase::setScaling hippodraw::Axes::Type  axis,
bool  on = true
[private, virtual]
 

Sets the scaling attribute of the AxisModelBase object.

The implementation in this base class does nothing.

Reimplemented in XyPlotter.

Definition at line 422 of file PlotterBase.cxx.

void PlotterBase::setTicks const std::string axis,
const std::vector< double > &  values,
const std::vector< std::string > &  labels
[virtual]
 

Sets the ticks on specified axis.

Definition at line 627 of file PlotterBase.cxx.

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

void PlotterBase::setTicks hippodraw::Axes::Type  axis,
const std::vector< AxisTick > &  ticks
[virtual]
 

Sets the ticks for the specified axis.

Reimplemented in XyPlotter.

Definition at line 590 of file PlotterBase.cxx.

Referenced by setTicks(), and setTicksOnX().

void PlotterBase::setTicksOnX const std::vector< double > &  values,
const std::vector< std::string > &  labels
[virtual]
 

Sets the ticks for the X axis.

Note:
This method is provided to avoid interfacing the other one with the same name to Python.

This method is temporary fix to memory leak problem with SIP.

Definition at line 611 of file PlotterBase.cxx.

References setTicks(), num_util::size(), and hippodraw::Axes::X.

void PlotterBase::setTitle const std::string title  ) 
 

Sets the title to be displayed.

The implementation is to pass the title parameter to the axes representation.

Definition at line 234 of file PlotterBase.cxx.

References activePlotIndex(), getDataRep(), m_title, and Observable::notifyObservers().

Referenced by XyPlotter::createPickTuple(), QtDisplay::setTitle(), and Inspector::titleText_returnPressed().

void PlotterBase::setTransform TransformBase  )  [virtual]
 

Sets the transform object.

A copy of the transform object is made by calling TransformBase::clone(), and the previous transform object is deleted. By doing it this way, a controller in an application does not need to keep track of how many references to a particular transform object are active. Derived classes may override this function in order to check if the concrete type of transform object is one appropriate for them. The implementation in this base class does nothing.

Reimplemented in XyPlotter.

Definition at line 115 of file PlotterBase.cxx.

Referenced by PlotterBaseXML::getObject(), DisplayController::setLog(), and DisplayController::setTransform().

void PlotterBase::setValueRep BinToColor rep  )  [virtual]
 

Sets the object that will do the value to color transform, if any.

The implementation is this base class does nothing.

Reimplemented in XyPlotter.

Definition at line 194 of file PlotterBase.cxx.

void PlotterBase::setView int  index  ) 
 

Set the view by index.

Definition at line 789 of file PlotterBase.cxx.

References m_currentView, m_views, and setRange().

Referenced by deleteView(), nextView(), and QtDisplay::setView().

void PlotterBase::toggleActivePlot  ) 
 

Toggles the active DataRep, if 2 or more are contained by the plotter.

Toggles the active plot. With each call, the current active plot is deselected and the next one becomes the active plot. When the end of the list of plots is reached, all plots become active. If all plots are active then only the first becomes active.

Definition at line 691 of file PlotterBase.cxx.

References activePlotIndex(), checkAxisScaling(), getNumDataReps(), and setActivePlot().

virtual void PlotterBase::update  )  [pure virtual]
 

Updates the plotter.

Updates the plotter by informing contained DataRep that an update is needed. Does not notify its Observer objects.

Implemented in TextPlotter, and XyPlotter.

void PlotterBase::update const Observable  )  [virtual]
 

Sends notification to it's Observer ViewBase object that redrawing is needed.

Implements hippodraw::Observer.

Reimplemented in CutPlotter.

Definition at line 88 of file PlotterBase.cxx.

References Observable::notifyObservers().

virtual float PlotterBase::userToInvertedMarginY double  y  )  const [pure virtual]
 

Converts the user Y coordinate into the top-left based margin Y coordinate.

Implemented in TextPlotter, and XyPlotter.

Referenced by QtViewWidget::toViewY(), QtView::toViewY(), QtViewImp::userToDrawY(), OpenGLView::userToDrawY(), and EpsView::userToDrawY().

float PlotterBase::userToMarginColor double  c  )  const [virtual]
 

Converts the user Z coordinate into the margin color (X) coordinate.

Reimplemented in XyPlotter.

Definition at line 410 of file PlotterBase.cxx.

Referenced by QtViewImp::userToDrawColor(), OpenGLView::userToDrawColor(), and EpsView::userToDrawColor().

virtual float PlotterBase::userToMarginX double  x  )  const [pure virtual]
 

Converts the user X coordinate into the margin X coordinate.

Implemented in TextPlotter, and XyPlotter.

Referenced by QtViewWidget::toViewX(), QtView::toViewX(), OpenGLView::toViewX(), EpsView::toViewX(), QtViewImp::userToDrawX(), and OpenGLView::userToDrawX().

virtual float PlotterBase::userToMarginY double  x  )  const [pure virtual]
 

Converts the user Y coordinate into the margin Y coordinate.

Implemented in TextPlotter, and XyPlotter.

Referenced by OpenGLView::toViewY(), and EpsView::toViewY().

bool PlotterBase::wantsPixmap  )  const [virtual]
 

Informs caller if the plotter prefers to use a pixmap or not.

Returns true if the plotter might make good use of an off screen pix map, otherwise returns false. If a plot contains thousands of points, then selection of the plot, or moving the plot on a canvas could be slow unless an off screen pixmap is used to flush previous drawing the the screen. The default implementation in the base class is to return false.

Reimplemented in XyPlotter.

Definition at line 529 of file PlotterBase.cxx.

void hippodraw::Observer::willDelete const Observable  )  [virtual, inherited]
 

Notifies this Observer object that one of its Observable objects is about to be deleted.

Since most Observable objects are owned by its Observer, it is the Observer that issued the delete. Thus the default implementation here does nothing. Derived classes that observe objects owned by another should implement this method to remove the Observable from the list they are observing.

Reimplemented in FunctionRep, DataSourceController, CutPlotter, TextPlotter, BinningProjector, DyHist1DProjector, DyHist2DProjector, NTupleProjector, Profile2DProjector, and ProfileProjector.

Definition at line 25 of file Observer.cxx.

Referenced by DataRep::~DataRep(), DataSource::~DataSource(), NTuple::~NTuple(), and RTuple::~RTuple().


Member Data Documentation

bool PlotterBase::current_range_saved [protected]
 

Returns true if the current range on the axes have been saved.

Definition at line 130 of file PlotterBase.h.

Referenced by getCurrentRangeSaved(), PlotterBase(), and setCurrentRangeSaved().

double PlotterBase::m_aspect_ratio [protected]
 

The aspect ratio.

The ratio of the width to the height that the should be used when drawing the plotter. A ratio of zero, the default, indicates that any ratio is acceptable.

Definition at line 81 of file PlotterBase.h.

Referenced by XyPlotter::getAspectRatio(), and setAspectRatio().

double PlotterBase::m_crossX [protected]
 

The x position of the cross hair.

Definition at line 96 of file PlotterBase.h.

Referenced by XyPlotter::drawCrossHairs(), and setCrossX().

double PlotterBase::m_crossY [protected]
 

The y position of the cross hair.

Definition at line 99 of file PlotterBase.h.

Referenced by XyPlotter::drawCrossHairs(), and setCrossY().

int PlotterBase::m_currentView [protected]
 

Index of the current view.

Definition at line 142 of file PlotterBase.h.

Referenced by currentView(), nextView(), saveView(), saveViewAtIndex(), and setView().

HippoRectangle PlotterBase::m_margin_rect [protected]
 

The rectangle area in which the projected points are plotted.

Definition at line 104 of file PlotterBase.h.

Referenced by XyPlotter::calcAxisRatios(), getMarginRect(), XyPlotter::marginToInvertedUserY(), XyPlotter::marginToUserX(), XyPlotter::marginToUserY(), XyPlotter::prepareMarginRect(), XyPlotter::userToInvertedMarginY(), XyPlotter::userToMarginColor(), XyPlotter::userToMarginX(), and XyPlotter::userToMarginY().

std::string PlotterBase::m_name [protected]
 

The name of the type of plotter.

Used to lookup the plotter in a factory.

Definition at line 85 of file PlotterBase.h.

Referenced by name().

int PlotterBase::m_parent_datarep_index [protected]
 

Parent DataRep index.

Definition at line 114 of file PlotterBase.h.

Referenced by getParentDataRepIndex(), and setParentDataRepIndex().

PlotterBase* PlotterBase::m_parent_plotter [protected]
 

Parent plotter.

Definition at line 111 of file PlotterBase.h.

Referenced by getParentPlotter(), and setParentPlotter().

int PlotterBase::m_plotterId [protected]
 

A unique plotter id.

Definition at line 134 of file PlotterBase.h.

Referenced by plotterId(), and setPlotterId().

std::string PlotterBase::m_title [protected]
 

The main label; the title of the plot.

Definition at line 93 of file PlotterBase.h.

Referenced by XyPlotter::drawIn(), getInternalTitle(), getTitle(), setTitle(), and TextPlotter::TextPlotter().

HippoRectangle PlotterBase::m_user_rect [protected]
 

The abstract data space.

In the user space X increases to the right and Y increases upward.

Definition at line 108 of file PlotterBase.h.

Referenced by XyPlotter::calcAxisRatios(), XyPlotter::drawIn(), getUserRect(), XyPlotter::marginToInvertedUserY(), XyPlotter::marginToUserX(), XyPlotter::marginToUserY(), XyPlotter::userToInvertedMarginY(), XyPlotter::userToMarginColor(), XyPlotter::userToMarginX(), and XyPlotter::userToMarginY().

std::vector< std::vector<double> > PlotterBase::m_views [protected]
 

A vector of x and y ranges to be used as a circular buffer allowing one to cycle through the saved plot "views".

Definition at line 139 of file PlotterBase.h.

Referenced by deleteView(), nextView(), numViews(), saveView(), saveViewAtIndex(), and setView().

int PlotterBase::s_plotters [static, protected]
 

Reference count for creating plotter ids.

Referenced by setPlotterId().


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