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

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

#include <CompositePlotter.h>

Collaboration diagram for CompositePlotter:
Collaboration graph
[legend]

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 (hippodraw::DataRep *rep)
 Adds the DataRep object to the composite.
virtual void addValues (const std::vector< double > &v)
 Adds the values to the plot.
virtual void autoScale ()
 Sets the Range on each axis that has the auto range flag set to include all the data.
void autoScale (hippodraw::Axes::Type axis)
 Sets the Range on the specified axis to include all the data.
void autoScale (AxisModelBase *model, hippodraw::Axes::Type axis)
 Auto scales the selected axis.
void autoScaleZ ()
 Sets the range on the Z axis.
Rect calcRawRectangle () const
 Calculates the raw rectangle before transform.
Rect 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 bool getBoxEdge ()
 Gets the box edge status to update the inspector.
virtual hippodraw::DataRepgetDataRep (int index) const
virtual TransformBasegetFitsTransform () const
virtual const std::string & getInternalLabel (hippodraw::Axes::Type axis) const
virtual const std::string & getLabel (hippodraw::Axes::Type) const
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 in this plot.
virtual double getOffset (hippodraw::Axes::Type axis) const
virtual hippodraw::DataRepgetParentDataRep (int index) const
 Gets the parent DataRep object associated with the DataRep whose index number is index.
virtual hippodraw::DataRepgetParentDataRep () const
 Gets the parent DataRep associated with the current/ active DataRep.
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
double getScaleFactor (Axes::Type axis) const
 Returns the scale factor used on specified axis.
virtual bool getShowGrid ()
 Gets the show-grid status to update the inspector.
virtual hippodraw::DataRepgetTarget () const
const std::string & getTitle () 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 DataSource 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 hippodraw::DataRep *rep) const
virtual bool isAutoRanging (hippodraw::Axes::Type axis) const
virtual bool isAxisScaled (hippodraw::Axes::Type axis) const
 Returns true if specified axis is scaled.
bool isImageConvertable () const
 Returns true if plotter contents is convertable to image.
virtual bool isReverse () const
virtual bool isTargetable () const
virtual void matrixTranspose (bool yes)
virtual hippodraw::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 (hippodraw::DataRep *rep)
 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 hippodraw::DataRepselectedDataRep () const
 Returns the selected DataRep if one is selected, otherwise returns the first one.
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 (bool flag)
 Sets the auto-ranging status for all axes to flag.
virtual void setAutoRanging (hippodraw::Axes::Type axis, bool flag)
 Sets the auto-ranging.
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 axis model on the specified axis.
virtual void setBinWidth (hippodraw::Axes::Type axis, double width)
 Sets the bin width.
virtual void setBoxEdge (bool flag)
 Sets the box edge status to flag.
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 setFitsTransform (const std::string &)
 Set the fits transform object.
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 setMinEntries (int entries)
 Set the minimum entries/bin.
virtual void setNumberOfBins (hippodraw::Axes::Type axis, unsigned int number)
virtual void setOffset (hippodraw::Axes::Type axis, double offset)
virtual void setParentDataRep (int index, hippodraw::DataRep *parent)
 Sets the parent DataRep associated with the DataRep whose index number is index.
