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

PlotterBase Class Reference

Inheritance diagram for PlotterBase:

Inheritance graph
[legend]
Collaboration diagram for PlotterBase:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 22 of file PlotterBase.sip.

Public Member Functions

virtual ~PlotterBase ()
 The virtual destructor.
const std::string & name () const
 Returns the name of the plotter.
 PlotterBase (const std::string &)
virtual PlotterBaseclone ()=0
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 void setTitle (const std::string &)
 Sets the title to be displayed.
const std::string & getTitle () const
 Gets the title to be displayed.
void setLabel (const std::string &, const std::string &)
 Sets the label of specified axis to label.
void setRange (const std::string &, double, double)
 Sets the range on the specified axis.
virtual void setNumberOfBins (const std::string &, unsigned int)
 Sets the number of bins.
virtual void setOffset (const std::string &, double)
 Sets the bin offset.
virtual void setOffset (const std::string, double)
virtual void setOffsets (double, double)
virtual bool wantsPixmap () const
 Informs caller if the plotter prefers to use a pixmap or not.
virtual double getLowRangeOnX ()
 Returns the low end of the X axis range.
virtual double getHighRangeOnX ()
 Returns the high end of the X axis range.
virtual void matrixTranspose (bool)
 Transpose the X and Y axis of matrix represention.
virtual void setBinWidth (const std::string &, double)
 Sets the bin width.
virtual double getBinWidth (const std::string &)
 Returns the bin width.
double getOffset (const std::string &) const
 Returns the offset on designated axis, similarly to getBinWidth.
int getNumOfEntries () const
 Returns the number of entries in the contained DataRep.
virtual void checkAxisScaling ()
 Check if Axis needs to be scaled or not.
virtual void setAutoRanging (const std::string &, bool)
 Sets the auto-ranging.
virtual void setAutoRanging (bool)
 Sets the auto-ranging status for all axes to flag.
virtual void addValues (const std::vector< double > &)=0
 This method declared pure virtual even thou it is not in C++ in order to trick SIP into calling the method via the virtual function table instead of calling the base class implementation.
virtual int getNumDataReps () const =0
 Returns the number of DataRep objects contained in the plot.
virtual DataRepgetDataRep (int)=0
 Returns the specified DataRep or null pointer if it doesn't exits.
virtual void removeDataRep (DataRep *)
 Removes the DataRep from the plot.
virtual void drawIn (ViewBase *)=0
 Starts the drawing in view view.
virtual void drawCrossHairs (ViewBase *)
 Draws cross-hairs.
virtual NTuplecreateNTuple () const =0/Factory/
 Creates an NTuple representation of the plotted data.
virtual void setEnableZ (bool=true)
 Enables the Z axis, if plotter has one.
virtual void setAutoTicks (const std::string &, bool)
 Sets automatic ticks on or off.
virtual void setAutoTicksOnX (bool)
 Sets automatic generation of axis ticks on X axis.
virtual void setTicksOnX (const std::vector< double > &, const std::vector< std::string > &)
 Sets the ticks for the X axis.
virtual void setTicks (const std::string &, const std::vector< double > &, const std::vector< std::string > &)
 Sets the ticks on specified axis.
virtual void setNumberOfBins (const std::string, unsigned int)
virtual double getAspectRatio () const
 Returns the aspect ratio.
void setAspectRatio (double)
 Sets the aspect ratio.
virtual void addDataRep (DataRep *)
 Adds a DataRep object to the plotter.
virtual void setActivePlot (int, bool)
 Sets the active plot.
virtual int activePlotIndex () const
 Returns the index of the active plotter.
virtual int getParentDataRepIndex () const
 Returns the index of the parent datarep.
virtual void setParentDataRepIndex (int)
 Sets the index of the parent datarep.
virtual PlotterBasegetParentPlotter () const
 Returns the parent plotter.
virtual void setParentPlotter (PlotterBase *)
 Sets the parent plotter.
virtual void reset ()
 Resets the bins.
virtual DataRepselectedDataRep () const
 Returns the selected DataRep.
virtual void autoScale ()
 Auto scales the Range of the axes using preferred Range from the points plotters.
virtual void marginToUserXY (double, double, bool, double &, double &) const =0
 Converts from the drawing space to the data space.
virtual NTuplecreatePickTuple ()/Factory/
 Creates a NTuple for a PickTable.
virtual void fillPickedPoint (double, double, std::vector< double > &) const
 Fills the picked data point.
virtual float userToMarginColor (double) const
 Converts the user Z coordinate into the margin color (X) coordinate.
virtual double getZValue (double, double, bool=true) const
 Get the z value at the specified point (x,y).
void setCrossX (double)
 Set the crossX value.
void setCrossY (double)
 Set the crossY value.
virtual bool isTargetable () const
 Returns true if receiving object is targetable.
virtual DataRepgetTarget () const
 Returns the target DataRep contained by the plotter.
