casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Slots | Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | Friends | List of all members
casa::QtCanvas Class Reference

#include <QtCanvas.qo.h>

Inheritance diagram for casa::QtCanvas:
casa::WorldCanvasTranslator

Public Types

enum  ColorCategory {
  TITLE_COLOR,
  CURVE_COLOR,
  CURVE_COLOR_PRIMARY,
  CURVE_COLOR_SECONDARY,
  WARNING_COLOR,
  CURVE_TRADITIONAL
}
 
enum  TaskMode {
  SPECTRAL_LINE_MODE,
  LINE_OVERLAY_MODE,
  MODE_COUNT
}
 

Public Slots

void zoomIn ()
 
void zoomOut ()
 
void zoomNeutral ()
 
void changeTaskMode (int mode)
 
void createAnnotationText ()
 
void rangeSelectionMode ()
 
void channelPositioningMode ()
 

Signals

void xRangeChanged (double xmin, double xmax)
 
void channelSelect (float xvalue)
 
void specFitEstimateSpecified (double xValue, double yValue, bool centerPeak)
 
void findRedshiftAt (double center, double peak)
 
void channelRangeSelect (float startVal, float endVal)
 
void curvesChanged ()
 
void clearPaletteModes ()
 
void togglePalette (int modeIndex)
 

Public Member Functions

 QtCanvas (QWidget *parent=0)
 
void setPlotSettings (const QtPlotSettings &settings)
 
void setTopAxisRange (const casacore::Vector< float > &xValues, bool topAxisDescending)
 
void setFrameMarker (float framePositionX)
 
void setZoomRectColor (QColor color)
 
void getCanvasDomain (double *minValue, double *maxValue, QString &units)
 Returns the spectrum as it is currently displayed in the canvas (with possible zooming). More...
 
CurveData getCurveData (int)
 
ErrorData getCurveError (int id)
 
QString getCurveName (int id)
 
void setCurveName (int id, const QString &name)
 
void curveColorsChanged ()
 
QColor getCurveColor (int id)
 
CanvasCurve getCurve (const QString &curveName)
 
int getLineCount ()
 
void curveLabelsChanged ()
 
void clearCurve (bool inDtor=false)
 
void clearFitCurves ()
 
void clearEverything ()
 
void clearMolecularLines (bool refresh=true)
 
void setDataRange ()
 
void setImageMode (bool)
 
QPixmap * graph ()
 
void drawBackBuffer (QPainter *)
 
void drawFrameMarker (QPainter *)
 Draws a vertical line indicating the current frame. More...
 
QString getType (QtPlotSettings::AxisIndex axisIndex=QtPlotSettings::xBottom)
 
QString getUnits (QtPlotSettings::AxisIndex axisIndex=QtPlotSettings::xBottom)
 
QList< MolecularLine * > getMolecularLines () const
 
void setGaussianEstimateCount (int count)
 
void plotPolyLines (QString)
 Plotting curves. More...
 
template<class T >
void plotPolyLine (const casacore::Vector< T > &, const casacore::Vector< T > &, double beamAngle, double beamArea, casacore::SpectralCoordinate coord)
 
void plotPolyLine (const casacore::Vector< float > &x, const casacore::Vector< float > &y, const casacore::Vector< float > &e, double beamAngle, double beamArea, casacore::SpectralCoordinate coord, const QString &lb="")
 
void addPolyLine (const casacore::Vector< float > &x, const casacore::Vector< float > &y, double beamAngle, double beamArea, casacore::SpectralCoordinate coord, const QString &lb="", ColorCategory colorCategory=CURVE_COLOR)
 
void addMolecularLine (MolecularLine *molecularLine)
 
QList< QString > getMolecularLineNames () const
 
template<class T >
void plotPolyLine (const casacore::Matrix< T > &verts, double beamAngle, double beamArea, casacore::SpectralCoordinate coord, double restValue)
 
QSize minimumSizeHint () const
 
QSize sizeHint () const
 
 ~QtCanvas ()
 
void setTitle (const QString &text, int fontSize=13, const QString &font=FONT_NAME)
 
QString getTitle ()
 
bool isShowChannelLine ()
 
void setShowChannelLine (bool showLine)
 
void setChannelLineColor (QColor color)
 
void setXLabel (const QString &text, int fontSize=10, const QString &font=FONT_NAME, QtPlotSettings::AxisIndex axisIndex=QtPlotSettings::xBottom)
 
void setWelcome (const QString &text, int fontSize=14, const QString &font=FONT_NAME)
 
void setAutoScaleX (bool autoScale)
 
void setAutoScaleY (bool autoScale)
 
void setShowGrid (int a)
 
bool getAutoScaleX ()
 
bool getAutoScaleY ()
 
int getShowGrid ()
 
void setPlotError (int a)
 
void setShowTopAxis (bool showAxis)
 Whether or not to show a top axis on the plot. More...
 
void setTopAxisCompatible (bool compatible)
 Even if the user wants to show a top axis, we won't do it when there are multiple curves which are not compatible in their x-axis units. More...
 
void setShowToolTips (bool toolTipsVisible)
 Whether or not to show tool tips with the x,y coordinates of the points on the plot. More...
 
bool getShowToolTips () const
 
void setToolTipXUnit (const QString &xUnit)
 Sets the coordinates for the x and y points that are displayed as tooltips. More...
 
void setProfileFitMarkerCenterPeak (int index, double center, double peak)
 Stores the location of a (center,peak) point that represents an initial Gaussian estimate for spectral line fitting. More...
 
