#include <RepBase.h>
Inheritance diagram for RepBase:
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.
Definition at line 45 of file RepBase.h.
Public Member Functions | |
virtual RepBase * | clone ()=0 |
Returns a copy of the object. | |
virtual const Color & | color () 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 Color & | getColor () const |
Get the color of the representation. | |
virtual unsigned int | getStyle () const |
Returns the style of the point representation. | |
const std::string & | getText () const |
Gets the text. | |
virtual const BinToColor * | getValueTransform () const |
Returns the value transform. | |
virtual bool | isSelected () const |
Returns true if representation is in selected state, otherwise returns false . | |
const std::string & | name () const |
Returns the name of the representation. | |
virtual void | setColor (const Color &) |
Sets the color of the representation. | |
virtual void | setErrorOn (hippodraw::Axes::Type 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. | |
virtual 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 | uses (hippodraw::Symbol::Type) const |
Returns true if receiving object uses a hippodraw::Symbol::Type as a property, otherwise returns false . | |
virtual bool | uses (hippodraw::Line::Style) const |
Returns true if receiving object uses a hippodraw::Line::Style as a property, otherwise returns false . | |
virtual bool | uses (Color::Value) const |
Returns true if receiving object uses a Color::Value as a property, otherwise returns false . | |
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. |
RepBase | ( | const char * | , | |
float | size | |||
) | [protected] |
A constructor that sets the name and size of the representation.
Definition at line 26 of file RepBase.cxx.
~RepBase | ( | ) | [virtual] |
virtual 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, FilledColumnPointRep, FuncChiRep, FuncParmRep, LineFunctionRep, LinePointRep, OverflowTextRep, PointRepBase, SymbolPointRep, TextRepBase, TotalTextRep, and UnderflowTextRep.
Referenced by DataRep::DataRep().
const Color & color | ( | ) | const [virtual] |
Returns the representation's color.
Definition at line 63 of file RepBase.cxx.
References RepBase::m_color, RepBase::m_desel, and RepBase::s_desel_color.
Referenced by ContourPointRep::createContours(), SymbolPointRep::drawProjectedValues(), ErrorBarRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), ColorBoxPointRep::drawProjectedValues(), LinePointRep::drawValues(), ColumnPointRep::drawValues(), DataRep::getRepColor(), SymbolPointRep::setColor(), RepBase::setColor(), FilledColumnPointRep::setColor(), and ColumnPointRep::setColor().
void 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 161 of file RepBase.cxx.
References ViewBase::drawText(), RepBase::m_name, and RepBase::m_size.
virtual void 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, SymbolPointRep, and TextRepBase.
const Color & getColor | ( | ) | const [virtual] |
Get the color of the representation.
Definition at line 58 of file RepBase.cxx.
References RepBase::m_color.
Referenced by PointRepXML::createElement().
unsigned int 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, and SymbolPointRep.
Definition at line 110 of file RepBase.cxx.
Referenced by PointRepXML::setAttributes().
const std::string & getText | ( | ) | const |
Gets the text.
Definition at line 139 of file RepBase.cxx.
References RepBase::m_text.
Referenced by PointRepXML::setAttributes().
const BinToColor * 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 147 of file RepBase.cxx.
Referenced by PointRepXML::createElement().
bool isSelected | ( | ) | const [virtual] |
Returns true
if representation is in selected state, otherwise returns false
.
Definition at line 79 of file RepBase.cxx.
References RepBase::m_desel.
Referenced by DataRep::isSelected().
const string & name | ( | ) | const |
Returns the name of the representation.
This name might be used by a Factory.
Definition at line 47 of file RepBase.cxx.
References RepBase::m_name.
Referenced by ContourPointRep::createContours(), FuncParmRep::drawProjectedValues(), ContourPointRep::drawProjectedValues(), PointRepXML::setAttributes(), QtDisplay::setContourLevels(), and Inspector::updatePlotTab().
void setColor | ( | const Color & | ) | [virtual] |
Sets the color of the representation.
Reimplemented in ColumnPointRep, FilledColumnPointRep, and SymbolPointRep.
Definition at line 53 of file RepBase.cxx.
References RepBase::color(), and RepBase::m_color.
Referenced by PointRepXML::createObject(), CutRangeRep::CutRangeRep(), FunctionRep1::FunctionRep1(), LineDataRep::LineDataRep(), SymbolPointRep::setColor(), ColumnPointRep::setColor(), and DataRep::setRepColor().
void setErrorOn | ( | hippodraw::Axes::Type | axis, | |
bool | yes = true | |||
) | [virtual] |
Sets the error representation on specified axis, if any, to yes.
Reimplemented in ColumnPointRep, and SymbolPointRep.
Definition at line 129 of file RepBase.cxx.
Referenced by PointRepXML::createObject().
void 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.
m_ranges.
Definition at line 86 of file RepBase.cxx.
References RepBase::m_highlite.
void 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 72 of file RepBase.cxx.
References RepBase::m_desel.
Referenced by PointRepBase::setSelected(), and DataRep::setSelected().
void setSize | ( | float | value | ) | [virtual] |
Sets the size of the representation.
Derived classes may use this method to set the size of the point representation and any of its components.
Reimplemented in ColumnPointRep, and SymbolPointRep.
Definition at line 96 of file RepBase.cxx.
References RepBase::m_size.
Referenced by PointRepXML::createObject(), DataRep::setRepSize(), SymbolPointRep::setSize(), and ColumnPointRep::setSize().
void 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, and SymbolPointRep.
Definition at line 103 of file RepBase.cxx.
Referenced by DataRep::setRepStyle().
void setText | ( | const std::string & | text | ) |
Sets the text.
Definition at line 133 of file RepBase.cxx.
References RepBase::m_text.
Referenced by PointRepXML::createObject(), and DisplayController::createTextDataRep().
void 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.
Reimplemented in ColorBoxPointRep, ColorSymbolPointRep, and ContourPointRep.
Definition at line 154 of file RepBase.cxx.
float size | ( | ) | const |
Returns the size of the representation.
Definition at line 91 of file RepBase.cxx.
References RepBase::m_size.
Referenced by ContourPointRep::createContours(), ContourPointRep::drawContourTicks(), SymbolPointRep::drawProjectedValues(), ErrorBarRep::drawProjectedValues(), ContourPointRep::drawProjectedValues(), ColumnPointRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), ColorBoxPointRep::drawProjectedValues(), LinePointRep::drawValues(), FilledColumnPointRep::drawValues(), DisplayController::pointSize(), PointRepXML::setAttributes(), LineFunctionRep::smoothCurve(), and LinePointRep::transformValues().
bool uses | ( | hippodraw::Symbol::Type | ) | const [virtual] |
Returns true
if receiving object uses a hippodraw::Symbol::Type as a property, otherwise returns false
.
This base class implementation returns false. Derived classes that use hippodraw::Symbol::Type should override this member function and return true
.
Reimplemented in SymbolPointRep.
Definition at line 185 of file RepBase.cxx.
bool uses | ( | hippodraw::Line::Style | ) | const [virtual] |
Returns true
if receiving object uses a hippodraw::Line::Style as a property, otherwise returns false
.
This base class implementation returns false. Derived classes that use hippodraw::Line::Style should override this member function and return true
.
Reimplemented in ColumnPointRep, and LinePointRep.
Definition at line 178 of file RepBase.cxx.
bool uses | ( | Color::Value | ) | const [virtual] |
Returns true
if receiving object uses a Color::Value as a property, otherwise returns false
.
This base class implementation returns true
as most derived classes use a Color::Value as a property. Derived classes that do not, such as those that represent a value in color, should override this member function and return false
.
Reimplemented in ColorBoxPointRep, and ColorSymbolPointRep.
Definition at line 171 of file RepBase.cxx.
bool 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 116 of file RepBase.cxx.
Referenced by DataRep::isErrorDisplayed(), and PointRepXML::setAttributes().
bool 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 122 of file RepBase.cxx.
Referenced by DataRep::isErrorDisplayed(), and PointRepXML::setAttributes().
The color of the representation.
Definition at line 57 of file RepBase.h.
Referenced by RepBase::color(), ContourPointRep::createContours(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), UnderflowTextRep::drawProjectedValues(), TotalTextRep::drawProjectedValues(), OverflowTextRep::drawProjectedValues(), FuncParmRep::drawProjectedValues(), FuncChiRep::drawProjectedValues(), BoxTextRep::drawProjectedValues(), AverageTextRep::drawProjectedValues(), RepBase::getColor(), and RepBase::setColor().
bool m_desel [protected] |
A flag to indicate the representation is de-selected.
Definition at line 66 of file RepBase.h.
Referenced by RepBase::color(), ContourPointRep::createContours(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), ColorBoxPointRep::drawProjectedValues(), RepBase::isSelected(), and RepBase::setSelected().
bool m_highlite [protected] |
Sets the state of highlighting.
Definition at line 70 of file RepBase.h.
Referenced by RepBase::setHighLighted().
std::string m_name [protected] |
The name of the representation.
Definition at line 51 of file RepBase.h.
Referenced by AverageTextRep::AverageTextRep(), ColorSymbolPointRep::ColorSymbolPointRep(), RepBase::displayError(), FilledColumnPointRep::FilledColumnPointRep(), ContourPointRep::init(), and RepBase::name().
float m_size [protected] |
The size of the representation.
Definition at line 63 of file RepBase.h.
Referenced by RepBase::displayError(), UnderflowTextRep::drawProjectedValues(), TotalTextRep::drawProjectedValues(), SymbolPointRep::drawProjectedValues(), OverflowTextRep::drawProjectedValues(), FuncParmRep::drawProjectedValues(), FuncChiRep::drawProjectedValues(), ErrorBarRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), BoxTextRep::drawProjectedValues(), AverageTextRep::drawProjectedValues(), LinePointRep::drawValues(), ContourPointRep::drawValues(), ColumnPointRep::drawValues(), ContourPointRep::drawValuesWithStyle(), RepBase::setSize(), and RepBase::size().
std::string m_text [protected] |
The text to be displayed before the statistics.
Definition at line 54 of file RepBase.h.
Referenced by BoxTextRep::drawProjectedValues(), RepBase::getText(), and RepBase::setText().
const Color s_desel_color [static, protected] |
The color of the representation when it is de-selected.
Definition at line 60 of file RepBase.h.
Referenced by RepBase::color(), ContourPointRep::createContours(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), and ColorBoxPointRep::drawProjectedValues().