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

RepBase Class Reference

#include <RepBase.h>

Inheritance diagram for RepBase:

Inheritance graph
[legend]
Collaboration diagram for RepBase:

Collaboration graph
[legend]
List of all members.

Detailed Description

The base class for the point representation hierarchy.

A point representation draws something in a view object whose class is derived from ViewBase. Examples are classes derived from PointRepBase and TextRepBase.

This base class implements the behavior of having a name so that it can be found by name in a Factory. It also implements the behavior of having a color and a size.

The compiler generated copy constructor and assignment operator are valid for this class and thus not explicitly implemented.

Author:
Paul_Kunz@slac.stanford.edu

Definition at line 43 of file RepBase.h.

Public Member Functions

virtual RepBaseclone ()=0
 Returns a copy of the object.
virtual const Colorcolor () const
 Returns the representation's color.
virtual void displayError (ViewBase &view)
 Display an error message.
virtual void drawProjectedValues (const DataSource *ntuple, TransformBase *transform, ViewBase *view)=0
 Draws the projected values.
virtual const ColorgetColor () const
 Get the color of the representation.
virtual unsigned int getStyle () const
 Returns the style of the point representation.
virtual const BinToColorgetValueTransform () const
 Returns the value transform.
virtual bool isSelected () const
 Returns true if representation is in selected state, otherwise returns false.
const std::stringname () const
 Returns the name of the representation.
virtual void setColor (const Color &)
 Sets the color of the representation.
virtual void setErrorOn (const std::string &axis, bool yes=true)
 Sets the error representation on specified axis, if any, to yes.
virtual void setHighLighted (bool yes)
 Sets the highlighted state of the point representation.
virtual void setSelected (bool yes=true)
 Sets the representation to be selected if yes is true, otherwise set it to be deselected.
void setSize (float value)
 Sets the size of the representation.
virtual void setStyle (unsigned int style)
 Sets the symbol of the representation.
void setText (const std::string &text)
 Sets the text.
virtual void setValueTransform (BinToColor *)
 Sets the value transform.
float size () const
 Returns the size of the representation.
virtual bool xError () const
 Returns true if the point representation displays error on the X axis.
virtual bool yError () const
 Returns true if the point representation displays error on the Y axis.
virtual ~RepBase ()
 The virtual destructor.

Protected Member Functions

 RepBase (const RepBase &)
 The copy constructor.
 RepBase (const char *, float size)
 A constructor that sets the name and size of the representation.

Protected Attributes

Color m_color
 The color of the representation.
bool m_desel
 A flag to indicate the representation is de-selected.
bool m_highlite
 Sets the state of highlighting.
std::string m_name
 The name of the representation.
float m_size
 The size of the representation.
std::string m_text
 The text to be displayed before the statistics.

Static Protected Attributes

static const Color s_desel_color
 The color of the representation when it is de-selected.


Constructor & Destructor Documentation

RepBase::RepBase const char *  ,
float  size
[protected]
 

A constructor that sets the name and size of the representation.

Definition at line 24 of file RepBase.cxx.

RepBase::RepBase const RepBase  )  [protected]
 

The copy constructor.

Definition at line 31 of file RepBase.cxx.

RepBase::~RepBase  )  [virtual]
 

The virtual destructor.

Definition at line 41 of file RepBase.cxx.


Member Function Documentation

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

Returns a copy of the object.

Derived classes should implement this function by calling their copy constructor.

Implemented in AverageTextRep, BoxTextRep, ColorBoxPointRep, ColorSymbolPointRep, ColumnPointRep, ContourPointRep, CutRangeRep, ErrorBarRep, FuncChiRep, FuncParmRep, LinePointRep, LinePointRep, PointRepBase, SymbolPointRep, TextRepBase, and TotalTextRep.

Referenced by DataRep::DataRep().

const Color & RepBase::color  )  const [virtual]
 

Returns the representation's color.

Todo:
Remove this member in favor of getColor().

Definition at line 61 of file RepBase.cxx.

References m_color, m_desel, and s_desel_color.

Referenced by ContourPointRep::createContours(), SymbolPointRep::drawProjectedValues(), LinePointRep::drawProjectedValues(), ErrorBarRep::drawProjectedValues(), ColumnPointRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), ColorBoxPointRep::drawProjectedValues(), and DataRep::getRepColor().