virtual int indexOf (const DataRep *) const
 Returns the index of the DataRep.
void toggleActivePlot ()
 Toggles the active DataRep, if 2 or more are contained by the plotter.
virtual int plotterId () const
 The unique ID number of this plotter.


Constructor & Destructor Documentation

virtual PlotterBase::~PlotterBase  )  [virtual]
 

The virtual destructor.

It is responsible for deleting the axis models.

PlotterBase::PlotterBase const std::string &   ) 
 


Member Function Documentation

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

virtual void PlotterBase::addDataRep DataRep  )  [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.

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

This method declared pure virtual even thou it is not in C++ in order to trick SIP into calling the method via the virtual function table instead of calling the base class implementation.

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

virtual void PlotterBase::checkAxisScaling  )  [virtual]
 

Check if Axis needs to be scaled or not.

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

Implemented in Cut1DPlotter.

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.

virtual NTuple* PlotterBase::createPickTuple  )  [virtual]
 

Creates a NTuple for a PickTable.

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

virtual void PlotterBase::drawCrossHairs ViewBase  )  [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.

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

Starts the drawing in view view.

This is the initial method that is called.

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

Fills the picked data point.

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

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

virtual double PlotterBase::getBinWidth const std::string &   )  [virtual]
 

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.

virtual DataRep* PlotterBase::getDataRep int   )  [pure virtual]
 

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

virtual double PlotterBase::getHighRangeOnX  )  [virtual]
 

Returns the high end of the X axis range.

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

virtual double PlotterBase::getLowRangeOnX  )  [virtual]
 

Returns the low end of the X axis range.

virtual int PlotterBase::getNumDataReps  )  const [pure virtual]
 

Returns the number of DataRep objects contained in the plot.

Implementation in this base return 0.

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().

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

Returns the offset on designated axis, similarly to getBinWidth.

virtual int PlotterBase::getParentDataRepIndex  )  const [virtual]
 

Returns the index of the parent datarep.

Returns -1 if there exist none

virtual PlotterBase* PlotterBase::getParentPlotter  )  const [virtual]
 

Returns the parent plotter.

Returns 0 if there exist none

virtual 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 targetable DataRep.

const std::string& PlotterBase::getTitle  )  const
 

Gets the title to be displayed.

virtual double PlotterBase::getZValue double  ,
double  ,
bool  = 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 eturns 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.

virtual int PlotterBase::indexOf const DataRep  )  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. .

virtual bool PlotterBase::isTargetable  )  const [virtual]
 

Returns true if receiving object is targetable.

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

See also:
DataRep::isTargetable () const

virtual void PlotterBase::marginToUserXY double  ,
double  ,
bool  ,
double &  ,
double & 
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.

virtual void PlotterBase::matrixTranspose bool   )  [virtual]
 

Transpose the X and Y axis of matrix represention.

If X-Y represetnation 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.

const std::string& PlotterBase::name  )  const
 

Returns the name of the plotter.

virtual int PlotterBase::plotterId  )  const [virtual]
 

The unique ID number of this plotter.

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

virtual void PlotterBase::reset  )  [virtual]
 

Resets the bins.

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

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

Sets the active plot.

Redraws the plot if redraw is true.

void PlotterBase::setAspectRatio double   ) 
 

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.

virtual void PlotterBase::setAutoRanging bool   )  [virtual]
 

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

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

Sets the auto-ranging.

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

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

Sets automatic ticks on or off.

virtual void PlotterBase::setAutoTicksOnX bool   )  [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.

virtual void PlotterBase::setBinWidth const std::string &  ,
double 
[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.

void PlotterBase::setCrossX double   ) 
 

Set the crossX value.

void PlotterBase::setCrossY double   ) 
 

Set the crossY value.

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

Enables the Z axis, if plotter has one.

Implementation here does nothing.

void PlotterBase::setLabel const std::string &  ,
const std::string & 
 

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.

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

virtual void PlotterBase::setNumberOfBins const std::string &  ,
unsigned  int
[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.

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

virtual void PlotterBase::setOffset const std::string &  ,
double 
[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.

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

virtual void PlotterBase::setParentDataRepIndex int   )  [virtual]
 

Sets the index of the parent datarep.

virtual void PlotterBase::setParentPlotter PlotterBase  )  [virtual]
 

Sets the parent plotter.

void PlotterBase::setRange const std::string &  ,
double  ,
double 
 

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.

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

Sets the ticks on specified axis.

virtual void PlotterBase::setTicksOnX const std::vector< double > &  ,
const std::vector< std::string > & 
[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.

virtual void PlotterBase::setTitle const std::string &   )  [virtual]
 

Sets the title to be displayed.

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

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.

virtual void PlotterBase::update const Observable  )  [virtual]
 

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

Implements Observer.

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 Oberver objects.

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

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

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


The documentation for this class was generated from the following file:
Generated on Wed Sep 7 14:51:57 2005 for SiHippo by  doxygen 1.4.3