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

CompositePlotter Class Reference

#include <CompositePlotter.h>

Collaboration diagram for CompositePlotter:

Collaboration graph
[legend]
List of all members.

Detailed Description

A class for containing one or more DataRep objects in a single composite plot.

For example, an XyPlotter can have one DataRep for the data points and another for the function overlaid on them. One of the DataRep objects is considered active, as it is the one that will receive commands that make a change to its characteristics.

Requests:
When 2 and only 2 DataRep objects are stacked, use right Y axis to show scale.

Requests:
Allow DataRep to be hidden.

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

Oded Wurman <owurman@stanford.edu>

Definition at line 53 of file CompositePlotter.h.

Public Member Functions

virtual int activePlotIndex () const
 Returns the index of the active DataRep object.
virtual ProjectorBaseactiveProjector () const
 Returns the active projector.
virtual void addDataRep (DataRep *rep)
 Adds the DataRep object to the composite.
virtual void addValues (const std::vector< double > &v)
 Adds the values to the plot.
void autoScale (AxisModelBase *model, hippodraw::Axes::Type axis)
 Auto scales the selected axis.
void autoScale (hippodraw::Axes::Type axis)
 Sets the Range on the specified axis to include all the data.
virtual void autoScale ()
 Sets the Range on each axis that has the auto range flag set to include all the data.
void autoScaleZ ()
 Sets the range on the Z axis.
HippoRectangle calcUserRectangle () const
 Calculates the user rectangle given the current axis ranges.
bool checkAutoScale ()
 Checks if the plotter needs to be auto-scaled and do so if needed.
virtual void checkAxisScaling ()
 Check if Axis needs to be scaled or not.
CompositePlotterclone ()
 Makes a copy of the receiving object.
 CompositePlotter ()
 The default constructor.
virtual NTuplecreateNTuple () const
 Creates a new NTuple from the selected DataRep object.
virtual NTuplecreatePickTuple ()
 Creates a NTuple for a PickTable.
void drawAxisRep (AxisRepBase *rep, ViewBase *view, bool do_y, bool do_z)
 Draws the data related to the axis representation.
virtual void drawProjValues (ViewBase *view)
 Draws the projected values.
virtual bool errorDisplay (hippodraw::Axes::Type axis) const
 Returns the state of error bar display on specified axis for the active plotter.
void fillCutList (std::vector< const TupleCut * > &cuts) const
 Fills the cuts vector with the TupleCuts contained by the DataRep objects.
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
virtual double getBinWidth (hippodraw::Axes::Type axis) const
 Returns the bin width on designated axis.
virtual DataRepgetDataRep (int index) const
virtual const std::stringgetInternalLabel (hippodraw::Axes::Type axis) const
virtual const std::stringgetLabel (hippodraw::Axes::Type) const
virtual int getNumberOfEntries () const
 Returns the number of entries in the contained DataRep.
virtual int getNumDataReps () const
 Returns the number of DataRep objects in this plot.
virtual double getOffset (hippodraw::Axes::Type axis) const
virtual DataRepgetParentDataRep () const
 Gets the parent DataRep associated with the current/ active DataRep.
virtual DataRepgetParentDataRep (int index) const
 Gets the parent DataRep object associated with the DataRep whose index number is index.
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
virtual DataRepgetTarget () const
const std::stringgetTitle () const
 Returns the title.
virtual TransformBasegetTransform () const
virtual const BinToColorgetValueRep () const
bool hasAutoScaled () const
 Returns true if the axes have already been auto-scaled.
virtual bool hasAxis (hippodraw::Axes::Type axis) const
virtual bool hasNTupleBindings () const
 Returns true if the selected DataRep object has ntuple bindings, otherwise returns false.
virtual bool hasZoomY () const
 Returns true if the plotter has zoom feature on the Y Axis otherwise it returns false.
virtual int indexOf (const DataRep *rep) const
virtual bool isAutoRanging (hippodraw::Axes::Type axis) const
virtual bool isAxisScaled (hippodraw::Axes::Type axis) const
virtual bool isTargetable () const
virtual void matrixTranspose (bool yes)
virtual DataRepmouseSelectedDataRep () const
 Returns the data rep under the mouse.
virtual void prepareToDraw ()
 Prepares the axes for drawing.
double processReturnValue (double retval, hippodraw::Axes::Type axis, bool scaled) const
 Process the return value for margin-to-user functions.
virtual void removeDataRep (DataRep *)
 Removes the DataRep from the composite.
virtual const ColorrepColor () const
 Returns the color used for the data points from the active plotter.
virtual RepBaserepresentation () const
 Returns the representation.
virtual void reset ()
 Resets bins.
virtual DataRepselectedDataRep () const
virtual int setActivePlot (int index, bool redraw)
 Sets the active DataRep object.
virtual void setAllAxisModels ()
 Sets the axis models for all of the components of the contained DataRep objects.
virtual void setAutoRanging (hippodraw::Axes::Type axis, bool flag)
 Sets the auto-ranging.
