Isis 3 Programmer Reference
Kernel.cpp
Go to the documentation of this file.
1 
22 #include "Kernel.h"
23 
24 #include <QString>
25 #include <QStringList>
26 
27 using namespace std;
28 namespace Isis {
32  Kernel::Kernel() {
33  m_kernelType = (Type)0;
34  m_kernels.clear();
35  }
36 
40  Kernel::~Kernel() {
41  }
42 
50  Kernel::Kernel(Type type, const QStringList &data) {
51  m_kernelType = type;
52  m_kernels = data;
53  }
54 
70  Kernel::Type Kernel::typeEnum(const QString &type) {
71  QString strng = type.simplified().trimmed().toUpper();
72  if (strng == "PREDICTED") return Predicted;
73  if (strng == "NADIR") return Nadir;
74  if (strng == "RECONSTRUCTED") return Reconstructed;
75  if (strng == "SMITHED") return Smithed;
76 
77  return (Type)0;
78  };
79 
93  const char *Kernel::typeEnum(const Type &type) {
94  if (type == Predicted) return "Predicted";
95  if (type == Nadir) return "Nadir";
96  if (type == Reconstructed) return "Reconstructed";
97  if (type == Smithed) return "Smithed";
98 
99  return "Unknown";
100  };
101 
106  QStringList Kernel::kernels() {
107  return m_kernels;
108  }
109 
114  Kernel::Type Kernel::type() {
115  return m_kernelType;
116  }
117 
122  void Kernel::setKernels(QStringList data) {
123  m_kernels = data;
124  }
125 
130  void Kernel::setType(const Type &type) {
131  m_kernelType = type;
132  }
133 
138  int Kernel::size() {
139  return m_kernels.size();
140  }
141 
146  void Kernel::push_back(const QString &str) {
147  m_kernels.push_back(str);
148  }
149 
157  QString &Kernel::operator[](const int index) {
158  return m_kernels[index];
159  }
160 
169  QString Kernel::operator[](const int index) const {
170  return m_kernels[index];
171  }
172 
181  bool Kernel::operator<(const Kernel &other) const {
182  return (this->m_kernelType < other.m_kernelType);
183  }
184 } //end namespace isis
Namespace for the standard library.
This class stores Kernel information, including Type and kernel file names.
Definition: Kernel.h:49
Type
Enumeration for type of kernel.
Definition: Kernel.h:54
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Type m_kernelType
Enumeration value indicating the kernel type.
Definition: Kernel.h:88