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

A derived class of PointRepBase class that draws a representation of a cut range. More...

#include <CutRangeRep.h>

Inheritance diagram for CutRangeRep:
Inheritance graph
[legend]
Collaboration diagram for CutRangeRep:
Collaboration graph
[legend]

Public Member Functions

void addCut (const TupleCut &cut)
 Add a TupleCut object to the list of cuts.
virtual CutRangeRepclone ()
 The clone function returns an object of its own kind which is a copy of this object at this moment.
virtual const Colorcolor () const
 Returns the representation's color.
 CutRangeRep ()
 The default constructor.
 CutRangeRep (const CutRangeRep &point_rep)
 The copy constructor.
virtual void displayError (ViewBase &view)
 Display an error message.
void drawProjectedValues (const Range &x_range, const Range &y_range, const TransformBase &tb, ViewBase &view)
 Draw the Range of the cut.
virtual void drawProjectedValues (const DataSource *ntuple, TransformBase *transform, ViewBase *view)
 Draws the projected values.
virtual const ColorgetColor () const
 Get the color of the representation.
const std::vector< TupleCut > & getCuts () const
 Returns the TupleCut objects used by the receiving object.
virtual unsigned int getStyle () const
 Returns the style of the point representation.
const std::string & getText () const
 Gets the text.
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::string & name () const
 Returns the name of the representation.
virtual void setColor (const Color &)
 Sets the color of the representation.
void setCutRangeAt (const Range &range, unsigned int i)
 Set the Range of the i-th cut.
void setEnabled (unsigned int i, bool yes)
 Sets the enabled state of the i-th cut.
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)
 Sets the selection state of the representation.
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.
void toggleInverted (unsigned int i)
 Toggles the i-th cut to be inverted from its current state.
virtual bool uses (Color::Value) const
 Returns true if receiving object uses a Color::Value 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 (hippodraw::Symbol::Type) const
 Returns true if receiving object uses a hippodraw::Symbol::Type 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.

Protected Attributes

Color m_color
 The color of the representation.
bool m_desel
 A flag to indicate the representation is de-selected.
ErrorBarRepm_error_rep
 The error bar representation.
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.

Private Types

typedef std::vector< TupleCutCutList_t
 The type of container for TupleCut objects.

Private Member Functions

void drawInvertedRange1D (const Range &x_range, const Range &y_range, const TransformBase &tb, ViewBase &view)
 Draws the Range for 1D cut with inversion within x_range and y_range using view under transform tb.
void drawInvertedRange2D (const Range &x_range, const Range &y_range, const TransformBase &transform, ViewBase &view)
 Draws the Range for 2D cut with inversion within x_range and y_range using view under transform transform.
void drawNormalRange (const Range &x_range, const Range &y_range, const TransformBase &tb, ViewBase &view)
 Draws the Range for cut within x_range and y_range using view under transform tb.
void throwRangeException ()
 Throws exception that index was out of range.

Private Attributes

CutList_t m_cut_list
 A list of cut objects used to highlight region of the data representation.

Detailed Description

A derived class of PointRepBase class that draws a representation of a cut range.

Author
Kaustuv kaust.nosp@m.uv@s.nosp@m.tanfo.nosp@m.rd.e.nosp@m.du
Paul F. Kunz Paul_.nosp@m.Kunz.nosp@m.@slac.nosp@m..sta.nosp@m.nford.nosp@m..edu

Definition at line 29 of file CutRangeRep.h.

Member Typedef Documentation

typedef std::vector< TupleCut > CutList_t
private

The type of container for TupleCut objects.

Definition at line 35 of file CutRangeRep.h.

Constructor & Destructor Documentation

The default constructor.

Definition at line 25 of file CutRangeRep.cxx.

References RepBase::setColor(), and Color::yellow.

Referenced by CutRangeRep::clone().

CutRangeRep ( const CutRangeRep point_rep)

The copy constructor.

Definition at line 32 of file CutRangeRep.cxx.

Member Function Documentation

void addCut ( const TupleCut cut)

Add a TupleCut object to the list of cuts.

Definition at line 259 of file CutRangeRep.cxx.

References CutRangeRep::m_cut_list.

CutRangeRep * clone ( )
virtual

The clone function returns an object of its own kind which is a copy of this object at this moment.

Implements PointRepBase.

Definition at line 37 of file CutRangeRep.cxx.

References CutRangeRep::CutRangeRep().

const Color & color ( ) const
virtualinherited
void displayError ( ViewBase view)
virtualinherited

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.

void drawInvertedRange1D ( const Range x_range,
const Range y_range,
const TransformBase tb,
ViewBase view 
)
private

Draws the Range for 1D cut with inversion within x_range and y_range using view under transform tb.

Definition at line 126 of file CutRangeRep.cxx.

References ViewBase::drawSquare(), Color::getBlue(), Color::getGreen(), Color::getRed(), Range::high(), Range::low(), RepBase::m_color, CutRangeRep::m_cut_list, RepBase::m_desel, RepBase::s_desel_color, and BinaryTransform::transform().

Referenced by CutRangeRep::drawProjectedValues().

void drawInvertedRange2D ( const Range x_range,
const Range y_range,
const TransformBase transform,
ViewBase view 
)
private

Draws the Range for 2D cut with inversion within x_range and y_range using view under transform transform.

Definition at line 175 of file CutRangeRep.cxx.

