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

A class that draws a function as contour lines. More...

#include <ContourFunctionRep.h>

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

Public Member Functions

virtual RepBaseclone ()
 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.
 ContourFunctionRep ()
 The default constructor.
virtual void displayError (ViewBase &view)
 Display an error message.
void drawContourTicks (const TransformBase &, ViewBase &, const std::vector< double > &)
void drawProjectedValues (const Range &x_range, const Range &y_range, const FunctionBase *function, TransformBase *transform, ViewBase *view)
 Draws a two dimension; function as contour lines.
virtual void drawProjectedValues (const DataSource *ntuple, TransformBase *transform, ViewBase *view)
 Draws the projected values.
virtual const ColorgetColor () const
 Get the color of the representation.
int getNumContours () const
 Returns the number of contours.
virtual unsigned int getStyle () const
 Returns the style of the line drawing.
const std::string & getText () const
 Gets the text.
bool getUsingUserValues () const
 Get the m_usingUserValues boolean.
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 setContourValues (std::vector< double > &values, ProjectorBase *proj)
 Set user defined contour values.
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.
void setNumContours (int i)
 Set number of contours.
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 style of the line drawing.
void setText (const std::string &text)
 Sets the text.
void setUsingUserValues (bool flag)
 Set the m_usingUserValues boolean.
virtual void setValueTransform (BinToColor *)
 Sets the value transform.
float size () const
 Returns the size of the representation.
virtual bool uses (hippodraw::Line::Style) const
 Returns true as this class uses hippodraw::Line::Style.
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::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.
 ~ContourFunctionRep ()
 The destructor.

Protected Member Functions

void drawValues (ViewBase *view)
 Draws the projected values from protected transformed copy to view.

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.
hippodraw::Line::Style m_line_style
 The style currently used.
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.
std::vector< double > m_x
 A cache of the points along the X axis to be drawn.
std::vector< double > m_y
 A cache of the points along the Y axis to be drawn.

Static Protected Attributes

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

Private Member Functions

 ContourFunctionRep (const ContourFunctionRep &point_rep)
 The copy constructor.

Private Attributes

NTuplem_ntuple
 The table of function values from which to build the contours.
unsigned int m_steps
 The number of steps taken to calculate function values.

Detailed Description

A class that draws a function as contour lines.

Author
Paul F. Kunz Paul_.nosp@m.Kunz.nosp@m.@slac.nosp@m..sta.nosp@m.nford.nosp@m..edu

Definition at line 30 of file ContourFunctionRep.h.

Constructor & Destructor Documentation

ContourFunctionRep ( const ContourFunctionRep point_rep)
private

The copy constructor.

The destructor.

Definition at line 46 of file ContourFunctionRep.cxx.

Member Function Documentation

RepBase * clone ( )
virtualinherited

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

Reimplemented from LinePointRep.

Definition at line 79 of file ContourPointRep.cxx.

References ContourPointRep::ContourPointRep().

Referenced by ContourPointRep::ContourPointRep().

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 drawContourTicks ( const TransformBase tb,
ViewBase base,
const std::vector< double > &  values 
)
inherited
void drawProjectedValues ( const Range x_range,
const Range y_range,
const FunctionBase function,
TransformBase transform,
ViewBase view 
)
void drawProjectedValues ( const DataSource ntuple,
TransformBase transform,
ViewBase view 
)
virtualinherited

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.

Reimplemented from LinePointRep.

Definition at line 762 of file ContourPointRep.cxx.

References ContourPointRep::createContours(), ContourPointRep::drawValues(), ContourPointRep::drawValuesWithStyle(), BinaryTransform::isPeriodic(), ContourPointRep::m_bin_to_color, ContourPointRep::m_colorvec, ContourPointRep::m_stylevec, LinePointRep::m_x, LinePointRep::m_y, BinToColor::name(), RepBase::name(), ContourPointRep::rotate(), ContourPointRep::setContourVector(), ContourPointRep::setMinMax(), BinToColor::setRange(), num_util::shape(), RepBase::size(), NTupleSorter::sort(), and hippodraw::Axes::Z.