void setProfileFitMarkerFWHM (int index, double fwhm, double fwhmHeight)
 Stores the fwhm and the y value of the fwhm for an initial Gaussian estimate for spectral line fitting. More...
 
bool isDisplayStepFunction () const
 Whether or not to plot a line graph or instead plot the points as a step function. More...
 
void setDisplayStepFunction (bool displayAsStepFunction)
 
void setTraditionalCurveColors (const QList< QString > &colors)
 Used for customizing the curve colors on the canvas. More...
 
void setMainCurveColors (const QList< QString > &colors)
 
void setFitCurveColors (const QList< QString > &colors)
 
void setSummaryCurveColors (const QList< QString > &colors)
 
void setTraditionalColors (bool traditionalColors)
 If this flag is set, only 'traditional' colors will be used. More...
 
void setShowLegend (bool visible)
 Customization of the curve legend. More...
 
bool isShowLegend () const
 
void setLegendPosition (int position)
 
int getLegendPosition () const
 
void setImageYUnits (const QString &imageUnits)
 Set the yaxis units the image is using (units the data we are getting is in). More...
 
QString getDisplayYUnits ()
 Units we will be displaying the y-axis in which may be different from the intrinsic image units. More...
 
void setDisplayYUnits (const QString &displayUnits)
 
int getCurZoom ()
 
int getZoomStackSize ()
 
bool isTopAxisRange () const
 Returns true if the range of the top axis is nonzero; otherwise false. More...
 
void refreshPixmap ()
 Force a repaint. More...
 
void setSpectralCoordinate (const casacore::SpectralCoordinate &coord)
 Used for conversion purposes. More...
 
- Public Member Functions inherited from casa::WorldCanvasTranslator
 WorldCanvasTranslator ()
 
virtual ~WorldCanvasTranslator ()
 

Static Public Attributes

static const QString FONT_NAME
 

Protected Member Functions

void paintEvent (QPaintEvent *event)
 
void resizeEvent (QResizeEvent *event)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseMoveEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 
void keyPressEvent (QKeyEvent *event)
 
void keyReleaseEvent (QKeyEvent *event)
 
void wheelEvent (QWheelEvent *event)
 
void updateRubberBandRegion ()
 
void updatexRangeBandRegion ()
 
void drawGrid (QPainter *painter)
 
void drawTicks (QPainter *painter)
 
void drawLabels (QPainter *painter)
 
void drawWelcome (QPainter *painter)
 
void drawCurves (QPainter *painter)
 

Private Slots

void deleteSelectedAnnotation ()
 
void editSelectedAnnotation ()
 
void gaussianCenterPeakSelected ()
 
void gaussianFWHMSelected ()
 
void findRedshift ()
 

Private Member Functions

void zoomYBasedOnX (QtPlotSettings &settings, double zoomFactor, bool zoomIn)
 Zoom functionality. More...
 
std::pair< double, double > getRangeFor (double zoomFactor, bool zoomIn, double minX, double maxX)
 
void increaseCurZoom ()
 
void defaultZoomIn ()
 
void defaultZoomOut ()
 
void setCurveData (int id, const CurveData &data, double beamAngle, double beamArea, casacore::SpectralCoordinate coord, const ErrorData &error=ErrorData(), const QString &lb="", ColorCategory colorCategory=CURVE_COLOR)
 Stores the curve information for later plotting. More...
 
void displayToolTip (QMouseEvent *event) const
 Attempts to display a tool tip indicated a data point corresponding to the mouse position, if there is such a point. More...
 
void adjustExtremes (double *const min, double *const max) const
 Adjusts the min and the max when they are a little too close together. More...
 
double getDataY (int pixelPosition) const
 Maps a y pixel coordinate to a world y value. More...
 
double getDataX (int pixelPosition) const
 Maps an x pixel coordinate to a world x value. More...
 
int getPixelX (double dataX) const
 WorldCanvasTranslator interface methods. More...
 
int getPixelY (double dataY) const
 Maps a world y value to a y pixel value. More...
 
QString findCoords (double x, double y) const
 Looks for a data point corresponding to the world cooordinates (x,y). More...
 
int getRectHeight () const
 Returns the height of the standard drawing rectangle. More...
 
int getRectWidth () const
 Returns the width of the standard drawing rectangle. More...
 
int getRectBottom () const
 Returns the bottom pixel coordinate for the standard drawing rectangle. More...
 
int getRectLeft () const
 Returns the standard left pixel coordinate for the standard drawing rectangle. More...
 
QString getXTickLabel (int index, int tickCount, QtPlotSettings::AxisIndex axisIndex) const
 Returns the appropriate x-Axis tick label corresponding to the tick identified by the given index and axis. More...
 
void initContextMenu ()
 Initializes the shift-right-click pop-up menu that the user can use to specify Gaussian estimates, edit annotations, search for redshift, etc, depending on context. More...
 
void addDiamond (int x, int y, int diamondSize, QPainterPath &points) const
 
bool storeClickPosition (QMouseEvent *event)
 
int getIndependentCurveCount ()
 
int getLastAxis ()
 
void stripCurveTitleNumbers (QString &curveName) const
 
int duplicateCurve (QString &targetLabel)
 
void setYLabel (const QString &text, int fontSize=10, const QString &font=FONT_NAME)
 
void selectAnnotation (QMouseEvent *event, bool select=true)
 Annotation methods. More...
 
bool isAnnotation (QMouseEvent *event) const
 
AnnotationgetSelectedAnnotation () const
 
void storeActiveAnnotation (QMouseEvent *event)
 Mouse Events. More...
 
