Isis 3 Programmer Reference
Isis::PlotCurve Class Reference

#include <PlotCurve.h>

Inheritance diagram for Isis::PlotCurve:
Inheritance graph
Collaboration diagram for Isis::PlotCurve:
Collaboration graph

Public Types

enum  Units {
  Unknown , Band , CubeDN , Elevation ,
  Percentage , PixelNumber , Meters , Kilometers ,
  Wavelength
}
 These are all the possible units for the x or y data in a plot curve. More...
 

Public Member Functions

 PlotCurve (Units xUnits, Units yUnits)
 Constructs and instance of a PlotCurve with some default properties.
 
void attachMarkers ()
 After attaching this curve to a plot, due to an inheritance/implementation complication with qwt the markers will remain detached until they are recreated.
 
QColor color () const
 This method returns the color of the curve.
 
QwtSymbol * markerSymbol () const
 This method returns the shape of the markers.
 
Units xUnits () const
 Get the units of the x-axis double data.
 
Units yUnits () const
 Get the units of the y-axis double data.
 
void setColor (const QColor &color)
 Set the color of this curve and it's markers.
 
void setData (QwtSeriesData< QPointF > *data)
 This method sets the data for the curve, then sets the value for the markers associated with the curve.
 
void setPen (const QPen &pen)
 Sets the plot pen to the passed-in pen.
 
void setMarkerSymbol (QwtSymbol::Style style)
 This method sets the shape of the markers.
 
void setMarkerVisible (bool visible)
 This method sets the visibility states of the markers at each value point.
 

Protected Member Functions

QByteArray fromByteArray (const QByteArray &classData)
 Construct the plot curve given the past results of toByteArray(...).
 
QByteArray toByteArray () const
 

Private Member Functions

 PlotCurve (const PlotCurve &other)
 
PlotCurveoperator= (const PlotCurve &other)
 
void clearMarkers ()
 
void recreateMarkers ()
 

Private Attributes

QColor m_color
 
QwtSymbol * m_markerSymbol
 Marker's styles.
 
QList< QwtPlotMarker * > m_valuePointMarkers
 
Units m_xUnits
 
Units m_yUnits
 

Detailed Description

Author
????-??-?? Unknown
History

2012-01-20 Steven Lambright - Completed documentation.

2012-07-03 Steven Lambright - Added Meters, Kilometers to the Units enum. References #853.

2014-04-15 Tracie Sucharski - Reset defaults for plots to the following: SolidLine, Width=1, NoSymbols. This is a temporary fix until the defaults can be saved on a user basis. Fixes #2062.

Definition at line 44 of file PlotCurve.h.

Member Enumeration Documentation

◆ Units

These are all the possible units for the x or y data in a plot curve.

We want these in order to have type checking when moving curves around - it's theoretically possible to even utilize the right y axis automatically when you put mismatched plot curve y data into the same plot. All of this and more requires knowing your data's units.

Enumerator
Unknown 

The data units are not yet known.

Please avoid using this if at all possible.

Band 

The data is a band number.

CubeDN 

The data is a Cube DN value.

Elevation 

The data is an elevation (in meters).

Percentage 

The data is a percentage (0-100).

PixelNumber 

The data is a pixel #.

For example, it's the nth pixel along a line.

Meters 

The data is in meters.

For example, it's the nth meter along a line.

Kilometers 

The data is in kilometers.

For example, it's the nth kilometer along a line.

Wavelength 

The data is a wavelength.

This is usually associated with a band and comes from the band bin group.

Definition at line 54 of file PlotCurve.h.

Constructor & Destructor Documentation

◆ PlotCurve()

Isis::PlotCurve::PlotCurve ( Units xUnits,
Units yUnits )

Constructs and instance of a PlotCurve with some default properties.

Definition at line 21 of file PlotCurve.cpp.

References m_markerSymbol, xUnits(), and yUnits().

◆ ~PlotCurve()

Isis::PlotCurve::~PlotCurve ( )

Definition at line 31 of file PlotCurve.cpp.

Member Function Documentation

◆ attachMarkers()

void Isis::PlotCurve::attachMarkers ( )

After attaching this curve to a plot, due to an inheritance/implementation complication with qwt the markers will remain detached until they are recreated.

This forces the markers to be updated immediately.

Please always call this method after attaching this curve to a plot.

Definition at line 45 of file PlotCurve.cpp.

◆ clearMarkers()

