Filter Class Reference

Abstract base class for data analysis operations. More...

#include <Filter.h>

Inheritance diagram for Filter:
Convolution Correlation Differentiation FFT FFTFilter Fit Integration Interpolation SmoothFilter

List of all members.

Public Member Functions

int dataSize ()
 Returns the size of the input data set.
virtual void enableGraphicsDisplay (bool on=true, Graph *g=0)
bool error ()
 Filter (ApplicationWindow *parent, QwtPlotCurve *c)
 Filter (ApplicationWindow *parent, Graph *g=0, const QString &name=QString())
 Filter (ApplicationWindow *parent, Table *t=0, const QString &name=QString())
virtual QString legendInfo ()
 Output string added to the plot as a new legend.
GraphoutputGraph ()
 Returns a pointer to the graph where the result curve should be displayed.
TableresultTable ()
 Returns a pointer to the table created to display the results.
virtual bool run ()
 Actually does the job. Should be reimplemented in derived classes.
void setColor (const QString &colorName)
 Sets the color of the output fit curve. Provided for convenience. To be used in scripts only!
void setColor (int colorId)
 Sets the color of the output fit curve.
virtual void setDataCurve (QwtPlotCurve *curve, double start, double end)
bool setDataFromCurve (const QString &curveTitle, double from, double to, Graph *g=0)
bool setDataFromCurve (const QString &curveTitle, Graph *g=0)
bool setDataFromCurve (QwtPlotCurve *c, double from, double to)
bool setDataFromCurve (QwtPlotCurve *c)
virtual bool setDataFromTable (Table *, const QString &, const QString &, int=1, int=-1)
void setInterval (double from, double to)
 Changes the data range if the source curve was already assigned. Provided for convenience.
void setMaximumIterations (int iter)
 Sets the maximum number of iterations to be performed during an iterative session.
void setOutputPoints (int points)
 Sets the number of points in the output curve.
void setOutputPrecision (int digits)
 Sets the precision used for the output.
void setTolerance (double eps)
 Sets the tolerance used by the GSL routines.
virtual void showLegend ()
 Adds a new legend to the plot. Calls virtual legendInfo().
double * x ()
 Returns the x values of the input data set.
double * y ()
 Returns the y values of the input data set.
 ~Filter ()

Protected Member Functions

QwtPlotCurve * addResultCurve (double *x, double *y)
 Adds the result curve to the target output plot window. Creates a hidden table and frees the input data from memory.
virtual void calculateOutputData (double *X, double *Y)
 Calculates the data for the output curve and store it in the X an Y vectors.
MultiLayercreateOutputGraph ()
virtual int curveData (QwtPlotCurve *c, double start, double end, double **x, double **y)
int curveIndex (const QString &curveTitle, Graph *g)
 Performs checks and returns the index of the source data curve if OK, -1 otherwise.
int curveRange (QwtPlotCurve *c, double start, double end, int *iStart, int *iEnd)
virtual void freeMemory ()
 Frees the memory allocated for the X and Y data sets.
void init ()
virtual QString logInfo ()
 Output string added to the log pannel of the application.
void memoryErrorMessage ()
virtual void output ()
 Performs the data analysis and takes care of the output.
virtual int sortedCurveData (QwtPlotCurve *c, double start, double end, double **x, double **y)
 Same as curveData, but sorts the points by their x value.

Protected Attributes

QwtPlotCurve * d_curve
 The curve to be analysed.
int d_curveColorIndex
 Color index of the result curve.
QString d_explanation
 String explaining the operation in the comment of the result table and in the project explorer.
double d_from
 Data interval.
Graphd_graph
 The source graph with the curve to be analyzed.
bool d_graphics_display
 Specifies if the filter should display a result curve.
bool d_init_err
 Error flag telling if something went wrong during the initialization phase.
int d_max_iterations
 Maximum number of iterations per fit.
int d_min_points
 Minimum number of data points necessary to perform the operation.
int d_n
 Size of the data arrays.
Graphd_output_graph
 The graph where the result curve should be displayed.
int d_points
 Number of result points to de calculated and displayed in the output curve.
int d_prec
 Precision (number of significant digits) used for the results output.
Tabled_result_table
 The table displaying the results of the filtering operation (not alvays valid!).
bool d_sort_data
 Specifies if the filter needs sorted data as input.
Tabled_table
 A table source of data.
double d_to
double d_tolerance
 GSL Tolerance, if ever needed...
double * d_x
 x data set to be analysed
double * d_y
 y data set to be analysed