void selectChannel (QMouseEvent *event)
 
void updateChannel (QMouseEvent *event)
 
void startRangeX (QMouseEvent *event)
 
void updateRangeX (QMouseEvent *event)
 
void endRangeX (QMouseEvent *event)
 
void startZoomRect (QMouseEvent *event)
 
void updateZoomRect (QMouseEvent *event)
 
void endZoomRect (QMouseEvent *event)
 
void resetSelectedAnnotation (QMouseEvent *event)
 
void drawMolecularLines (QPainter &painter)
 
void drawAnnotations (QPainter &painter)
 
void showContextMenu (QMouseEvent *event)
 
ProfileFitMarker getMarker (int index) const
 
void setMarker (int index, ProfileFitMarker &marker)
 
QColor getDiscreteColor (ColorCategory colorCategory, int id=0)
 Returns the color to use for drawing a particular item on the canvas. More...
 
bool isAnnotationActive () const
 Returns true if the user is in the process of drawing an annotation. More...
 
AnnotationgetActiveAnnotation () const
 

Private Attributes

const int MARGIN_LEFT
 Plot Margins. More...
 
const int MARGIN_BOTTOM
 
const int MARGIN_TOP
 
const int MARGIN_RIGHT
 
const int FRACZOOM
 
GraphLabel title
 
GraphLabel xLabel [2]
 
GraphLabel yLabel
 
GraphLabel welcome
 
std::map< int, CanvasCurvecurveMap
 
std::vector< QtPlotSettingszoomStack
 
QList< MolecularLine * > molecularLineStack
 
std::pair< double, double > topAxisRange
 
int curZoom
 
int curMarker
 
bool rubberBandIsShown
 
bool xRangeIsShown
 
bool imageMode
 
bool xRangeMode
 
double xRangeStart
 
double xRangeEnd
 
QRect rubberBandRect
 
QRect xRangeRect
 
QPixmap pixmap
 
QPixmap backBuffer
 
casacore::Matrix
< casacore::uInt > * 
pMask
 
QPoint currentCursorPosition
 
QColor xcursor
 
bool autoScaleX
 
bool autoScaleY
 
int plotError
 
int showGrid
 
int xRectStart
 
int xRectEnd
 
bool showTopAxis
 Whether or not the user WANTS to see a top axis. More...
 
bool topAxisCompatible
 We can only show the top axis in the case of multiple curves, when all the curves have equally spaced units in their top axis. More...
 
bool showToolTips
 
bool showFrameMarker
 
bool displayStepFunction
 
QString toolTipXUnit
 
QString yUnitImage
 
QString yUnitDisplay
 
QMenu contextMenu
 Context Menu. More...
 
QAction * centerPeakAction
 
QAction * fwhmAction
 
QAction * findRedshiftAction
 
QAction * createAnnotationAction
 
QAction * editAnnotationAction
 
QAction * deleteAnnotationAction
 
double gaussianEstimateX
 Profile Fitting Gaussian Estimation. More...
 
double gaussianEstimateY
 
QList< ProfileFitMarkerprofileFitMarkers
 
QColor frameMarkerColor
 
QColor zoomColor
 
QList< QString > mainCurveColorList
 
QList< QString > fitCurveColorList
 
QList< QString > fitSummaryCurveColorList
 
QList< QString > traditionalCurveColorList
 
int curveCount
 
int curveCountPrimary
 
int curveCountSecondary
 
bool traditionalColors
 The optical spectral line fitting curve needs to use the traditional color list rather than a customizable one. More...
 
bool showLegend
 Whether the pixel canvas should show a legend with the curves. More...
 
int legendPosition
 Where the curve legend should appear relative to this canvas. More...
 
float framePositionX
 The x location for the vertical line representing the current frame position. More...
 
TaskMode taskMode
 Indicates the current work focus of the profiler. More...
 
float channelSelectValue
 
int gaussEstimateCount
 Needed to determine if we show the gauss estimate context items. More...
 
AnnotationselectedAnnotation
 
std::vector< Annotation * > annotations
 
CanvasModecurrentMode
 
CanvasModeFactorymodeFactory
 
casacore::SpectralCoordinate m_spectralCoordinate
 

Friends

class CanvasModeAnnotation
 
class CanvasModeRangeSelection
 
class CanvasModeChannel
 
class CanvasModeContextMenu
 
class CanvasModeZoom
 

Detailed Description

Definition at line 80 of file QtCanvas.qo.h.

Member Enumeration Documentation

Enumerator
TITLE_COLOR 
CURVE_COLOR 
CURVE_COLOR_PRIMARY 
CURVE_COLOR_SECONDARY 
WARNING_COLOR 
CURVE_TRADITIONAL 

Definition at line 130 of file QtCanvas.qo.h.

Enumerator
SPECTRAL_LINE_MODE 
LINE_OVERLAY_MODE 
MODE_COUNT 

Definition at line 238 of file QtCanvas.qo.h.

Constructor & Destructor Documentation

casa::QtCanvas::QtCanvas ( QWidget *  parent = 0)
casa::QtCanvas::~QtCanvas ( )

Member Function Documentation

void casa::QtCanvas::addDiamond ( int  x,
int  y,
int  diamondSize,
QPainterPath &  points 
) const
private
void casa::QtCanvas::addMolecularLine ( MolecularLine molecularLine)
void casa::QtCanvas::addPolyLine ( const casacore::Vector< float > &  x,
const casacore::Vector< float > &  y,
double  beamAngle,
double  beamArea,
casacore::SpectralCoordinate  coord,
const QString &  lb = "",
ColorCategory  colorCategory = CURVE_COLOR 
)
void casa::QtCanvas::adjustExtremes ( double *const  min,
double *const  max 
) const
private

