Commit a714c4e1 authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Clang-format changes. Get project to build again on OSX.

parent f3ebfa21
......@@ -44,10 +44,10 @@ public:
explicit LegendWidget(Plot *);
~LegendWidget() override;
void clone(LegendWidget* t);
QwtPlot *plot(){return d_plot;};
void clone(LegendWidget *t);
QwtPlot *plot() { return d_plot; };
//! The kinds of frame a LegendWidget can draw around the Text.
//! The kinds of frame a LegendWidget can draw around the Text.
enum FrameStyle{None = 0, Line = 1, Shadow = 2};
QString text(){return d_text->text();};
......@@ -103,9 +103,9 @@ private:
};
//! Parent plot
Plot *d_plot;
Plot *d_plot;
//! Frame type
//! Frame type
int d_frame;
//! Rotation angle: not implemented yet
......
......@@ -71,12 +71,13 @@ class LineProfileTool : public QWidget, public PlotToolInterface
return PlotToolInterface::Rtti_LineProfileTool;
};
signals:
/** Emitted whenever a new message should be presented to the user.
*
* You don't have to connect to this signal if you alreay specified a reciever during initialization.
*/
void statusText(const QString&);
signals:
/** Emitted whenever a new message should be presented to the user.
*
* You don't have to connect to this signal if you alreay specified a reciever
*during initialization.
*/
void statusText(const QString&);
protected:
int averageImagePixel(const QImage &image, int px, int py, bool moreHorizontal);
......@@ -85,18 +86,21 @@ class LineProfileTool : public QWidget, public PlotToolInterface
*/
void paintEvent(QPaintEvent *e) override;
/**\brief Pressing the left mouse button starts line selection.
*
* Clicks with anything else than the left button are propagated to the parent as usual.
*/
*
* Clicks with anything else than the left button are propagated
*to the parent as usual.
*/
void mousePressEvent(QMouseEvent *e) override;
/**\brief Mouse movements need to be monitored for updating the line during operation.
*/
/**\brief Mouse movements need to be monitored for updating the
* line during operation.
*/
void mouseMoveEvent(QMouseEvent *e) override;
/**\brief Mouse releases end line selection and cause the profile to be displayed.
*/
/**\brief Mouse releases end line selection and cause the
* profile to be displayed.
*/
void mouseReleaseEvent(QMouseEvent *e) override;
private:
private:
ApplicationWindow *d_app;
//! Number of image pixels over which to average.
int d_average_pixels;
......
......@@ -47,8 +47,8 @@ class LogisticFit : public Fit
par[1];
};
private:
void init();
private:
void init();
void calculateFitCurveData(double *X, double *Y) override;
};
......
......@@ -19,9 +19,9 @@ public:
explicit loadDAEDlg(QWidget *parent = 0);
~loadDAEDlg() override;
const QString& getHostName() { return m_hostName; }
const QString& getWorkspaceName() { return m_workspaceName; }
const QString& getSpectrumMin() { return m_spectrum_min; }
const QString &getHostName() { return m_hostName; }
const QString &getWorkspaceName() { return m_workspaceName; }
const QString& getSpectrumMin() { return m_spectrum_min; }
const QString& getSpectrumMax() { return m_spectrum_max; }
const QString& getSpectrumList() { return m_spectrum_list; }
int updateInterval(){return m_updateInterval;}
......
......@@ -53,9 +53,9 @@ public:
private slots:
//! Accept changes and quit
void accept() override;
//! Apply changes
void apply();
//! Activate the numeric precision choice box
//! Apply changes
void apply();
//! Activate the numeric precision choice box
void showPrecisionBox(int item);
private:
......
......@@ -78,9 +78,9 @@ public:
const QModelIndex &parent = QModelIndex()) override;
virtual double x(int col) const;
virtual double y(int row) const;
virtual double y(int row) const;
virtual double cell(int row, int col) const;
virtual double cell(int row, int col) const;
virtual void setCell(int row, int col, double val);
virtual QString text(int row, int col);
......@@ -99,14 +99,15 @@ public:
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
virtual void setImage(const QImage& image);
virtual void setImage(const QImage &image);
virtual
bool importASCII(const QString &fname, const QString &sep, int ignoredLines, bool stripSpaces,
bool simplifySpaces, const QString& commentString, int importAs,
const QLocale& locale, int endLineChar = 0, int maxRows = -1);
virtual bool importASCII(const QString &fname, const QString &sep,
int ignoredLines, bool stripSpaces,
bool simplifySpaces, const QString &commentString,
int importAs, const QLocale &locale,
int endLineChar = 0, int maxRows = -1);
void setLocale(const QLocale& locale){d_locale = locale;};
void setLocale(const QLocale& locale){d_locale = locale;};
void setNumericFormat(char f, int prec);
virtual bool initWorkspace();
......
......@@ -53,8 +53,8 @@ public:
private slots:
//! Accept changes and quit
void accept() override;
//! Apply changes
void apply();
//! Apply changes
void apply();
private:
QPushButton* buttonOk, *buttonApply;
......
......@@ -63,7 +63,7 @@ private:
QSize sizeHint() const override;
void customEvent(QEvent *e) override;
ScriptEditor* commands;
ScriptEditor *commands;
QPushButton* btnCancel;
QSpinBox *startRow, *endRow, *startCol, *endCol;
QPushButton *btnApply;
......
......@@ -155,14 +155,15 @@ public slots:
void exportImage(const QString& fileName, int quality = 100, bool transparent = false);
void exportSVG(const QString& fname);
void exportPDF(const QString &fname) override;
void exportVector(const QString& fileName, int res = 0, bool color = true,
bool keepAspect = true, QPrinter::PageSize pageSize = QPrinter::Custom);
void exportVector(const QString &fileName, int res = 0,
bool color = true, bool keepAspect = true,
QPrinter::PageSize pageSize = QPrinter::Custom);
void copyAllLayers();
void copyAllLayers();
void print() override;
void printAllLayers(QPainter *painter);
void printActiveLayer();
//@}
void printActiveLayer();
//@}
void setFonts(const QFont& titleFnt, const QFont& scaleFnt,
const QFont& numbersFnt, const QFont& legendFnt);
......@@ -221,8 +222,8 @@ private:
void wheelEvent(QWheelEvent *) override;
void keyPressEvent(QKeyEvent *) override;
bool eventFilter(QObject *object, QEvent *) override;
void releaseLayer();
void resizeLayers(QResizeEvent *re);
void releaseLayer();
void resizeLayers(QResizeEvent *re);
bool focusNextPrevChild(bool next) override;
void dragEnterEvent(QDragEnterEvent *event) override;
void dropEvent(QDropEvent *event) override;
......
......@@ -57,20 +57,20 @@ class MultiPeakFit : public Fit
double eval(double *par, double x) override;
double evalPeak(double *par, double x, int peak);
private:
void init(int);
private:
void init(int);
QString logFitInfo(int iterations, int status) override;
void generateFitCurve() override;
static QString peakFormula(int peakIndex, PeakProfile profile);
//! Inserts a peak function curve into the plot
void insertPeakFunctionCurve(double *x, double *y, int peak);
//! Inserts a peak function curve into the plot
void insertPeakFunctionCurve(double *x, double *y, int peak);
void customizeFitResults() override;
//! Number of peaks
int d_peaks;
int d_peaks;
//! Tells weather the peak curves should be displayed together with the best line fit.
//! Tells weather the peak curves should be displayed together with the best line fit.
bool generate_peak_curves;
//! Color index for the peak curves
......@@ -121,8 +121,8 @@ class GaussAmpFit : public Fit
void guessInitialValues() override;
double eval(double *par, double x) override;
private:
void init();
private:
void init();
void calculateFitCurveData(double *X, double *Y) override;
};
#endif
......@@ -55,12 +55,13 @@ class MultiPeakFitTool : public QObject, public PlotToolInterface
int rtti() const override {
return PlotToolInterface::Rtti_MultiPeakFitTool;
};
signals:
/** Emitted whenever a new message should be presented to the user.
*
* You don't have to connect to this signal if you alreay specified a reciever during initialization.
*/
void statusText(const QString&);
signals:
/** Emitted whenever a new message should be presented to the user.
*
* You don't have to connect to this signal if you alreay specified a reciever
*during initialization.
*/
void statusText(const QString&);
protected slots:
void selectPeak(QwtPlotCurve *curve, int point_index);
private:
......
......@@ -46,8 +46,8 @@ class NonLinearFit : public Fit
void setParametersList(const QStringList &lst) override;
void setFormula(const QString &s) override;
private:
void calculateFitCurveData(double *X, double *Y) override;
private:
void calculateFitCurveData(double *X, double *Y) override;
void init();
};
#endif
......@@ -126,15 +126,16 @@ protected:
const QwtScaleMap map[axisCnt],
const QwtPlotPrintFilter &pfilter) const override;
void drawInwardTicks(QPainter *painter, const QRect &rect,
const QwtScaleMap&map, int axis, bool min, bool maj) const;
void drawInwardTicks(QPainter *painter, const QRect &rect,
const QwtScaleMap &map, int axis, bool min,
bool maj) const;
void drawBreak(QPainter *painter, const QRect &rect, const QwtScaleMap &map, int axis) const;
bool eventFilter(QObject *obj, QEvent *ev) override;
Grid *d_grid;
QMap<int, QwtPlotItem*> d_curves;
QMap<int, QwtPlotMarker*> d_markers;
Grid *d_grid;
QMap<int, QwtPlotItem *> d_curves;
QMap<int, QwtPlotMarker*> d_markers;
int minTickLength, majTickLength;
int marker_key;
......
......@@ -65,10 +65,10 @@ public:
private slots:
void accept() override;
bool updatePlot();
bool updatePlot();
void pickTitleFont();
void viewAxisOptions(int axis);
void pickTitleFont();
void viewAxisOptions(int axis);
QFont axisFont(int axis);
void pickAxisLabelFont();
void pickNumbersFont();
......
......@@ -105,7 +105,7 @@ public slots:
//! Accept settings, close the dialog
void accept() override;
//! Add column as Z
void addZCol();
void addZCol();
private:
void plot3D(const QStringList& lst);
......
......@@ -46,9 +46,9 @@ class PluginFit : public Fit
return f_eval(x, par);
};
private:
void init();
typedef double (*fitFunctionEval)(double, double *);
private:
void init();
typedef double (*fitFunctionEval)(double, double *);
void calculateFitCurveData(double *X, double *Y) override;
fitFunctionEval f_eval;
};
......
......@@ -44,20 +44,20 @@ class PolynomialFit : public Fit
QString legendInfo() override;
void fit() override;
int order(){return d_order;};
void setOrder(int order);
int order() { return d_order; };
void setOrder(int order);
static QString generateFormula(int order);
static QString generateFormula(int order);
static QStringList generateParameterList(int order);
double eval(double *par, double x) override;
private:
void init();
private:
void init();
void calculateFitCurveData(double *X, double *Y) override;
int d_order;
bool show_legend;
bool show_legend;
};
class LinearFit : public Fit
......@@ -75,8 +75,8 @@ class LinearFit : public Fit
return par[0] + par[1] * x;
};
private:
void init();
private:
void init();
void calculateFitCurveData(double *X, double *Y) override;
};
......@@ -95,8 +95,8 @@ class LinearSlopeFit : public Fit
return par[0] * x;
};
private:
void init();
private:
void init();
void calculateFitCurveData(double *X, double *Y) override;
};
#endif
......@@ -43,10 +43,10 @@ public:
QwtDoubleRect boundingRect() const override;
BarStyle orientation(){return bar_style;};
BarStyle orientation() { return bar_style; };
void setGap (int gap);
int gap() const {return bar_gap;};
void setGap(int gap);
int gap() const {return bar_gap;};
void setOffset(int offset);
int offset() const {return bar_offset;};
......@@ -59,7 +59,7 @@ private:
const QwtScaleMap &yMap, int from, int to) const override;
int bar_gap, bar_offset;
BarStyle bar_style;
BarStyle bar_style;
};
#endif
......@@ -42,8 +42,8 @@ public:
QwtDoubleRect boundingRect() const override;
void setBinning(bool autoBin, double size, double begin, double end);
bool autoBinning(){return d_autoBin;};
double begin(){return d_begin;};
bool autoBinning() { return d_autoBin; };
double begin(){return d_begin;};
double end(){return d_end;};
double binSize(){return d_bin_size;};
......@@ -60,12 +60,13 @@ public:
private:
void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap,
int from, int to) const override;
// Implement overloaded virtual method to just pass up to the base class to avoid
// an Intel compiler warning
// Implement overloaded virtual method to just pass up to the base class to
// avoid
// an Intel compiler warning
void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRect &rect) const override {
DataCurve::draw(p,xMap,yMap,rect);
}
DataCurve::draw(p, xMap, yMap, rect);
}
void loadDataFromMatrix();
Matrix *d_matrix;
......
......@@ -55,14 +55,20 @@ class RangeSelectorTool : public QwtPlotPicker, public PlotToolInterface
public:
RangeSelectorTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
~RangeSelectorTool() override;
double minXValue() const { return QMIN(d_active_marker.xValue(), d_inactive_marker.xValue()); }
double maxXValue() const { return QMAX(d_active_marker.xValue(), d_inactive_marker.xValue()); }
int dataSize() const { return qAbs(d_active_point - d_inactive_point); }
double minXValue() const {
return QMIN(d_active_marker.xValue(),
d_inactive_marker.xValue());
}
double maxXValue() const {
return QMAX(d_active_marker.xValue(),
d_inactive_marker.xValue());
}
int dataSize() const { return qAbs(d_active_point - d_inactive_point); }
bool eventFilter(QObject *obj, QEvent *event) override;
bool keyEventFilter(QKeyEvent *ke);
QwtPlotCurve *selectedCurve() const { return d_selected_curve; }
//! Caller is responsible for replot.
QwtPlotCurve *selectedCurve() const { return d_selected_curve; }
//! Caller is responsible for replot.
void setSelectedCurve(QwtPlotCurve *curve);
void copySelection();
......@@ -72,26 +78,27 @@ class RangeSelectorTool : public QwtPlotPicker, public PlotToolInterface
int rtti() const override {
return PlotToolInterface::Rtti_RangeSelector;
};
bool isVisible(){return d_visible;};
bool isVisible() { return d_visible; };
public slots:
virtual void pointSelected(const QPoint &point);
public slots:
virtual void pointSelected(const QPoint &point);
void setCurveRange();
void setEnabled(bool on = true) override;
signals:
/** Emitted whenever a new message should be presented to the user.
*
* You don't have to connect to this signal if you alreay specified a reciever during initialization.
*/
void statusText(const QString&);
signals:
/** Emitted whenever a new message should be presented to the user.
*
* You don't have to connect to this signal if you alreay specified a reciever
*during initialization.
*/
void statusText(const QString&);
//! Emitted whenever the selected curve and/or range have changed.
void changed();
protected:
void append(const QPoint &point) override { pointSelected(point); }
void emitStatusText();
void switchActiveMarker();
//! Caller is responsible for replot.
void emitStatusText();
void switchActiveMarker();
//! Caller is responsible for replot.
void setActivePoint(int index);
private:
QwtPlotMarker d_active_marker, d_inactive_marker;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment