Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
FilterWidget.h
Go to the documentation of this file.
1#ifndef FilterWidget_H
2#define FilterWidget_H
3
9
10/* SPDX-License-Identifier: CC0-1.0 */
11
12// parent
13#include <QWidget>
14
15// these are included because it is needed inside a templated method
16#include "FilterGroup.h"
17
18
19class QLabel;
20template< class T > class QList;
21class QPushButton;
22class QString;
23class QTextEdit;
24class QVBoxLayout;
25
26
27namespace Isis {
28 class ControlNet;
29 class ControlMeasure;
30 class ControlPoint;
31 class FilterGroup;
32
57 class FilterWidget : public QWidget {
58 Q_OBJECT
59
60 public:
61 explicit FilterWidget(QString);
63 virtual ~FilterWidget();
64
65 template< typename T >
66 bool evaluate(const T *t, bool (AbstractFilter::*meth)() const) const {
67 // if andFiltersTogether is true then we break out of the loop as
68 // soon as any selectors evaluate to false. If andFiltersTogether
69 // is false then we are ORing them so we break out as soon as any
70 // selector evaluates to true. Whether we are looking for
71 // successes or failures depends on whether we are ANDing or ORing
72 // the filters (selectors) together!!!
73 bool looking = true;
74 for (int i = 0; looking && i < m_filterGroups->size(); i++) {
75 if (m_filterGroups->at(i)->hasFilter(meth))
76 looking = !(m_filterGroups->at(i)->evaluate(t, meth) ^
77 m_andGroupsTogether);
78 }
79
80 // It is good that we are still looking for failures if we were
81 // ANDing filters together, but it is bad if we were ORing them
82 // since in this case we were looking for success (unless of
83 // course there were no filters to look through).
84 return !(looking ^ m_andGroupsTogether) || !hasFilter(meth);
85 }
86
87 bool evaluate(const QPair<QString, ControlNet *> *) const;
88 bool evaluate(const ControlPoint *point) const;
89 bool evaluate(const ControlMeasure *measure) const;
90
91 bool hasFilter(bool (AbstractFilter:: *)() const) const;
92
94
95
96 signals:
99
100
101 private:
102 void nullify();
103 void init();
104 QList< FilterGroup * > groupsWithCondition(
105 bool (FilterGroup:: *)() const) const;
106
107 void updateDescription(QLabel *label,
108 bool (AbstractFilter:: *)() const,
109 QString(AbstractFilter:: *)() const,
110 QString);
111
112 void addGroup(FilterGroup *newGroup);
113
114
115 private slots:
116 void addGroup();
117 void deleteGroup(FilterGroup *);
118 void changeGroupCombinationLogic(int);
119 void updateDescription();
120 void maybeScroll(FilterGroup *);
121
122
123 private:
124 QPushButton *m_addGroupButton;
125 QButtonGroup *m_buttonGroup;
126 QLabel *m_imageDescription;
127 QLabel *m_imageDummy;
128 QLabel *m_pointDescription;
129 QLabel *m_pointDummy;
130 QLabel *m_measureDescription;
131 QLabel *m_measureDummy;
132 QVBoxLayout *m_mainLayout;
133 QWidget *m_logicWidget;
134
135 bool m_andGroupsTogether;
136
137 QList< FilterGroup * > * m_filterGroups;
138 QString *m_filterType;
139 };
140}
141
142#endif
Base class for control net filters.
Definition AbstractFilter.h:45
a control measurement
Definition ControlMeasure.h:175
a control network
Definition ControlNet.h:257
A single control point.
Definition ControlPoint.h:354
This class provides an interface for a group of filters.
Definition FilterGroup.h:40
This widget contains filtering capabilities for a single filter type.
Definition FilterWidget.h:57
bool hasFilter(bool(AbstractFilter::*)() const) const
Definition FilterWidget.cpp:96
bool evaluate(const T *t, bool(AbstractFilter::*meth)() const) const
Definition FilterWidget.h:66
virtual ~FilterWidget()
Definition FilterWidget.cpp:63
FilterWidget(QString)
Definition FilterWidget.cpp:35
FilterWidget & operator=(FilterWidget other)
Definition FilterWidget.cpp:106
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16