virtual void setAutoRanging (bool flag)
 Sets the auto-ranging status for all axes to flag.
void setAutoScaled (bool flag=true)
 Sets the auto scaled flag.
virtual void setAutoTicks (hippodraw::Axes::Type axis, bool yes)
 Sets automatic generation of ticks on specified axis.
virtual void setAxisModel (AxisModelBase *, hippodraw::Axes::Type)
 Sets the AxisModel on the specified axis.
virtual void setBinWidth (hippodraw::Axes::Type axis, double width)
 Sets the bin width.
virtual void setCutRangeAt (const Range &range, unsigned int index)
 Sets the TupleCut range.
void setEnableZ (bool yes)
 Enables the Z axis.
virtual void setErrorDisplay (hippodraw::Axes::Type axis, bool)
 Sets the display of the error bars on or off for the active plotter.
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)
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)
virtual void setOffset (hippodraw::Axes::Type axis, double offset)
virtual void setParentDataRep (DataRep *parent)
 Sets the parent DataRep associated with the current/ active DataRep.
virtual void setParentDataRep (int index, DataRep *parent)
 Sets the parent DataRep associated with the DataRep whose index number is index.
virtual void setRange (hippodraw::Axes::Type, const Range &, bool scaled, bool adjust_width)
virtual void setRepColor (const Color &)
 Sets the representation color of the active plotter.
virtual void setRepresentation (RepBase *pointrep)
 Sets the representation.
virtual void setScaleFactor (hippodraw::Axes::Type axis, double factor)
virtual void setScaling (hippodraw::Axes::Type axis, bool on=true)
 Sets the scaling attribute of the AxisModelBase object.
virtual void setTicks (hippodraw::Axes::Type axis, const std::vector< AxisTick > &ticks)
void setTitle (const std::string &title)
 Sets the title.
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.
virtual void toUserXY (double mx, double my, bool scaled, double &ux, double &uy) const
virtual void update ()
virtual ~CompositePlotter ()
 The destructor.

Protected Types

typedef std::vector< DataRep * > DataRepList_t
 The type of container used to store the DataRep objects.

Protected Member Functions

 CompositePlotter (const CompositePlotter &plotter)
 The copy constructor.
virtual double getZValue (double x, double y, bool scaled=true) const
 Get the z value at the specified point (x,y).
bool isDirty () const
 Return true if any of the contained DataRep objects returns true from its isDirty() function.
void push_back (DataRep *)
 Adds the DataRep object to the composite if it is not already there.
virtual void setRangePrivate (hippodraw::Axes::Type axis, const Range &range, bool scaled=false, bool adjust_width=true)

Protected Attributes

int m_datarep_index
 The index of the active DataRep or a negative value if more than one is active.
DataRepList_t m_datareps
 The list of the DataRep objects in the composite.
bool m_has_autoscaled
 A flag that when true indicates the plotter has already auto-scaled the axes.
bool m_has_z
 A flag which when set true indicates the plotter maintains a Z axis.
TransformBasem_transform
 The transform object.
AxisModelBasem_x_axis
 The x dimension axis model.
std::string m_x_label
 The label of the x axis is associated with the X AxisModel object.
AxisModelBasem_y_axis
 The y dimension axis model.
std::string m_y_label
 The label of the y axis is associated with the YAxisModel object.
AxisModelBasem_z_axis
 The z dimension axis model.
std::string m_z_label
 The label of the z axis is associated with the Z AxisModel object.


Member Typedef Documentation

typedef std::vector< DataRep * > CompositePlotter::DataRepList_t [protected]
 

The type of container used to store the DataRep objects.

Definition at line 111 of file CompositePlotter.h.


Constructor & Destructor Documentation

CompositePlotter::CompositePlotter const CompositePlotter plotter  )  [protected]
 

The copy constructor.

The copy constructor is not used. Copying is done via XML serialization.

Definition at line 78 of file CompositePlotter.cxx.

References TransformBase::clone(), AxisModelBase::clone(), m_datareps, m_has_z, m_transform, m_x_axis, m_y_axis, m_z_axis, and setEnableZ().

CompositePlotter::CompositePlotter  ) 
 

The default constructor.

Definition at line 58 of file CompositePlotter.cxx.

References TransformFactory::createTransform(), TransformFactory::instance(), m_transform, m_x_axis, m_y_axis, m_z_axis, PLOTBOTTOM, and PLOTLEFT.

Referenced by clone().

CompositePlotter::~CompositePlotter  )  [virtual]
 

The destructor.

Definition at line 105 of file CompositePlotter.cxx.

References m_datareps, m_transform, m_x_axis, m_y_axis, and m_z_axis.


Member Function Documentation

int CompositePlotter::activePlotIndex  )  const [virtual]
 

Returns the index of the active DataRep object.

Returns the index of the active plotter. If returned value is -1, then all DataRep objects are active. If the returned value is -2, then none are active.

Definition at line 185 of file CompositePlotter.cxx.

References m_datarep_index.

Referenced by getBinWidth(), getNumberOfEntries(), and getOffset().

