USGS

Isis 3.0 Object Programmers' Reference

Home

ChooserNameFilter.cpp
1 #include "IsisDebug.h"
2 
3 #include "ChooserNameFilter.h"
4 
5 #include <QString>
6 
7 #include "ControlCubeGraphNode.h"
8 #include "ControlMeasure.h"
9 #include "ControlPoint.h"
10 #include "IString.h"
11 
12 
13 namespace Isis {
14  namespace CnetViz {
15  ChooserNameFilter::ChooserNameFilter(
16  AbstractFilter::FilterEffectivenessFlag flag,
17  int minimumForSuccess) : AbstractStringFilter(flag, minimumForSuccess) {
18  }
19 
20 
21  ChooserNameFilter::ChooserNameFilter(const ChooserNameFilter &other)
22  : AbstractStringFilter(other) {
23  }
24 
25 
26  ChooserNameFilter::~ChooserNameFilter() {
27  }
28 
29 
30  bool ChooserNameFilter::evaluate(const ControlCubeGraphNode *node) const {
31  return evaluateImageFromPointFilter(node);
32  }
33 
34 
35  bool ChooserNameFilter::evaluate(const ControlPoint *point) const {
36  return AbstractStringFilter::evaluate((QString) point->GetChooserName());
37  }
38 
39 
40  bool ChooserNameFilter::evaluate(const ControlMeasure *) const {
41  return true;
42  }
43 
44 
45  AbstractFilter *ChooserNameFilter::clone() const {
46  return new ChooserNameFilter(*this);
47  }
48 
49 
50  QString ChooserNameFilter::getImageDescription() const {
51  QString description = AbstractFilter::getImageDescription();
52 
53  if (getMinForSuccess() == 1)
54  description += "point with it's chooser name ";
55  else
56  description += "points with chooser names ";
57 
58  description += descriptionSuffix();
59  return description;
60  }
61 
62 
63  QString ChooserNameFilter::getPointDescription() const {
64  return "have chooser names " + descriptionSuffix();
65  }
66  }
67 }