32 #include "CubeManager.h"
55 m_usedCubes->SetNumOpenCubes(50);
80 m_currentCube = m_usedCubes->OpenCube(cubeFileName);
81 m_camera = m_currentCube->camera();
96 const bool outside,
const bool errors) {
98 bool passed = m_camera->SetImage(sample, line);
99 return GetPointInfo(passed, outside, errors);
113 bool passed = m_camera->SetImage(m_currentCube->sampleCount() / 2.0,
114 m_currentCube->lineCount() / 2.0);
115 return GetPointInfo(passed, outside, errors);
130 const bool outside,
const bool errors) {
132 bool passed = m_camera->SetImage(sample, m_currentCube->lineCount() / 2.0);
133 return GetPointInfo(passed, outside, errors);
148 const bool outside,
const bool errors) {
150 bool passed = m_camera->SetImage(m_currentCube->sampleCount() / 2.0, line);
151 return GetPointInfo(passed, outside, errors);
171 const bool outside,
const bool errors) {
173 bool passed = m_camera->SetUniversalGround(latitude, longitude);
174 return GetPointInfo(passed, outside, errors);
188 if (m_currentCube == NULL) {
189 string msg =
"Please set a cube before setting parameters";
248 bool noErrors = passed;
250 if (!m_camera->HasSurfaceIntersection()) {
251 error =
"Requested position does not project in camera model; no surface intersection";
255 if (!m_camera->InCube() && !allowOutside) {
256 error =
"Requested position does not project in camera model; not inside cube";
262 for (
int i = 0; i < gp->
keywords(); i++) {
263 QString name = (*gp)[i].name();
265 if (name ==
"BodyFixedCoordinate" || name ==
"SpacecraftPosition" ||
266 name ==
"SunPosition") {
267 (*gp)[i].addValue(
"NULL");
268 (*gp)[i].addValue(
"NULL");
269 (*gp)[i].addValue(
"NULL");
272 (*gp)[i].setValue(
"NULL");
281 toString(m_camera->time().Et()),
"seconds");
283 QString utc = m_camera->time().UTC();
292 Brick b(3, 3, 1, m_currentCube->pixelType());
294 int intSamp = (int)(m_camera->Sample() + 0.5);
295 int intLine = (int)(m_camera->Line() + 0.5);
297 m_currentCube->read(b);
299 double pB[3], spB[3], sB[3];
301 double ssplat, ssplon, sslat, sslon, ocentricLat, ographicLat, pe360Lon, pw360Lon;
309 m_camera->RightAscension()));
311 m_camera->Declination()));
312 ocentricLat = m_camera->UniversalLatitude();
317 m_camera->radii(radii);
319 radii[0].kilometers(),
320 radii[2].kilometers());
323 pe360Lon = m_camera->UniversalLongitude();
338 m_camera->Coordinate(pB);
344 m_camera->LocalRadius().meters()),
"meters");
347 m_camera->SampleResolution()),
"meters/pixel");
349 m_camera->LineResolution()),
"meters/pixel");
352 m_camera->instrumentPosition(spB);
358 double spacecraftAzi = m_camera->SpacecraftAzimuth();
367 m_camera->SlantDistance()),
"km");
369 m_camera->targetCenterDistance()),
"km");
370 m_camera->subSpacecraftPoint(ssplat, ssplon);
374 m_camera->SpacecraftAltitude()),
"km");
376 m_camera->OffNadirAngle()));
377 double subspcgrdaz = m_camera->GroundAzimuth(m_camera->UniversalLatitude(),
378 m_camera->UniversalLongitude(),
382 m_camera->sunPosition(sB);
388 double sunAzi = m_camera->SunAzimuth();
397 m_camera->SolarDistance()),
"AU");
398 m_camera->subSolarPoint(sslat, sslon);
401 double subsolgrdaz = m_camera->GroundAzimuth(m_camera->UniversalLatitude(),
402 m_camera->UniversalLongitude(),
409 m_camera->IncidenceAngle()));
411 m_camera->EmissionAngle()));
413 double northAzi = m_camera->NorthAzimuth();
422 m_camera->time().Et()),
"seconds");
424 utc = m_camera->time().UTC();
427 m_camera->LocalSolarTime()),
"hour");
429 m_camera->solarLongitude().degrees()));
437 Camera *CameraPointInfo::camera() {
441 Cube *CameraPointInfo::cube() {
442 return m_currentCube;