Isis 3 Programmer Reference
Isis::CameraPointInfo Class Reference

CameraPointInfo provides quick access to the majority of information avaliable from a camera on a point. More...

#include <CameraPointInfo.h>

Collaboration diagram for Isis::CameraPointInfo:
Collaboration graph

Public Member Functions

 CameraPointInfo ()
 Constructor, initializes CubeManager and other variables for use.
 
virtual ~CameraPointInfo ()
 Destructor, deletes CubeManager object used.
 
void SetCube (const QString &cubeFileName)
 SetCube opens the given cube in a CubeManager.
 
void SetCSVOutput (bool csvOutput)
 Set the output format (true is CSV, false is PVL)
 
PvlGroupSetImage (const double sample, const double line, const bool outside=false, const bool error=false)
 SetImage sets a sample, line image coordinate in the camera so data can be accessed.
 
PvlGroupSetCenter (const bool outside=false, const bool error=false)
 SetCenter sets the image coordinates to the center of the image.
 
PvlGroupSetSample (const double sample, const bool outside=false, const bool error=false)
 SetSample sets the image coordinates to the center line and the given sample.
 
PvlGroupSetLine (const double line, const bool outside=false, const bool error=false)
 SetLine sets the image coordinates to the center sample and the given line.
 
PvlGroupSetGround (const double latitude, const double longitude, const bool outside=false, const bool error=false)
 SetGround sets a latitude, longitude grrund coordinate in the camera so data can be accessed.
 

Protected Member Functions

Cameracamera ()
 Retrieves a pointer to the camera.
 
Cubecube ()
 Retrieves a pointer to the current cube.
 

Private Member Functions

bool CheckCube ()
 CheckCube checks that a cube has been set before the data for a point is accessed.
 
virtual PvlGroupGetPointInfo (bool passed, bool outside, bool errors)
 GetPointInfo builds the PvlGroup containing all the important information derived from the Camera.
 

Private Attributes

CubeManagerm_usedCubes
 The cubeManager used to open the current cube.
 
Cubem_currentCube
 The cube to extract camera information from.
 
Cameram_camera
 The camera to extract point information from.
 
bool m_csvOutput
 Boolean to keep track of output format (CSV or PVL)
 

Detailed Description

CameraPointInfo provides quick access to the majority of information avaliable from a camera on a point.

CameraPointInfo provides the functionality which was a part of campt in class form. This functionality is access to the majoirty of information avaliable on any given point on an image. The main difference is the use of a CubeManager within CameraPointInfo for effeciency when working with control nets and the opening of cubes several times.

Author
2009-08-25 Mackenzie Boyd
History

2009-09-13 Mackenzie Boyd - Added methods SetCenter(), SetSample() and SetLine() to support campt functionality. Added CheckCube() private method to check m_currentCube isn't NULL.

2010-03-25 Mackenzie Boyd - Modified longitude output to have Positive East and West, 360 and 180 longitudes.

2010-05-25 Mackenzie Boyd - Many changes, primary changes had to do with how errors are handled. Depending on the options sent in, errors can be handled by putting an Error keyword into the PvlGroup instead of throwing an exception. Other changes, addition of two booleans, both defaulting to false, to the Set methods (excluding SetCube) so that allowoutside option and allowerrors option could be taken in instead of using setters. CheckConditions method was removed and placed within GetPointInfo, GetPointInfo had 3 boolean parameters added, passed - whether or not the SetImage or SetGround done above was successful, allowoutside - if locations outside the cube are acceptable, and allowerrors - what to do with errors.

2010-06-07 Mackenzie Boyd - Changed Error keyword so that it is always present when allowErrors is true.

2010-09-13 Steven Lambright - Corrected units for SampleResolution and LineResolution

2012-07-06 Debbie A. Cook - Updated Spice members to be more compliant with Isis coding standards. References #972.

2013-03-27 Jeannie Backer - Added comment in code. References #1248.

2012-12-20 Debbie A. Cook - Changed to use TProjection. References #775.

2013-03-16 Jeannie Backer - Added accessor methods camera() and cube(). Added m_ prefix to member variables. Made GetPointInfo() virtual so it can be redefined in child classes. References #775.

2014-04-17 Jeannie Backer - Added check for valid azimuth values. If not, print "NULL" to be consistent with caminfo's CamTools.cpp. Replaced local variable names with more descriptive names. References #1659.

2015-10-01 Jeannie Backer - Made improvements to documentation and brought code closer to ISIS coding standards. References #1438

2016-07-11 Curtis Rose - Added units to a few of the outputs. References #3979.

2016-08-16 Tyler Wilson - Modified the GetPointInfo function to allow developers to specify which order CameraPointInfo fields are output for different file formats (PVL or CSV). This is managed by setting the m_csvOutput flag via the public member function SetCSVOutput. PVL is the default output format, as m_csvOuput is set to false in the constructor. The reason for this is to not to break any scripts processors might be running when outputting files in csv format. Column order is important in this case. References #476,#4100.

2017-08-30 Summer Stapleton - Updated documentation. References #4807.

