casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QtCanvas.qo.h
Go to the documentation of this file.
1 //# Copyright (C) 2005
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 
26 #ifndef QTCANVAS_H
27 #define QTCANVAS_H
28 
29 #include <casa/aips.h>
30 #include <casa/BasicSL/String.h>
31 #include <casa/Containers/Record.h>
32 #include <casa/Arrays/Array.h>
33 #include <casa/Arrays/ArrayMath.h>
34 #include <casa/Arrays/Vector.h>
35 #include <casa/Arrays/Matrix.h>
36 #include <casa/Inputs/Input.h>
37 #include <casa/Arrays/IPosition.h>
39 
46 
47 #include <graphics/X11/X_enter.h>
48 #include <QDir>
49 #include <QColor>
50 #include <QHash>
51 #include <QWidget>
52 #include <QMouseEvent>
53 #include <QToolButton>
54 #include <QDialog>
55 #include <QPixmap>
56 #include <QVBoxLayout>
57 #include <QPainterPath>
58 #include <QLabel>
59 #include <QMenu>
60 #include <map>
61 #include <vector>
62 #include <graphics/X11/X_exit.h>
63 
64 namespace casa {
65 
66  class Annotation;
67  class CanvasModeFactory;
68 
69 #define QT_DIAMOND_SIZE 5
70 
71  class GraphLabel {
72  public:
73  QString text;
74  QString fontName;
75  int fontSize;
76  QColor color;
77  GraphLabel() : text(""), fontName(""), fontSize(12), color(Qt::blue) {}
78  };
79 
80  class QtCanvas : public QWidget, public WorldCanvasTranslator {
81  Q_OBJECT
82 
83  friend class CanvasModeAnnotation;
85  friend class CanvasModeChannel;
86  friend class CanvasModeContextMenu;
87  friend class CanvasModeZoom;
88 
89  public:
90  QtCanvas(QWidget *parent = 0);
91 
92  void setPlotSettings(const QtPlotSettings &settings);
93  void setTopAxisRange(const casacore::Vector<float> &xValues, bool topAxisDescending );
94  void setFrameMarker( float framePositionX );
95  void setZoomRectColor( QColor color );
96  //Returns the spectrum as it is currently displayed in the canvas (with
97  //possible zooming).
98  void getCanvasDomain( double* minValue, double* maxValue, QString& units);
99 
100  CurveData getCurveData(int);
101  ErrorData getCurveError(int id);
102  QString getCurveName(int id);
103  void setCurveName(int id, const QString& name );
104  void curveColorsChanged();
105  QColor getCurveColor( int id );
106  CanvasCurve getCurve( const QString& curveName );
107  int getLineCount();
108  void curveLabelsChanged();
109  void clearCurve( bool inDtor=false );
110  void clearFitCurves();
111  void clearEverything();
112  void clearMolecularLines( bool refresh = true );
113  void setDataRange();
114  void setImageMode(bool);
115  QPixmap* graph();
116  void drawBackBuffer(QPainter *);
117  //Draws a vertical line indicating the current frame.
118  void drawFrameMarker( QPainter* );
121  QList<MolecularLine*> getMolecularLines() const;
122  void setGaussianEstimateCount( int count );
123 
124  //Plotting curves
125  void plotPolyLines(QString);
126  template<class T> void plotPolyLine(const casacore::Vector<T>&, const casacore::Vector<T>&,
127  double beamAngle, double beamArea, casacore::SpectralCoordinate coord);
129  double beamAngle, double beamArea, casacore::SpectralCoordinate coord, const QString& lb="");
133  double beamAngle, double beamArea, casacore::SpectralCoordinate coord,
134  const QString& lb="", ColorCategory colorCategory=CURVE_COLOR );
135  void addMolecularLine(MolecularLine* molecularLine );
136  QList<QString> getMolecularLineNames() const;
137 
138  template<class T> void plotPolyLine(const casacore::Matrix<T> &verts, double beamAngle,
139  double beamArea, casacore::SpectralCoordinate coord, double restValue );
140 
141  QSize minimumSizeHint() const;
142  QSize sizeHint() const;
143  ~QtCanvas();
144 
145 
146  void setTitle(const QString &text, int fontSize = 13,const QString &font = FONT_NAME);
147  QString getTitle() {
148  return title.text;
149  };
150 
151  bool isShowChannelLine();
152  void setShowChannelLine( bool showLine );
153  void setChannelLineColor( QColor color );
154 
155  void setXLabel(const QString &text, int fontSize = 10,
156  const QString &font = FONT_NAME, QtPlotSettings::AxisIndex axisIndex=QtPlotSettings::xBottom);
157  void setWelcome(const QString &text, int fontSize = 14,
158  const QString &font = FONT_NAME);
159  void setAutoScaleX(bool autoScale);
160  void setAutoScaleY(bool autoScale);
161  void setShowGrid(int a) {
162  showGrid = a;
163  refreshPixmap();
164  }
165  bool getAutoScaleX( ) {
166  return autoScaleX;
167  }
168  bool getAutoScaleY( ) {
169  return autoScaleY;
170  }
171  int getShowGrid( ) {
172  return showGrid;
173  }
174  void setPlotError(int a) {
175  plotError = a;
176  setDataRange();
177  }
178 
179  //Whether or not to show a top axis on the plot.
180  void setShowTopAxis( bool showAxis );
181  /*bool getShowTopAxis() const {
182  return showTopAxis;
183  }*/
184 
185  //Even if the user wants to show a top axis, we won't do it
186  //when there are multiple curves which are not compatible in their
187  //x-axis units.
188  void setTopAxisCompatible( bool compatible );
189 
190  //Whether or not to show tool tips with the x,y coordinates
191  //of the points on the plot.
192  void setShowToolTips( bool toolTipsVisible ) {
193  showToolTips = toolTipsVisible;
194  }
195  bool getShowToolTips() const {
196  return showToolTips;
197  }
198 
199  //Sets the coordinates for the x and y points that are displayed
200  //as tooltips.
201  void setToolTipXUnit( const QString& xUnit ) {
202  toolTipXUnit = xUnit;
203  }
204 
205  //Stores the location of a (center,peak) point that represents an initial
206  //Gaussian estimate for spectral line fitting.
207  void setProfileFitMarkerCenterPeak( int index, double center, double peak);
208 
209  //Stores the fwhm and the y value of the fwhm for an initial Gaussian estimate
210  //for spectral line fitting.
211  void setProfileFitMarkerFWHM( int index, double fwhm, double fwhmHeight);
212 
213  //Whether or not to plot a line graph or instead plot the points as a
214  //step function.
215  bool isDisplayStepFunction() const;
216  void setDisplayStepFunction( bool displayAsStepFunction );
217 
218  //Used for customizing the curve colors on the canvas.
219  void setTraditionalCurveColors( const QList<QString>& colors );
220  void setMainCurveColors( const QList<QString>& colors );
221  void setFitCurveColors( const QList<QString>& colors );
222  void setSummaryCurveColors( const QList<QString>& colors );
223 
224  //If this flag is set, only 'traditional' colors will be used.
226  static const QString FONT_NAME;
227 
228  //Customization of the curve legend.
229  void setShowLegend( bool visible );
230  bool isShowLegend() const;
231  void setLegendPosition( int position );
232  int getLegendPosition() const;
233 
234  //Set the yaxis units the image is using ( units the data we are getting is in).
235  void setImageYUnits( const QString& imageUnits );
236 
237 
239 
240 
241  //Units we will be displaying the y-axis in which may be different
242  //from the intrinsic image units.
243  QString getDisplayYUnits();
244  void setDisplayYUnits( const QString& displayUnits );
245 
246  int getCurZoom();
247  int getZoomStackSize();
248 
253  bool isTopAxisRange() const;
254 
255  //Force a repaint
256  void refreshPixmap();
257 
258  //Used for conversion purposes.
260 
261 
262  public slots:
263  void zoomIn();
264  void zoomOut();
265  void zoomNeutral();
266  void changeTaskMode( int mode );
267  void createAnnotationText();
268  void rangeSelectionMode();
269  void channelPositioningMode();
270 
271  signals:
272  void xRangeChanged(double xmin, double xmax);
273  void channelSelect(float xvalue);
274  void specFitEstimateSpecified( double xValue, double yValue, bool centerPeak );
275  void findRedshiftAt( double center, double peak );
276  void channelRangeSelect( float startVal, float endVal );
277  void curvesChanged();
278  void clearPaletteModes();
279  void togglePalette( int modeIndex );
280 
281  protected:
282  void paintEvent(QPaintEvent *event);
283  void resizeEvent(QResizeEvent *event);
284  void mousePressEvent(QMouseEvent *event);
285  void mouseMoveEvent(QMouseEvent *event);
286  void mouseReleaseEvent(QMouseEvent *event);
287  void keyPressEvent(QKeyEvent *event);
288  void keyReleaseEvent(QKeyEvent *event);
289  void wheelEvent(QWheelEvent *event);
290 
291  void updateRubberBandRegion();
292  void updatexRangeBandRegion();
293  void drawGrid(QPainter *painter);
294  void drawTicks(QPainter *painter);
295  void drawLabels(QPainter *painter);
296  void drawWelcome(QPainter *painter);
297  void drawCurves(QPainter *painter);
298 
299  private slots:
301  void editSelectedAnnotation();
303  void gaussianFWHMSelected();
304  void findRedshift();
305 
306  private:
307 
308  //Zoom functionality
309  void zoomYBasedOnX( QtPlotSettings& settings, double zoomFactor, bool zoomIn );
310  std::pair<double,double> getRangeFor( double zoomFactor, bool zoomIn, double minX, double maxX );
311  void increaseCurZoom();
312  void defaultZoomIn();
313  void defaultZoomOut();
314 
324  void setCurveData(int id, const CurveData &data, double beamAngle, double beamArea,
325  casacore::SpectralCoordinate coord, const ErrorData &error=ErrorData(),
326  const QString& lb="", ColorCategory colorCategory = CURVE_COLOR);
327 
328 
333  void displayToolTip( QMouseEvent* event ) const;
334 
339  void adjustExtremes( double* const min, double* const max ) const;
340 
346  double getDataY( int pixelPosition ) const;
347 
353  double getDataX( int pixelPosition ) const;
354 
355  //WorldCanvasTranslator interface methods.
361  int getPixelX( double dataX ) const;
362 
368  int getPixelY ( double dataY ) const;
369 
380  QString findCoords( double x, double y ) const;
381 
385  int getRectHeight() const;
386 
390  int getRectWidth() const;
391 
395  int getRectBottom() const;
396 
400  int getRectLeft() const;
401 
410  QString getXTickLabel( int index, int tickCount, QtPlotSettings::AxisIndex axisIndex ) const;
411 
417  void initContextMenu();
418  void addDiamond( int x, int y, int diamondSize, QPainterPath& points ) const;
419  bool storeClickPosition( QMouseEvent* event );
421  int getLastAxis();
422  void stripCurveTitleNumbers( QString& curveName ) const;
423  int duplicateCurve( QString& targetLabel );
424 
425  void setYLabel(const QString &text, int fontSize = 10, const QString &font = FONT_NAME);
426 
427  //Annotation methods
428  void selectAnnotation( QMouseEvent* event, bool select = true );
429  bool isAnnotation( QMouseEvent* event ) const;
431 
432  //Mouse Events
433  void storeActiveAnnotation( QMouseEvent* event );
434  void selectChannel( QMouseEvent* event );
435  void updateChannel( QMouseEvent* event );
436  void startRangeX( QMouseEvent* event );
437  void updateRangeX( QMouseEvent* event );
438  void endRangeX( QMouseEvent* event );
439  void startZoomRect( QMouseEvent* event );
440  void updateZoomRect( QMouseEvent* event );
441  void endZoomRect( QMouseEvent* event );
442  void resetSelectedAnnotation( QMouseEvent* event );
443  void drawMolecularLines( QPainter& painter );
444  void drawAnnotations( QPainter& painter );
445 
446  //Plot Margins
447  const int MARGIN_LEFT;
448  const int MARGIN_BOTTOM;
449  const int MARGIN_TOP;
450  const int MARGIN_RIGHT;
451  const int FRACZOOM;
452 
453 
458 
459  std::map<int, CanvasCurve> curveMap;
460  std::vector<QtPlotSettings> zoomStack;
461  QList<MolecularLine*> molecularLineStack;
462  std::pair<double,double> topAxisRange;
463 
464  int curZoom;
468  bool imageMode;
470  double xRangeStart;
471  double xRangeEnd;
473  QRect xRangeRect;
474  QPixmap pixmap;
475  QPixmap backBuffer;
477 
479  QColor xcursor;
480 
484  int showGrid;
485 
487  int xRectEnd;
488 
489  //Whether or not the user WANTS to see a top axis.
491  //We can only show the top axis in the case of multiple curves, when
492  //all the curves have equally spaced units in their top axis.
497  QString toolTipXUnit;
498  QString yUnitImage;
499  QString yUnitDisplay;
500 
501  //Context Menu
502  QMenu contextMenu;
504  QAction* fwhmAction;
509  void showContextMenu( QMouseEvent* event );
510 
511  //Profile Fitting Gaussian Estimation
514  QList<ProfileFitMarker> profileFitMarkers;
515 
516  ProfileFitMarker getMarker( int index ) const;
517  void setMarker( int index, ProfileFitMarker& marker );
518 
519 
527  QColor getDiscreteColor(ColorCategory colorCategory, int id=0);
529  QColor zoomColor;
530  QList<QString> mainCurveColorList;
531  QList<QString> fitCurveColorList;
532  QList<QString> fitSummaryCurveColorList;
534 
538 
539  //The optical spectral line fitting curve needs to use
540  //the traditional color list rather than a customizable one.
541  //That is the purpose of this flag.
543 
544  //Whether the pixel canvas should show a legend with the curves.
546 
547  //Where the curve legend should appear relative to this
548  //canvas.
550 
551  //The x location for the vertical line representing the
552  //current frame position.
554 
555  //Indicates the current work focus of the profiler
557 
559 
560  //Needed to determine if we show the gauss estimate context
561  //items.
563 
565  std::vector<Annotation*> annotations;
566 
567  //Returns true if the user is in the process of drawing an
568  //annotation.
569  bool isAnnotationActive() const;
570 
575  };
576 
577 }
578 #endif
579 
CanvasModeFactory * modeFactory
Definition: QtCanvas.qo.h:573
bool isDisplayStepFunction() const
Whether or not to plot a line graph or instead plot the points as a step function.
void increaseCurZoom()
Annotation * selectedAnnotation
Definition: QtCanvas.qo.h:564
void refreshPixmap()
Force a repaint.
int getPixelY(double dataY) const
Maps a world y value to a y pixel value.
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)
bool getAutoScaleY()
Definition: QtCanvas.qo.h:168
bool isTopAxisRange() const
Returns true if the range of the top axis is nonzero; otherwise false.
void updateZoomRect(QMouseEvent *event)
void updateRubberBandRegion()
void setAutoScaleY(bool autoScale)
casacore::SpectralCoordinate m_spectralCoordinate
Definition: QtCanvas.qo.h:574
void setGaussianEstimateCount(int count)
void clearPaletteModes()
bool isAnnotationActive() const
Returns true if the user is in the process of drawing an annotation.
std::map< int, CanvasCurve > curveMap
Definition: QtCanvas.qo.h:459
int getZoomStackSize()
void setShowGrid(int a)
Definition: QtCanvas.qo.h:161
void setMainCurveColors(const QList< QString > &colors)
void setSummaryCurveColors(const QList< QString > &colors)
QString fontName
Definition: QtCanvas.qo.h:74
void findRedshiftAt(double center, double peak)
void wheelEvent(QWheelEvent *event)
void drawCurves(QPainter *painter)
const int MARGIN_LEFT
Plot Margins.
Definition: QtCanvas.qo.h:447
QPixmap * graph()
bool isShowLegend() const
#define max(a, b)
Definition: hio.h:44
void mousePressEvent(QMouseEvent *event)
void getCanvasDomain(double *minValue, double *maxValue, QString &units)
Returns the spectrum as it is currently displayed in the canvas (with possible zooming).
QList< ProfileFitMarker > profileFitMarkers
Definition: QtCanvas.qo.h:514
QString yUnitDisplay
Definition: QtCanvas.qo.h:499
bool getShowToolTips() const
Definition: QtCanvas.qo.h:195
void plotPolyLines(QString)
Plotting curves.
void drawAnnotations(QPainter &painter)
int getIndependentCurveCount()
std::vector< Annotation * > annotations
Definition: QtCanvas.qo.h:565
QAction * findRedshiftAction
Definition: QtCanvas.qo.h:505
QString toolTipXUnit
Definition: QtCanvas.qo.h:497
#define min(a, b)
Definition: hio.h:45
void clearEverything()
void addDiamond(int x, int y, int diamondSize, QPainterPath &points) const
QList< MolecularLine * > getMolecularLines() const
double gaussianEstimateX
Profile Fitting Gaussian Estimation.
Definition: QtCanvas.qo.h:512
Annotation * getSelectedAnnotation() const
void createAnnotationText()
void startRangeX(QMouseEvent *event)
void clearCurve(bool inDtor=false)
const int MARGIN_TOP
Definition: QtCanvas.qo.h:449
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.
QAction * editAnnotationAction
Definition: QtCanvas.qo.h:507
const int FRACZOOM
Definition: QtCanvas.qo.h:451
GraphLabel title
Definition: QtCanvas.qo.h:454
TaskMode taskMode
Indicates the current work focus of the profiler.
Definition: QtCanvas.qo.h:556
void keyReleaseEvent(QKeyEvent *event)
void curveColorsChanged()
QColor zoomColor
Definition: QtCanvas.qo.h:529
void setPlotSettings(const QtPlotSettings &settings)
void setXLabel(const QString &text, int fontSize=10, const QString &font=FONT_NAME, QtPlotSettings::AxisIndex axisIndex=QtPlotSettings::xBottom)
void setToolTipXUnit(const QString &xUnit)
Sets the coordinates for the x and y points that are displayed as tooltips.
Definition: QtCanvas.qo.h:201
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.
const int MARGIN_RIGHT
Definition: QtCanvas.qo.h:450
int duplicateCurve(QString &targetLabel)
void paintEvent(QPaintEvent *event)
QColor frameMarkerColor
Definition: QtCanvas.qo.h:528
void endZoomRect(QMouseEvent *event)
bool isShowChannelLine()
void drawWelcome(QPainter *painter)
ProfileFitMarker getMarker(int index) const
bool isAnnotation(QMouseEvent *event) const
A 2-D Specialization of the Array class.
QString getUnits(QtPlotSettings::AxisIndex axisIndex=QtPlotSettings::xBottom)
CurveData getCurveData(int)
CanvasMode * currentMode
Definition: QtCanvas.qo.h:572
void showContextMenu(QMouseEvent *event)
void deleteSelectedAnnotation()
void drawMolecularLines(QPainter &painter)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
bool rubberBandIsShown
Definition: QtCanvas.qo.h:466
QString getType(QtPlotSettings::AxisIndex axisIndex=QtPlotSettings::xBottom)
std::vector< QtPlotSettings > zoomStack
Definition: QtCanvas.qo.h:460
casacore::Matrix< casacore::uInt > * pMask
Definition: QtCanvas.qo.h:476
void xRangeChanged(double xmin, double xmax)
double gaussianEstimateY
Definition: QtCanvas.qo.h:513
void setZoomRectColor(QColor color)
void setImageYUnits(const QString &imageUnits)
Set the yaxis units the image is using (units the data we are getting is in).
double getDataY(int pixelPosition) const
Maps a y pixel coordinate to a world y value.
QList< QString > fitCurveColorList
Definition: QtCanvas.qo.h:531
void setShowToolTips(bool toolTipsVisible)
Whether or not to show tool tips with the x,y coordinates of the points on the plot.
Definition: QtCanvas.qo.h:192
QString getCurveName(int id)
void togglePalette(int modeIndex)
void setDisplayStepFunction(bool displayAsStepFunction)
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
void clearFitCurves()
void setProfileFitMarkerCenterPeak(int index, double center, double peak)
Stores the location of a (center,peak) point that represents an initial Gaussian estimate for spectra...
int getRectHeight() const
Returns the height of the standard drawing rectangle.
int legendPosition
Where the curve legend should appear relative to this canvas.
Definition: QtCanvas.qo.h:549
void setFitCurveColors(const QList< QString > &colors)
Annotation * getActiveAnnotation() const
void setImageMode(bool)
void mouseMoveEvent(QMouseEvent *event)
QMenu contextMenu
Context Menu.
Definition: QtCanvas.qo.h:502
void endRangeX(QMouseEvent *event)
QList< QString > traditionalCurveColorList
Definition: QtCanvas.qo.h:533
double getDataX(int pixelPosition) const
Maps an x pixel coordinate to a world x value.
void clearMolecularLines(bool refresh=true)
void selectChannel(QMouseEvent *event)
QRect rubberBandRect
Definition: QtCanvas.qo.h:472
void updateChannel(QMouseEvent *event)
void zoomYBasedOnX(QtPlotSettings &settings, double zoomFactor, bool zoomIn)
Zoom functionality.
void updatexRangeBandRegion()
void setTopAxisCompatible(bool compatible)
Even if the user wants to show a top axis, we won&#39;t do it when there are multiple curves which are no...
double xRangeStart
Definition: QtCanvas.qo.h:470
void startZoomRect(QMouseEvent *event)
void defaultZoomIn()
bool topAxisCompatible
We can only show the top axis in the case of multiple curves, when all the curves have equally spaced...
Definition: QtCanvas.qo.h:493
void specFitEstimateSpecified(double xValue, double yValue, bool centerPeak)
void updateRangeX(QMouseEvent *event)
void gaussianCenterPeakSelected()
void curvesChanged()
void setWelcome(const QString &text, int fontSize=14, const QString &font=FONT_NAME)
void setMarker(int index, ProfileFitMarker &marker)
GraphLabel welcome
Definition: QtCanvas.qo.h:457
void findRedshift()
QColor getDiscreteColor(ColorCategory colorCategory, int id=0)
Returns the color to use for drawing a particular item on the canvas.
bool showLegend
Whether the pixel canvas should show a legend with the curves.
Definition: QtCanvas.qo.h:545
void initContextMenu()
Initializes the shift-right-click pop-up menu that the user can use to specify Gaussian estimates...
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...
void setDataRange()
void setTopAxisRange(const casacore::Vector< float > &xValues, bool topAxisDescending)
void setLegendPosition(int position)
void gaussianFWHMSelected()
QList< QString > mainCurveColorList
Definition: QtCanvas.qo.h:530
void storeActiveAnnotation(QMouseEvent *event)
Mouse Events.
void setTitle(const QString &text, int fontSize=13, const QString &font=FONT_NAME)
int getLegendPosition() const
void setPlotError(int a)
Definition: QtCanvas.qo.h:174
CanvasCurve getCurve(const QString &curveName)
GraphLabel xLabel[2]
Definition: QtCanvas.qo.h:455
int getRectBottom() const
Returns the bottom pixel coordinate for the standard drawing rectangle.
QString getDisplayYUnits()
Units we will be displaying the y-axis in which may be different from the intrinsic image units...
double xRangeEnd
Definition: QtCanvas.qo.h:471
void mouseReleaseEvent(QMouseEvent *event)
QAction * createAnnotationAction
Definition: QtCanvas.qo.h:506
void setAutoScaleX(bool autoScale)
QAction * deleteAnnotationAction
Definition: QtCanvas.qo.h:508
void drawGrid(QPainter *painter)
QColor getCurveColor(int id)
void zoomNeutral()
QSize sizeHint() const
void defaultZoomOut()
std::vector< double > ErrorData
Definition: CanvasCurve.h:43
void setTraditionalCurveColors(const QList< QString > &colors)
Used for customizing the curve colors on the canvas.
Interconvert pixel and frequency values.
void setSpectralCoordinate(const casacore::SpectralCoordinate &coord)
Used for conversion purposes.
void setFrameMarker(float framePositionX)
int curveCountSecondary
Definition: QtCanvas.qo.h:537
QList< MolecularLine * > molecularLineStack
Definition: QtCanvas.qo.h:461
QAction * centerPeakAction
Definition: QtCanvas.qo.h:503
void channelRangeSelect(float startVal, float endVal)
void addMolecularLine(MolecularLine *molecularLine)
QPixmap backBuffer
Definition: QtCanvas.qo.h:475
void channelSelect(float xvalue)
QPoint currentCursorPosition
Definition: QtCanvas.qo.h:478
int getRectLeft() const
Returns the standard left pixel coordinate for the standard drawing rectangle.
std::pair< double, double > topAxisRange
Definition: QtCanvas.qo.h:462
void resetSelectedAnnotation(QMouseEvent *event)
float framePositionX
The x location for the vertical line representing the current frame position.
Definition: QtCanvas.qo.h:553
void keyPressEvent(QKeyEvent *event)
static const QString FONT_NAME
Definition: QtCanvas.qo.h:226
void drawTicks(QPainter *painter)
const int MARGIN_BOTTOM
Definition: QtCanvas.qo.h:448
const Double e
e and functions thereof:
void changeTaskMode(int mode)
void drawFrameMarker(QPainter *)
Draws a vertical line indicating the current frame.
void channelPositioningMode()
QSize minimumSizeHint() const
QString getTitle()
Definition: QtCanvas.qo.h:147
void rangeSelectionMode()
void setShowLegend(bool visible)
Customization of the curve legend.
void adjustExtremes(double *const min, double *const max) const
Adjusts the min and the max when they are a little too close together.
bool displayStepFunction
Definition: QtCanvas.qo.h:496
int getRectWidth() const
Returns the width of the standard drawing rectangle.
void resizeEvent(QResizeEvent *event)
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 fittin...
int gaussEstimateCount
Needed to determine if we show the gauss estimate context items.
Definition: QtCanvas.qo.h:562
QList< QString > fitSummaryCurveColorList
Definition: QtCanvas.qo.h:532
void setChannelLineColor(QColor color)
void setTraditionalColors(bool traditionalColors)
If this flag is set, only &#39;traditional&#39; colors will be used.
bool storeClickPosition(QMouseEvent *event)
void editSelectedAnnotation()
void setCurveName(int id, const QString &name)
int getPixelX(double dataX) const
WorldCanvasTranslator interface methods.
bool traditionalColors
The optical spectral line fitting curve needs to use the traditional color list rather than a customi...
Definition: QtCanvas.qo.h:542
void stripCurveTitleNumbers(QString &curveName) const
void curveLabelsChanged()
QtCanvas(QWidget *parent=0)
void setShowChannelLine(bool showLine)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the color(i.e.,"000000"for black) and
QList< QString > getMolecularLineNames() const
void setShowTopAxis(bool showAxis)
Whether or not to show a top axis on the plot.
bool showFrameMarker
Definition: QtCanvas.qo.h:495
QAction * fwhmAction
Definition: QtCanvas.qo.h:504
bool getAutoScaleX()
Definition: QtCanvas.qo.h:165
void drawLabels(QPainter *painter)
float channelSelectValue
Definition: QtCanvas.qo.h:558
void setDisplayYUnits(const QString &displayUnits)
QPixmap pixmap
Definition: QtCanvas.qo.h:474
std::pair< double, double > getRangeFor(double zoomFactor, bool zoomIn, double minX, double maxX)
void selectAnnotation(QMouseEvent *event, bool select=true)
Annotation methods.
QString findCoords(double x, double y) const
Looks for a data point corresponding to the world cooordinates (x,y).
std::vector< double > CurveData
bool showTopAxis
Whether or not the user WANTS to see a top axis.
Definition: QtCanvas.qo.h:490
void drawBackBuffer(QPainter *)
void plotPolyLine(const casacore::Vector< T > &, const casacore::Vector< T > &, double beamAngle, double beamArea, casacore::SpectralCoordinate coord)
ErrorData getCurveError(int id)
void setYLabel(const QString &text, int fontSize=10, const QString &font=FONT_NAME)
QString yUnitImage
Definition: QtCanvas.qo.h:498
GraphLabel yLabel
Definition: QtCanvas.qo.h:456