QString d_y_col_name

Detailed Description

Abstract base class for data analysis operations.


Constructor & Destructor Documentation

Filter::Filter ( ApplicationWindow parent,
Table t = 0,
const QString &  name = QString() 
)

References d_table, and init().

Filter::Filter ( ApplicationWindow parent,
Graph g = 0,
const QString &  name = QString() 
)

References d_graph, d_output_graph, and init().

Filter::Filter ( ApplicationWindow parent,
QwtPlotCurve *  c 
)

References init().

Filter::~Filter (  ) 

References d_n, and freeMemory().


Member Function Documentation

QwtPlotCurve * Filter::addResultCurve ( double *  x,
double *  y 
) [protected]
virtual void Filter::calculateOutputData ( double *  X,
double *  Y 
) [inline, protected, virtual]

Calculates the data for the output curve and store it in the X an Y vectors.

Reimplemented in FFTFilter, Interpolation, and SmoothFilter.

Referenced by output().

MultiLayer * Filter::createOutputGraph (  )  [protected]
int Filter::curveData ( QwtPlotCurve *  c,
double  start,
double  end,
double **  x,
double **  y 
) [protected, virtual]

Sets x and y to the curve points between start and end. Memory will be allocated with new double[]. Returns the number of points within range == size of x and y arrays.

References curveRange(), and memoryErrorMessage().

Referenced by setDataCurve().

int Filter::curveIndex ( const QString &  curveTitle,
Graph g 
) [protected]

Performs checks and returns the index of the source data curve if OK, -1 otherwise.

References Graph::curveIndex(), d_graph, d_init_err, and d_output_graph.

Referenced by setDataFromCurve().

int Filter::curveRange ( QwtPlotCurve *  c,
double  start,
double  end,
int *  iStart,
int *  iEnd 
) [protected]

Referenced by curveData(), and sortedCurveData().

int Filter::dataSize (  )  [inline]
void Filter::enableGraphicsDisplay ( bool  on = true,
Graph g = 0 
) [virtual]
bool Filter::error (  )  [inline]
void Filter::freeMemory (  )  [protected, virtual]

Frees the memory allocated for the X and Y data sets.

Reimplemented in Fit.

References d_x, and d_y.

Referenced by setDataCurve(), setDataFromTable(), FFT::setDataFromTable(), Correlation::setDataFromTable(), Convolution::setDataFromTable(), and ~Filter().

void Filter::init (  )  [protected]
virtual QString Filter::legendInfo (  )  [inline, virtual]

Output string added to the plot as a new legend.

Reimplemented in Fit, NonLinearFit, and PolynomialFit.

Referenced by showLegend().

virtual QString Filter::logInfo (  )  [inline, protected, virtual]

Output string added to the log pannel of the application.

Reimplemented in Integration.

Referenced by run().

void Filter::memoryErrorMessage (  )  [protected]
void Filter::output (  )  [protected, virtual]

Performs the data analysis and takes care of the output.

Reimplemented in Convolution, Deconvolution, Correlation, Differentiation, FFT, and Integration.

References addResultCurve(), calculateOutputData(), and d_points.

Referenced by run().

Graph* Filter::outputGraph (  )  [inline]

Returns a pointer to the graph where the result curve should be displayed.

References d_output_graph.

Referenced by ApplicationWindow::differentiate().

Table* Filter::resultTable (  )  [inline]

Returns a pointer to the table created to display the results.

References d_result_table.

bool Filter::run (  )  [virtual]
void Filter::setColor ( const QString &  colorName  ) 

Sets the color of the output fit curve. Provided for convenience. To be used in scripts only!

References ColorBox::colorIndex(), d_curveColorIndex, and ColorBox::isValidColor().

void Filter::setColor ( int  colorId  )  [inline]
void Filter::setDataCurve ( QwtPlotCurve *  curve,
double  start,
double  end 
) [virtual]
bool Filter::setDataFromCurve ( const QString &  curveTitle,
double  from,
double  to,
Graph g = 0 
)
bool Filter::setDataFromCurve ( const QString &  curveTitle,
Graph g = 0 
)
bool Filter::setDataFromCurve ( QwtPlotCurve *  c,
double  from,
double  to 
)
bool Filter::setDataFromCurve ( QwtPlotCurve *  c  ) 
bool Filter::setDataFromTable ( Table t,
const QString &  xColName,
const QString &  yColName,
int  startRow = 1,
int  endRow = -1 
) [virtual]
void Filter::setInterval ( double  from,
double  to 
)