void RepBase::displayError ViewBase view  )  [virtual]
 

Display an error message.

Display an error message instead of drawing a point. This base class implementation displays a message with the name of the RepBase object.

Definition at line 153 of file RepBase.cxx.

References ViewBase::drawText(), m_name, and m_size.

virtual void RepBase::drawProjectedValues const DataSource ntuple,
TransformBase transform,
ViewBase view
[pure virtual]
 

Draws the projected values.

Draws the projected values contained in the DataSource ntuple. Each row of the ntuple is data point tuple of some dimension. Derived classes expect the DataSoruce to be of the correct dimension. The drawn points undergo a transform represented by transform and are drawn to the view view. If highlighting is on, uses the ranges to control highlighting.

Implemented in ColorBoxPointRep, ColorSymbolPointRep, ColumnPointRep, ContourPointRep, CutRangeRep, ErrorBarRep, LinePointRep, LinePointRep, SymbolPointRep, and TextRepBase.

const Color & RepBase::getColor  )  const [virtual]
 

Get the color of the representation.

Definition at line 56 of file RepBase.cxx.

References m_color.

Referenced by PointRepXML::createElement().

unsigned int RepBase::getStyle  )  const [virtual]
 

Returns the style of the point representation.

Derived class should override this member function if they support styles. This base class implementation returns 0.

Reimplemented in ColumnPointRep, LinePointRep, LinePointRep, and SymbolPointRep.

Definition at line 108 of file RepBase.cxx.

Referenced by PointRepXML::setAttributes().

const BinToColor * RepBase::getValueTransform  )  const [virtual]
 

Returns the value transform.

A value transform changes a binary value to some graphical representations such as color. The implementation in this base class returns a null pointer. Derived classes that implement value transform should return a pointer to the object it uses.

Reimplemented in ColorBoxPointRep, ColorSymbolPointRep, and ContourPointRep.

Definition at line 139 of file RepBase.cxx.

Referenced by PointRepXML::createElement().

bool RepBase::isSelected  )  const [virtual]
 

Returns true if representation is in selected state, otherwise returns false.

Definition at line 77 of file RepBase.cxx.

References m_desel.

Referenced by DataRep::isSelected().

const string & RepBase::name  )  const
 

Returns the name of the representation.

This name might be used by a Factory.

Definition at line 45 of file RepBase.cxx.

References m_name.

Referenced by FuncParmRep::drawProjectedValues(), PointRepXML::setAttributes(), QtDisplay::setContourLevels(), and Inspector::updatePlotTab().

void RepBase::setColor const Color  )  [virtual]
 

Sets the color of the representation.

Reimplemented in ColumnPointRep, and SymbolPointRep.

Definition at line 51 of file RepBase.cxx.

References m_color.

Referenced by PointRepXML::createObject(), CutRangeRep::CutRangeRep(), FunctionRep::FunctionRep(), LineDataRep::LineDataRep(), SymbolPointRep::setColor(), ColumnPointRep::setColor(), and DataRep::setRepColor().

void RepBase::setErrorOn const std::string axis,
bool  yes = true
[virtual]
 

Sets the error representation on specified axis, if any, to yes.

Todo:
This member Needs to be implemented in some derived classes.

Reimplemented in ColumnPointRep, and SymbolPointRep.

Definition at line 128 of file RepBase.cxx.

Referenced by PointRepXML::createObject(), and DataRep::setErrorDisplay().

void RepBase::setHighLighted bool  yes  )  [virtual]
 

Sets the highlighted state of the point representation.

If yes is true, then the point representation should show the non highlighted regions in some fashion, typically using light gray color instead of its normal color.

See also:
setSelected (bool)

m_ranges.

Definition at line 84 of file RepBase.cxx.

References m_highlite.

void RepBase::setSelected bool  yes = true  )  [virtual]
 

Sets the representation to be selected if yes is true, otherwise set it to be deselected.

Reimplemented in PointRepBase.

Definition at line 70 of file RepBase.cxx.

References m_desel.

Referenced by PointRepBase::setSelected(), and DataRep::setSelected().

void RepBase::setSize float  value  ) 
 

Sets the size of the representation.