Adjusts the min and the max when they are a little too close together.

void casa::QtCanvas::changeTaskMode ( int  mode)
slot
void casa::QtCanvas::channelPositioningMode ( )
slot
void casa::QtCanvas::channelRangeSelect ( float  startVal,
float  endVal 
)
signal
void casa::QtCanvas::channelSelect ( float  xvalue)
signal
void casa::QtCanvas::clearCurve ( bool  inDtor = false)
void casa::QtCanvas::clearEverything ( )
void casa::QtCanvas::clearFitCurves ( )
void casa::QtCanvas::clearMolecularLines ( bool  refresh = true)
void casa::QtCanvas::clearPaletteModes ( )
signal
void casa::QtCanvas::createAnnotationText ( )
slot
void casa::QtCanvas::curveColorsChanged ( )
void casa::QtCanvas::curveLabelsChanged ( )
void casa::QtCanvas::curvesChanged ( )
signal
void casa::QtCanvas::defaultZoomIn ( )
private
void casa::QtCanvas::defaultZoomOut ( )
private
void casa::QtCanvas::deleteSelectedAnnotation ( )
privateslot
void casa::QtCanvas::displayToolTip ( QMouseEvent *  event) const
private

Attempts to display a tool tip indicated a data point corresponding to the mouse position, if there is such a point.

void casa::QtCanvas::drawAnnotations ( QPainter &  painter)
private
void casa::QtCanvas::drawBackBuffer ( QPainter *  )
void casa::QtCanvas::drawCurves ( QPainter *  painter)
protected
void casa::QtCanvas::drawFrameMarker ( QPainter *  )

Draws a vertical line indicating the current frame.

void casa::QtCanvas::drawGrid ( QPainter *  painter)
protected
void casa::QtCanvas::drawLabels ( QPainter *  painter)
protected
void casa::QtCanvas::drawMolecularLines ( QPainter &  painter)
private
void casa::QtCanvas::drawTicks ( QPainter *  painter)
protected
void casa::QtCanvas::drawWelcome ( QPainter *  painter)
protected
int casa::QtCanvas::duplicateCurve ( QString &  targetLabel)
private
void casa::QtCanvas::editSelectedAnnotation ( )
privateslot
void casa::QtCanvas::endRangeX ( QMouseEvent *  event)
private
void casa::QtCanvas::endZoomRect ( QMouseEvent *  event)
private
QString casa::QtCanvas::findCoords ( double  x,
double  y 
) const
private

Looks for a data point corresponding to the world cooordinates (x,y).

Returns an empty string if there is no close match.

Parameters
xan world x-coordinate.
ya world y-coordinate.
Returns
a casacore::String containing the curve data point that is a close match to the passed in coordinates or an empty string if there is no good match.
void casa::QtCanvas::findRedshift ( )
privateslot
void casa::QtCanvas::findRedshiftAt ( double  center,
double  peak 
)
signal
void casa::QtCanvas::gaussianCenterPeakSelected ( )
privateslot
void casa::QtCanvas::gaussianFWHMSelected ( )
privateslot
Annotation* casa::QtCanvas::getActiveAnnotation ( ) const
private
bool casa::QtCanvas::getAutoScaleX ( )
inline

Definition at line 165 of file QtCanvas.qo.h.

References autoScaleX.

bool casa::QtCanvas::getAutoScaleY ( )
inline

Definition at line 168 of file QtCanvas.qo.h.

References autoScaleY.

void casa::QtCanvas::getCanvasDomain ( double *  minValue,
double *  maxValue,
QString &  units 
)

Returns the spectrum as it is currently displayed in the canvas (with possible zooming).

CanvasCurve casa::QtCanvas::getCurve ( const QString &  curveName)
QColor casa::QtCanvas::getCurveColor ( int  id)
CurveData casa::QtCanvas::getCurveData ( int  )
ErrorData casa::QtCanvas::getCurveError ( int  id)
QString casa::QtCanvas::getCurveName ( int  id)
int casa::QtCanvas::getCurZoom ( )
double casa::QtCanvas::getDataX ( int  pixelPosition) const
private

Maps an x pixel coordinate to a world x value.

Parameters
pixelPositionthe x-coordinate in pixels.
Returns
double the corresponding world x value.
double casa::QtCanvas::getDataY ( int  pixelPosition) const
private

Maps a y pixel coordinate to a world y value.

Parameters
pixelPositionthe y-coordinate in pixels.
Returns
double the corresponding world y value.
QColor casa::QtCanvas::getDiscreteColor ( ColorCategory  colorCategory,
int  id = 0 
)
private

Returns the color to use for drawing a particular item on the canvas.

The rational for the method is to always draw similar items in shades of the same color so that the user will learn to recognize those items by color. Similar items should always have the same colorCategory.

Parameters
colorCategorythe type of item that needs to be drawn.
QString casa::QtCanvas::getDisplayYUnits ( )

Units we will be displaying the y-axis in which may be different from the intrinsic image units.

int casa::QtCanvas::getIndependentCurveCount ( )
private
int casa::QtCanvas::getLastAxis ( )
private
int casa::QtCanvas::getLegendPosition ( ) const
int casa::QtCanvas::getLineCount ( )
ProfileFitMarker casa::QtCanvas::getMarker ( int  index) const
private
QList<QString> casa::QtCanvas::getMolecularLineNames ( ) const
QList<MolecularLine*> casa::QtCanvas::getMolecularLines ( ) const
int casa::QtCanvas::getPixelX ( double  dataX) const
privatevirtual