virtual void setParentDataRep (hippodraw::DataRep *parent)
 Sets the parent DataRep associated with the current/ active DataRep.
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 setReverse (bool flag)
 Sets the reverse status for the X axis to flag.
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 setShowGrid (bool flag)
 Sets the show-grid status to flag.
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
< hippodraw::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 (hippodraw::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

bool m_box_edge
 A flag when set true indicates the box edge is show for color boxes.
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.
TransformBasem_fits_transform
 The fits transform object.
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.
bool m_reverse
 A flag which when set ture indicates the x axis is reversed.
bool m_show_grid
 A flag when set true indicates the plotter shows grid.
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 axis model object.
AxisModelBasem_y_axis
 The y dimension axis model.
std::string m_y_label
 The label of the y axis is associated with the Y axis model 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 axis model object.

Private Member Functions

void toggleBoxEdge (DataRep *datarep)
 Set box edge status according to m_box_edge flag for the datarep.

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_.nosp@m.Kunz.nosp@m.@slac.nosp@m..sta.nosp@m.nford.nosp@m..edu
Oded Wurman owurm.nosp@m.an@s.nosp@m.tanfo.nosp@m.rd.e.nosp@m.du

Definition at line 54 of file CompositePlotter.h.

Member Typedef Documentation

typedef std::vector< hippodraw::DataRep * > DataRepList_t
protected

The type of container used to store the DataRep objects.

Definition at line 116 of file CompositePlotter.h.

Constructor & Destructor Documentation

CompositePlotter ( const CompositePlotter plotter)
protected
~CompositePlotter ( )
virtual

Member Function Documentation

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

References CompositePlotter::m_datarep_index.

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

ProjectorBase * activeProjector ( ) const
virtual

Returns the active projector.

Definition at line 241 of file CompositePlotter.cxx.

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

Referenced by CompositePlotter::getLabel().

void addDataRep ( hippodraw::DataRep rep)
virtual
void 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 1052 of file CompositePlotter.cxx.

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

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

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

Referenced by CompositePlotter::autoScale().

void autoScale ( hippodraw::Axes::Type  axis)
void autoScale ( AxisModelBase model,
hippodraw::Axes::Type  axis 
)
void autoScaleZ ( )
Rect calcRawRectangle ( ) const

Calculates the raw rectangle before transform.

Definition at line 1577 of file CompositePlotter.cxx.

References CompositePlotter::getRange(), Range::high(), Range::low(), CompositePlotter::m_x_axis, and CompositePlotter::m_y_axis.

Rect calcUserRectangle ( ) const
bool checkAutoScale ( )

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

Returns true if it needed it.

Definition at line 1496 of file CompositePlotter.cxx.

References CompositePlotter::hasAutoScaled(), and CompositePlotter::isDirty().

void checkAxisScaling ( )
virtual
CompositePlotter * clone ( )

Makes a copy of the receiving object.

Definition at line 135 of file CompositePlotter.cxx.

References CompositePlotter::CompositePlotter().

Referenced by CompositePlotter::setTransform().

NTuple * 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 1060 of file CompositePlotter.cxx.

References CompositePlotter::getDataRep(), and CompositePlotter::selectedDataRep().

NTuple * 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 874 of file CompositePlotter.cxx.

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

void drawAxisRep ( AxisRepBase rep,
ViewBase view,
bool  do_y,
bool  do_z 
)
void 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 476 of file CompositePlotter.cxx.

References CompositePlotter::m_datarep_index, CompositePlotter::m_datareps, CompositePlotter::m_transform, num_util::size(), and CompositePlotter::toggleBoxEdge().

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

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

Definition at line 617 of file CompositePlotter.cxx.

References DataRep::isErrorDisplayed(), and CompositePlotter::m_datareps.

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

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

Definition at line 1660 of file CompositePlotter.cxx.

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

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

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

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.

Definition at line 1446 of file CompositePlotter.cxx.

References TransformBase::aspectRatio(), and CompositePlotter::m_transform.

AxisModelBase * getAxisModel ( hippodraw::Axes::Type  axis) const
virtual
double 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 681 of file CompositePlotter.cxx.

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

Referenced by CompositePlotter::checkAxisScaling().

bool getBoxEdge ( )
virtual

Gets the box edge status to update the inspector.

Definition at line 1707 of file CompositePlotter.cxx.

References CompositePlotter::m_box_edge.

Referenced by XyPlotter::getBoxEdge().

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

Definition at line 1723 of file CompositePlotter.cxx.

References CompositePlotter::m_fits_transform.

const string & getInternalLabel ( hippodraw::Axes::Type  axis) const
virtual
const string & getLabel ( hippodraw::Axes::Type  axis) const
virtual
int getMinEntries ( )
virtual
int 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 666 of file CompositePlotter.cxx.

References CompositePlotter::activePlotIndex(), and CompositePlotter::getDataRep().

int getNumDataReps ( ) const
virtual
double getOffset ( hippodraw::Axes::Type  axis) const
virtual
DataRep * getParentDataRep ( int  index) const
virtual

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

Definition at line 280 of file CompositePlotter.cxx.

References CompositePlotter::getDataRep(), and CompositePlotter::getParentDataRep().

DataRep * getParentDataRep ( ) const
virtual

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

Definition at line 291 of file CompositePlotter.cxx.

References CompositePlotter::getDataRep(), and CompositePlotter::m_datarep_index.

Referenced by CompositePlotter::getParentDataRep().

double getPosRange ( hippodraw::Axes::Type  axis) const
virtual

Returns the smallest positive number from the data.

Definition at line 537 of file CompositePlotter.cxx.

References CompositePlotter::hasAxis(), and CompositePlotter::m_datareps.

ProjectorBase * getProjector ( int  i) const
virtual
const Range & getRange ( hippodraw::Axes::Type  axis,
bool  scaled 
) const
virtual
double getScaleFactor ( Axes::Type  axis) const

Returns the scale factor used on specified axis.

Definition at line 1339 of file CompositePlotter.cxx.

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

bool getShowGrid ( )
virtual

Gets the show-grid status to update the inspector.

Definition at line 1693 of file CompositePlotter.cxx.

References CompositePlotter::m_show_grid.

DataRep * getTarget ( ) const
virtual

Definition at line 1129 of file CompositePlotter.cxx.

References CompositePlotter::m_datareps, and num_util::size().

const std::string& 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 * getTransform ( ) const
virtual

Definition at line 833 of file CompositePlotter.cxx.

References CompositePlotter::m_transform.

Referenced by CompositePlotter::prepareToDraw().

const BinToColor * getValueRep ( ) const
virtual

Definition at line 647 of file CompositePlotter.cxx.

References CompositePlotter::representation().

Referenced by CompositePlotter::drawAxisRep().

double getZValue ( double  x,
double  y,
bool  scaled = true 
) const
protectedvirtual

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

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

Referenced by CompositePlotter::fillPickedPoint().

bool hasAutoScaled ( ) const

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

Definition at line 1489 of file CompositePlotter.cxx.

References CompositePlotter::m_has_autoscaled.

Referenced by CompositePlotter::checkAutoScale().

bool hasAxis ( hippodraw::Axes::Type  axis) const
virtual
bool hasNTupleBindings ( ) const
virtual

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

Definition at line 147 of file CompositePlotter.cxx.

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

bool hasZoomY ( ) const
virtual

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

Definition at line 155 of file CompositePlotter.cxx.

References CompositePlotter::m_datareps.

int indexOf ( const hippodraw::DataRep rep) const
virtual

Definition at line 1147 of file CompositePlotter.cxx.

References CompositePlotter::m_datareps, and num_util::size().

bool isAutoRanging ( hippodraw::Axes::Type  axis) const
virtual
bool isAxisScaled ( hippodraw::Axes::Type  axis) const
virtual
bool isDirty ( ) const
protected

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

Definition at line 465 of file CompositePlotter.cxx.

References CompositePlotter::m_datareps.

Referenced by CompositePlotter::checkAutoScale().

bool isImageConvertable ( ) const

Returns true if plotter contents is convertable to image.

Returns true if the plotter contains only one DataRep and that DataRep is convertable to an image.

Definition at line 1766 of file CompositePlotter.cxx.

References CompositePlotter::m_datareps.

bool isReverse ( ) const
virtual

Definition at line 826 of file CompositePlotter.cxx.

References CompositePlotter::m_reverse.

bool isTargetable ( ) const
virtual

Definition at line 1103 of file CompositePlotter.cxx.

References CompositePlotter::m_datareps.

void matrixTranspose ( bool  yes)
virtual
DataRep * mouseSelectedDataRep ( ) const
virtual

Returns the data rep under the mouse.

Definition at line 1045 of file CompositePlotter.cxx.

References CompositePlotter::selectedDataRep().

Referenced by CompositePlotter::processReturnValue().

void prepareToDraw ( )
virtual
double processReturnValue ( double  retval,
hippodraw::Axes::Type  axis,
bool  scaled 
) const
void push_back ( hippodraw::DataRep rep)
protected

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

Definition at line 208 of file CompositePlotter.cxx.

References CompositePlotter::m_datareps.

Referenced by CompositePlotter::addDataRep().

void removeDataRep ( hippodraw::DataRep rep)
virtual

Removes the DataRep from the composite.

If rep is contained by the plotter, then remove it, otherwise does nothing.

Definition at line 321 of file CompositePlotter.cxx.

References CompositePlotter::checkAxisScaling(), CompositePlotter::getNumDataReps(), CompositePlotter::m_datarep_index, and CompositePlotter::m_datareps.

const Color & repColor ( ) const
virtual

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

Definition at line 780 of file CompositePlotter.cxx.

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

RepBase * representation ( ) const
virtual

Returns the representation.

The data representation of the active plotter is returned.

Definition at line 632 of file CompositePlotter.cxx.

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

Referenced by CompositePlotter::getValueRep(), and CompositePlotter::setValueRep().

void reset ( )
virtual
hippodraw::DataRep * selectedDataRep ( ) const
virtual
int 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 169 of file CompositePlotter.cxx.

References CompositePlotter::checkAxisScaling(), CompositePlotter::getProjector(), CompositePlotter::m_datarep_index, CompositePlotter::m_datareps, and DataRep::setSelected().

Referenced by CompositePlotter::addDataRep().

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

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

void setAutoRanging ( bool  flag)
virtual

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

Definition at line 814 of file CompositePlotter.cxx.

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

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

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

void setAutoScaled ( bool  flag = true)
void setAutoTicks ( hippodraw::Axes::Type  axis,
bool  yes 
)
virtual

Sets automatic generation of ticks on specified axis.

Definition at line 1084 of file CompositePlotter.cxx.

References CompositePlotter::getAxisModel().

void setAxisModel ( AxisModelBase model,
hippodraw::Axes::Type  axis 
)
virtual

Sets the axis model on the specified axis.

Also, sets the same axis model to all of the contained plotters.

Definition at line 795 of file CompositePlotter.cxx.

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

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

References CompositePlotter::getProjector(), CompositePlotter::m_datareps, and ProjectorBase::setBinWidth().

void setBoxEdge ( bool  flag)
virtual

Sets the box edge status to flag.

Definition at line 1700 of file CompositePlotter.cxx.

References CompositePlotter::m_box_edge.

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

References CompositePlotter::selectedDataRep().

void setEnableZ ( bool  yes)

Enables the Z axis.

Definition at line 1646 of file CompositePlotter.cxx.

References CompositePlotter::m_has_z, CompositePlotter::m_z_axis, and PLOTTOP.

Referenced by CompositePlotter::CompositePlotter().

void setErrorDisplay ( hippodraw::Axes::Type  axis,
bool  flag 
)
virtual

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

Definition at line 607 of file CompositePlotter.cxx.

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

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

Set the fits transform object.

Definition at line 1715 of file CompositePlotter.cxx.

References TransformFactory::createTransform(), TransformFactory::instance(), and CompositePlotter::m_fits_transform.

void setHighRange ( hippodraw::Axes::Type  axis,
int  parm,
bool  dragging 
)
virtual
void setLabel ( hippodraw::Axes::Type  axis,
const std::string &  value 
)
virtual
void setLowRange ( hippodraw::Axes::Type  axis,
int  parm,
bool  dragging 
)
virtual
void setMinEntries ( int  entries)
virtual

Set the minimum entries/bin.

Definition at line 1730 of file CompositePlotter.cxx.

References CompositePlotter::getProjector(), CompositePlotter::m_datareps, and ProjectorBase::setMinEntries().

void setNumberOfBins ( hippodraw::Axes::Type  axis,
unsigned int  number 
)
virtual
void setOffset ( hippodraw::Axes::Type  axis,
double  offset 
)
virtual
void setParentDataRep ( int  index,
hippodraw::DataRep parent 
)
virtual

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

Definition at line 302 of file CompositePlotter.cxx.

References CompositePlotter::getDataRep().

Referenced by CompositePlotter::setParentDataRep().

void setParentDataRep ( hippodraw::DataRep parent)
virtual

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

Definition at line 311 of file CompositePlotter.cxx.

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

void setRange ( hippodraw::Axes::Type  axis,
const Range range,
bool  scaled,
bool  adjust_width 
)
virtual
void setRangePrivate ( hippodraw::Axes::Type  axis,
const Range range,
bool  scaled = false,
bool  adjust_width = true 
)
protectedvirtual
void setRepColor ( const Color color)
virtual

Sets the representation color of the active plotter.

Definition at line 772 of file CompositePlotter.cxx.

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

void setRepresentation ( RepBase pointrep)
virtual

Sets the representation.

The representation of the active plotter is changed.

Definition at line 624 of file CompositePlotter.cxx.

References CompositePlotter::m_datarep_index, CompositePlotter::m_datareps, and DataRep::setPointRep().

void setReverse ( bool  flag)
virtual

Sets the reverse status for the X axis to flag.

Definition at line 821 of file CompositePlotter.cxx.

References CompositePlotter::m_reverse.

void setScaleFactor ( hippodraw::Axes::Type  axis,
double  factor 
)
virtual
void setScaling ( hippodraw::Axes::Type  axis,
bool  on = true 
)
virtual
void setShowGrid ( bool  flag)
virtual

Sets the show-grid status to flag.

Definition at line 1686 of file CompositePlotter.cxx.

References CompositePlotter::m_show_grid.

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

Definition at line 1093 of file CompositePlotter.cxx.

References CompositePlotter::getAxisModel().

Referenced by CompositePlotter::prepareToDraw().

void 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 setTransform ( TransformBase tf)
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 839 of file CompositePlotter.cxx.

References CompositePlotter::clone(), CompositePlotter::m_transform, and CompositePlotter::setAutoScaled().

void setValueRep ( BinToColor rep)
virtual

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

Definition at line 658 of file CompositePlotter.cxx.

References CompositePlotter::representation().

void toggleBoxEdge ( DataRep datarep)
private

Set box edge status according to m_box_edge flag for the datarep.

Works on when the rep of the data is ColorBoxPointRep class.

Definition at line 1757 of file CompositePlotter.cxx.

References DataRep::getRepresentation(), CompositePlotter::m_box_edge, and ColorBoxPointRep::setBoxEdge().

Referenced by CompositePlotter::drawProjValues().

void toUserXY ( double  x,
double  y,
bool  scaled,
double &  ux,
double &  uy 
) const
virtual
void update ( )
virtual

Definition at line 1073 of file CompositePlotter.cxx.

References CompositePlotter::m_datareps.

Member Data Documentation

bool m_box_edge
protected

A flag when set true indicates the box edge is show for color boxes.

Definition at line 132 of file CompositePlotter.h.

Referenced by CompositePlotter::getBoxEdge(), CompositePlotter::setBoxEdge(), and CompositePlotter::toggleBoxEdge().

int m_datarep_index
protected
DataRepList_t m_datareps
protected
TransformBase* m_fits_transform
protected

The fits transform object.

It is useful when a fits image has periodical transform.

Definition at line 107 of file CompositePlotter.h.

Referenced by CompositePlotter::CompositePlotter(), CompositePlotter::fillPickedPoint(), CompositePlotter::getFitsTransform(), CompositePlotter::setFitsTransform(), and CompositePlotter::~CompositePlotter().

bool m_has_autoscaled
protected

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

Definition at line 124 of file CompositePlotter.h.

Referenced by CompositePlotter::hasAutoScaled(), and CompositePlotter::setAutoScaled().

bool m_has_z
protected

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

Definition at line 137 of file CompositePlotter.h.

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

bool m_reverse
protected

A flag which when set ture indicates the x axis is reversed.

Definition at line 141 of file CompositePlotter.h.

Referenced by CompositePlotter::isReverse(), and CompositePlotter::setReverse().

bool m_show_grid
protected

A flag when set true indicates the plotter shows grid.

Definition at line 128 of file CompositePlotter.h.

Referenced by CompositePlotter::drawAxisRep(), CompositePlotter::getShowGrid(), and CompositePlotter::setShowGrid().

TransformBase* m_transform
protected
AxisModelBase* m_x_axis
protected
std::string m_x_label
protected

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

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

Definition at line 91 of file CompositePlotter.h.

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

AxisModelBase* m_y_axis
protected
std::string m_y_label
protected

The label of the y axis is associated with the Y axis model object.

Definition at line 95 of file CompositePlotter.h.

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

AxisModelBase* m_z_axis
protected
std::string m_z_label
protected

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

Definition at line 99 of file CompositePlotter.h.

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


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

Generated for HippoDraw Class Library by doxygen