#include <ContourPointRep.h>
Inheritance diagram for ContourPointRep:
The ContourPointRep transforms a two dimension matrix of projected values into a set of colored contour levels. The algorithm used is adapted from CONREC, which is a contouring Fortran 77 subroutine written by Paul Bourke, of the Center for Astrophysics and Supercomputing, Swinburne University of Technology in Melbourne, Australia.
Definition at line 39 of file ContourPointRep.h.
Public Member Functions | |
virtual RepBase * | clone () |
The clone function returns an object of its own kind which is a copy of this object at this moment. | |
virtual const Color & | color () const |
Returns the representation's color. | |
ContourPointRep (const ContourPointRep &point_rep) | |
The copy constructor. | |
ContourPointRep (float size) | |
Constructor that takes size as argument. | |
ContourPointRep () | |
The default constructor. | |
virtual void | displayError (ViewBase &view) |
Display an error message. | |
void | drawContourTicks (const TransformBase &, ViewBase &, const std::vector< double > &) |
virtual void | drawProjectedValues (const DataSource *ntuple, TransformBase *transform, ViewBase *view) |
Draws the projected values. | |
virtual const Color & | getColor () 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. | |
virtual unsigned int | getStyle () const |
Returns the style of the line drawing. | |
bool | getUsingUserValues () const |
Get the m_usingUserValues boolean. | |
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. | |
void | setContourValues (std::vector< double > &values, ProjectorBase *proj) |
Set user defined contour values. | |
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. | |
void | setNumContours (int i) |
Set number of contours. | |
virtual void | setSelected (bool yes) |
Sets the selection state of the representation. | |
void | setSize (float value) |
Sets the size of the representation. | |
virtual void | setStyle (unsigned int style) |
Sets the style of the line drawing. | |
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 | 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. | |
~ContourPointRep () | |
The destructor. | |
Protected Attributes | |
Color | m_color |
The color of the representation. | |
bool | m_desel |
A flag to indicate the representation is de-selected. | |
ErrorBarRep * | m_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 | |
void | createContours (const DataSource *ntuple, const TransformBase *transform) |
The method that actually calculates the contour lines. | |
virtual void | endPlot (const TransformBase &, ViewBase &vb, const Range &range) |
double | getContour (int i, const TransformBase *transform) |
Returns the z value where the i-th level contour is to be drawn. | |
void | init () |
Initialization member function used by constructors. | |
double | intersect (int p1, int p2, double *h, double *xh) |
Returns the intersection of the segment given by h[p1] and h[p2] with the segment given by xh[p1] and xh[p2]. | |
void | setContourVector (const TransformBase *transform) |
Prepare the vector of contour values. | |
void | setMinMax (const DataSource *) |
Set the min and max Z values of the data being plotted. | |
Private Attributes | |
BinToColor * | m_bin_to_color |
The color scale generator. | |
std::vector< Color > | m_colorvec |
The vector of colors used for drawing the lines. | |
double | m_maxValue |
The max Z value of the data. | |
double | m_minValue |
The min Z value of the data. | |
int | m_numContours |
The number of contours to be drawn. | |
bool | m_usingUserValues |
A boolean which is true if we are using user input contour values. | |
std::vector< double > | m_values |
The vector of contour values. |
|
The default constructor.
Definition at line 43 of file ContourPointRep.cxx. References init(). Referenced by clone(). |
|
Constructor that takes size as argument.
Definition at line 37 of file ContourPointRep.cxx. References init(). |
|
The copy constructor.
Definition at line 62 of file ContourPointRep.cxx. References clone(), getNumContours(), getUsingUserValues(), m_bin_to_color, m_numContours, m_usingUserValues, and m_values. |
|
The destructor.
Definition at line 74 of file ContourPointRep.cxx. References m_bin_to_color. |
|
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(). Referenced by ContourPointRep(). |
|
Returns the representation's color.
Definition at line 61 of file RepBase.cxx. References RepBase::m_color, RepBase::m_desel, and RepBase::s_desel_color. Referenced by createContours(), SymbolPointRep::drawProjectedValues(), LinePointRep::drawProjectedValues(), ErrorBarRep::drawProjectedValues(), ColumnPointRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), ColorBoxPointRep::drawProjectedValues(), and DataRep::getRepColor(). |
|
The method that actually calculates the contour lines. The implementation is modified version of Nicholas Yue's C++ adaption of CONREC, to use STL vector instead of a double ** array.
Definition at line 178 of file ContourPointRep.cxx. References RepBase::color(), Range::excludes(), BinToColor::getRange(), intersect(), m_bin_to_color, m_colorvec, m_numContours, m_values, LinePointRep::m_x, LinePointRep::m_y, std::max(), std::min(), num_util::shape(), RepBase::size(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z. Referenced by drawProjectedValues(). |
|
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(), RepBase::m_name, and RepBase::m_size. |
|
Definition at line 127 of file ContourPointRep.cxx. References ViewBase::drawViewLines(), Range::excludes(), HippoRectangle::getHeight(), ViewBase::getMarginRect(), ViewBase::getRange(), HippoRectangle::getY(), RepBase::size(), hippodraw::Line::Solid, BinaryTransform::transformZ(), ViewBase::userToDrawColor(), and hippodraw::Axes::Z. Referenced by endPlot(). |
|
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 548 of file ContourPointRep.cxx. References createContours(), endPlot(), Range::high(), Range::low(), m_bin_to_color, m_colorvec, LinePointRep::m_x, LinePointRep::m_y, setContourVector(), setMinMax(), BinToColor::setRange(), RepBase::size(), and hippodraw::Axes::Z. |
|
Definition at line 99 of file ContourPointRep.cxx. References ViewBase::drawColorLines(), drawContourTicks(), ViewBase::getUserRect(), m_colorvec, LinePointRep::m_line_style, RepBase::m_size, m_values, LinePointRep::m_x, LinePointRep::m_y, HippoRectangle::makeInBounds(), and BinaryTransform::transform(). Referenced by drawProjectedValues(). |
|
Get the color of the representation.
Definition at line 56 of file RepBase.cxx. References RepBase::m_color. Referenced by PointRepXML::createElement(). |
|
Returns the z value where the i-th level contour is to be drawn.
Definition at line 455 of file ContourPointRep.cxx. References m_maxValue, m_minValue, and m_numContours. Referenced by setContourVector(). |
|
Returns the number of contours.
Definition at line 489 of file ContourPointRep.cxx. References m_numContours. Referenced by ContourPointRep(), Inspector::contourRadioButton1_toggled(), and Inspector::contourTextBox_returnPressed(). |
|
Returns the style of the line drawing.
Reimplemented from RepBase. |
|
Returns the style of the line drawing.
Reimplemented from RepBase. Definition at line 70 of file LineFunctionRep.cxx. References LinePointRep::m_line_style. |
|
Get the m_usingUserValues boolean.
Definition at line 504 of file ContourPointRep.cxx. References m_usingUserValues. Referenced by ContourPointRep(), and Inspector::updateAxisTab(). |
|
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 m_bin_to_color. |
|
Initialization member function used by constructors.
Definition at line 51 of file ContourPointRep.cxx. References BinToColorFactory::instance(), m_bin_to_color, RepBase::m_name, m_numContours, m_usingUserValues, and m_values. Referenced by ContourPointRep(). |
|
Returns the intersection of the segment given by h[p1] and h[p2] with the segment given by xh[p1] and xh[p2].
Definition at line 484 of file ContourPointRep.cxx. Referenced by createContours(). |
|
Returns
Definition at line 77 of file RepBase.cxx. References RepBase::m_desel. Referenced by DataRep::isSelected(). |
|
Returns the name of the representation. This name might be used by a Factory. Definition at line 45 of file RepBase.cxx. References RepBase::m_name. Referenced by FuncParmRep::drawProjectedValues(), PointRepXML::setAttributes(), QtDisplay::setContourLevels(), and Inspector::updatePlotTab(). |
|
Sets the color of the representation.
Reimplemented in ColumnPointRep, and SymbolPointRep. Definition at line 51 of file RepBase.cxx. References RepBase::m_color. Referenced by PointRepXML::createObject(), CutRangeRep::CutRangeRep(), FunctionRep::FunctionRep(), LineDataRep::LineDataRep(), SymbolPointRep::setColor(), ColumnPointRep::setColor(), and DataRep::setRepColor(). |
|
Set user defined contour values.
Definition at line 511 of file ContourPointRep.cxx. References ProjectorBase::getAxisModel(), AxisModelBase::getScaleFactor(), m_numContours, m_usingUserValues, m_values, and hippodraw::Axes::Z. Referenced by Inspector::contourLevelsTextBox_returnPressed(). |
|
Prepare the vector of contour values.
Definition at line 532 of file ContourPointRep.cxx. References getContour(), m_numContours, m_usingUserValues, and m_values. Referenced by drawProjectedValues(). |
|
Sets the error representation on specified axis, if any, to yes.
Reimplemented in ColumnPointRep, and SymbolPointRep. Definition at line 128 of file RepBase.cxx. Referenced by PointRepXML::createObject(), and DataRep::setErrorDisplay(). |
|
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.
Definition at line 84 of file RepBase.cxx. References RepBase::m_highlite. |
|
Set the min and max Z values of the data being plotted.
Definition at line 591 of file ContourPointRep.cxx. References Range::high(), Range::low(), m_maxValue, m_minValue, and hippodraw::Axes::Z. Referenced by drawProjectedValues(). |
|
Set number of contours.
Definition at line 494 of file ContourPointRep.cxx. References m_numContours. Referenced by Inspector::contourSlider_valueChanged(), and Inspector::contourTextBox_returnPressed(). |
|
Sets the selection state of the representation.
Also sets the selection state of the ErrorBarRep representation, if any. If yes is Reimplemented from RepBase. Definition at line 36 of file PointRepBase.cxx. References PointRepBase::m_error_rep, and RepBase::setSelected(). |
|
Sets the size of the representation.
Definition at line 94 of file RepBase.cxx. References RepBase::m_size. Referenced by PointRepXML::createObject(), FunctionRep::FunctionRep(), and DataRep::setRepSize(). |
|
Sets the style of the line drawing.
Reimplemented from RepBase. |
|
Sets the style of the line drawing.
Reimplemented from RepBase. Definition at line 63 of file LineFunctionRep.cxx. References hippodraw::Axes::convert(), and LinePointRep::m_line_style. |
|
Sets the text.
Definition at line 132 of file RepBase.cxx. References RepBase::m_text. Referenced by DisplayController::createTextDataRep(). |
|
Set the m_usingUserValues boolean.
Definition at line 499 of file ContourPointRep.cxx. References m_usingUserValues. Referenced by Inspector::contourSlider_valueChanged(), and Inspector::contourTextBox_returnPressed(). |
|
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 from RepBase. Definition at line 93 of file ContourPointRep.cxx. References m_bin_to_color. |
|
Returns the size of the representation.
Definition at line 89 of file RepBase.cxx. References RepBase::m_size. Referenced by createContours(), drawContourTicks(), SymbolPointRep::drawProjectedValues(), LinePointRep::drawProjectedValues(), ErrorBarRep::drawProjectedValues(), drawProjectedValues(), ColumnPointRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), ColorBoxPointRep::drawProjectedValues(), DisplayController::pointSize(), and PointRepXML::setAttributes(). |
|
Returns true if the point representation displays error on the X axis.
The default implementation returns Reimplemented in SymbolPointRep. Definition at line 114 of file RepBase.cxx. Referenced by DataRep::isErrorDisplayed(), and PointRepXML::setAttributes(). |
|
Returns true if the point representation displays error on the Y axis.
The default implementation returns Reimplemented in ColumnPointRep, and SymbolPointRep. Definition at line 120 of file RepBase.cxx. Referenced by DataRep::isErrorDisplayed(), and PointRepXML::setAttributes(). |
|
The color scale generator.
Definition at line 45 of file ContourPointRep.h. Referenced by ContourPointRep(), createContours(), drawProjectedValues(), getValueTransform(), init(), setValueTransform(), and ~ContourPointRep(). |
|
The color of the representation.
Definition at line 55 of file RepBase.h. Referenced by RepBase::color(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), RepBase::getColor(), and RepBase::setColor(). |
|
The vector of colors used for drawing the lines.
Definition at line 48 of file ContourPointRep.h. Referenced by createContours(), drawProjectedValues(), and endPlot(). |
|
A flag to indicate the representation is de-selected.
Definition at line 64 of file RepBase.h. Referenced by RepBase::color(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), ColorBoxPointRep::drawProjectedValues(), RepBase::isSelected(), and RepBase::setSelected(). |
|
The error bar representation. Will be a null pointer if a derived class doesn't have one. Definition at line 42 of file PointRepBase.h. Referenced by ColumnPointRep::ColumnPointRep(), SymbolPointRep::drawProjectedValues(), ColumnPointRep::drawProjectedValues(), SymbolPointRep::setColor(), ColumnPointRep::setColor(), SymbolPointRep::setErrorOn(), ColumnPointRep::setErrorOn(), PointRepBase::setSelected(), SymbolPointRep::SymbolPointRep(), ColumnPointRep::~ColumnPointRep(), and SymbolPointRep::~SymbolPointRep(). |
|
Sets the state of highlighting.
Definition at line 68 of file RepBase.h. Referenced by RepBase::setHighLighted(). |
|
The style currently used.
Definition at line 94 of file LinePointRep.h. Referenced by LinePointRep::drawProjectedValues(), endPlot(), LinePointRep::getStyle(), and LinePointRep::setStyle(). |
|
The max Z value of the data.
Definition at line 54 of file ContourPointRep.h. Referenced by getContour(), and setMinMax(). |
|
The min Z value of the data.
Definition at line 57 of file ContourPointRep.h. Referenced by getContour(), and setMinMax(). |
|
The name of the representation.
Definition at line 49 of file RepBase.h. Referenced by AverageTextRep::AverageTextRep(), ColorSymbolPointRep::ColorSymbolPointRep(), RepBase::displayError(), init(), and RepBase::name(). |
|
The number of contours to be drawn.
Definition at line 51 of file ContourPointRep.h. Referenced by ContourPointRep(), createContours(), getContour(), getNumContours(), init(), setContourValues(), setContourVector(), and setNumContours(). |
|
|
The text to be displayed before the statistics.
Definition at line 52 of file RepBase.h. Referenced by BoxTextRep::drawProjectedValues(), and RepBase::setText(). |
|
A boolean which is true if we are using user input contour values.
Definition at line 64 of file ContourPointRep.h. Referenced by ContourPointRep(), getUsingUserValues(), init(), setContourValues(), setContourVector(), and setUsingUserValues(). |
|
The vector of contour values.
Definition at line 60 of file ContourPointRep.h. Referenced by ContourPointRep(), createContours(), endPlot(), init(), setContourValues(), and setContourVector(). |
|
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 82 of file LinePointRep.h. Referenced by createContours(), LinePointRep::drawProjectedValues(), drawProjectedValues(), and endPlot(). |
|
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 90 of file LinePointRep.h. Referenced by createContours(), LinePointRep::drawProjectedValues(), drawProjectedValues(), and endPlot(). |
|
The color of the representation when it is de-selected.
Referenced by RepBase::color(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), and CutRangeRep::drawNormalRange(). |