WorldCanvasTranslator interface methods.

Maps a world x value to an x pixel coordinate.

Parameters
dataXan world X value.
Returns
the pixel position of the passed in value.

Implements casa::WorldCanvasTranslator.

int casa::QtCanvas::getPixelY ( double  dataY) const
privatevirtual

Maps a world y value to a y pixel value.

Parameters
dataYa world y value.
Returns
the pixel position of the world y value.

Implements casa::WorldCanvasTranslator.

std::pair<double,double> casa::QtCanvas::getRangeFor ( double  zoomFactor,
bool  zoomIn,
double  minX,
double  maxX 
)
private
int casa::QtCanvas::getRectBottom ( ) const
private

Returns the bottom pixel coordinate for the standard drawing rectangle.

int casa::QtCanvas::getRectHeight ( ) const
private

Returns the height of the standard drawing rectangle.

int casa::QtCanvas::getRectLeft ( ) const
private

Returns the standard left pixel coordinate for the standard drawing rectangle.

int casa::QtCanvas::getRectWidth ( ) const
private

Returns the width of the standard drawing rectangle.

Annotation* casa::QtCanvas::getSelectedAnnotation ( ) const
private
int casa::QtCanvas::getShowGrid ( )
inline

Definition at line 171 of file QtCanvas.qo.h.

References showGrid.

bool casa::QtCanvas::getShowToolTips ( ) const
inline

Definition at line 195 of file QtCanvas.qo.h.

References showToolTips.

QString casa::QtCanvas::getTitle ( )
inline

Definition at line 147 of file QtCanvas.qo.h.

References casa::GraphLabel::text, and title.

QString casa::QtCanvas::getType ( QtPlotSettings::AxisIndex  axisIndex = QtPlotSettings::xBottom)
QString casa::QtCanvas::getUnits ( QtPlotSettings::AxisIndex  axisIndex = QtPlotSettings::xBottom)
QString casa::QtCanvas::getXTickLabel ( int  index,
int  tickCount,
QtPlotSettings::AxisIndex  axisIndex 
) const
private

Returns the appropriate x-Axis tick label corresponding to the tick identified by the given index and axis.

Parameters
indexthe index number of the tick withen a given axis.
tickCountthe number of ticks on the axis.
axisIndex,anidentifier for the axis (currently, top or bottom).
Returns
the appropriate axis label for the tick.
int casa::QtCanvas::getZoomStackSize ( )
QPixmap* casa::QtCanvas::graph ( )
void casa::QtCanvas::increaseCurZoom ( )
private
void casa::QtCanvas::initContextMenu ( )
private

Initializes the shift-right-click pop-up menu that the user can use to specify Gaussian estimates, edit annotations, search for redshift, etc, depending on context.

bool casa::QtCanvas::isAnnotation ( QMouseEvent *  event) const
private
bool casa::QtCanvas::isAnnotationActive ( ) const
private

Returns true if the user is in the process of drawing an annotation.

bool casa::QtCanvas::isDisplayStepFunction ( ) const

Whether or not to plot a line graph or instead plot the points as a step function.

bool casa::QtCanvas::isShowChannelLine ( )
bool casa::QtCanvas::isShowLegend ( ) const
bool casa::QtCanvas::isTopAxisRange ( ) const

Returns true if the range of the top axis is nonzero; otherwise false.

Returns
true if the range of the top axis is nonzero; otherwise false.
void casa::QtCanvas::keyPressEvent ( QKeyEvent *  event)
protected
void casa::QtCanvas::keyReleaseEvent ( QKeyEvent *  event)
protected
QSize casa::QtCanvas::minimumSizeHint ( ) const
void casa::QtCanvas::mouseMoveEvent ( QMouseEvent *  event)
protected
void casa::QtCanvas::mousePressEvent ( QMouseEvent *  event)
protected
void casa::QtCanvas::mouseReleaseEvent ( QMouseEvent *  event)
protected
void casa::QtCanvas::paintEvent ( QPaintEvent *  event)
protected
template<class T >
void casa::QtCanvas::plotPolyLine ( const casacore::Vector< T > &  ,
const casacore::Vector< T > &  ,
double  beamAngle,
double  beamArea,
casacore::SpectralCoordinate  coord 
)
void casa::QtCanvas::plotPolyLine ( const casacore::Vector< float > &  x,
const casacore::Vector< float > &  y,
const casacore::Vector< float > &  e,
double  beamAngle,
double  beamArea,
casacore::SpectralCoordinate  coord,
const QString &  lb = "" 
)
template<class T >
void casa::QtCanvas::plotPolyLine ( const casacore::Matrix< T > &  verts,
double  beamAngle,
double  beamArea,
casacore::SpectralCoordinate  coord,
double  restValue 
)
void casa::QtCanvas::plotPolyLines ( QString  )

Plotting curves.

void casa::QtCanvas::rangeSelectionMode ( )
slot
void casa::QtCanvas::refreshPixmap ( )

Force a repaint.

Referenced by setShowGrid().

void casa::QtCanvas::resetSelectedAnnotation ( QMouseEvent *  event)
private
void casa::QtCanvas::resizeEvent ( QResizeEvent *  event)
protected
void casa::QtCanvas::selectAnnotation ( QMouseEvent *  event,
bool  select = true 
)
private

Annotation methods.