ProjectorBase * CompositePlotter::activeProjector  )  const [virtual]
 

Returns the active projector.

Definition at line 223 of file CompositePlotter.cxx.

References DataRep::getProjector(), m_datarep_index, and m_datareps.

Referenced by getLabel().

void CompositePlotter::addDataRep DataRep rep  )  [virtual]
 

Adds the DataRep object to the composite.

Sends the DataRep::addingTo message to the rep. Becomes an Observer of the DataRep object.

Definition at line 199 of file CompositePlotter.cxx.

References checkAxisScaling(), hasAxis(), m_datareps, m_x_axis, m_y_axis, m_z_axis, push_back(), setActivePlot(), DataRep::setAxisModel(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

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

Adds the values to the plot.

This method is provided as a convenience for the situation that only one DataRep exists and it responds to DataRep::addValues. It calls this function on the first DataRep object.

Definition at line 978 of file CompositePlotter.cxx.

References DataRep::addValues(), and getDataRep().

void CompositePlotter::autoScale AxisModelBase model,
hippodraw::Axes::Type  axis
 

Auto scales the selected axis.

Definition at line 332 of file CompositePlotter.cxx.

References BinaryTransform::adjustValues(), DataRep::hasZeroRows(), AxisModelBase::isAutoRanging(), BinaryTransform::limitX(), BinaryTransform::limitY(), m_datareps, m_transform, DataRep::preferredRange(), DataRep::setRange(), AxisModelBase::setUnionRange(), hippodraw::Axes::X, and hippodraw::Axes::Y.

void CompositePlotter::autoScale hippodraw::Axes::Type  axis  ) 
 

Sets the Range on the specified axis to include all the data.

Definition at line 369 of file CompositePlotter.cxx.

References autoScale(), autoScaleZ(), m_x_axis, m_y_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

void CompositePlotter::autoScale  )  [virtual]
 

Sets the Range on each axis that has the auto range flag set to include all the data.

This function scrolls through all the points plotters, asking for their preferred ranges. It then sets the range to be the union of all of those.

Definition at line 389 of file CompositePlotter.cxx.

References autoScaleZ(), AxisModelBase::isAutoRanging(), m_x_axis, m_y_axis, m_z_axis, setAutoScaled(), hippodraw::Axes::X, and hippodraw::Axes::Y.

Referenced by autoScale().

void CompositePlotter::autoScaleZ  ) 
 

Sets the range on the Z axis.

Todo:
Determine why is Z axis so different from X and Y?

Definition at line 408 of file CompositePlotter.cxx.

References getRange(), hasAxis(), DataRep::hasZeroRows(), BinaryTransform::limitZ(), m_datareps, m_transform, m_z_axis, Range::pos(), DataRep::preferredRange(), AxisModelBase::setEmpty(), Range::setPos(), DataRep::setRange(), AxisModelBase::setUnionRange(), and hippodraw::Axes::Z.

Referenced by autoScale().

HippoRectangle CompositePlotter::calcUserRectangle  )  const
 

Calculates the user rectangle given the current axis ranges.

Definition at line 1441 of file CompositePlotter.cxx.

References getRange(), Range::high(), Range::low(), m_has_z, m_transform, m_x_axis, m_y_axis, m_z_axis, HippoRectangle::setDepth(), and HippoRectangle::setZ().

bool CompositePlotter::checkAutoScale  ) 
 

Checks if the plotter needs to be auto-scaled and do so if needed.

Returns true if it needed it.

Definition at line 1383 of file CompositePlotter.cxx.

References hasAutoScaled(), and isDirty().

void CompositePlotter::checkAxisScaling  )  [virtual]
 

Check if Axis needs to be scaled or not.

Definition at line 1343 of file CompositePlotter.cxx.

References getBinWidth(), getNumDataReps(), getProjector(), setScaleFactor(), setScaling(), ProjectorBase::wantsScaleFactor(), hippodraw::Axes::X, and hippodraw::Axes::Y.

Referenced by addDataRep(), removeDataRep(), and setActivePlot().

CompositePlotter * CompositePlotter::clone  ) 
 

Makes a copy of the receiving object.

Definition at line 121 of file CompositePlotter.cxx.

References CompositePlotter().

Referenced by setTransform().

NTuple * CompositePlotter::createNTuple  )  const [virtual]
 

Creates a new NTuple from the selected DataRep object.

Creates and return a NTuple object from the selected DataRep if one is selected or only one exists. Otherwise returns a null pointer.

Definition at line 986 of file CompositePlotter.cxx.

References getDataRep(), and selectedDataRep().

NTuple * CompositePlotter::createPickTuple  )  [virtual]
 

Creates a NTuple for a PickTable.

Creates an NTuple appropriate for a PickTable for this plotter. For plotters derived from this class the first three column labels and subsequent labels are as follows

  • "Item number"
  • The X axis label.
  • The Y axis label.
  • For 2D plots with Y axis scaling, the 4th label is "Density"
  • For 3D plots the 4th label is the Z axis label.
  • For 3D plots with Z axis scaling, the 5th label is "Density"