References ViewBase::drawSquare(), Color::getBlue(), Color::getGreen(), Color::getRed(), Range::high(), Range::low(), RepBase::m_color, CutRangeRep::m_cut_list, RepBase::m_desel, RepBase::s_desel_color, and BinaryTransform::transform().

Referenced by CutRangeRep::drawProjectedValues().

void drawNormalRange ( const Range x_range,
const Range y_range,
const TransformBase tb,
ViewBase view 
)
private
void drawProjectedValues ( const Range x_range,
const Range y_range,
const TransformBase tb,
ViewBase view 
)

Draw the Range of the cut.

Drawing is done within the boundaries of x_range and y_range. The transform tb is used before drawing to view.

Definition at line 52 of file CutRangeRep.cxx.

References CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), and CutRangeRep::m_cut_list.

void drawProjectedValues ( const DataSource ntuple,
TransformBase transform,
ViewBase view 
)
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.

Implements RepBase.

Definition at line 44 of file CutRangeRep.cxx.

const Color & getColor ( ) const
virtualinherited

Get the color of the representation.

Definition at line 58 of file RepBase.cxx.

References RepBase::m_color.

Referenced by PointRepXML::createElement().

const vector< TupleCut > & getCuts ( ) const

Returns the TupleCut objects used by the receiving object.

Definition at line 252 of file CutRangeRep.cxx.

References CutRangeRep::m_cut_list.

unsigned int getStyle ( ) const
virtualinherited

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 SymbolPointRep, LinePointRep, and ColumnPointRep.

Definition at line 110 of file RepBase.cxx.

Referenced by PointRepXML::setAttributes().

const std::string & getText ( ) const
inherited

Gets the text.

Definition at line 139 of file RepBase.cxx.

References RepBase::m_text.

Referenced by PointRepXML::setAttributes().

const BinToColor * getValueTransform ( ) const
virtualinherited

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 ContourPointRep, ColorBoxPointRep, and ColorSymbolPointRep.

Definition at line 147 of file RepBase.cxx.

Referenced by PointRepXML::createElement().

bool isSelected ( ) const
virtualinherited

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
inherited
void setColor ( const Color color)
virtualinherited
void setCutRangeAt ( const Range range,
unsigned int  i 
)

Set the Range of the i-th cut.

Definition at line 266 of file CutRangeRep.cxx.

References CutRangeRep::m_cut_list, and CutRangeRep::throwRangeException().

void setEnabled ( unsigned int  i,
bool  yes 
)

Sets the enabled state of the i-th cut.

Definition at line 284 of file CutRangeRep.cxx.

References CutRangeRep::m_cut_list, and CutRangeRep::throwRangeException().

void setErrorOn ( hippodraw::Axes::Type  axis,
bool  yes = true 
)
virtualinherited

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

Reimplemented in SymbolPointRep, and ColumnPointRep.

Definition at line 129 of file RepBase.cxx.

Referenced by PointRepXML::createObject().

void setHighLighted ( bool  yes)
virtualinherited

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 86 of file RepBase.cxx.

References RepBase::m_highlite.

void setSelected ( bool  yes)
virtualinherited

Sets the selection state of the representation.

Also sets the selection state of the ErrorBarRep representation, if any. If yes is false, the point representation should shows its deselected stated by some fashion, typically using a light gray color instead of its normal color.

Reimplemented from RepBase.

Definition at line 38 of file PointRepBase.cxx.

References PointRepBase::m_error_rep, and RepBase::setSelected().

void setSize ( float  value)
virtualinherited

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 SymbolPointRep, and ColumnPointRep.

Definition at line 96 of file RepBase.cxx.

References RepBase::m_size, and RepBase::size().

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

void setStyle ( unsigned int  style)
virtualinherited

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 SymbolPointRep, LinePointRep, and ColumnPointRep.

Definition at line 103 of file RepBase.cxx.

Referenced by DataRep::setRepStyle().

void setText ( const std::string &  text)
inherited

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 )
virtualinherited

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 ContourPointRep, ColorBoxPointRep, and ColorSymbolPointRep.

Definition at line 154 of file RepBase.cxx.

float size ( ) const
inherited
void throwRangeException ( )
private

Throws exception that index was out of range.

Definition at line 293 of file CutRangeRep.cxx.

Referenced by CutRangeRep::setCutRangeAt(), CutRangeRep::setEnabled(), and CutRangeRep::toggleInverted().

void toggleInverted ( unsigned int  i)

Toggles the i-th cut to be inverted from its current state.

Definition at line 275 of file CutRangeRep.cxx.

References CutRangeRep::m_cut_list, and CutRangeRep::throwRangeException().

bool uses ( Color::Value  ) const
virtualinherited

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 uses ( hippodraw::Line::Style  ) const
virtualinherited

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 LinePointRep, and ColumnPointRep.

Definition at line 178 of file RepBase.cxx.

bool uses ( hippodraw::Symbol::Type  ) const
virtualinherited

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 xError ( ) const
virtualinherited

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
virtualinherited

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 SymbolPointRep, and ColumnPointRep.

Definition at line 122 of file RepBase.cxx.

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

Member Data Documentation

Color m_color
protectedinherited
CutList_t m_cut_list
private
bool m_desel
protectedinherited
ErrorBarRep* m_error_rep
protectedinherited
bool m_highlite
protectedinherited

Sets the state of highlighting.

Definition at line 70 of file RepBase.h.

Referenced by RepBase::setHighLighted().

std::string m_name
protectedinherited
float m_size
protectedinherited
std::string m_text
protectedinherited

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
staticprotectedinherited

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

Generated for HippoDraw Class Library by doxygen