void casa::QtCanvas::selectChannel ( QMouseEvent *  event)
private
void casa::QtCanvas::setAutoScaleX ( bool  autoScale)
void casa::QtCanvas::setAutoScaleY ( bool  autoScale)
void casa::QtCanvas::setChannelLineColor ( QColor  color)
void casa::QtCanvas::setCurveData ( int  id,
const CurveData data,
double  beamAngle,
double  beamArea,
casacore::SpectralCoordinate  coord,
const ErrorData error = ErrorData(),
const QString &  lb = "",
ColorCategory  colorCategory = CURVE_COLOR 
)
private

Stores the curve information for later plotting.

Parameters
ida unique identifier for the curve
dataa vector containing the (x,y) points that make up the curve.
errora vector containing errors associated with the curve.
lba human readable identifier for the curve.
colorCategoryan indication of the type of curve this is (main curve, secondary spectral fitting curve, etc).
void casa::QtCanvas::setCurveName ( int  id,
const QString &  name 
)
void casa::QtCanvas::setDataRange ( )

Referenced by setPlotError().

void casa::QtCanvas::setDisplayStepFunction ( bool  displayAsStepFunction)
void casa::QtCanvas::setDisplayYUnits ( const QString &  displayUnits)
void casa::QtCanvas::setFitCurveColors ( const QList< QString > &  colors)
void casa::QtCanvas::setFrameMarker ( float  framePositionX)
void casa::QtCanvas::setGaussianEstimateCount ( int  count)
void casa::QtCanvas::setImageMode ( bool  )
void casa::QtCanvas::setImageYUnits ( const QString &  imageUnits)

Set the yaxis units the image is using (units the data we are getting is in).

void casa::QtCanvas::setLegendPosition ( int  position)
void casa::QtCanvas::setMainCurveColors ( const QList< QString > &  colors)
void casa::QtCanvas::setMarker ( int  index,
ProfileFitMarker marker 
)
private
void casa::QtCanvas::setPlotError ( int  a)
inline

Definition at line 174 of file QtCanvas.qo.h.

References plotError, and setDataRange().

void casa::QtCanvas::setPlotSettings ( const QtPlotSettings settings)
void casa::QtCanvas::setProfileFitMarkerCenterPeak ( int  index,
double  center,
double  peak 
)

Stores the location of a (center,peak) point that represents an initial Gaussian estimate for spectral line fitting.

void casa::QtCanvas::setProfileFitMarkerFWHM ( int  index,
double  fwhm,
double  fwhmHeight 
)

Stores the fwhm and the y value of the fwhm for an initial Gaussian estimate for spectral line fitting.

void casa::QtCanvas::setShowChannelLine ( bool  showLine)
void casa::QtCanvas::setShowGrid ( int  a)
inline

Definition at line 161 of file QtCanvas.qo.h.

References refreshPixmap(), and showGrid.

void casa::QtCanvas::setShowLegend ( bool  visible)

Customization of the curve legend.

void casa::QtCanvas::setShowToolTips ( bool  toolTipsVisible)
inline

Whether or not to show tool tips with the x,y coordinates of the points on the plot.

Definition at line 192 of file QtCanvas.qo.h.

References showToolTips.

void casa::QtCanvas::setShowTopAxis ( bool  showAxis)

Whether or not to show a top axis on the plot.

void casa::QtCanvas::setSpectralCoordinate ( const casacore::SpectralCoordinate coord)

Used for conversion purposes.

void casa::QtCanvas::setSummaryCurveColors ( const QList< QString > &  colors)
void casa::QtCanvas::setTitle ( const QString &  text,
int  fontSize = 13,
const QString &  font = FONT_NAME 
)
void casa::QtCanvas::setToolTipXUnit ( const QString &  xUnit)
inline

Sets the coordinates for the x and y points that are displayed as tooltips.

Definition at line 201 of file QtCanvas.qo.h.

References toolTipXUnit.

void casa::QtCanvas::setTopAxisCompatible ( bool  compatible)

Even if the user wants to show a top axis, we won't do it when there are multiple curves which are not compatible in their x-axis units.

void casa::QtCanvas::setTopAxisRange ( const casacore::Vector< float > &  xValues,
bool  topAxisDescending 
)
void casa::QtCanvas::setTraditionalColors ( bool  traditionalColors)

If this flag is set, only 'traditional' colors will be used.

void casa::QtCanvas::setTraditionalCurveColors ( const QList< QString > &  colors)

Used for customizing the curve colors on the canvas.

void casa::QtCanvas::setWelcome ( const QString &  text,
int  fontSize = 14,
const QString &  font = FONT_NAME 
)
void casa::QtCanvas::setXLabel ( const QString &  text,
int  fontSize = 10,
const QString &  font = FONT_NAME,
QtPlotSettings::AxisIndex  axisIndex = QtPlotSettings::xBottom 
)
void casa::QtCanvas::setYLabel ( const QString &  text,
int  fontSize = 10,
const QString &  font = FONT_NAME 
)
private
void casa::QtCanvas::setZoomRectColor ( QColor  color)
void casa::QtCanvas::showContextMenu ( QMouseEvent *  event)
private
QSize casa::QtCanvas::sizeHint ( ) const
void casa::QtCanvas::specFitEstimateSpecified ( double  xValue,
double  yValue,
bool  centerPeak 
)
signal
void casa::QtCanvas::startRangeX ( QMouseEvent *  event)
private
void casa::QtCanvas::startZoomRect ( QMouseEvent *  event)
private
void casa::QtCanvas::storeActiveAnnotation ( QMouseEvent *  event)
private

Mouse Events.