See also:
fillPickTuple.

Definition at line 822 of file CompositePlotter.cxx.

References getLabel(), hasAxis(), isAxisScaled(), num_util::size(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

void CompositePlotter::drawAxisRep AxisRepBase rep,
ViewBase view,
bool  do_y,
bool  do_z
 

Draws the data related to the axis representation.

Draw the data related to the axis representation. If do_y is false do not do the Y axis ticks or labels. If do_z is false, do not do the Z axis.

Definition at line 1464 of file CompositePlotter.cxx.

References AxisRepBase::drawAllXTicks(), AxisRepBase::drawAllYTicks(), AxisRepBase::drawAllZTicks(), AxisRepBase::drawAxesLines(), AxisRepBase::drawColorScale(), AxisRepBase::drawGridLines(), AxisRepBase::drawXLabels(), AxisRepBase::drawYLabels(), AxisRepBase::drawZLabels(), getLabel(), getRange(), getValueRep(), m_has_z, m_transform, m_x_axis, m_x_label, m_y_axis, m_y_label, m_z_axis, m_z_label, BinaryTransform::needsGrid(), BinaryTransform::needsXTicks(), BinaryTransform::needsYTicks(), AxisRepBase::setFontSize(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

void CompositePlotter::drawProjValues ViewBase view  )  [virtual]
 

Draws the projected values.

This implementation invokes drawProjValues on each of the DataRep objects in the composite. If multiple DataRep objects exist in the composite and one is selected (active), it is the one that is drawn last.

Definition at line 450 of file CompositePlotter.cxx.

References DataRep::drawProjectedValues(), m_datarep_index, m_datareps, m_transform, and num_util::size().

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

Returns the state of error bar display on specified axis for the active plotter.

Definition at line 575 of file CompositePlotter.cxx.

References DataRep::isErrorDisplayed(), and m_datareps.

void CompositePlotter::fillCutList std::vector< const TupleCut * > &  cuts  )  const
 

Fills the cuts vector with the TupleCuts contained by the DataRep objects.

Definition at line 1526 of file CompositePlotter.cxx.

References DataRep::getCuts(), m_datareps, and num_util::size().

void CompositePlotter::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. The vector will be cleared before insertion of coordinates. The resulting size of the vector depends on the type of DataRep in use and the contents is as follows.

  • 2D plots without Y axis scaling: 0., X, Y
  • 2D plots with Y axis scaling: 1., X, Y-scaled, Y
  • 3D plots without Z axis scaling: 2., X, Y, Z
  • 3D plots with Z axis scaling: 3., X, Y, Z-scaled, Z
The first item is used to identify the type of picked point.
See also:
createPickNTuple.

Definition at line 872 of file CompositePlotter.cxx.

References getZValue(), hasAxis(), isAxisScaled(), BinaryTransform::isPeriodic(), m_transform, PeriodicBinaryTransform::moduloAddX(), PeriodicBinaryTransform::moduloAddY(), processReturnValue(), hippodraw::Axes::X, PeriodicBinaryTransform::xOffset(), hippodraw::Axes::Y, PeriodicBinaryTransform::yOffset(), and hippodraw::Axes::Z.

double CompositePlotter::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.

Definition at line 1334 of file CompositePlotter.cxx.

References TransformBase::aspectRatio(), and m_transform.

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

Definition at line 1113 of file CompositePlotter.cxx.

References m_x_axis, m_y_axis, m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by setAutoTicks(), and setTicks().

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

Returns the bin width on designated axis.

. Returns the actual bin width if axis is binned and only one DataRep is in the display. If multiple DataRep objects are in the display, then returns the bin width if all have the same width, or if only one is selected, otherwise returns -1. If axis is not binned, returns 0. This base class implementation returns 0.0 and should be overridden by derived classes.

Definition at line 639 of file CompositePlotter.cxx.

References std::abs(), activePlotIndex(), ProjectorBase::getBinWidth(), getProjector(), ProjectorBase::isAxisBinned(), m_datareps, hippodraw::Axes::X, and hippodraw::Axes::Y.

Referenced by checkAxisScaling().

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

Definition at line 254 of file CompositePlotter.cxx.

References getNumDataReps(), and m_datareps.

Referenced by addValues(), createNTuple(), getNumberOfEntries(), getParentDataRep(), getZValue(), processReturnValue(), and setParentDataRep().

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

Definition at line 1318 of file CompositePlotter.cxx.

References m_x_label, m_y_label, m_z_label, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

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

Definition at line 1297 of file CompositePlotter.cxx.

References activeProjector(), ProjectorBase::getXLabel(), ProjectorBase::getYLabel(), ProjectorBase::getZLabel(), m_x_label, m_y_label, m_z_label, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by createPickTuple(), and drawAxisRep().

int CompositePlotter::getNumberOfEntries  )  const [virtual]
 

Returns the number of entries in the contained DataRep.

