Isis Developer Reference
AbstractFilter.h
Go to the documentation of this file.
1#ifndef AbstractFilter_H
2#define AbstractFilter_H
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <QWidget>
13
14class QBoxLayout;
15class QButtonGroup;
16class QCheckBox;
17template< typename U, typename V > struct QPair;
18class QString;
19template< typename T > class QFlags;
20
21
22namespace Isis {
23 class AbstractFilterSelector;
24 class ControlPoint;
25 class ControlMeasure;
26 class ControlNet;
27
46 class AbstractFilter : public QWidget {
47 Q_OBJECT
48
49 public:
55 Q_DECLARE_FLAGS(FilterEffectivenessFlag, FilterEffectiveness)
56
57
58 public:
59 AbstractFilter(FilterEffectivenessFlag, int minimumForSuccess = -1);
60 AbstractFilter(const AbstractFilter &other);
61 virtual ~AbstractFilter();
62
63 virtual bool canFilterImages() const;
64 virtual bool canFilterPoints() const;
65 virtual bool canFilterMeasures() const;
66
67 virtual bool evaluate(const QPair<QString, ControlNet *> *) const = 0;
68 virtual bool evaluate(const ControlPoint *) const = 0;
69 virtual bool evaluate(const ControlMeasure *) const = 0;
70
71 virtual AbstractFilter *clone() const = 0;
72
73 virtual QString getImageDescription() const;
74 virtual QString getPointDescription() const;
75 virtual QString getMeasureDescription() const;
76
77
78 signals:
80
81
82 protected:
83 bool inclusive() const;
84 int getMinForSuccess() const {
85 return m_minForSuccess;
86 }
87 AbstractFilter::FilterEffectivenessFlag *getEffectivenessFlags() const;
88 QBoxLayout *getMainLayout() const;
89 QBoxLayout *getInclusiveExclusiveLayout() const;
90
91 bool evaluateImageFromPointFilter(const QPair<QString, ControlNet *> *) const;
92 bool evaluateImageFromMeasureFilter(const QPair<QString, ControlNet *> *) const;
94
95 virtual bool evaluate(const ControlPoint *,
96 bool (ControlPoint:: *)() const) const;
97 virtual bool evaluate(const ControlMeasure *,
98 bool (ControlMeasure:: *)() const) const;
99
100
101 private:
102 void createWidget();
103 bool evaluateFromCount(QList< ControlMeasure * >, bool) const;
104 void nullify();
105
106
107 private slots:
108 void updateEffectiveness();
109 void updateMinForSuccess(int);
110
111
112 private:
113 QCheckBox *createEffectivenessCheckBox(QString);
114
115
116 private:
117 QBoxLayout *m_mainLayout;
118 QBoxLayout *m_inclusiveExclusiveLayout;
119 QButtonGroup *m_inclusiveExclusiveGroup;
120 QButtonGroup *m_effectivenessGroup;
121 QWidget *m_minWidget;
122
123
124 private:
125 int m_minForSuccess;
126 FilterEffectivenessFlag *m_effectivenessFlags;
127 QFont *m_smallFont;
128 };
129
130 Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractFilter::FilterEffectivenessFlag)
131}
132
133#endif
Base class for control net filters.
Definition AbstractFilter.h:46
virtual QString getImageDescription() const
Definition AbstractFilter.cpp:96
virtual bool evaluate(const ControlMeasure *) const =0
QBoxLayout * getInclusiveExclusiveLayout() const
Definition AbstractFilter.cpp:262
virtual ~AbstractFilter()
Definition AbstractFilter.cpp:69
FilterEffectiveness
Definition AbstractFilter.h:50
@ Images
Definition AbstractFilter.h:51
@ Points
Definition AbstractFilter.h:52
@ Measures
Definition AbstractFilter.h:53
virtual AbstractFilter * clone() const =0
virtual bool evaluate(const QPair< QString, ControlNet * > *) const =0
bool evaluatePointFromMeasureFilter(const ControlPoint *) const
Definition AbstractFilter.cpp:316
QBoxLayout * getMainLayout() const
Definition AbstractFilter.cpp:256
virtual bool canFilterMeasures() const
Definition AbstractFilter.cpp:91
virtual QString getMeasureDescription() const
Definition AbstractFilter.cpp:106
AbstractFilter(FilterEffectivenessFlag, int minimumForSuccess=-1)
Definition AbstractFilter.cpp:39
virtual bool canFilterImages() const
Definition AbstractFilter.cpp:81
bool evaluateImageFromPointFilter(const QPair< QString, ControlNet * > *) const
Definition AbstractFilter.cpp:290
virtual bool canFilterPoints() const
Definition AbstractFilter.cpp:86
bool evaluateImageFromMeasureFilter(const QPair< QString, ControlNet * > *) const
Definition AbstractFilter.cpp:303
AbstractFilter::FilterEffectivenessFlag * getEffectivenessFlags() const
Definition AbstractFilter.cpp:251
int getMinForSuccess() const
Definition AbstractFilter.h:84
bool inclusive() const
Definition AbstractFilter.cpp:245
virtual QString getPointDescription() const
Definition AbstractFilter.cpp:101
virtual bool evaluate(const ControlPoint *) const =0
a control measurement
Definition ControlMeasure.h:175
A single control point.
Definition ControlPoint.h:356
Definition AbstractFilter.h:19
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
This is free and unencumbered software released into the public domain.
Definition CubeIoHandler.h:23