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
CubeCalculator.h
Go to the documentation of this file.
1
5
6/* SPDX-License-Identifier: CC0-1.0 */
7
8// Calculator.h
9#ifndef CUBE_CALCULATOR_H_
10#define CUBE_CALCULATOR_H_
11
12#include "Calculator.h"
13#include "Cube.h"
14
15class QString;
16
17namespace Isis {
18 class DataValue;
19 class CameraBuffers;
20
57 public:
60
65 void Clear();
66
67 void prepareCalculations(QString equation,
68 QVector<Cube *> &inCubes,
69 Cube *outCube);
70
72 int line, int band);
73
74 private:
80 enum Calculations {
82 CallNextMethod,
84 PushNextData
85 };
86
87 void addMethodCall(void (Calculator::*method)(void));
88
89 int lastPushToCubeStats(QVector<Cube *> &inCubes);
90
91 int lastPushToCubeCameras(QVector<Cube *> &inCubes);
92
98 QVector<Calculations> *m_calculations;
99
101 QVector<void (Calculator:: *)(void)> *m_methods;
102
104 QVector<DataValue> *m_dataDefinitions;
105
107 QVector<Statistics *> *m_cubeStats;
108
113 QVector<Camera *> *m_cubeCameras;
114
119 QVector<CameraBuffers *> *m_cameraBuffers;
120
121 int m_outputSamples;
122 };
123
124
131 class DataValue {
132 public:
154
155 DataValue();
156 DataValue(DataValueType type);
157 DataValue(DataValueType type, int cubeIndex);
158 DataValue(DataValueType type, double value);
159
160 DataValueType type();
161 int cubeIndex();
162 double constant();
163
164 private:
165 int m_cubeIndex;
166 double m_constantValue;
167
168 DataValueType m_type;
169 };
170
171
187 public:
188 CameraBuffers(Camera *camera);
190
191 void enablePhaBuffer();
192 void enableInaBuffer();
193 void enableEmaBuffer();
194 void enableLatBuffer();
195 void enableLonBuffer();
196 void enableResBuffer();
197 void enableRadiusBuffer();
198 void enablePhalBuffer();
199 void enableInalBuffer();
200 void enableEmalBuffer();
201 void enablePhacBuffer();
202 void enableInacBuffer();
203 void enableEmacBuffer();
204
205 // Accessors
206 QVector<double> *phaBuffer(int currentLine, int ns, int currentBand);
207 QVector<double> *inaBuffer(int currentLine, int ns, int currentBand);
208 QVector<double> *emaBuffer(int currentLine, int ns, int currentBand);
209 QVector<double> *latBuffer(int currentLine, int ns, int currentBand);
210 QVector<double> *lonBuffer(int currentLine, int ns, int currentBand);
211 QVector<double> *resBuffer(int currentLine, int ns, int currentBand);
212 QVector<double> *radiusBuffer(int currentLine, int ns, int currentBand);
213 QVector<double> *phalBuffer(int currentLine, int ns, int currentBand);
214 QVector<double> *inalBuffer(int currentLine, int ns, int currentBand);
215 QVector<double> *emalBuffer(int currentLine, int ns, int currentBand);
216 QVector<double> *phacBuffer(int currentLine, int ns, int currentBand);
217 QVector<double> *inacBuffer(int currentLine, int ns, int currentBand);
218 QVector<double> *emacBuffer(int currentLine, int ns, int currentBand);
219
220
221 private:
222 void loadBuffers(int currentLine, int ns, int currentBand);
223
224 Camera *m_camera;
225 int m_lastLine;
226
227 QVector<double> *m_phaBuffer;
228 QVector<double> *m_inaBuffer;
229 QVector<double> *m_emaBuffer;
230 QVector<double> *m_phalBuffer;
231 QVector<double> *m_inalBuffer;
232 QVector<double> *m_emalBuffer;
233 QVector<double> *m_phacBuffer;
234 QVector<double> *m_inacBuffer;
235 QVector<double> *m_emacBuffer;
236 QVector<double> *m_resBuffer;
237 QVector<double> *m_latBuffer;
238 QVector<double> *m_lonBuffer;
239 QVector<double> *m_radiusBuffer;
240 };
241}
242#endif
Calculator()
The code that performs math operations is designed to call a function and use the result.
Definition Calculator.cpp:32
This class is used to manage buffers for calculating camera related information, such as angles,...
Definition CubeCalculator.h:186
void enableLonBuffer()
Enables the longitude buffer for use.
Definition CubeCalculator.cpp:1012
void enableLatBuffer()
Enables the latitude buffer for use.
Definition CubeCalculator.cpp:1006
QVector< double > * inalBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1113
void enablePhalBuffer()
Enables the local phase angle buffer for use.
Definition CubeCalculator.cpp:1030
void enableResBuffer()
Enables the resolution buffer for use.
Definition CubeCalculator.cpp:1018
QVector< double > * emalBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1119
QVector< double > * emaBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1077
void enablePhaBuffer()
Enables the phase angle buffer for use.
Definition CubeCalculator.cpp:988
void enableRadiusBuffer()
Enables the radius buffer for use.
Definition CubeCalculator.cpp:1024
CameraBuffers(Camera *camera)
Constructs a CameraBuffers object.
Definition CubeCalculator.cpp:933
QVector< double > * phacBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1125
void enableInalBuffer()
Enables the local incidence angle buffer for use.
Definition CubeCalculator.cpp:1036
QVector< double > * emacBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1137
QVector< double > * latBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1083
void enableInaBuffer()
Enables the incidence angle buffer for use.
Definition CubeCalculator.cpp:994
void enableEmalBuffer()
Enables the local emission angle buffer for use.
Definition CubeCalculator.cpp:1042
QVector< double > * inacBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1131
QVector< double > * inaBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1071
~CameraBuffers()
Destroys the CameraBuffers.
Definition CubeCalculator.cpp:956
void enableEmacBuffer()
Enables the center emission angle buffer for use.
Definition CubeCalculator.cpp:1060
void enableInacBuffer()
Enables the center incidence angle buffer for use.
Definition CubeCalculator.cpp:1054
void enableEmaBuffer()
Enables the emission angle buffer for use.
Definition CubeCalculator.cpp:1000
QVector< double > * radiusBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1101
QVector< double > * resBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1095
QVector< double > * phaBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1065
QVector< double > * lonBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1089
QVector< double > * phalBuffer(int currentLine, int ns, int currentBand)
Definition CubeCalculator.cpp:1107
void enablePhacBuffer()
Enables the center phase angle buffer for use.
Definition CubeCalculator.cpp:1048
Definition Camera.h:236
~CubeCalculator()
Destroys the CubeCalculator object.
Definition CubeCalculator.cpp:42
CubeCalculator()
Constructs a CubeCalculator.
Definition CubeCalculator.cpp:22
void Clear()
This method completely resets the calculator.
Definition CubeCalculator.cpp:64
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:114
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:249
IO Handler for Isis Cubes.
Definition Cube.h:168
This class is used to define what kind of data is being pushed onto the cube calculator.
Definition CubeCalculator.h:131
int cubeIndex()
Accesses the cube index of the DataValue.
Definition CubeCalculator.cpp:913
double constant()
Accesses the constant value of the DataValue.
Definition CubeCalculator.cpp:923
DataValue()
Constructs a default DataValue.
Definition CubeCalculator.cpp:840
DataValueType
This is used to tell what kind of data to push onto the RPN calculator.
Definition CubeCalculator.h:134
@ InaData
Incidence camera data.
Definition CubeCalculator.h:140
@ PhacData
Center phase camera data.
Definition CubeCalculator.h:152
@ EmalData
Local emission camera data.
Definition CubeCalculator.h:148
@ PhaData
Phase camera data.
Definition CubeCalculator.h:142
@ InalData
Local incidence camera data.
Definition CubeCalculator.h:147
@ EmaData
Emission camera data.
Definition CubeCalculator.h:141
@ LatData
Latitude camera data.
Definition CubeCalculator.h:143
@ Sample
Current sample number.
Definition CubeCalculator.h:136
@ Band
Current band number.
Definition CubeCalculator.h:138
@ ResData
Pixel resolution camera data.
Definition CubeCalculator.h:145
@ Constant
A single constant value.
Definition CubeCalculator.h:135
@ InacData
Center incidence camera data.
Definition CubeCalculator.h:150
@ PhalData
Local phase camera data.
Definition CubeCalculator.h:149
@ Line
Current line number.
Definition CubeCalculator.h:137
@ RadiusData
DEM radius.
Definition CubeCalculator.h:146
@ LonData
Longitude camera data.
Definition CubeCalculator.h:144
@ CubeData
A brick of cube data.
Definition CubeCalculator.h:139
@ EmacData
Center emission camera data.
Definition CubeCalculator.h:151
DataValueType type()
Accesses the type of the DataValue.
Definition CubeCalculator.cpp:903
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16