If multiple DataRep objects are active, returns 0, otherwise returns the number of entries of the elected DataRep.

Definition at line 624 of file CompositePlotter.cxx.

References activePlotIndex(), and getDataRep().

int CompositePlotter::getNumDataReps  )  const [virtual]
 

Returns the number of DataRep objects in this plot.

Definition at line 246 of file CompositePlotter.cxx.

References m_datareps.

Referenced by checkAxisScaling(), getDataRep(), getProjector(), and removeDataRep().

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

Definition at line 689 of file CompositePlotter.cxx.

References activePlotIndex(), ProjectorBase::getOffset(), getProjector(), ProjectorBase::isAxisBinned(), m_datareps, hippodraw::Axes::X, and hippodraw::Axes::Y.

DataRep * CompositePlotter::getParentDataRep  )  const [virtual]
 

Gets the parent DataRep associated with the current/ active DataRep.

Definition at line 273 of file CompositePlotter.cxx.

References getDataRep(), and m_datarep_index.

Referenced by getParentDataRep().

DataRep * CompositePlotter::getParentDataRep int  index  )  const [virtual]
 

Gets the parent DataRep object associated with the DataRep whose index number is index.

Definition at line 262 of file CompositePlotter.cxx.

References getDataRep(), and getParentDataRep().

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

Returns the smallest positive number from the data.

Definition at line 499 of file CompositePlotter.cxx.

References m_datareps, and std::min().

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

Returns the projector at index i.

Definition at line 237 of file CompositePlotter.cxx.

References getNumDataReps(), DataRep::getProjector(), and m_datareps.

Referenced by checkAxisScaling(), getBinWidth(), and getOffset().

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

Definition at line 1237 of file CompositePlotter.cxx.

References AxisModelBase::getRange(), m_x_axis, m_y_axis, m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by autoScaleZ(), calcUserRectangle(), and drawAxisRep().

DataRep * CompositePlotter::getTarget  )  const [virtual]
 

Definition at line 1055 of file CompositePlotter.cxx.

References m_datareps, and num_util::size().

const std::string& CompositePlotter::getTitle  )  const
 

Returns the title.

Returns the title of the active DataRep object. If multiple DataRep objects are active, return the title of the first one.

TransformBase * CompositePlotter::getTransform  )  const [virtual]
 

Definition at line 781 of file CompositePlotter.cxx.

References m_transform.

Referenced by prepareToDraw().

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

Definition at line 605 of file CompositePlotter.cxx.

References representation().

Referenced by drawAxisRep().

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

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

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 854 of file CompositePlotter.cxx.

References getDataRep(), DataRep::getProjector(), ProjectorBase::getZValue(), processReturnValue(), selectedDataRep(), and hippodraw::Axes::Z.

Referenced by fillPickedPoint().

bool CompositePlotter::hasAutoScaled  )  const
 

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

Definition at line 1376 of file CompositePlotter.cxx.

References m_has_autoscaled.

Referenced by checkAutoScale().

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

Definition at line 1090 of file CompositePlotter.cxx.

References m_x_axis, m_y_axis, m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by addDataRep(), autoScaleZ(), createPickTuple(), fillPickedPoint(), setAutoRanging(), and setAxisModel().

bool CompositePlotter::hasNTupleBindings  )  const [virtual]
 

Returns true if the selected DataRep object has ntuple bindings, otherwise returns false.

Definition at line 134 of file CompositePlotter.cxx.

References DataRep::hasNTupleBindings(), and selectedDataRep().

bool CompositePlotter::hasZoomY  )  const [virtual]
 

Returns true if the plotter has zoom feature on the Y Axis otherwise it returns false.

Definition at line 142 of file CompositePlotter.cxx.

References m_datareps.

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

Definition at line 1073 of file CompositePlotter.cxx.

References m_datareps, and num_util::size().

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

Definition at line 1158 of file CompositePlotter.cxx.

References AxisModelBase::isAutoRanging(), m_x_axis, m_y_axis, m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

bool CompositePlotter::isAxisScaled hippodraw::Axes::Type  axis  )  const [virtual]
 

Definition at line 1101 of file CompositePlotter.cxx.

References m_x_axis, m_y_axis, m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by createPickTuple(), and fillPickedPoint().

bool CompositePlotter::isDirty  )  const [protected]
 

Return true if any of the contained DataRep objects returns true from its isDirty() function.

Definition at line 439 of file CompositePlotter.cxx.

References m_datareps.

Referenced by checkAutoScale().

bool CompositePlotter::isTargetable  )  const [virtual]
 

Definition at line 1029 of file CompositePlotter.cxx.

References m_datareps.

void CompositePlotter::matrixTranspose bool  yes  )  [virtual]
 

Definition at line 546 of file CompositePlotter.cxx.

References std::bind2nd(), std::for_each(), m_datareps, DataRep::matrixTranspose(), and std::mem_fun().

DataRep * CompositePlotter::mouseSelectedDataRep  )  const [virtual]
 

Returns the data rep under the mouse.

Definition at line 971 of file CompositePlotter.cxx.