void drawValues ( ViewBase view)
protectedinherited
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().

int getNumContours ( ) const
inherited
unsigned int getStyle ( ) const
virtualinherited

Returns the style of the line drawing.

Reimplemented from RepBase.

Definition at line 74 of file LinePointRep.cxx.

References LinePointRep::m_line_style.

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().

bool getUsingUserValues ( ) const
inherited

Get the m_usingUserValues boolean.

Definition at line 718 of file ContourPointRep.cxx.

References ContourPointRep::m_usingUserValues.

Referenced by ContourPointRep::ContourPointRep(), and Inspector::updateAxisTab().

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 from RepBase.

Definition at line 86 of file ContourPointRep.cxx.

References ContourPointRep::m_bin_to_color.

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 setContourValues ( std::vector< double > &  values,
ProjectorBase proj 
)
inherited
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 setNumContours ( int  i)
inherited

Set number of contours.

Definition at line 708 of file ContourPointRep.cxx.

References ContourPointRep::m_numContours.

Referenced by Inspector::contourSlider_valueChanged(), and Inspector::contourTextBox_returnPressed().

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 style of the line drawing.

Reimplemented from RepBase.

Definition at line 67 of file LinePointRep.cxx.

References hippodraw::Axes::convert(), and LinePointRep::m_line_style.

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 setUsingUserValues ( bool  flag)
inherited

Set the m_usingUserValues boolean.

Definition at line 713 of file ContourPointRep.cxx.

References ContourPointRep::m_usingUserValues.

Referenced by Inspector::contourSlider_valueChanged(), and Inspector::contourTextBox_returnPressed().

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 from RepBase.

Definition at line 93 of file ContourPointRep.cxx.

References ContourPointRep::m_bin_to_color.

Referenced by ContourFunctionRep::ContourFunctionRep().

float size ( ) const
inherited
bool uses ( hippodraw::Line::Style  ) const
virtualinherited

Returns true as this class uses hippodraw::Line::Style.

Reimplemented from RepBase.

Definition at line 346 of file LinePointRep.cxx.

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::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
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().

hippodraw::Line::Style m_line_style
protectedinherited
std::string m_name
protectedinherited
NTuple* m_ntuple
private

The table of function values from which to build the contours.

Definition at line 37 of file ContourFunctionRep.h.

Referenced by ContourFunctionRep::ContourFunctionRep(), and ContourFunctionRep::drawProjectedValues().

float m_size
protectedinherited
unsigned int m_steps
private

The number of steps taken to calculate function values.

Definition at line 41 of file ContourFunctionRep.h.

Referenced by ContourFunctionRep::ContourFunctionRep(), and ContourFunctionRep::drawProjectedValues().

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().

std::vector< double > m_x
protectedinherited

A cache of the points along the X axis to be drawn.

For efficiency, all line segments are sent once to the view. However, the x and y points are kept separate so that they can be transformed separately. LinePointRep builds a cache for efficiency.

Definition at line 87 of file LinePointRep.h.

Referenced by ContourPointRep::createContours(), ContourPointRep::drawProjectedValues(), LinePointRep::drawValues(), ContourPointRep::drawValues(), ContourPointRep::drawValuesWithStyle(), LineFunctionRep::smoothCurve(), and LinePointRep::transformValues().

std::vector< double > m_y
protectedinherited

A cache of the points along the Y axis to be drawn.

For efficiency, all line segments are sent once to the view. However, the x and y points are kept separate so that they can be transformed separately. LinePointRep builds a cache for efficiency.

Definition at line 95 of file LinePointRep.h.

Referenced by ContourPointRep::createContours(), ContourPointRep::drawProjectedValues(), LinePointRep::drawValues(), ContourPointRep::drawValues(), ContourPointRep::drawValuesWithStyle(), LineFunctionRep::smoothCurve(), and LinePointRep::transformValues().

const Color s_desel_color
staticprotectedinherited

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

Generated for HippoDraw Class Library by doxygen