Definition at line 94 of file RepBase.cxx.

References m_size.

Referenced by PointRepXML::createObject(), FunctionRep::FunctionRep(), and DataRep::setRepSize().

void RepBase::setStyle unsigned int  style  )  [virtual]
 

Sets the symbol of the representation.

Derived classes may use this method to set the style of the representation, if they have various styles. This base class implementation does nothing.

Reimplemented in ColumnPointRep, LinePointRep, LinePointRep, and SymbolPointRep.

Definition at line 101 of file RepBase.cxx.

Referenced by DataRep::setRepStyle().

void RepBase::setText const std::string text  ) 
 

Sets the text.

Definition at line 132 of file RepBase.cxx.

References m_text.

Referenced by DisplayController::createTextDataRep().

void RepBase::setValueTransform BinToColor  )  [virtual]
 

Sets the value transform.

The implementation in this base class does nothing. Derived classes that implement a value transform should override this method and take possession of the received object.

Todo:
Should have base class that doesn't know about color and BinToColor class should derive from it.

Reimplemented in ColorBoxPointRep, ColorSymbolPointRep, and ContourPointRep.

Definition at line 146 of file RepBase.cxx.

float RepBase::size  )  const
 

Returns the size of the representation.

Definition at line 89 of file RepBase.cxx.

References m_size.

Referenced by ContourPointRep::createContours(), ContourPointRep::drawContourTicks(), SymbolPointRep::drawProjectedValues(), LinePointRep::drawProjectedValues(), ErrorBarRep::drawProjectedValues(), ContourPointRep::drawProjectedValues(), ColumnPointRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), ColorBoxPointRep::drawProjectedValues(), DisplayController::pointSize(), and PointRepXML::setAttributes().

bool RepBase::xError  )  const [virtual]
 

Returns true if the point representation displays error on the X axis.

The default implementation returns false. May be overridden by derived classes.

Reimplemented in SymbolPointRep.

Definition at line 114 of file RepBase.cxx.

Referenced by DataRep::isErrorDisplayed(), and PointRepXML::setAttributes().

bool RepBase::yError  )  const [virtual]
 

Returns true if the point representation displays error on the Y axis.

The default implementation returns false. May be overridden by derived classes.

Reimplemented in ColumnPointRep, and SymbolPointRep.

Definition at line 120 of file RepBase.cxx.

Referenced by DataRep::isErrorDisplayed(), and PointRepXML::setAttributes().


Member Data Documentation

Color RepBase::m_color [protected]
 

The color of the representation.

Definition at line 55 of file RepBase.h.

Referenced by color(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), getColor(), and setColor().

bool RepBase::m_desel [protected]
 

A flag to indicate the representation is de-selected.

Definition at line 64 of file RepBase.h.

Referenced by color(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), ColorBoxPointRep::drawProjectedValues(), isSelected(), and setSelected().

bool RepBase::m_highlite [protected]
 

Sets the state of highlighting.

Definition at line 68 of file RepBase.h.

Referenced by setHighLighted().

std::string RepBase::m_name [protected]
 

The name of the representation.

Definition at line 49 of file RepBase.h.

Referenced by AverageTextRep::AverageTextRep(), ColorSymbolPointRep::ColorSymbolPointRep(), displayError(), ContourPointRep::init(), and name().

float RepBase::m_size [protected]
 

The size of the representation.

Definition at line 61 of file RepBase.h.

Referenced by displayError(), TotalTextRep::drawProjectedValues(), SymbolPointRep::drawProjectedValues(), LinePointRep::drawProjectedValues(), FuncParmRep::drawProjectedValues(), FuncChiRep::drawProjectedValues(), ErrorBarRep::drawProjectedValues(), ColumnPointRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), BoxTextRep::drawProjectedValues(), AverageTextRep::drawProjectedValues(), ContourPointRep::endPlot(), setSize(), and size().

std::string RepBase::m_text [protected]
 

The text to be displayed before the statistics.

Definition at line 52 of file RepBase.h.

Referenced by BoxTextRep::drawProjectedValues(), and setText().

const Color RepBase::s_desel_color [static, protected]
 

The color of the representation when it is de-selected.

Referenced by color(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), and CutRangeRep::drawNormalRange().


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