USGS

Isis 3.0 Developer's Reference (API)

Home

CubeCalculator.h
Go to the documentation of this file.
1 
23 // Calculator.h
24 #ifndef CUBE_CALCULATOR_H_
25 #define CUBE_CALCULATOR_H_
26 
27 #include "Calculator.h"
28 #include "Cube.h"
29 
30 template<class T> class QVector;
31 
32 namespace Isis {
33  class DataValue;
34  class CameraBuffers;
35 
67  public:
70 
75  void Clear();
76 
77  void prepareCalculations(QString equation,
78  QVector<Cube *> &inCubes,
79  Cube *outCube);
80 
82  int line, int band);
83 
84  private:
90  enum Calculations {
92  CallNextMethod,
94  PushNextData
95  };
96 
97  void addMethodCall(void (Calculator::*method)(void));
98 
99  int lastPushToCubeStats(QVector<Cube *> &inCubes);
100 
101  int lastPushToCubeCameras(QVector<Cube *> &inCubes);
102 
108  QVector<Calculations> *m_calculations;
109 
115 
121  // m_data is never used anywhere
122 // QVector< QVector<double> > *m_data;
123 
129  QVector<DataValue> *m_dataDefinitions;
130 
131  QVector<Statistics *> *m_cubeStats;
132 
137  QVector<Camera *> *m_cubeCameras;
138 
139  QVector<CameraBuffers *> *m_cameraBuffers;
140 
141  int m_outputSamples;
142  };
143 
149  class DataValue {
150  public:
171  };
172 
174  m_type = (DataValueType) - 1;
175  m_cubeIndex = -1;
176  m_constantValue = 0.0;
177  }
178 
180  m_type = type;
181  m_constantValue = 0.0;
182  m_cubeIndex = -1;
183  }
184 
185  DataValue(DataValueType type, int cubeIndex) {
186  m_type = type;
187  m_constantValue = 0.0;
188  m_cubeIndex = cubeIndex;
189  }
190 
191  DataValue(DataValueType type, double value) {
192  m_type = type;
193  m_cubeIndex = -1;
194 
195  if(type == Constant) {
196  m_constantValue = value;
197  }
198  }
199 
201  return m_type;
202  }
203 
204  int getCubeIndex() {
205  return m_cubeIndex;
206  }
207 
208  double getConstant() {
209  return m_constantValue;
210  }
211 
212  private:
213  int m_cubeIndex;
214  double m_constantValue;
215 
216  DataValueType m_type;
217  };
218 
225  public:
226  CameraBuffers(Camera *camera);
227  ~CameraBuffers();
228 
229  void enablePhaBuffer();
230  void enableInaBuffer();
231  void enableEmaBuffer();
232  void enableLatBuffer();
233  void enableLonBuffer();
234  void enableResBuffer();
235  void enableRadiusBuffer();
236  void enablePhalBuffer();
237  void enableInalBuffer();
238  void enableEmalBuffer();
239 
240  QVector<double> *getPhaBuffer (int currentLine, int ns);
241  QVector<double> *getInaBuffer (int currentLine, int ns);
242  QVector<double> *getEmaBuffer (int currentLine, int ns);
243  QVector<double> *getLatBuffer (int currentLine, int ns);
244  QVector<double> *getLonBuffer (int currentLine, int ns);
245  QVector<double> *getResBuffer (int currentLine, int ns);
246  QVector<double> *getRadiusBuffer (int currentLine, int ns);
247  QVector<double> *getPhalBuffer (int currentLine, int ns);
248  QVector<double> *getInalBuffer (int currentLine, int ns);
249  QVector<double> *getEmalBuffer (int currentLine, int ns);
250 
251 
252  private:
253  void loadBuffers (int currentLine, int ns);
254 
255  Camera *m_camera;
256  int m_lastLine;
257 
258  QVector<double> *m_phaBuffer;
259  QVector<double> *m_inaBuffer;
260  QVector<double> *m_emaBuffer;
261  QVector<double> *m_phalBuffer;
262  QVector<double> *m_inalBuffer;
263  QVector<double> *m_emalBuffer;
264  QVector<double> *m_resBuffer;
265  QVector<double> *m_latBuffer;
266  QVector<double> *m_lonBuffer;
267  QVector<double> *m_radiusBuffer;
268  };
269 }
270 #endif