scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

DayOfWeek2DoubleFilter.h
Go to the documentation of this file.
1 
12 
30 #ifndef DAY_OF_WEEK2DOUBLE_FILTER_H
31 #define DAY_OF_WEEK2DOUBLE_FILTER_H
32 
33 #include "../AbstractSimpleFilter.h"
34 #include <QDateTime>
35 #include "lib/XmlStreamReader.h"
36 #include <QXmlStreamWriter>
37 
40 {
41  Q_OBJECT
42 
43  public:
44  virtual double valueAt(int row) const {
45  if (!d_inputs.value(0)) return 0;
46  return double(d_inputs.value(0)->dateAt(row).dayOfWeek());
47  }
48 
51 
52  protected:
54  virtual bool inputAcceptable(int, const AbstractColumn *source) {
55  return source->dataType() == SciDAVis::TypeQDateTime;
56  }
57 };
58 
59 #endif // ifndef DAY_OF_WEEK2DOUBLE_FILTER_H
60 
SciDAVis::ColumnDataType
ColumnDataType
Column data type.
Definition: globals.h:77
DayOfWeek2DoubleFilter
Conversion filter QDateTime -> double, translating dates into days of the week (Monday -> 1).
Definition: DayOfWeek2DoubleFilter.h:40
AbstractColumn::dataType
virtual SciDAVis::ColumnDataType dataType() const =0
Return the data type of the column.
DayOfWeek2DoubleFilter::inputAcceptable
virtual bool inputAcceptable(int, const AbstractColumn *source)
Using typed ports: only date-time inputs are accepted.
Definition: DayOfWeek2DoubleFilter.h:54
XmlStreamReader.h
SciDAVis::TypeDouble
@ TypeDouble
Definition: globals.h:78
AbstractSimpleFilter
Simplified filter interface for filters with only one output port.
Definition: AbstractSimpleFilter.h:129
SciDAVis::TypeQDateTime
@ TypeQDateTime
Definition: globals.h:80
DayOfWeek2DoubleFilter::dataType
virtual SciDAVis::ColumnDataType dataType() const
Return the data type of the column.
Definition: DayOfWeek2DoubleFilter.h:50
AbstractFilter::d_inputs
QVector< const AbstractColumn * > d_inputs
The data sources connected to my input ports.
Definition: AbstractFilter.h:275
AbstractColumn
Interface definition for data with column logic.
Definition: AbstractColumn.h:82
DayOfWeek2DoubleFilter::valueAt
virtual double valueAt(int row) const
Return the double value in row 'row'.
Definition: DayOfWeek2DoubleFilter.h:44