Changes the data range if the source curve was already assigned. Provided for convenience.

References d_curve, and setDataFromCurve().

void Filter::setMaximumIterations ( int  iter  )  [inline]

Sets the maximum number of iterations to be performed during an iterative session.

References d_max_iterations.

Referenced by IntDialog::accept(), and FitDialog::accept().

void Filter::setOutputPoints ( int  points  )  [inline]

Sets the number of points in the output curve.

References d_points.

Referenced by InterpolationDialog::interpolate().

void Filter::setOutputPrecision ( int  digits  )  [inline]
void Filter::setTolerance ( double  eps  )  [inline]

Sets the tolerance used by the GSL routines.

References d_tolerance.

Referenced by IntDialog::accept(), and FitDialog::accept().

void Filter::showLegend (  )  [virtual]
int Filter::sortedCurveData ( QwtPlotCurve *  c,
double  start,
double  end,
double **  x,
double **  y 
) [protected, virtual]

Same as curveData, but sorts the points by their x value.

Reimplemented in Interpolation.

References curveRange(), and memoryErrorMessage().

Referenced by setDataCurve().

double* Filter::x (  )  [inline]
double* Filter::y (  )  [inline]

Member Data Documentation

QwtPlotCurve* Filter::d_curve [protected]
int Filter::d_curveColorIndex [protected]
QString Filter::d_explanation [protected]
double Filter::d_from [protected]
Graph* Filter::d_graph [protected]
bool Filter::d_graphics_display [protected]
bool Filter::d_init_err [protected]
int Filter::d_max_iterations [protected]
int Filter::d_min_points [protected]
int Filter::d_n [protected]

Size of the data arrays.

Referenced by Correlation::addResultCurve(), Convolution::addResultCurve(), SigmoidalFit::calculateFitCurveData(), LinearSlopeFit::calculateFitCurveData(), LinearFit::calculateFitCurveData(), PolynomialFit::calculateFitCurveData(), PluginFit::calculateFitCurveData(), NonLinearFit::calculateFitCurveData(), GaussAmpFit::calculateFitCurveData(), LogisticFit::calculateFitCurveData(), ThreeExpFit::calculateFitCurveData(), TwoExpFit::calculateFitCurveData(), ExponentialFit::calculateFitCurveData(), Interpolation::calculateOutputData(), FFTFilter::calculateOutputData(), dataSize(), Fit::errors(), FFT::fftCurve(), FFT::fftTable(), LinearSlopeFit::fit(), LinearFit::fit(), PolynomialFit::fit(), Fit::fit(), Fit::fitGSL(), MultiPeakFit::generateFitCurve(), Fit::generateFitCurve(), SigmoidalFit::guessInitialValues(), GaussAmpFit::guessInitialValues(), MultiPeakFit::guessInitialValues(), LogisticFit::guessInitialValues(), SmoothFilter::init(), Fit::init(), init(), FFTFilter::init(), Integration::Integration(), Fit::lcl(), Fit::legendInfo(), Fit::logFitInfo(), Integration::logInfo(), FFT::output(), Differentiation::output(), Correlation::output(), NonLinearFit::removeDataSingularities(), NonLinearFit::removePole(), Fit::residuals(), Fit::rmse(), Fit::rSquare(), run(), Fit::setDataCurve(), setDataCurve(), Fit::setDataFromTable(), setDataFromTable(), FFT::setDataFromTable(), Correlation::setDataFromTable(), Convolution::setDataFromTable(), Interpolation::setMethod(), Fit::setWeightingData(), Fit::showConfidenceLimits(), Fit::showPredictionLimits(), Fit::showResiduals(), SmoothFilter::smoothAverage(), SmoothFilter::smoothFFT(), SmoothFilter::smoothLowess(), SmoothFilter::smoothSavGol(), Integration::trapez(), Fit::ucl(), Fit::writeParametersToTable(), and ~Filter().

int Filter::d_points [protected]
int Filter::d_prec [protected]

The table displaying the results of the filtering operation (not alvays valid!).

Referenced by addResultCurve(), MultiPeakFit::generateFitCurve(), init(), FFT::output(), Differentiation::output(), Correlation::output(), Deconvolution::output(), Convolution::output(), and resultTable().

bool Filter::d_sort_data [protected]
Table* Filter::d_table [protected]
double Filter::d_to [protected]
double Filter::d_tolerance [protected]
double* Filter::d_x [protected]
double* Filter::d_y [protected]
QString Filter::d_y_col_name [protected]

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

Generated by  doxygen 1.6.2