void Isis::PlotCurve::clearMarkers ( )
private

Definition at line 348 of file PlotCurve.cpp.

◆ color()

QColor Isis::PlotCurve::color ( ) const

This method returns the color of the curve.

Returns
QColor

Definition at line 55 of file PlotCurve.cpp.

Referenced by Isis::PlotWindowBestFitDialog::createBestFitLine(), Isis::CubePlotCurve::paint(), and setColor().

◆ fromByteArray()

QByteArray Isis::PlotCurve::fromByteArray ( const QByteArray & classData)
protected

Construct the plot curve given the past results of toByteArray(...).

This is used for copy/paste and drag/drop.

Returns
The unconsumed part of the byte array.

Definition at line 144 of file PlotCurve.cpp.

References m_markerSymbol, Isis::IException::Programmer, setColor(), setData(), and setPen().

Referenced by Isis::CubePlotCurve::CubePlotCurve().

◆ markerSymbol()

QwtSymbol * Isis::PlotCurve::markerSymbol ( ) const

This method returns the shape of the markers.

Returns
QwtSymbol *

Definition at line 65 of file PlotCurve.cpp.

References m_markerSymbol.

◆ recreateMarkers()

void Isis::PlotCurve::recreateMarkers ( )
private

Definition at line 358 of file PlotCurve.cpp.

◆ setColor()

void Isis::PlotCurve::setColor ( const QColor & color)

Set the color of this curve and it's markers.

This color will override the pen's color always.

Parameters
colorThe color of this curve.

Definition at line 96 of file PlotCurve.cpp.

References color(), and setPen().

Referenced by fromByteArray(), and Isis::CubePlotCurve::mousePressEvent().

◆ setData()

void Isis::PlotCurve::setData ( QwtSeriesData< QPointF > * data)

This method sets the data for the curve, then sets the value for the markers associated with the curve.

Parameters
data

Definition at line 108 of file PlotCurve.cpp.

Referenced by fromByteArray().

◆ setMarkerSymbol()

void Isis::PlotCurve::setMarkerSymbol ( QwtSymbol::Style style)

This method sets the shape of the markers.

Parameters
style

Definition at line 119 of file PlotCurve.cpp.

References m_markerSymbol.

◆ setMarkerVisible()

void Isis::PlotCurve::setMarkerVisible ( bool visible)

This method sets the visibility states of the markers at each value point.

Parameters
visibleTrue to show markers, false to hide

Definition at line 130 of file PlotCurve.cpp.

◆ setPen()

void Isis::PlotCurve::setPen ( const QPen & pen)

Sets the plot pen to the passed-in pen.

Parameters
pen

Definition at line 338 of file PlotCurve.cpp.

Referenced by fromByteArray(), and setColor().

◆ toByteArray()

QByteArray Isis::PlotCurve::toByteArray ( ) const
protected

Definition at line 260 of file PlotCurve.cpp.

◆ xUnits()

PlotCurve::Units Isis::PlotCurve::xUnits ( ) const

Get the units of the x-axis double data.

Returns
The units of the x-axis data

Definition at line 75 of file PlotCurve.cpp.

Referenced by Isis::PlotWindowBestFitDialog::createBestFitLine(), and PlotCurve().

◆ yUnits()

PlotCurve::Units Isis::PlotCurve::yUnits ( ) const

Get the units of the y-axis double data.

Returns
The units of the y-axis data

Definition at line 85 of file PlotCurve.cpp.

Referenced by Isis::PlotWindowBestFitDialog::createBestFitLine(), and PlotCurve().

Member Data Documentation

◆ m_color

QColor Isis::PlotCurve::m_color
private

Definition at line 123 of file PlotCurve.h.

◆ m_markerSymbol

QwtSymbol* Isis::PlotCurve::m_markerSymbol
private

Marker's styles.

Definition at line 124 of file PlotCurve.h.

Referenced by fromByteArray(), markerSymbol(), PlotCurve(), and setMarkerSymbol().

◆ m_valuePointMarkers

QList<QwtPlotMarker *> Isis::PlotCurve::m_valuePointMarkers
private

Definition at line 125 of file PlotCurve.h.

◆ m_xUnits

Units Isis::PlotCurve::m_xUnits
private

Definition at line 126 of file PlotCurve.h.

◆ m_yUnits

Units Isis::PlotCurve::m_yUnits
private

Definition at line 127 of file PlotCurve.h.


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