Isis 3 Developer Reference
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 class QString;
31 template<class T> class QVector;
32 
33 namespace Isis {
34  class DataValue;
35  class CameraBuffers;
36 
73  public:
76 
81  void Clear();
82 
83  void prepareCalculations(QString equation,
84  QVector<Cube *> &inCubes,
85  Cube *outCube);
86 
88  int line, int band);
89 
90  private:
96  enum Calculations {
98  CallNextMethod,
100  PushNextData
101  };
102 
103  void addMethodCall(void (Calculator::*method)(void));
104 
105  int lastPushToCubeStats(QVector<Cube *> &inCubes);
106 
107  int lastPushToCubeCameras(QVector<Cube *> &inCubes);
108 
114  QVector<Calculations> *m_calculations;
115 
118 
120  QVector<DataValue> *m_dataDefinitions;
121 
123  QVector<Statistics *> *m_cubeStats;
124 
129  QVector<Camera *> *m_cubeCameras;
130 
135  QVector<CameraBuffers *> *m_cameraBuffers;
136 
137  int m_outputSamples;
138  };
139 
140 
147  class DataValue {
148  public:
169  };
170 
171  DataValue();
174  DataValue(DataValueType type, double value);
175 
177  int cubeIndex();
178  double constant();
179 
180  private:
181  int m_cubeIndex;
182  double m_constantValue;
183 
184  DataValueType m_type;
185  };
186 
187 
203  public:
204  CameraBuffers(Camera *camera);
205  ~CameraBuffers();
206 
207  void enablePhaBuffer();
208  void enableInaBuffer();
209  void enableEmaBuffer();
210  void enableLatBuffer();
211  void enableLonBuffer();
212  void enableResBuffer();
213  void enableRadiusBuffer();
214  void enablePhalBuffer();
215  void enableInalBuffer();
216  void enableEmalBuffer();
217  void enablePhacBuffer();
218  void enableInacBuffer();
219  void enableEmacBuffer();
220 
221  // Accessors
222  QVector<double> *phaBuffer(int currentLine, int ns, int currentBand);
223  QVector<double> *inaBuffer(int currentLine, int ns, int currentBand);
224  QVector<double> *emaBuffer(int currentLine, int ns, int currentBand);
225  QVector<double> *latBuffer(int currentLine, int ns, int currentBand);
226  QVector<double> *lonBuffer(int currentLine, int ns, int currentBand);
227  QVector<double> *resBuffer(int currentLine, int ns, int currentBand);
228  QVector<double> *radiusBuffer(int currentLine, int ns, int currentBand);
229  QVector<double> *phalBuffer(int currentLine, int ns, int currentBand);
230  QVector<double> *inalBuffer(int currentLine, int ns, int currentBand);
231  QVector<double> *emalBuffer(int currentLine, int ns, int currentBand);
232  QVector<double> *phacBuffer(int currentLine, int ns, int currentBand);
233  QVector<double> *inacBuffer(int currentLine, int ns, int currentBand);
234  QVector<double> *emacBuffer(int currentLine, int ns, int currentBand);
235 
236 
237  private:
238  void loadBuffers(int currentLine, int ns, int currentBand);
239 
240  Camera *m_camera;
241  int m_lastLine;
242 
243  QVector<double> *m_phaBuffer;
244  QVector<double> *m_inaBuffer;
245  QVector<double> *m_emaBuffer;
246  QVector<double> *m_phalBuffer;
247  QVector<double> *m_inalBuffer;
248  QVector<double> *m_emalBuffer;
249  QVector<double> *m_phacBuffer;
250  QVector<double> *m_inacBuffer;
251  QVector<double> *m_emacBuffer;
252  QVector<double> *m_resBuffer;
253  QVector<double> *m_latBuffer;
254  QVector<double> *m_lonBuffer;
255  QVector<double> *m_radiusBuffer;
256  };
257 }
258 #endif
QVector< double > * phacBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1140
Center phase camera data.
Definition: CubeCalculator.h:168
void enableEmalBuffer()
Enables the local emission angle buffer for use.
Definition: CubeCalculator.cpp:1057
void enableEmaBuffer()
Enables the emission angle buffer for use.
Definition: CubeCalculator.cpp:1015
QVector< double > * resBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1110
void enableResBuffer()
Enables the resolution buffer for use.
Definition: CubeCalculator.cpp:1033
This class is used to define what kind of data is being pushed onto the cube calculator.
Definition: CubeCalculator.h:147
void prepareCalculations(QString equation, QVector< Cube *> &inCubes, Cube *outCube)
This method builds a list of actions to perform based on the postfix expression.
Definition: CubeCalculator.cpp:264
DataValue()
Constructs a default DataValue.
Definition: CubeCalculator.cpp:855
Current line number.
Definition: CubeCalculator.h:153
void enableRadiusBuffer()
Enables the radius buffer for use.
Definition: CubeCalculator.cpp:1039
DEM radius.
Definition: CubeCalculator.h:162
This class is used to manage buffers for calculating camera related information, such as angles...
Definition: CubeCalculator.h:202
Local phase camera data.
Definition: CubeCalculator.h:165
Incidence camera data.
Definition: CubeCalculator.h:156
QVector< double > * inaBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1086
Pixel resolution camera data.
Definition: CubeCalculator.h:161
A single constant value.
Definition: CubeCalculator.h:151
Local emission camera data.
Definition: CubeCalculator.h:164
Center incidence camera data.
Definition: CubeCalculator.h:166
Definition: Camera.h:249
QVector< double > * emaBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1092
void enablePhaBuffer()
Enables the phase angle buffer for use.
Definition: CubeCalculator.cpp:1003
DataValueType type()
Accesses the type of the DataValue.
Definition: CubeCalculator.cpp:918
Current sample number.
Definition: CubeCalculator.h:152
QVector< double > * phalBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1122
DataValueType
This is used to tell what kind of data to push onto the RPN calculator.
Definition: CubeCalculator.h:150
QVector< double > * latBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1098
Longitude camera data.
Definition: CubeCalculator.h:160
QVector< double > runCalculations(QVector< Buffer *> &cubeData, int line, int band)
This method will execute the calculations built up when PrepareCalculations was called.
Definition: CubeCalculator.cpp:129
void enableInaBuffer()
Enables the incidence angle buffer for use.
Definition: CubeCalculator.cpp:1009
void enableInacBuffer()
Enables the center incidence angle buffer for use.
Definition: CubeCalculator.cpp:1069
void enablePhalBuffer()
Enables the local phase angle buffer for use.
Definition: CubeCalculator.cpp:1045
void enableEmacBuffer()
Enables the center emission angle buffer for use.
Definition: CubeCalculator.cpp:1075
void enablePhacBuffer()
Enables the center phase angle buffer for use.
Definition: CubeCalculator.cpp:1063
Local incidence camera data.
Definition: CubeCalculator.h:163
QVector< double > * lonBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1104
Calculator for arrays.
Definition: CubeCalculator.h:72
QVector< double > * phaBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1080
Definition: Calculator.h:33
int cubeIndex()
Accesses the cube index of the DataValue.
Definition: CubeCalculator.cpp:928
Current band number.
Definition: CubeCalculator.h:154
Center emission camera data.
Definition: CubeCalculator.h:167
QVector< double > * emacBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1152
CameraBuffers(Camera *camera)
Constructs a CameraBuffers object.
Definition: CubeCalculator.cpp:948
A brick of cube data.
Definition: CubeCalculator.h:155
void Clear()
This method completely resets the calculator.
Definition: CubeCalculator.cpp:79
Phase camera data.
Definition: CubeCalculator.h:158
~CubeCalculator()
Destroys the CubeCalculator object.
Definition: CubeCalculator.cpp:57
void enableLonBuffer()
Enables the longitude buffer for use.
Definition: CubeCalculator.cpp:1027
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
QVector< double > * inalBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1128
double constant()
Accesses the constant value of the DataValue.
Definition: CubeCalculator.cpp:938
QVector< double > * emalBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1134
Latitude camera data.
Definition: CubeCalculator.h:159
void enableLatBuffer()
Enables the latitude buffer for use.
Definition: CubeCalculator.cpp:1021
~CameraBuffers()
Destroys the CameraBuffers.
Definition: CubeCalculator.cpp:971
QVector< double > * inacBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1146
Emission camera data.
Definition: CubeCalculator.h:157
void enableInalBuffer()
Enables the local incidence angle buffer for use.
Definition: CubeCalculator.cpp:1051
Calculator for arrays.
Definition: Calculator.h:70
CubeCalculator()
Constructs a CubeCalculator.
Definition: CubeCalculator.cpp:37
QVector< double > * radiusBuffer(int currentLine, int ns, int currentBand)
Definition: CubeCalculator.cpp:1116
IO Handler for Isis Cubes.
Definition: Cube.h:170