bool casa::QtCanvas::storeClickPosition ( QMouseEvent *  event)
private
void casa::QtCanvas::stripCurveTitleNumbers ( QString &  curveName) const
private
void casa::QtCanvas::togglePalette ( int  modeIndex)
signal
void casa::QtCanvas::updateChannel ( QMouseEvent *  event)
private
void casa::QtCanvas::updateRangeX ( QMouseEvent *  event)
private
void casa::QtCanvas::updateRubberBandRegion ( )
protected
void casa::QtCanvas::updatexRangeBandRegion ( )
protected
void casa::QtCanvas::updateZoomRect ( QMouseEvent *  event)
private
void casa::QtCanvas::wheelEvent ( QWheelEvent *  event)
protected
void casa::QtCanvas::xRangeChanged ( double  xmin,
double  xmax 
)
signal
void casa::QtCanvas::zoomIn ( )
slot
void casa::QtCanvas::zoomNeutral ( )
slot
void casa::QtCanvas::zoomOut ( )
slot
void casa::QtCanvas::zoomYBasedOnX ( QtPlotSettings settings,
double  zoomFactor,
bool  zoomIn 
)
private

Zoom functionality.

Friends And Related Function Documentation

friend class CanvasModeAnnotation
friend

Definition at line 83 of file QtCanvas.qo.h.

friend class CanvasModeChannel
friend

Definition at line 85 of file QtCanvas.qo.h.

friend class CanvasModeContextMenu
friend

Definition at line 86 of file QtCanvas.qo.h.

friend class CanvasModeRangeSelection
friend

Definition at line 84 of file QtCanvas.qo.h.

friend class CanvasModeZoom
friend

Definition at line 87 of file QtCanvas.qo.h.

Member Data Documentation

std::vector<Annotation*> casa::QtCanvas::annotations
private

Definition at line 565 of file QtCanvas.qo.h.

bool casa::QtCanvas::autoScaleX
private

Definition at line 481 of file QtCanvas.qo.h.

Referenced by getAutoScaleX().

bool casa::QtCanvas::autoScaleY
private

Definition at line 482 of file QtCanvas.qo.h.

Referenced by getAutoScaleY().

QPixmap casa::QtCanvas::backBuffer
private

Definition at line 475 of file QtCanvas.qo.h.

QAction* casa::QtCanvas::centerPeakAction
private

Definition at line 503 of file QtCanvas.qo.h.

float casa::QtCanvas::channelSelectValue
private

Definition at line 558 of file QtCanvas.qo.h.

QMenu casa::QtCanvas::contextMenu
private

Context Menu.

Definition at line 502 of file QtCanvas.qo.h.

QAction* casa::QtCanvas::createAnnotationAction
private

Definition at line 506 of file QtCanvas.qo.h.

int casa::QtCanvas::curMarker
private

Definition at line 465 of file QtCanvas.qo.h.

QPoint casa::QtCanvas::currentCursorPosition
private

Definition at line 478 of file QtCanvas.qo.h.

CanvasMode* casa::QtCanvas::currentMode
private

Definition at line 572 of file QtCanvas.qo.h.

int casa::QtCanvas::curveCount
private

Definition at line 535 of file QtCanvas.qo.h.

int casa::QtCanvas::curveCountPrimary
private

Definition at line 536 of file QtCanvas.qo.h.

int casa::QtCanvas::curveCountSecondary
private

Definition at line 537 of file QtCanvas.qo.h.

std::map<int, CanvasCurve> casa::QtCanvas::curveMap
private

Definition at line 459 of file QtCanvas.qo.h.

int casa::QtCanvas::curZoom
private

Definition at line 464 of file QtCanvas.qo.h.

QAction* casa::QtCanvas::deleteAnnotationAction
private

Definition at line 508 of file QtCanvas.qo.h.

bool casa::QtCanvas::displayStepFunction
private

Definition at line 496 of file QtCanvas.qo.h.

QAction* casa::QtCanvas::editAnnotationAction
private

Definition at line 507 of file QtCanvas.qo.h.

QAction* casa::QtCanvas::findRedshiftAction
private

Definition at line 505 of file QtCanvas.qo.h.

QList<QString> casa::QtCanvas::fitCurveColorList
private

Definition at line 531 of file QtCanvas.qo.h.

QList<QString> casa::QtCanvas::fitSummaryCurveColorList
private

Definition at line 532 of file QtCanvas.qo.h.

const QString casa::QtCanvas::FONT_NAME
static

Definition at line 226 of file QtCanvas.qo.h.

const int casa::QtCanvas::FRACZOOM
private

Definition at line 451 of file QtCanvas.qo.h.

QColor casa::QtCanvas::frameMarkerColor
private

Definition at line 528 of file QtCanvas.qo.h.

float casa::QtCanvas::framePositionX
private

The x location for the vertical line representing the current frame position.

Definition at line 553 of file QtCanvas.qo.h.

QAction* casa::QtCanvas::fwhmAction
private

Definition at line 504 of file QtCanvas.qo.h.

int casa::QtCanvas::gaussEstimateCount
private

Needed to determine if we show the gauss estimate context items.

Definition at line 562 of file QtCanvas.qo.h.

double casa::QtCanvas::gaussianEstimateX
private

Profile Fitting Gaussian Estimation.

Definition at line 512 of file QtCanvas.qo.h.

double casa::QtCanvas::gaussianEstimateY
private

Definition at line 513 of file QtCanvas.qo.h.

bool casa::QtCanvas::imageMode
private

Definition at line 468 of file QtCanvas.qo.h.

int casa::QtCanvas::legendPosition
private

Where the curve legend should appear relative to this canvas.