Definition at line 77 of file CameraPointInfo.h.

Constructor & Destructor Documentation

◆ CameraPointInfo()

Isis::CameraPointInfo::CameraPointInfo ( )

Constructor, initializes CubeManager and other variables for use.

Definition at line 36 of file CameraPointInfo.cpp.

References m_camera, m_csvOutput, m_currentCube, m_usedCubes, and Isis::CubeManager::SetNumOpenCubes().

◆ ~CameraPointInfo()

Isis::CameraPointInfo::~CameraPointInfo ( )
virtual

Destructor, deletes CubeManager object used.

Definition at line 60 of file CameraPointInfo.cpp.

References m_usedCubes.

Member Function Documentation

◆ camera()

Camera * Isis::CameraPointInfo::camera ( )
protected

Retrieves a pointer to the camera.

Returns
Camera* A pointer to the Camera.

Definition at line 626 of file CameraPointInfo.cpp.

References m_camera.

◆ CheckCube()

bool Isis::CameraPointInfo::CheckCube ( )
private

CheckCube checks that a cube has been set before the data for a point is accessed.

Returns
bool Indicates whether a cube has been set.

Definition at line 204 of file CameraPointInfo.cpp.

References m_currentCube, and Isis::IException::Programmer.

Referenced by SetCenter(), SetGround(), SetImage(), SetLine(), and SetSample().

◆ cube()

Cube * Isis::CameraPointInfo::cube ( )
protected

Retrieves a pointer to the current cube.

Returns
Cube* A pointer to the current cube.

Definition at line 636 of file CameraPointInfo.cpp.

References m_currentCube.

◆ GetPointInfo()

PvlGroup * Isis::CameraPointInfo::GetPointInfo ( bool passed,
bool allowOutside,
bool allowErrors )
privatevirtual

GetPointInfo builds the PvlGroup containing all the important information derived from the Camera.

Parameters
passedIndicates whether the call to SetImage() was successful.
allowOutsideIndicates whether to allow extrapolation.
allowErrorsIndicates whether to allow the program to throw an error if a problem occurs.
Returns
PvlGroup* Data taken directly from the Camera and derived from Camera information. Ownership is passed to caller.

Definition at line 227 of file CameraPointInfo.cpp.

References Isis::Sensor::Coordinate(), Isis::Sensor::Declination(), Isis::Sensor::EmissionAngle(), Isis::Cube::fileName(), Isis::Camera::GroundAzimuth(), Isis::Sensor::HasSurfaceIntersection(), Isis::Sensor::IncidenceAngle(), Isis::Camera::InCube(), Isis::Spice::instrumentPosition(), Isis::IsValidPixel(), Isis::Camera::Line(), Isis::Camera::LineResolution(), Isis::Sensor::LocalRadius(), Isis::Sensor::LocalSolarTime(), Isis::Sensor::LookDirection(), Isis::Sensor::lookDirectionBodyFixed(), Isis::Sensor::lookDirectionJ2000(), m_camera, m_csvOutput, m_currentCube, Isis::Distance::meters(), Isis::Camera::NorthAzimuth(), Isis::Camera::ObliqueDetectorResolution(), Isis::Camera::ObliqueLineResolution(), Isis::Camera::ObliquePixelResolution(), Isis::Camera::ObliqueSampleResolution(), Isis::Camera::OffNadirAngle(), Isis::Sensor::PhaseAngle(), Isis::PixelToString(), Isis::Cube::pixelType(), Isis::Spice::radii(), Isis::Cube::read(), Isis::Sensor::RightAscension(), Isis::Camera::Sample(), Isis::Camera::SampleResolution(), Isis::Sensor::SlantDistance(), Isis::Sensor::SolarDistance(), Isis::Spice::solarLongitude(), Isis::Sensor::SpacecraftAltitude(), Isis::Camera::SpacecraftAzimuth(), Isis::Spice::subSolarPoint(), Isis::Spice::subSpacecraftPoint(), Isis::Camera::SunAzimuth(), Isis::Spice::sunPosition(), Isis::Spice::targetCenterDistance(), Isis::Spice::time(), Isis::TProjection::To180Domain(), Isis::TProjection::ToPlanetographic(), Isis::TProjection::ToPositiveWest(), Isis::toString(), Isis::Sensor::UniversalLatitude(), Isis::Sensor::UniversalLongitude(), and Isis::IException::Unknown.

Referenced by SetCenter(), SetGround(), SetImage(), SetLine(), and SetSample().

◆ SetCenter()

PvlGroup * Isis::CameraPointInfo::SetCenter ( const bool allowOutside = false,
const bool allowErrors = false )

SetCenter sets the image coordinates to the center of the image.

Parameters
allowOutsideIndicates whether to allow extrapolation.
allowErrorsIndicates whether to allow the program to throw an error if a problem occurs.
Returns
PvlGroup* The pertinent data from the Camera class on the point. Ownership is passed to caller.

Definition at line 115 of file CameraPointInfo.cpp.

References CheckCube(), GetPointInfo(), Isis::Cube::lineCount(), m_camera, m_currentCube, Isis::Cube::sampleCount(), and Isis::Camera::SetImage().

