Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
PlotterBase Class Reference

The base class for the PlotterBase hierarchy. More...

#include <PlotterBase.h>

Inheritance diagram for PlotterBase:
Inheritance graph
[legend]
Collaboration diagram for PlotterBase:
Collaboration graph
[legend]

Public Types

typedef void(Observer::* Action )(const Observable *)
 The member function of the Observer that is called.
typedef std::list< 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 (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 DataSource representation of the plotted data.
virtual NTuplecreatePickTuple ()
 Creates a DataSource 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 (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 fillPickedPointFrom (double mx, double my, std::vector< double > &picked) const
 Fills the picked data point.
virtual double getAspectRatio () const
 Returns the aspect ratio.
virtual AxisModelBasegetAxisModel (Axes::Type axis) const
 Returns the AxisModelBase derived class for the specified axis.
virtual double getBinWidth (Axes::Type axis) const
 Returns the bin width.
double getBinWidth (const std::string &axis) const
 Returns the bin width.
virtual double getBottomMargin ()
virtual bool getBoxEdge ()
 Get the box-edge status to update the inspector.
virtual bool getCurrentRangeSaved ()
 Returns current_range_saved member t.
virtual Range getDataRange (Axes::Type axis)
 Return the range of the raw data on the specified axis.
virtual DataRepgetDataRep (int index) const
 Returns the specified DataRep or null pointer if it doesn't exits.
virtual TransformBasegetFitsTransform () const
 Returns the fits transform object.
virtual double getHighRangeOnX () const
 Returns the high end of the X axis range.
virtual const std::string & getInternalLabel (Axes::Type axis) const
 Returns the internal label.
virtual const std::string & getInternalTitle () const
 Returns the internal title.
virtual const std::string & getLabel (Axes::Type) const
 Returns the label for the specified axis.
virtual double getLeftMargin ()
virtual double getLowRangeOnX () const
 Returns the low end of the X axis range.
virtual int getMinEntries ()
 Get the minimum entries/bin.
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.
virtual double getOffset (Axes::Type axis) const
 Returns the offset on designated axis, similarly to getBinWidth.
double getOffset (const std::string &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 (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 (Axes::Type axis, bool scaled) const
 Returns the range on the specified axis.
const RectgetRawRect () const
 Returns the raw rectangle before transform.
virtual double getScaleFactor (Axes::Type axis) const
 Returns 1.0.
virtual const std::vector
< unsigned int > & 
getShape ()
virtual bool getShowGrid ()
 Gets the show-grid status to update the inspector.
virtual DataRepgetTarget () const
 Returns the target DataRep contained by the plotter.
const std::string & getTitle () const
 Gets the title to be displayed.
virtual double getTopMargin ()
virtual TransformBasegetTransform () const
 Returns the transform object used by the plotter.
const RectgetUserRect () const
 Returns the data space rectangle.
virtual const BinToColorgetValueRep () const
 Returns the value to color representation.
virtual double getZMargin ()
virtual double getZValue (double x, double y, bool scaled=true) const
 Get the z value at the specified point (x,y).
virtual const std::vector
< double > & 
getZValues ()
 Returns all Z values.
virtual bool hasAxis (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 DataSource 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 (Axes::Type axis) const
 Returns true if auto-ranging is enabled, otherwise returns false.
virtual bool isAxisScaled (Axes::Type axis) const
 Returns false.
virtual bool isImageConvertable () const
 Returns true if contents of the plotter is convertable to an image.
virtual bool isReverse () const
 Return true if reverse is enabled, otherwise returns false.
virtual bool isTargetable () const
 Returns true if receiving object is target-able.
virtual bool isTextPlotter () const
 Return true if it's a text plotter.
virtual FontBaselabelFont (Axes::Type axes) const
 What font is being used to override the default while drawing axis label.
virtual void matrixTranspose (bool yes)
 Transpose the X and Y axis of matrix representation.
const std::string & name () 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 prepareToDraw ()
 Prepare the plotter for drawing.
virtual void removeDataRep (DataRep *)
 Removes the DataRep from the plot.
void removeObserver (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 (const std::string &axis, bool flag)
 Sets the auto-ranging.
virtual void setAutoRanging (Axes::Type axis, bool flag)
 Sets the auto-ranging.
virtual void setAutoRanging (bool flag)
 Sets the auto-ranging status for all axes to flag.
virtual void setAutoTicks (Axes::Type axis, bool yes)
 Sets automatic generation of axis ticks.
virtual void setAutoTicks (const std::string &, bool on)
 Sets automatic ticks on or off.
virtual void setAutoTicksOnX (bool yes)
 Sets automatic generation of axis ticks on X axis.
virtual void setAxisModel (AxisModelBase *, Axes::Type)=0
 Sets the AxisModel on the specified axis.
virtual void setBinWidth (Axes::Type axis, double width)
 Sets the bin width.
virtual void setBinWidth (const std::string &axis, double width)
 Sets the bin width.
virtual void setBinWidth (Axes::Type axis, int parameter, bool dragging)
 Sets the bin width according to parameter of dragging slider.
virtual void setBottomMargin (double bottom)
virtual void setBoxEdge (bool flag)
 Set the box-edge status to flag.
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 (Axes::Type axis, bool)=0
 Sets the display of the error bars on or off.
virtual void setFitsTransform (const std::string &)
 Set the fits transform object.
virtual void setHighRange (Axes::Type axis, int parm, bool dragging)
 Sets the high end of the Range of data displayed.
virtual void setLabel (const std::string &axis, const std::string &label)
 Sets the label of specified axis to label.
virtual void setLabel (Axes::Type, const std::string &value)
 Sets the label of the specified axis to value.
virtual void setLeftMargin (double left)
virtual void setLowRange (Axes::Type axis, int parm, bool dragging)
 Sets the low end of the Range of data displayed.
virtual void setMinEntries (int entries)
 Set the minimum entries/bin.
virtual void setNeedUpdate (bool isChanged)
 Set the m_need_update flag, called by inspector.
virtual void setNumberOfBins (const std::string &axis, unsigned int number)
 Sets the number of bins.
virtual void setNumberOfBins (Axes::Type axis, unsigned int number)
 Sets the number of bins.
virtual void setOffset (Axes::Type axis, double offset)
 Sets the offset.
virtual void setOffset (const std::string &axis, double offset)
 Sets the bin 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.
virtual void setRange (Axes::Type axis, const Range &range, bool scaled=false, bool adjust_width=true)
 Sets the range on the specified axis.
void setRange (const std::string &axis, double low, double high)
 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 setReverse (bool flag)
 Set the reverse status to flag.
virtual void setScaleFactor (Axes::Type axis, double factor)
 Sets the scale factor on the specified axis.
virtual void setShowGrid (bool flag)
 Sets the show-grid status to flag.
virtual void setTicks (Axes::Type axis, const std::vector< AxisTick > &ticks)
 Sets the ticks for the specified axis.
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 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 setTopMargin (double top)
 Set and get additional margin on top,bottom,left of the plotter.
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.
virtual void setZMargin (double z)
virtual const FontBasetitleFont () const
 What font is being used to override the default while drawing title of plot.
void toggleActivePlot ()
 Toggles the active DataRep, if 2 or more are contained by the plotter.
virtual void update (const Observable *)
 Sends notification to it's Observer ViewBase object that redrawing is needed.
virtual void update ()=0
 Updates the plotter.
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 ()
 Default constructor needed to ensure m_plotterId is set.
 PlotterBase (const std::string &name)
 A constructor taking name of type of plotter as argument.
 PlotterBase (const PlotterBase &plotter)
 The copy constructor.

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.
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.
Rect m_raw_rect
 The raw rectangle before transform.
std::string m_title
 The main label; the title of the plot.
Rect 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 setScaling (Axes::Type axis, bool on=true)
 Sets the scaling attribute of the AxisModelBase object.

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:
Make title of plot optional and not the default. Use the space for plotting.
Author
Stephane Bonneaud ganda.nosp@m.lf@s.nosp@m.lac.s.nosp@m.tanf.nosp@m.ord.e.nosp@m.du
Jim Chiang < jchia.nosp@m.ng@s.nosp@m.lac.s.nosp@m.tanf.nosp@m.ord.e.nosp@m.du>
Paul F. Kunz Paul_.nosp@m.Kunz.nosp@m.@slac.nosp@m..sta.nosp@m.nford.nosp@m..edu
Joy Rajiv jraji.nosp@m.v@st.nosp@m.anfor.nosp@m.d.ed.nosp@m.u
Oded Wurman owurm.nosp@m.an@s.nosp@m.tanfo.nosp@m.rd.e.nosp@m.du
Xie Fang xiefa.nosp@m.ng@s.nosp@m.tanfo.nosp@m.rd.e.nosp@m.du

Definition at line 55 of file PlotterBase.h.

Member Typedef Documentation

typedef void( Observer::* Action)(const Observable *)
inherited

The member function of the Observer that is called.

Definition at line 86 of file Observable.h.

typedef std::list< Observer * > ObserverList_t
inherited

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

Definition at line 45 of file Observable.h.

Constructor & Destructor Documentation

PlotterBase ( )
protected

Default constructor needed to ensure m_plotterId is set.

Definition at line 33 of file PlotterBase.cxx.

References PlotterBase::current_range_saved, and PlotterBase::setPlotterId().

PlotterBase ( const std::string &  name)
protected

A constructor taking name of type of plotter as argument.

Definition at line 48 of file PlotterBase.cxx.

References PlotterBase::current_range_saved, and PlotterBase::setPlotterId().

PlotterBase ( const PlotterBase plotter)
protected

The copy constructor.

Definition at line 62 of file PlotterBase.cxx.

References PlotterBase::current_range_saved, and PlotterBase::setPlotterId().

~PlotterBase ( )
virtual

The virtual destructor.

It is responsible for deleting the axis models.

Definition at line 78 of file PlotterBase.cxx.

References Observable::notifyObservers(), and Observer::willDelete().

Member Function Documentation

int activePlotIndex ( ) const
virtual
ProjectorBase * activeProjector ( ) const
virtual

Returns the active projector.

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

Reimplemented in XyPlotter.

Definition at line 137 of file PlotterBase.cxx.

Referenced by DisplayController::axisBindings(), PlotterBase::getDataRange(), PlotterBase::getShape(), PlotterBase::getZValues(), DisplayController::isAxisBinned(), and QtDisplay::numberOfEntries().

void 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 XyPlotter, TextPlotter, Cut2DPlotter, and Cut1DPlotter.

Definition at line 168 of file PlotterBase.cxx.

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

void addObserver ( hippodraw::Observer observer)
inherited
void 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 539 of file PlotterBase.cxx.

void 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 322 of file PlotterBase.cxx.

Referenced by PlotterBase::setAutoRanging().

void checkAxisScaling ( )
virtual

Check if Axis needs to be scaled or not.

Reimplemented in XyPlotter.

Definition at line 503 of file PlotterBase.cxx.

Referenced by DisplayController::addDataRep().

virtual 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 XyPlotter, TextPlotter, Cut2DPlotter, and Cut1DPlotter.

virtual NTuple* createNTuple ( ) const
pure virtual

Creates an DataSource representation of the plotted data.

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

Implemented in XyPlotter, and TextPlotter.

NTuple * createPickTuple ( )
virtual

Creates a DataSource 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 568 of file PlotterBase.cxx.

int currentView ( ) const

Return the current view index.

Definition at line 860 of file PlotterBase.cxx.

References PlotterBase::m_currentView.

Referenced by QtDisplay::currentView().

void deleteView ( int  index)

Delete a view by index.

Definition at line 843 of file PlotterBase.cxx.

References PlotterBase::m_views, and PlotterBase::setView().

Referenced by QtDisplay::deleteView().

void 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 532 of file PlotterBase.cxx.

virtual void drawIn ( ViewBase view)
pure virtual

Starts the drawing in view view.

This is the initial method that is called.

Implemented in XyPlotter, and TextPlotter.

Referenced by ViewBase::drawSelf().

virtual bool errorDisplay ( Axes::Type  axis) const
pure virtual

Returns the state of error bar display on specified axis.

Implemented in XyPlotter, and TextPlotter.

Referenced by Inspector::updatePlotTab().

void 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 867 of file PlotterBase.cxx.

void fillPickedPointFrom ( 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 575 of file PlotterBase.cxx.

double 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 546 of file PlotterBase.cxx.

References PlotterBase::m_aspect_ratio.

AxisModelBase * getAxisModel ( 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 118 of file PlotterBase.cxx.

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

double getBinWidth ( 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 468 of file PlotterBase.cxx.

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

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

Returns the bin width.

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

Definition at line 459 of file PlotterBase.cxx.

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

double getBottomMargin ( )
virtual

Reimplemented in XyPlotter.

Definition at line 1016 of file PlotterBase.cxx.

Referenced by DataView::prepareMarginRect().

bool getBoxEdge ( )
virtual

Get the box-edge status to update the inspector.

Reimplemented in XyPlotter.

Definition at line 933 of file PlotterBase.cxx.

Referenced by Inspector::updatePlotTab().

bool getCurrentRangeSaved ( )
virtual

Returns current_range_saved member t.

Definition at line 888 of file PlotterBase.cxx.

References PlotterBase::current_range_saved.

Referenced by CanvasWindow::nextView(), and CanvasWindow::previousView().

Range getDataRange ( Axes::Type  axis)
virtual

Return the range of the raw data on the specified axis.

Definition at line 895 of file PlotterBase.cxx.

References PlotterBase::activeProjector().

DataRep * getDataRep ( int  index) const
virtual
TransformBase * getFitsTransform ( ) const
virtual

Returns the fits transform object.

Reimplemented in XyPlotter.

Definition at line 953 of file PlotterBase.cxx.

Referenced by CanvasView::contentsMouseMoveEvent().

double 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 686 of file PlotterBase.cxx.

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

const string & getInternalLabel ( 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 315 of file PlotterBase.cxx.

Referenced by PlotterBaseXML::createElement().

const string & 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 308 of file PlotterBase.cxx.

References PlotterBase::m_title.

Referenced by PlotterBaseXML::createElement().

const string & getLabel ( 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 299 of file PlotterBase.cxx.

Referenced by PlotTable::initialize().

double getLeftMargin ( )
virtual

Reimplemented in XyPlotter.

Definition at line 1023 of file PlotterBase.cxx.

Referenced by DataView::prepareMarginRect().

double getLowRangeOnX ( ) const
virtual

Returns the low end of the X axis range.

Definition at line 677 of file PlotterBase.cxx.

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

int getMinEntries ( )
virtual

Get the minimum entries/bin.

Reimplemented in XyPlotter.

Definition at line 966 of file PlotterBase.cxx.

Referenced by Inspector::getMinEntries().

int getNumberOfEntries ( ) const
virtual

Returns the number of entries in the contained DataRep.

Reimplemented in XyPlotter.

Definition at line 491 of file PlotterBase.cxx.

Referenced by PlotterBase::getNumOfEntries().

int getNumDataReps ( ) const
virtual
int 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 498 of file PlotterBase.cxx.

References PlotterBase::getNumberOfEntries().

const Observable::ObserverList_t & getObservers ( ) const
inherited

Returns the list of observers.

Definition at line 60 of file Observable.cxx.

double getOffset ( Axes::Type  axis) const
virtual

Returns the offset on designated axis, similarly to getBinWidth.

Reimplemented in XyPlotter.

Definition at line 475 of file PlotterBase.cxx.

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

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

Returns the offset on designated axis, similarly to getBinWidth.

Definition at line 482 of file PlotterBase.cxx.

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

int getParentDataRepIndex ( ) const
virtual

Returns the index of the parent DataRep.

Returns -1 if there exist none

Definition at line 586 of file PlotterBase.cxx.

References PlotterBase::m_parent_datarep_index.

Referenced by PlotterBaseXML::createElement().

PlotterBase * getParentPlotter ( ) const
virtual

Returns the parent plotter.

Returns 0 if there exist none

Definition at line 596 of file PlotterBase.cxx.

References PlotterBase::m_parent_plotter.

Referenced by PlotterBaseXML::createElement(), FigureEditor::movePlotterWithText(), CanvasView::placeItems(), and FunctionController::refreshEllipsoidDisplay().

double getPosRange ( Axes::Type  axis) const
virtual

Returns the smallest positive number from the data.

Reimplemented in XyPlotter.

Definition at line 510 of file PlotterBase.cxx.

Referenced by DisplayController::setAxisModel(), and DisplayController::setAxisModelWithoutSetBin().

ProjectorBase * 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 144 of file PlotterBase.cxx.

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

const Range & getRange ( 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.
Todo:
In the future, keep a list of the axis rather than hardwired them.

Reimplemented in XyPlotter.

Definition at line 359 of file PlotterBase.cxx.

Referenced by Inspector::axisZoomPanCheckBox_clicked(), CanvasView::contentsMouseMoveEvent(), Inspector::cutHighSlider_sliderReleased(), Inspector::cutLowSlider_sliderReleased(), PlotterBase::getHighRangeOnX(), PlotterBase::getLowRangeOnX(), QtDisplay::getRange(), Inspector::rotateX(), Inspector::rotateY(), Inspector::setDragOn(), Inspector::setHighRange(), Inspector::setHighText(), Inspector::setLowRange(), Inspector::setLowText(), Inspector::setXRotateText(), Inspector::setYRotateText(), Inspector::updateAxisTab(), and Inspector::updateCutControlValues().

const Rect & getRawRect ( ) const

Returns the raw rectangle before transform.

Definition at line 440 of file PlotterBase.cxx.

References PlotterBase::m_raw_rect.

Referenced by ViewBase::getRawRect().

double getScaleFactor ( Axes::Type  axis) const
virtual

Returns 1.0.

This method should be overriden by a derived class.

Reimplemented in XyPlotter.

Definition at line 1065 of file PlotterBase.cxx.

const std::vector< unsigned int > & getShape ( )
virtual

Reimplemented in XyPlotter.

Definition at line 912 of file PlotterBase.cxx.

References PlotterBase::activeProjector().

Referenced by CanvasView::savePlotAsFits().

bool getShowGrid ( )
virtual

Gets the show-grid status to update the inspector.

Reimplemented in XyPlotter.

Definition at line 940 of file PlotterBase.cxx.

Referenced by Inspector::updatePlotTab().

DataRep * 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 709 of file PlotterBase.cxx.

const string & getTitle ( ) const
double getTopMargin ( )
virtual

Reimplemented in XyPlotter.

Definition at line 1002 of file PlotterBase.cxx.

Referenced by DataView::prepareMarginRect().

TransformBase * getTransform ( ) const
virtual
const Rect & getUserRect ( ) const

Returns the data space rectangle.

Definition at line 433 of file PlotterBase.cxx.

References PlotterBase::m_user_rect.

Referenced by ViewBase::getUserRect().

const BinToColor * 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 191 of file PlotterBase.cxx.

Referenced by DisplayController::getValueCtrlPts(), DisplayController::saveValueCtrlPts(), and DisplayController::setValueCtrlPts().

double getZMargin ( )
virtual

Reimplemented in XyPlotter.

Definition at line 1009 of file PlotterBase.cxx.

Referenced by DataView::prepareMarginRect().

double 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 515 of file PlotterBase.cxx.

const std::vector< double > & getZValues ( )
virtual

Returns all Z values.

Reimplemented in XyPlotter.

Definition at line 904 of file PlotterBase.cxx.

References PlotterBase::activeProjector().

Referenced by CanvasView::savePlotAsFits().

bool hasAutoScaled ( ) const
protected

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

Reimplemented in XyPlotter.

Definition at line 132 of file PlotterBase.cxx.

bool hasAxis ( 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 103 of file PlotterBase.cxx.

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

virtual bool hasNTupleBindings ( ) const
pure virtual

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

Implemented in XyPlotter, CutPlotter, and TextPlotter.

bool hasZoomY ( ) const
virtual

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

Reimplemented in XyPlotter.

Definition at line 110 of file PlotterBase.cxx.

Referenced by CanvasView::setPlotZoom().

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

bool isAutoRanging ( 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 235 of file PlotterBase.cxx.

bool isAxisScaled ( Axes::Type  axis) const
virtual

Returns false.

Should be overrided by derived class.

Reimplemented in XyPlotter.

Definition at line 1072 of file PlotterBase.cxx.

bool isImageConvertable ( ) const
virtual

Returns true if contents of the plotter is convertable to an image.

Returns true if the contents of the plotter can be taken as a regular grid of values, i.e. an image. As a convienence to implementers of derived classes, this base class method returns false.

Reimplemented in XyPlotter, and CutPlotter.

Definition at line 987 of file PlotterBase.cxx.

bool isReverse ( ) const
virtual

Return true if reverse is enabled, otherwise returns false.

Reimplemented in XyPlotter.

Definition at line 248 of file PlotterBase.cxx.

bool 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 702 of file PlotterBase.cxx.

bool isTextPlotter ( ) const
virtual

Return true if it's a text plotter.

Reimplemented in TextPlotter.

Definition at line 994 of file PlotterBase.cxx.

Referenced by QtView::isTextView(), and FigureEditor::movePlotterWithText().

FontBase * labelFont ( Axes::Type  axes) const
virtual

What font is being used to override the default while drawing axis label.

If return value is null pointer the default is being used. Base class returns NULL.

Reimplemented in XyPlotter.

Definition at line 980 of file PlotterBase.cxx.

Referenced by DataView::prepareMarginRect().

void 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 695 of file PlotterBase.cxx.

const string & name ( ) const

Returns the name of the plotter.

See Also
m_name.

Definition at line 83 of file PlotterBase.cxx.

References PlotterBase::m_name.

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

int nextView ( bool  stepForward = true)

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

Returns
The index of the current view.
Parameters
stepForwardDirection to step through the views.

Definition at line 796 of file PlotterBase.cxx.

References PlotterBase::m_currentView, PlotterBase::m_views, and PlotterBase::setView().

Referenced by QtDisplay::nextView().

void notifyObservers ( ) const
virtualinherited

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, RootNTuple, NumArrayTuple, ListTuple, and FitsNTuple.

Definition at line 93 of file Observable.cxx.

References Observer::update().

Referenced by XyPlotter::addDataRep(), XyPlotter::addDataRepStacked(), FunctionController::addFunctionRep(), StHist1DProjector::addValues(), StHist2DProjector::addValues(), XyPlotter::autoScale(), Inspector::contourLevelsTextBox_returnPressed(), Inspector::contourSlider_valueChanged(), Inspector::contourTextBox_returnPressed(), FunctionRep::fitFunction(), XyPlotter::removeDataRep(), FunctionRep::restoreParameters(), DataRep::set(), CutPlotter::setActive(), PlotterBase::setAspectRatio(), XyPlotter::setAutoRanging(), XyPlotter::setBoxEdge(), QtDisplay::setContourLevels(), CutPlotter::setCutColor(), XyPlotter::setCutEnabled(), XyPlotter::setCutInverted(), XyPlotter::setCutRangeAt(), ProjectorBase::setDirty(), DataRep::setErrorDisplay(), XyPlotter::setHighRange(), PlotterBase::setLabel(), XyPlotter::setLabel(), DataSource::setLabelAt(), DataSource::setLabels(), XyPlotter::setLowRange(), DataSource::setName(), DisplayController::setNTuple(), FunctionRep::setParameters(), DyHistogram::setPointRep(), DyHistogramEqualEntries::setPointRep(), DataRep::setPointRep(), TextPlotter::setRepColor(), DataRep::setRepColor(), DataRep::setRepSize(), DataRep::setRepStyle(), XyPlotter::setReverse(), XyPlotter::setScaling(), XyPlotter::setShowGrid(), DataSource::setTitle(), PlotterBase::setTitle(), XyPlotter::setTransform(), XyPlotter::setValueRep(), NTupleProjector::update(), BinningProjector::update(), DataRep::update(), PlotterBase::update(), CutPlotter::update(), CutPlotter::updateTargets(), DataRep::~DataRep(), DataSource::~DataSource(), PlotterBase::~PlotterBase(), and RTuple::~RTuple().

void notifyObservers ( Action  action) const
protectedinherited

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

Definition at line 72 of file Observable.cxx.

int numViews ( ) const

Return the number of stored views.

Definition at line 836 of file PlotterBase.cxx.

References PlotterBase::m_views.

Referenced by QtDisplay::numViews().

int plotterId ( ) const
virtual

The unique ID number of this plotter.

Definition at line 749 of file PlotterBase.cxx.

References PlotterBase::m_plotterId.

Referenced by QtDisplay::plotterId().

void prepareToDraw ( )
virtual

Prepare the plotter for drawing.

The base class implementation does nothing. Derived classes should do what is needed before drawing such as auto scaling. The ViewBase class may depend on the axis ranges being set.

Definition at line 96 of file PlotterBase.cxx.

void 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 184 of file PlotterBase.cxx.

Referenced by FunctionController::removeFunction().

void removeObserver ( hippodraw::Observer observer)
inherited
virtual const Color& repColor ( ) const
pure virtual

Returns the color used for the representation.

Implemented in XyPlotter, and TextPlotter.

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

virtual RepBase* representation ( ) const
pure virtual

Returns the representation used by the plotter.

Implemented in XyPlotter, and TextPlotter.

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

void reset ( )
virtual

Resets the bins.

Reimplemented in XyPlotter.

Definition at line 426 of file PlotterBase.cxx.

int 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_valuesA vector of 4 elements containing the x and y ranges.

Definition at line 756 of file PlotterBase.cxx.

References PlotterBase::m_currentView, and PlotterBase::m_views.

Referenced by QtDisplay::saveView().

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.

The views from position i onward are deleted

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

Definition at line 771 of file PlotterBase.cxx.

References PlotterBase::m_currentView, and PlotterBase::m_views.

DataRep * 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 161 of file PlotterBase.cxx.

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

void setActivePlot ( int  index,
bool  redraw 
)
virtual
void 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 553 of file PlotterBase.cxx.

References PlotterBase::m_aspect_ratio, and Observable::notifyObservers().

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

void setAutoRanging ( const std::string &  axis,
bool  flag 
)
virtual
void setAutoRanging ( 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 222 of file PlotterBase.cxx.

void setAutoRanging ( bool  flag)
virtual

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

Reimplemented in XyPlotter.

Definition at line 229 of file PlotterBase.cxx.

void setAutoTicks ( 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 615 of file PlotterBase.cxx.

Referenced by PlotterBase::setAutoTicks(), and PlotterBase::setAutoTicksOnX().

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

Sets automatic ticks on or off.

Definition at line 635 of file PlotterBase.cxx.

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

void 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 628 of file PlotterBase.cxx.

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

virtual void setAxisModel ( AxisModelBase ,
Axes::Type   
)
pure virtual

Sets the AxisModel on the specified axis.

Implemented in XyPlotter, and TextPlotter.

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

void setBinWidth ( 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 375 of file PlotterBase.cxx.

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

void 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 402 of file PlotterBase.cxx.

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

void setBinWidth ( Axes::Type  axis,
int  parameter,
bool  dragging 
)
virtual

Sets the bin width according to parameter of dragging slider.

Does nothing if more than one DataRep is active.

Definition at line 382 of file PlotterBase.cxx.

References PlotterBase::activePlotIndex(), PlotterBase::getProjector(), PlotterBase::setBinWidth(), and PlotterBase::setRange().

void setBottomMargin ( double  bottom)
virtual

Reimplemented in XyPlotter.

Definition at line 1044 of file PlotterBase.cxx.

Referenced by PlotterBaseXML::createPlotter().

void setBoxEdge ( bool  flag)
virtual

Set the box-edge status to flag.

Reimplemented in XyPlotter.

Definition at line 927 of file PlotterBase.cxx.

Referenced by Inspector::m_boxedge_clicked().

void setCrossX ( double  val)

Set the crossX value.

Definition at line 520 of file PlotterBase.cxx.

References PlotterBase::m_crossX.

Referenced by QtViewImp::setCrossX().

void setCrossY ( double  val)

Set the crossY value.

Definition at line 525 of file PlotterBase.cxx.

References PlotterBase::m_crossY.

Referenced by QtViewImp::setCrossY().

void setCurrentRangeSaved ( bool  flag)
virtual

Sets current_range_saved member to flag.

Definition at line 881 of file PlotterBase.cxx.

References PlotterBase::current_range_saved.

void 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 XyPlotter, and CutPlotter.

Definition at line 874 of file PlotterBase.cxx.

Referenced by Inspector::cutText_returnPressed().

void setEnableZ ( bool  yes = true)
virtual

Enables the Z axis, if plotter has one.

Implementation here does nothing.

Reimplemented in XyPlotter.

Definition at line 608 of file PlotterBase.cxx.

Referenced by PlotterBaseXML::createPlotter().

virtual void setErrorDisplay ( 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 XyPlotter, and TextPlotter.

void setFitsTransform ( const std::string &  transform)
virtual

Set the fits transform object.

It is created in the CompositePlotter class. Useful when a fits image has transform.

Reimplemented in XyPlotter.

Definition at line 947 of file PlotterBase.cxx.

Referenced by FitsController::checkForImage().

void setHighRange ( 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 350 of file PlotterBase.cxx.

Referenced by Inspector::setHighRange().

void 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 DataSource column. Invoking this member function overrides that. To return to taking the label from the DataSource column, label should be set to "%l".

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

Definition at line 282 of file PlotterBase.cxx.

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

Referenced by QtDisplay::setLabel().

void setLabel ( 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 293 of file PlotterBase.cxx.

void setLeftMargin ( double  left)
virtual

Reimplemented in XyPlotter.

Definition at line 1051 of file PlotterBase.cxx.

Referenced by PlotterBaseXML::createPlotter().

void setLowRange ( 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 344 of file PlotterBase.cxx.

Referenced by Inspector::setLowRange().

void setMinEntries ( int  entries)
virtual

Set the minimum entries/bin.

Reimplemented in XyPlotter.

Definition at line 960 of file PlotterBase.cxx.

Referenced by Inspector::combineCheckBox_clicked(), Inspector::setMinEntries(), and Inspector::setMinEntriesText().

void setNeedUpdate ( bool  isChanged)
virtual

Set the m_need_update flag, called by inspector.

Reimplemented in XyPlotter.

Definition at line 1058 of file PlotterBase.cxx.

void 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 418 of file PlotterBase.cxx.

References hippodraw::Axes::convert().

Referenced by QtDisplay::setNumberOfBins().

void setNumberOfBins ( 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 368 of file PlotterBase.cxx.

void setOffset ( 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 395 of file PlotterBase.cxx.

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

void 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 410 of file PlotterBase.cxx.

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

void setOffsets ( double  xoffset,
double  yoffset 
)
virtual

Sets the offsets on the x and y axis.

Definition at line 580 of file PlotterBase.cxx.

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

void setParentDataRepIndex ( int  index)
virtual

Sets the index of the parent DataRep.

Definition at line 591 of file PlotterBase.cxx.

References PlotterBase::m_parent_datarep_index.

void setParentPlotter ( PlotterBase plotter)
virtual

Sets the parent plotter.

Definition at line 601 of file PlotterBase.cxx.

References PlotterBase::m_parent_plotter.

Referenced by DisplayController::createTextView().

void setPlotterId ( )
private

Definition at line 741 of file PlotterBase.cxx.

References PlotterBase::m_plotterId, and PlotterBase::s_plotters.

Referenced by PlotterBase::PlotterBase().

void setRange ( 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.

Reimplemented in XyPlotter.

Definition at line 339 of file PlotterBase.cxx.

Referenced by QtDisplay::resize(), Inspector::rotateX(), Inspector::rotateY(), PlotterBase::setBinWidth(), Inspector::setHighRange(), Inspector::setHighText(), Inspector::setLowRange(), Inspector::setLowText(), CanvasView::setPlotZoom(), QtDisplay::setRange(), PlotterBase::setRange(), DisplayController::setRange(), PlotterBase::setView(), Inspector::setXRotateText(), and Inspector::setYRotateText().

void 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 329 of file PlotterBase.cxx.

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

virtual void setRepColor ( const Color )
pure virtual

Sets the representation's color.

Implemented in XyPlotter, and TextPlotter.

Referenced by Inspector::colorSelect_clicked().

virtual void 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 XyPlotter, and TextPlotter.

Referenced by QtDisplay::setPointRep().

void setReverse ( bool  flag)
virtual

Set the reverse status to flag.

Reimplemented in XyPlotter.

Definition at line 242 of file PlotterBase.cxx.

void setScaleFactor ( Axes::Type  axis,
double  factor 
)
virtual

Sets the scale factor on the specified axis.

The implementation in this base class does nothing.

Reimplemented in XyPlotter.

Definition at line 447 of file PlotterBase.cxx.

void setScaling ( Axes::Type  axis,
bool  on = true 
)
privatevirtual

Sets the scaling attribute of the AxisModelBase object.

The implementation in this base class does nothing.

Reimplemented in XyPlotter.

Definition at line 453 of file PlotterBase.cxx.

void setShowGrid ( bool  flag)
virtual

Sets the show-grid status to flag.

Reimplemented in XyPlotter.

Definition at line 920 of file PlotterBase.cxx.

Referenced by Inspector::m_grid_clicked().

void setTicks ( Axes::Type  axis,
const std::vector< AxisTick > &  ticks 
)
virtual

Sets the ticks for the specified axis.

Reimplemented in XyPlotter.

Definition at line 622 of file PlotterBase.cxx.

Referenced by PlotterBase::setTicks(), and PlotterBase::setTicksOnX().

void 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 659 of file PlotterBase.cxx.

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

void 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 643 of file PlotterBase.cxx.

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

void 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 253 of file PlotterBase.cxx.

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

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

void setTopMargin ( double  top)
virtual

Set and get additional margin on top,bottom,left of the plotter.

Reimplemented in XyPlotter.

Definition at line 1030 of file PlotterBase.cxx.

Referenced by PlotterBaseXML::createPlotter().

void 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 123 of file PlotterBase.cxx.

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

void 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 198 of file PlotterBase.cxx.

void setView ( int  index)
void setZMargin ( double  z)
virtual

Reimplemented in XyPlotter.

Definition at line 1037 of file PlotterBase.cxx.

Referenced by PlotterBaseXML::createPlotter().

const FontBase * titleFont ( ) const
virtual

What font is being used to override the default while drawing title of plot.

If return value is null pointer the default is being used. Base class returns NULL.

Reimplemented in XyPlotter.

Definition at line 973 of file PlotterBase.cxx.

Referenced by DataView::prepareMarginRect().

void 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 723 of file PlotterBase.cxx.

References PlotterBase::activePlotIndex(), PlotterBase::getNumDataReps(), and PlotterBase::setActivePlot().

void update ( const Observable )
virtual

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

Implements Observer.

Reimplemented in CutPlotter.

Definition at line 89 of file PlotterBase.cxx.

References Observable::notifyObservers().

virtual void 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 XyPlotter, and TextPlotter.

bool 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 561 of file PlotterBase.cxx.

void willDelete ( const Observable )
virtualinherited

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 ViewBase, FunctionRep, BinningProjector, NTupleProjector, Profile2DProjector, DyHist1DProjector, DyHist2DProjector, TextPlotter, CutPlotter, and ProfileProjector.

Definition at line 25 of file Observer.cxx.

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

Member Data Documentation

bool current_range_saved
protected

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

Definition at line 124 of file PlotterBase.h.

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

double 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 74 of file PlotterBase.h.

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

double m_crossX
protected

The x position of the cross hair.

Definition at line 89 of file PlotterBase.h.

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

double m_crossY
protected

The y position of the cross hair.

Definition at line 92 of file PlotterBase.h.

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

int m_currentView
protected
std::string m_name
protected

The name of the type of plotter.

Used to lookup the plotter in a factory.

Definition at line 78 of file PlotterBase.h.

Referenced by PlotterBase::name().

int m_parent_datarep_index
protected

Parent DataRep index.

Definition at line 108 of file PlotterBase.h.

Referenced by PlotterBase::getParentDataRepIndex(), and PlotterBase::setParentDataRepIndex().

PlotterBase* m_parent_plotter
protected

Parent plotter.

Definition at line 105 of file PlotterBase.h.

Referenced by PlotterBase::getParentPlotter(), and PlotterBase::setParentPlotter().

int m_plotterId
protected

A unique plotter id.

Definition at line 128 of file PlotterBase.h.

Referenced by PlotterBase::plotterId(), and PlotterBase::setPlotterId().

Rect m_raw_rect
protected

The raw rectangle before transform.

Definition at line 102 of file PlotterBase.h.

Referenced by XyPlotter::drawIn(), XyPlotter::drawProjValues(), and PlotterBase::getRawRect().

std::string m_title
protected

The main label; the title of the plot.

Definition at line 86 of file PlotterBase.h.

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

Rect m_user_rect
protected

The abstract data space.

In the user space X increases to the right and Y increases upward. The coordinate system is that of the data points being plotting

Definition at line 98 of file PlotterBase.h.

Referenced by XyPlotter::drawIn(), XyPlotter::drawProjValues(), and PlotterBase::getUserRect().

std::vector< std::vector<double> > 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 133 of file PlotterBase.h.

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

int s_plotters
staticprotected

Reference count for creating plotter ids.

Definition at line 139 of file PlotterBase.h.

Referenced by PlotterBase::setPlotterId().


The documentation for this class was generated from the following files:

Generated for HippoDraw Class Library by doxygen