References selectedDataRep().

Referenced by processReturnValue().

void CompositePlotter::prepareToDraw  )  [virtual]
 

Prepares the axes for drawing.

Definition at line 1395 of file CompositePlotter.cxx.

References AxisModelBase::getRange(), getTransform(), Range::high(), Range::low(), m_has_z, m_x_axis, m_y_axis, m_z_axis, AxisModelBase::setRange(), setTicks(), BinaryTransform::transformZ(), BinaryTransform::validate(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

double CompositePlotter::processReturnValue double  retval,
hippodraw::Axes::Type  axis,
bool  scaled
const
 

Process the return value for margin-to-user functions.

Definition at line 923 of file CompositePlotter.cxx.

References ProjectorBase::getAxisModel(), getDataRep(), DataRep::getProjector(), AxisModelBase::getRange(), AxisModelBase::getScaleFactor(), Range::high(), Range::low(), and mouseSelectedDataRep().

Referenced by fillPickedPoint(), getZValue(), and toUserXY().

void CompositePlotter::push_back DataRep  )  [protected]
 

Adds the DataRep object to the composite if it is not already there.

Definition at line 190 of file CompositePlotter.cxx.

References std::find(), and m_datareps.

Referenced by addDataRep().

void CompositePlotter::removeDataRep DataRep  )  [virtual]
 

Removes the DataRep from the composite.

Definition at line 303 of file CompositePlotter.cxx.

References checkAxisScaling(), std::find(), getNumDataReps(), m_datarep_index, and m_datareps.

const Color & CompositePlotter::repColor  )  const [virtual]
 

Returns the color used for the data points from the active plotter.

Definition at line 738 of file CompositePlotter.cxx.

References DataRep::getRepColor(), m_datarep_index, and m_datareps.

RepBase * CompositePlotter::representation  )  const [virtual]
 

Returns the representation.

The data representation of the active plotter is returned.

Definition at line 590 of file CompositePlotter.cxx.

References DataRep::getRepresentation(), m_datarep_index, and m_datareps.

Referenced by getValueRep(), and setValueRep().

void CompositePlotter::reset  )  [virtual]
 

Resets bins.

Definition at line 535 of file CompositePlotter.cxx.

References m_datareps, and ProjectorBase::reset().

DataRep * CompositePlotter::selectedDataRep  )  const [virtual]
 

Definition at line 126 of file CompositePlotter.cxx.

References m_datarep_index, and m_datareps.

Referenced by createNTuple(), getZValue(), hasNTupleBindings(), mouseSelectedDataRep(), and setCutRangeAt().

int CompositePlotter::setActivePlot int  index,
bool  redraw
[virtual]
 

Sets the active DataRep object.

Sets the active DataRep object indexed by index. Redraws if redraw is true. If index is -1, then all the contained DataRep objects are set active. If index is -2, then all contained DataRep objects are set inactive.

Definition at line 154 of file CompositePlotter.cxx.

References checkAxisScaling(), m_datarep_index, and m_datareps.

Referenced by addDataRep().

void CompositePlotter::setAllAxisModels  )  [virtual]
 

Sets the axis models for all of the components of the contained DataRep objects.

This protected method should be called in the implementation of the copy constructor after the axis models have been created.

Definition at line 320 of file CompositePlotter.cxx.

References m_datareps, m_x_axis, m_y_axis, m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

void CompositePlotter::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.

Definition at line 1130 of file CompositePlotter.cxx.

References m_x_axis, m_y_axis, m_z_axis, AxisModelBase::setAutoRanging(), setAutoScaled(), AxisModelBase::setEmpty(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

void CompositePlotter::setAutoRanging bool  flag  )  [virtual]
 

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

Definition at line 772 of file CompositePlotter.cxx.

References hasAxis(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

void CompositePlotter::setAutoScaled bool  flag = true  ) 
 

Sets the auto scaled flag.

Definition at line 1369 of file CompositePlotter.cxx.

References m_has_autoscaled.

Referenced by autoScale(), setAutoRanging(), setAxisModel(), and setTransform().

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

Sets automatic generation of ticks on specified axis.

Definition at line 1010 of file CompositePlotter.cxx.

References getAxisModel().

void CompositePlotter::setAxisModel AxisModelBase ,
hippodraw::Axes::Type 
[virtual]
 

Sets the AxisModel on the specified axis.

Also, sets the same AxisModel to all of the contained plotters.

Definition at line 753 of file CompositePlotter.cxx.

References hasAxis(), m_datareps, m_x_axis, m_y_axis, m_z_axis, setAutoScaled(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

void CompositePlotter::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.

Definition at line 524 of file CompositePlotter.cxx.

References m_datareps, and ProjectorBase::setBinWidth().

void CompositePlotter::setCutRangeAt const Range range,
unsigned int  index
[virtual]
 

Sets the TupleCut range.

For the selected DataRep object, set its TupleCut object indexed by index Range to range.

Definition at line 1541 of file CompositePlotter.cxx.

References selectedDataRep().

void CompositePlotter::setEnableZ bool  yes  ) 
 

