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. More...
 
virtual ~CameraPointInfo ()
 Destructor, deletes CubeManager object used. More...
 
void SetCube (const QString &cubeFileName)
 SetCube opens the given cube in a CubeManager. More...
 
void SetCSVOutput (bool csvOutput)
 Set the output format (true is CSV, false is PVL) More...
 
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. More...
 
PvlGroupSetCenter (const bool outside=false, const bool error=false)
 SetCenter sets the image coordinates to the center of the image. More...
 
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. More...
 
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. More...
 
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. More...
 

Protected Member Functions

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

Private Member Functions

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

Private Attributes

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

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 93 of file CameraPointInfo.h.

Constructor & Destructor Documentation

◆ CameraPointInfo()

Isis::CameraPointInfo::CameraPointInfo ( )

Constructor, initializes CubeManager and other variables for use.

Definition at line 52 of file CameraPointInfo.cpp.

◆ ~CameraPointInfo()

Isis::CameraPointInfo::~CameraPointInfo ( )
virtual

Destructor, deletes CubeManager object used.

Definition at line 76 of file CameraPointInfo.cpp.

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 580 of file CameraPointInfo.cpp.

◆ 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 220 of file CameraPointInfo.cpp.

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

◆ cube()

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

Retrieves a pointer to the current cube.

Returns
Cube* A pointer to the current cube.

Definition at line 590 of file CameraPointInfo.cpp.

◆ 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 243 of file CameraPointInfo.cpp.

References _FILEINFO_, Isis::PvlKeyword::addComment(), Isis::PvlContainer::addKeyword(), Isis::PvlKeyword::addValue(), Isis::PvlContainer::findKeyword(), Isis::IsValidPixel(), Isis::PvlContainer::keywords(), Isis::PixelToString(), Isis::Brick::SetBasePosition(), Isis::PvlKeyword::setValue(), Isis::TProjection::To180Domain(), Isis::TProjection::ToPlanetographic(), Isis::TProjection::ToPositiveWest(), Isis::toString(), and Isis::IException::Unknown.

◆ 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 131 of file CameraPointInfo.cpp.

◆ 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 66 of file CameraPointInfo.cpp.

◆ 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 91 of file CameraPointInfo.cpp.

◆ 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 203 of file CameraPointInfo.cpp.

◆ 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 110 of file CameraPointInfo.cpp.

◆ 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 178 of file CameraPointInfo.cpp.

◆ 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 154 of file CameraPointInfo.cpp.

Member Data Documentation

◆ m_camera

Camera* Isis::CameraPointInfo::m_camera
private

The camera to extract point information from.

Definition at line 120 of file CameraPointInfo.h.

◆ m_csvOutput

bool Isis::CameraPointInfo::m_csvOutput
private

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

Definition at line 121 of file CameraPointInfo.h.

◆ m_currentCube

Cube* Isis::CameraPointInfo::m_currentCube
private

The cube to extract camera information from.

Definition at line 119 of file CameraPointInfo.h.

◆ m_usedCubes

CubeManager* Isis::CameraPointInfo::m_usedCubes
private

The cubeManager used to open the current cube.

Definition at line 118 of file CameraPointInfo.h.


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