Definition at line 549 of file QtCanvas.qo.h.

casacore::SpectralCoordinate casa::QtCanvas::m_spectralCoordinate
private

Definition at line 574 of file QtCanvas.qo.h.

QList<QString> casa::QtCanvas::mainCurveColorList
private

Definition at line 530 of file QtCanvas.qo.h.

const int casa::QtCanvas::MARGIN_BOTTOM
private

Definition at line 448 of file QtCanvas.qo.h.

const int casa::QtCanvas::MARGIN_LEFT
private

Plot Margins.

Definition at line 447 of file QtCanvas.qo.h.

const int casa::QtCanvas::MARGIN_RIGHT
private

Definition at line 450 of file QtCanvas.qo.h.

const int casa::QtCanvas::MARGIN_TOP
private

Definition at line 449 of file QtCanvas.qo.h.

CanvasModeFactory* casa::QtCanvas::modeFactory
private

Definition at line 573 of file QtCanvas.qo.h.

QList<MolecularLine*> casa::QtCanvas::molecularLineStack
private

Definition at line 461 of file QtCanvas.qo.h.

QPixmap casa::QtCanvas::pixmap
private

Definition at line 474 of file QtCanvas.qo.h.

int casa::QtCanvas::plotError
private

Definition at line 483 of file QtCanvas.qo.h.

Referenced by setPlotError().

casacore::Matrix<casacore::uInt>* casa::QtCanvas::pMask
private

Definition at line 476 of file QtCanvas.qo.h.

QList<ProfileFitMarker> casa::QtCanvas::profileFitMarkers
private

Definition at line 514 of file QtCanvas.qo.h.

bool casa::QtCanvas::rubberBandIsShown
private

Definition at line 466 of file QtCanvas.qo.h.

QRect casa::QtCanvas::rubberBandRect
private

Definition at line 472 of file QtCanvas.qo.h.

Annotation* casa::QtCanvas::selectedAnnotation
private

Definition at line 564 of file QtCanvas.qo.h.

bool casa::QtCanvas::showFrameMarker
private

Definition at line 495 of file QtCanvas.qo.h.

int casa::QtCanvas::showGrid
private

Definition at line 484 of file QtCanvas.qo.h.

Referenced by getShowGrid(), and setShowGrid().

bool casa::QtCanvas::showLegend
private

Whether the pixel canvas should show a legend with the curves.

Definition at line 545 of file QtCanvas.qo.h.

bool casa::QtCanvas::showToolTips
private

Definition at line 494 of file QtCanvas.qo.h.

Referenced by getShowToolTips(), and setShowToolTips().

bool casa::QtCanvas::showTopAxis
private

Whether or not the user WANTS to see a top axis.

Definition at line 490 of file QtCanvas.qo.h.

TaskMode casa::QtCanvas::taskMode
private

Indicates the current work focus of the profiler.

Definition at line 556 of file QtCanvas.qo.h.

GraphLabel casa::QtCanvas::title
private

Definition at line 454 of file QtCanvas.qo.h.

Referenced by getTitle().

QString casa::QtCanvas::toolTipXUnit
private

Definition at line 497 of file QtCanvas.qo.h.

Referenced by setToolTipXUnit().

bool casa::QtCanvas::topAxisCompatible
private

We can only show the top axis in the case of multiple curves, when all the curves have equally spaced units in their top axis.

Definition at line 493 of file QtCanvas.qo.h.

std::pair<double,double> casa::QtCanvas::topAxisRange
private

Definition at line 462 of file QtCanvas.qo.h.

bool casa::QtCanvas::traditionalColors
private

The optical spectral line fitting curve needs to use the traditional color list rather than a customizable one.

That is the purpose of this flag.

Definition at line 542 of file QtCanvas.qo.h.

QList<QString> casa::QtCanvas::traditionalCurveColorList
private

Definition at line 533 of file QtCanvas.qo.h.

GraphLabel casa::QtCanvas::welcome
private

Definition at line 457 of file QtCanvas.qo.h.

QColor casa::QtCanvas::xcursor
private

Definition at line 479 of file QtCanvas.qo.h.

GraphLabel casa::QtCanvas::xLabel[2]
private

Definition at line 455 of file QtCanvas.qo.h.

double casa::QtCanvas::xRangeEnd
private

Definition at line 471 of file QtCanvas.qo.h.

bool casa::QtCanvas::xRangeIsShown
private

Definition at line 467 of file QtCanvas.qo.h.

bool casa::QtCanvas::xRangeMode
private

Definition at line 469 of file QtCanvas.qo.h.

QRect casa::QtCanvas::xRangeRect
private

Definition at line 473 of file QtCanvas.qo.h.

double casa::QtCanvas::xRangeStart
private

Definition at line 470 of file QtCanvas.qo.h.

int casa::QtCanvas::xRectEnd
private

Definition at line 487 of file QtCanvas.qo.h.

int casa::QtCanvas::xRectStart
private

Definition at line 486 of file QtCanvas.qo.h.

GraphLabel casa::QtCanvas::yLabel
private

Definition at line 456 of file QtCanvas.qo.h.

QString casa::QtCanvas::yUnitDisplay
private

Definition at line 499 of file QtCanvas.qo.h.

QString casa::QtCanvas::yUnitImage
private

Definition at line 498 of file QtCanvas.qo.h.

QColor casa::QtCanvas::zoomColor
private

Definition at line 529 of file QtCanvas.qo.h.

std::vector<QtPlotSettings> casa::QtCanvas::zoomStack
private

Definition at line 460 of file QtCanvas.qo.h.


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