Enables the Z axis.

Definition at line 1512 of file CompositePlotter.cxx.

References m_has_z, m_z_axis, and PLOTTOP.

Referenced by CompositePlotter().

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

Sets the display of the error bars on or off for the active plotter.

Definition at line 565 of file CompositePlotter.cxx.

References m_datarep_index, m_datareps, and DataRep::setErrorDisplay().

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

Sets the high end of the Range of data displayed.

Definition at line 1220 of file CompositePlotter.cxx.

References AxisModelBase::calcHigh(), m_x_axis, m_y_axis, m_z_axis, setRangePrivate(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

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

Definition at line 1286 of file CompositePlotter.cxx.

References m_x_label, m_y_label, m_z_label, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

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

Sets the low end of the Range of data displayed.

Definition at line 1204 of file CompositePlotter.cxx.

References AxisModelBase::calcLow(), m_x_axis, m_y_axis, m_z_axis, setRangePrivate(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

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

Definition at line 513 of file CompositePlotter.cxx.

References m_datareps, and ProjectorBase::setNumberOfBins().

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

Definition at line 554 of file CompositePlotter.cxx.

References m_datareps, and ProjectorBase::setOffset().

void CompositePlotter::setParentDataRep DataRep parent  )  [virtual]
 

Sets the parent DataRep associated with the current/ active DataRep.

Definition at line 293 of file CompositePlotter.cxx.

References getDataRep(), m_datarep_index, and setParentDataRep().

void CompositePlotter::setParentDataRep int  index,
DataRep parent
[virtual]
 

Sets the parent DataRep associated with the DataRep whose index number is index.

Definition at line 284 of file CompositePlotter.cxx.

References getDataRep().

Referenced by setParentDataRep().

void CompositePlotter::setRange hippodraw::Axes::Type  ,
const Range ,
bool  scaled,
bool  adjust_width
[virtual]
 

Definition at line 486 of file CompositePlotter.cxx.

References m_datareps, and setRangePrivate().

void CompositePlotter::setRangePrivate hippodraw::Axes::Type  axis,
const Range range,
bool  scaled = false,
bool  adjust_width = true
[protected, virtual]
 

Definition at line 1174 of file CompositePlotter.cxx.

References AxisModelBase::getRange(), BinaryTransform::limitX(), BinaryTransform::limitY(), BinaryTransform::limitZ(), m_transform, m_x_axis, m_y_axis, m_z_axis, AxisModelBase::setAutoRanging(), AxisModelBase::setIntersectRange(), AxisModelBase::setRange(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by setHighRange(), setLowRange(), and setRange().

void CompositePlotter::setRepColor const Color  )  [virtual]
 

Sets the representation color of the active plotter.

Definition at line 730 of file CompositePlotter.cxx.

References m_datarep_index, m_datareps, and DataRep::setRepColor().

void CompositePlotter::setRepresentation RepBase pointrep  )  [virtual]
 

Sets the representation.

The representation of the active plotter is changed.

Definition at line 582 of file CompositePlotter.cxx.

References m_datarep_index, m_datareps, and DataRep::setRepresentation().

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

Definition at line 1256 of file CompositePlotter.cxx.

References m_x_axis, m_y_axis, m_z_axis, AxisModelBase::setScaleFactor(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by checkAxisScaling().

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

Sets the scaling attribute of the AxisModelBase object.

Definition at line 1271 of file CompositePlotter.cxx.

References m_x_axis, m_y_axis, m_z_axis, AxisModelBase::setScaling(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by checkAxisScaling().

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

Definition at line 1019 of file CompositePlotter.cxx.

References getAxisModel().

Referenced by prepareToDraw().

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

Sets the title.

Sets the title of the active DataRep object. If multiple DataRep objects are active, sets the title of the first one.

void CompositePlotter::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.

See also:
m_transform.

Definition at line 787 of file CompositePlotter.cxx.

References clone(), m_transform, setAutoScaled(), and std::swap().

void CompositePlotter::setValueRep BinToColor rep  )  [virtual]
 

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

Definition at line 616 of file CompositePlotter.cxx.

References representation().

void CompositePlotter::toUserXY double  x,
double  y,
bool  scaled,
double &  ux,
double &  uy
const [virtual]
 

Todo:
Needs to be renamed.

Definition at line 807 of file CompositePlotter.cxx.

References m_transform, processReturnValue(), hippodraw::Axes::X, and hippodraw::Axes::Y.

void CompositePlotter::update  )  [virtual]
 

Definition at line 999 of file CompositePlotter.cxx.

References m_datareps.


Member Data Documentation

int CompositePlotter::m_datarep_index [protected]
 

The index of the active DataRep or a negative value if more than one is active.

Definition at line 107 of file CompositePlotter.h.

Referenced by activePlotIndex(), activeProjector(), drawProjValues(), getParentDataRep(), removeDataRep(), repColor(), representation(), selectedDataRep(), setActivePlot(), setErrorDisplay(), setParentDataRep(), setRepColor(), and setRepresentation().