◆ SetCSVOutput()

void Isis::CameraPointInfo::SetCSVOutput ( bool csvOutput)

Set the output format (true is CSV, false is PVL)

Parameters
csvOutputThe new value to set csvOutput

Definition at line 50 of file CameraPointInfo.cpp.

References m_csvOutput.

◆ SetCube()

void Isis::CameraPointInfo::SetCube ( const QString & cubeFileName)

SetCube opens the given cube in a CubeManager.

The CubeManager is for effeciency when working with control nets where cubes are accesed multiple times.

Parameters
cubeFileNameA cube file name.

Definition at line 75 of file CameraPointInfo.cpp.

References Isis::Cube::camera(), m_camera, m_currentCube, m_usedCubes, and Isis::CubeManager::OpenCube().

◆ SetGround()

PvlGroup * Isis::CameraPointInfo::SetGround ( const double latitude,
const double longitude,
const bool allowOutside = false,
const bool allowErrors = false )

SetGround sets a latitude, longitude grrund coordinate in the camera so data can be accessed.

Parameters
latitudeA latitude coordinate in or almost in the cube
longitudeA longitude coordinate in or almost in the cube
allowOutsideIndicates whether to allow extrapolation.
allowErrorsIndicates whether to allow the program to throw an error if a problem occurs.
Returns
PvlGroup* The pertinent data from the Camera class on the point. Ownership is passed to caller.

Definition at line 187 of file CameraPointInfo.cpp.

References CheckCube(), GetPointInfo(), m_camera, and Isis::Camera::SetUniversalGround().

◆ SetImage()

PvlGroup * Isis::CameraPointInfo::SetImage ( const double sample,
const double line,
const bool allowOutside = false,
const bool allowErrors = false )

SetImage sets a sample, line image coordinate in the camera so data can be accessed.

Parameters
sampleA sample coordinate in or almost in the cube.
lineA line coordinate in or almost in the cube.
allowOutsideIndicates whether to allow extrapolation.
allowErrorsIndicates whether to allow the program to throw an error if a problem occurs.
Returns
PvlGroup* The pertinent data from the Camera class on the point. Ownership is passed to caller.

Definition at line 94 of file CameraPointInfo.cpp.

References CheckCube(), GetPointInfo(), m_camera, and Isis::Camera::SetImage().

◆ SetLine()

PvlGroup * Isis::CameraPointInfo::SetLine ( const double line,
const bool allowOutside = false,
const bool allowErrors = false )

SetLine sets the image coordinates to the center sample and the given line.

Parameters
lineA line coordinate in or almost in the cube.
allowOutsideIndicates whether to allow extrapolation.
allowErrorsIndicates whether to allow the program to throw an error if a problem occurs.
Returns
PvlGroup* The pertinent data from the Camera class on the point. Ownership is passed to caller.

Definition at line 162 of file CameraPointInfo.cpp.

References CheckCube(), GetPointInfo(), m_camera, m_currentCube, Isis::Cube::sampleCount(), and Isis::Camera::SetImage().

◆ SetSample()

PvlGroup * Isis::CameraPointInfo::SetSample ( const double sample,
const bool allowOutside = false,
const bool allowErrors = false )

SetSample sets the image coordinates to the center line and the given sample.

Parameters
sampleA sample coordinate in or almost in the cube.
allowOutsideIndicates whether to allow extrapolation.
allowErrorsIndicates whether to allow the program to throw an error if a problem occurs.
Returns
PvlGroup* The pertinent data from the Camera class on the point. Ownership is passed to caller.

Definition at line 138 of file CameraPointInfo.cpp.

References CheckCube(), GetPointInfo(), Isis::Cube::lineCount(), m_camera, m_currentCube, and Isis::Camera::SetImage().

Member Data Documentation

◆ m_camera

Camera* Isis::CameraPointInfo::m_camera
private

The camera to extract point information from.

Definition at line 104 of file CameraPointInfo.h.

Referenced by camera(), CameraPointInfo(), GetPointInfo(), SetCenter(), SetCube(), SetGround(), SetImage(), SetLine(), and SetSample().

◆ m_csvOutput

bool Isis::CameraPointInfo::m_csvOutput
private

Boolean to keep track of output format (CSV or PVL)

Definition at line 105 of file CameraPointInfo.h.

Referenced by CameraPointInfo(), GetPointInfo(), and SetCSVOutput().

◆ m_currentCube

Cube* Isis::CameraPointInfo::m_currentCube
private

The cube to extract camera information from.

Definition at line 103 of file CameraPointInfo.h.

Referenced by CameraPointInfo(), CheckCube(), cube(), GetPointInfo(), SetCenter(), SetCube(), SetLine(), and SetSample().

◆ m_usedCubes

CubeManager* Isis::CameraPointInfo::m_usedCubes
private

The cubeManager used to open the current cube.

Definition at line 102 of file CameraPointInfo.h.

Referenced by CameraPointInfo(), SetCube(), and ~CameraPointInfo().


The documentation for this class was generated from the following files: