52 #include <QMouseEvent>
53 #include <QToolButton>
56 #include <QVBoxLayout>
57 #include <QPainterPath>
67 class CanvasModeFactory;
69 #define QT_DIAMOND_SIZE 5
98 void getCanvasDomain(
double* minValue,
double* maxValue, QString& units);
146 void setTitle(
const QString &text,
int fontSize = 13,
const QString &font =
FONT_NAME);
155 void setXLabel(
const QString &text,
int fontSize = 10,
157 void setWelcome(
const QString &text,
int fontSize = 14,
310 std::pair<double,double>
getRangeFor(
double zoomFactor,
bool zoomIn,
double minX,
double maxX );
346 double getDataY(
int pixelPosition )
const;
353 double getDataX(
int pixelPosition )
const;
380 QString
findCoords(
double x,
double y )
const;
418 void addDiamond(
int x,
int y,
int diamondSize, QPainterPath& points )
const;
425 void setYLabel(
const QString &text,
int fontSize = 10,
const QString &font =
FONT_NAME);
CanvasModeFactory * modeFactory
bool isDisplayStepFunction() const
Whether or not to plot a line graph or instead plot the points as a step function.
Annotation * selectedAnnotation
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 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
void setGaussianEstimateCount(int count)
bool isAnnotationActive() const
Returns true if the user is in the process of drawing an annotation.
std::map< int, CanvasCurve > curveMap
void setMainCurveColors(const QList< QString > &colors)
void setSummaryCurveColors(const QList< QString > &colors)
void findRedshiftAt(double center, double peak)
void wheelEvent(QWheelEvent *event)
void drawCurves(QPainter *painter)
const int MARGIN_LEFT
Plot Margins.
bool isShowLegend() const
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
bool getShowToolTips() const
void plotPolyLines(QString)
Plotting curves.
void drawAnnotations(QPainter &painter)
int getIndependentCurveCount()
std::vector< Annotation * > annotations
QAction * findRedshiftAction
void addDiamond(int x, int y, int diamondSize, QPainterPath &points) const
QList< MolecularLine * > getMolecularLines() const
double gaussianEstimateX
Profile Fitting Gaussian Estimation.
Annotation * getSelectedAnnotation() const
void createAnnotationText()
void startRangeX(QMouseEvent *event)
void clearCurve(bool inDtor=false)
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
TaskMode taskMode
Indicates the current work focus of the profiler.
void keyReleaseEvent(QKeyEvent *event)
void curveColorsChanged()
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.
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.
int duplicateCurve(QString &targetLabel)
void paintEvent(QPaintEvent *event)
void endZoomRect(QMouseEvent *event)
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)
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
QString getType(QtPlotSettings::AxisIndex axisIndex=QtPlotSettings::xBottom)
std::vector< QtPlotSettings > zoomStack
casacore::Matrix< casacore::uInt > * pMask
void xRangeChanged(double xmin, double xmax)
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
void setShowToolTips(bool toolTipsVisible)
Whether or not to show tool tips with the x,y coordinates of the points on the plot.
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
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.
void setFitCurveColors(const QList< QString > &colors)
Annotation * getActiveAnnotation() const
void mouseMoveEvent(QMouseEvent *event)
QMenu contextMenu
Context Menu.
void endRangeX(QMouseEvent *event)
QList< QString > traditionalCurveColorList
double getDataX(int pixelPosition) const
Maps an x pixel coordinate to a world x value.
void clearMolecularLines(bool refresh=true)
void selectChannel(QMouseEvent *event)
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't do it when there are multiple curves which are no...
void startZoomRect(QMouseEvent *event)
bool topAxisCompatible
We can only show the top axis in the case of multiple curves, when all the curves have equally spaced...
void specFitEstimateSpecified(double xValue, double yValue, bool centerPeak)
void updateRangeX(QMouseEvent *event)
void gaussianCenterPeakSelected()
void setWelcome(const QString &text, int fontSize=14, const QString &font=FONT_NAME)
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.
bool showLegend
Whether the pixel canvas should show a legend with the curves.
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 setTopAxisRange(const casacore::Vector< float > &xValues, bool topAxisDescending)
void setLegendPosition(int position)
void gaussianFWHMSelected()
QList< QString > mainCurveColorList
void storeActiveAnnotation(QMouseEvent *event)
Mouse Events.
void setTitle(const QString &text, int fontSize=13, const QString &font=FONT_NAME)
int getLegendPosition() const
CanvasCurve getCurve(const QString &curveName)
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...
void mouseReleaseEvent(QMouseEvent *event)
QAction * createAnnotationAction
void setAutoScaleX(bool autoScale)
QAction * deleteAnnotationAction
void drawGrid(QPainter *painter)
QColor getCurveColor(int id)
std::vector< double > ErrorData
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)
QList< MolecularLine * > molecularLineStack
QAction * centerPeakAction
void channelRangeSelect(float startVal, float endVal)
void addMolecularLine(MolecularLine *molecularLine)
void channelSelect(float xvalue)
QPoint currentCursorPosition
int getRectLeft() const
Returns the standard left pixel coordinate for the standard drawing rectangle.
std::pair< double, double > topAxisRange
void resetSelectedAnnotation(QMouseEvent *event)
float framePositionX
The x location for the vertical line representing the current frame position.
void keyPressEvent(QKeyEvent *event)
static const QString FONT_NAME
void drawTicks(QPainter *painter)
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
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.
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.
QList< QString > fitSummaryCurveColorList
void setChannelLineColor(QColor color)
void setTraditionalColors(bool traditionalColors)
If this flag is set, only 'traditional' 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...
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.
void drawLabels(QPainter *painter)
void setDisplayYUnits(const QString &displayUnits)
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.
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)