DataRepList_t CompositePlotter::m_datareps [protected]
 

The list of the DataRep objects in the composite.

Definition at line 114 of file CompositePlotter.h.

Referenced by activeProjector(), addDataRep(), autoScale(), autoScaleZ(), CompositePlotter(), drawProjValues(), errorDisplay(), fillCutList(), getBinWidth(), getDataRep(), getNumDataReps(), getOffset(), getPosRange(), getProjector(), getTarget(), hasZoomY(), indexOf(), isDirty(), isTargetable(), matrixTranspose(), push_back(), removeDataRep(), repColor(), representation(), reset(), selectedDataRep(), setActivePlot(), setAllAxisModels(), setAxisModel(), setBinWidth(), setErrorDisplay(), setNumberOfBins(), setOffset(), setRange(), setRepColor(), setRepresentation(), update(), and ~CompositePlotter().

bool CompositePlotter::m_has_autoscaled [protected]
 

A flag that when true indicates the plotter has already auto-scaled the axes.

Definition at line 119 of file CompositePlotter.h.

Referenced by hasAutoScaled(), and setAutoScaled().

bool CompositePlotter::m_has_z [protected]
 

A flag which when set true indicates the plotter maintains a Z axis.

Definition at line 124 of file CompositePlotter.h.

Referenced by calcUserRectangle(), CompositePlotter(), drawAxisRep(), prepareToDraw(), and setEnableZ().

TransformBase* CompositePlotter::m_transform [protected]
 

The transform object.

It is responsible for transforming the original data coordinate system to another.

Definition at line 102 of file CompositePlotter.h.

Referenced by autoScale(), autoScaleZ(), calcUserRectangle(), CompositePlotter(), drawAxisRep(), drawProjValues(), fillPickedPoint(), getAspectRatio(), getTransform(), setRangePrivate(), setTransform(), toUserXY(), and ~CompositePlotter().

AxisModelBase* CompositePlotter::m_x_axis [protected]
 

The x dimension axis model.

In a composite display, a number of plotters can share the same axis model. The owner of the object, i.e. the one responsible for deleting it, is the plotter that created it.

Todo:
Generalize the containment of axis model to n-dimension.

Definition at line 71 of file CompositePlotter.h.

Referenced by addDataRep(), autoScale(), calcUserRectangle(), CompositePlotter(), drawAxisRep(), getAxisModel(), getRange(), hasAxis(), isAutoRanging(), isAxisScaled(), prepareToDraw(), setAllAxisModels(), setAutoRanging(), setAxisModel(), setHighRange(), setLowRange(), setRangePrivate(), setScaleFactor(), setScaling(), and ~CompositePlotter().

std::string CompositePlotter::m_x_label [protected]
 

The label of the x axis is associated with the X AxisModel object.

Todo:
The axis labels should be a member of the axis model.

Definition at line 90 of file CompositePlotter.h.

Referenced by drawAxisRep(), getInternalLabel(), getLabel(), and setLabel().

AxisModelBase* CompositePlotter::m_y_axis [protected]
 

The y dimension axis model.

In a composite display, a number of plotters can share the same axis model. The owner of the object, i.e. the one responsible for deleting it, is the plotter that created it.

Definition at line 77 of file CompositePlotter.h.

Referenced by addDataRep(), autoScale(), calcUserRectangle(), CompositePlotter(), drawAxisRep(), getAxisModel(), getRange(), hasAxis(), isAutoRanging(), isAxisScaled(), prepareToDraw(), setAllAxisModels(), setAutoRanging(), setAxisModel(), setHighRange(), setLowRange(), setRangePrivate(), setScaleFactor(), setScaling(), and ~CompositePlotter().

std::string CompositePlotter::m_y_label [protected]
 

The label of the y axis is associated with the YAxisModel object.

Definition at line 94 of file CompositePlotter.h.

Referenced by drawAxisRep(), getInternalLabel(), getLabel(), and setLabel().

AxisModelBase* CompositePlotter::m_z_axis [protected]
 

The z dimension axis model.

In a composite display, a number of plotters can share the same axis model. The owner of the object, i.e. the one responsible for deleting it, is the plotter that created it.

Definition at line 83 of file CompositePlotter.h.

Referenced by addDataRep(), autoScale(), autoScaleZ(), calcUserRectangle(), CompositePlotter(), drawAxisRep(), getAxisModel(), getRange(), hasAxis(), isAutoRanging(), isAxisScaled(), prepareToDraw(), setAllAxisModels(), setAutoRanging(), setAxisModel(), setEnableZ(), setHighRange(), setLowRange(), setRangePrivate(), setScaleFactor(), setScaling(), and ~CompositePlotter().

std::string CompositePlotter::m_z_label [protected]
 

The label of the z axis is associated with the Z AxisModel object.

Definition at line 98 of file CompositePlotter.h.

Referenced by drawAxisRep(), getInternalLabel(), getLabel(), and setLabel().


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