USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::UniversalGroundMap Class Reference
[Geometry]

Universal Ground Map. More...

#include <UniversalGroundMap.h>

Collaboration diagram for Isis::UniversalGroundMap:
Collaboration graph
[legend]

List of all members.

Public Types

enum  CameraPriority { CameraFirst, ProjectionFirst }
 

This enum is used to define whether to use a camera or projection primarily, and which to fall back on.

More...

Public Member Functions

 UniversalGroundMap (Pvl &pvl, CameraPriority priority=CameraFirst)
 Constructs a UniversalGroundMap object from a pvl.
 UniversalGroundMap (Cube &cube, CameraPriority priority=CameraFirst)
 Constructs a UniversalGroundMap object from a cube.
 ~UniversalGroundMap ()
 Destroys the UniversalGroundMap object.
void SetBand (const int band)
 Set the image band number.
bool SetUniversalGround (double lat, double lon)
 Returns whether the lat/lon position was set successfully in the camera model or projection.
bool SetGround (Latitude lat, Longitude lon)
 Returns whether the lat/lon position was set successfully in the camera model or projection.
bool SetGround (const SurfacePoint &)
 Returns whether the SurfacePoint was set successfully in the camera model or projection.
double Sample () const
 Returns the current line value of the camera model or projection.
double Line () const
 Returns the current line value of the camera model or projection.
bool SetImage (double sample, double line)
 Returns whether the sample/line postion was set successfully in the camera model or projection.
double UniversalLatitude () const
 Returns the universal latitude of the camera model or projection.
double UniversalLongitude () const
 Returns the universal longitude of the camera model or projection.
double Resolution () const
 Returns the resolution of the camera model or projection.
bool GroundRange (Cube *cube, Latitude &minLat, Latitude &maxLat, Longitude &minLon, Longitude &maxLon, bool allowEstimation=true)
 Find the lat/lon range of the image.
bool HasProjection ()
 Returns whether the ground map has a projection or not.
bool HasCamera ()
 Returns whether the ground map has a camera or not.
Isis::ProjectionProjection () const
 Return the projection associated with the ground map (NULL implies none).
Isis::CameraCamera () const
 Return the camera associated with the ground map (NULL implies none).

Private Member Functions

void Init (Pvl &pvl, CameraPriority priority)
 Creates the UniversalGroundMap.

Private Attributes

Isis::Camerap_camera
 The camera (if the image has a camera).
Isis::Projectionp_projection
 The projection (if the image is projected).

Detailed Description

Universal Ground Map.

???

Author:
2005-08-09 Jeff Anderson

For internal use only.

Todo:
Jeff Anderson - Finish Class Documentation
History:
2005-11-09 Tracie Sucharski Added HasProjection method.
History:
2006-03-20 Elizabeth Miller Added camera, projection, and Resolution methods and documentation
History:
2006-03-31 Elizabeth Miller Added unitTest
History:
2006-05-17 Elizabeth Miller Depricated CameraManager to CameraFactory
History:
2007-02-06 Tracie Sucharski Added SetBand method.
History:
2007-02-06 Steven Lambright Fixed documentation
History:
2009-04-24 Steven Koechle Added a check to SetUniversalGround that makes sure the result is on the cube before returning true.
History:
2010-04-09 Sharmila Prasad Added an API to check for camera in an image
History:
2010-04-28 Mackenzie Boyd Fixed dereferencing issue in constructor that takes a cube.
History:
2011-01-25 Steven Lambright Added CameraPriority and SetGround. The CameraPriority was for grid to use projections by default so they would work across the image regardless of the camera. The SetGround is so that conversions between lat/lon types are simply handled and allows a clean interface to use the new Latitude and Longitude classes.
History:
2011-01-25 Eric Hyer - Added SetGround method for Surface Points
History:
2012-03-22 Steven Lambright - Added GroundRange() method because I needed a ground range in the qview nomenclature tool and this seemed like the best place to put it. The Cube paramater is optional.
History:
2012-06-29 Steven Lambright and Kimberly Oyama - Made the estimation section of GroundRange() sample more points by walking the perimeter, the two corner to corner diagonals, and a plus that intersects in the center of the image. This ensures that the entire longitude range is returned. Fixes #855.

Definition at line 77 of file UniversalGroundMap.h.


Member Enumeration Documentation

This enum is used to define whether to use a camera or projection primarily, and which to fall back on.

Enumerator:
CameraFirst 

This is the default because cameras are projection-aware.

Use the camera for additional power if available, and fall back to projection

ProjectionFirst 

Use the projection for functionality well outside the original image if available, and fall back to camera.

Definition at line 83 of file UniversalGroundMap.h.


Constructor & Destructor Documentation

Isis::UniversalGroundMap::UniversalGroundMap ( Pvl pvl,
CameraPriority  priority = CameraFirst 
)

Constructs a UniversalGroundMap object from a pvl.

Parameters:
pvl The Pvl file to create the UniversalGroundMap from
priority Try to make a camera or projection first

Definition at line 24 of file UniversalGroundMap.cpp.

References Init().

Isis::UniversalGroundMap::UniversalGroundMap ( Cube cube,
CameraPriority  priority = CameraFirst 
)

Constructs a UniversalGroundMap object from a cube.

Parameters:
cube The Cube to create the UniversalGroundMap from
priority Try to make a camera or projection first

Definition at line 34 of file UniversalGroundMap.cpp.

References Init(), and Isis::Cube::label().

Isis::UniversalGroundMap::~UniversalGroundMap (  ) 

Destroys the UniversalGroundMap object.

Definition at line 92 of file UniversalGroundMap.cpp.

References p_camera, and p_projection.


Member Function Documentation

Isis::Camera* Isis::UniversalGroundMap::Camera (  )  const [inline]
bool Isis::UniversalGroundMap::GroundRange ( Cube cube,
Latitude minLat,
Latitude maxLat,
Longitude minLon,
Longitude maxLon,
bool  allowEstimation = true 
)

Find the lat/lon range of the image.

This will use the image footprint, camera, or projection in order to find a good result.

Parameters:
Cube* This is required for estimation. You can pass in NULL (it will disable estimation).
minLat This is an output: minimum latitude
maxLat This is an output: maximum latitude
minLon This is an output: minimum longitude
maxLon This is an output: maximum longitude
allowEstimation If this is true then extra efforts will be made to guess the ground range of the input. This can still fail.
Returns:
True if a ground range was found, false if no ground range could be determined. Some lat/lon results may still be populated; their values are undefined.

Definition at line 281 of file UniversalGroundMap.cpp.

References Isis::Angle::Degrees, Isis::Camera::GroundRange(), HasCamera(), Isis::PvlContainer::HasKeyword(), HasProjection(), Isis::Angle::isValid(), Isis::Cube::lineCount(), Isis::PolygonTools::MakeMultiPolygon(), Isis::Projection::Mapping(), p_camera, p_projection, poly(), Isis::ImagePolygon::Polys(), Isis::Cube::read(), Isis::Cube::sampleCount(), Isis::Projection::SetWorld(), Isis::Projection::UniversalLatitude(), and Isis::Projection::UniversalLongitude().

Referenced by Isis::FeatureNomenclatureTool::findMissingNomenclature().

bool Isis::UniversalGroundMap::HasCamera (  )  [inline]

Returns whether the ground map has a camera or not.

Returns:
bool Returns true if the ground map has a camera, and false if it does not

Definition at line 134 of file UniversalGroundMap.h.

References p_camera.

Referenced by Isis::GroundGrid::GroundGrid(), GroundRange(), and Isis::InterestOperator::Operate().

bool Isis::UniversalGroundMap::HasProjection (  )  [inline]

Returns whether the ground map has a projection or not.

Returns:
bool Returns true if the ground map has a projection, and false if it does not

Definition at line 123 of file UniversalGroundMap.h.

References p_projection.

Referenced by Isis::FindTool::distancePerPixel(), and GroundRange().

void Isis::UniversalGroundMap::Init ( Pvl pvl,
CameraPriority  priority 
) [private]

Creates the UniversalGroundMap.

Parameters:
pvl The Pvl file to create the UniversalGroundMap from
priority Try to make a camera or projection first
Exceptions:
Isis::iException::Camera - Could not create camera or projection

Definition at line 46 of file UniversalGroundMap.cpp.

References _FILEINFO_, Isis::IException::append(), CameraFirst, Isis::CameraFactory::Create(), Isis::ProjectionFactory::CreateFromCube(), Isis::PvlContainer::FileName(), p_camera, p_projection, and Isis::IException::Unknown.

Referenced by UniversalGroundMap().

double Isis::UniversalGroundMap::Line (  )  const
Isis::Projection* Isis::UniversalGroundMap::Projection (  )  const [inline]

Return the projection associated with the ground map (NULL implies none).

Definition at line 139 of file UniversalGroundMap.h.

References p_projection.

Referenced by Isis::CubeViewport::CubeViewport(), Isis::FindTool::distancePerPixel(), Isis::MosaicSceneItem::drawImage(), Isis::ImagePolygon::FixPolePoly(), and Isis::GroundGrid::GroundGrid().

double Isis::UniversalGroundMap::Resolution (  )  const

Returns the resolution of the camera model or projection.

Returns:
Resolution

Definition at line 255 of file UniversalGroundMap.cpp.

References p_camera, p_projection, Isis::Camera::PixelResolution(), and Isis::Projection::Resolution().

Referenced by Isis::FindTool::distancePerPixel(), and Isis::GroundGrid::GroundGrid().

double Isis::UniversalGroundMap::Sample (  )  const
void Isis::UniversalGroundMap::SetBand ( const int  band  ) 

Set the image band number.

Parameters:
[in] band (int) Image band number

Definition at line 84 of file UniversalGroundMap.cpp.

References p_camera, and Isis::Camera::SetBand().

Referenced by Isis::ImagePolygon::initCube().

bool Isis::UniversalGroundMap::SetGround ( const SurfacePoint sp  ) 

Returns whether the SurfacePoint was set successfully in the camera model or projection.

Parameters:
sp The Surface Point to set ground with
Returns:
Returns true if the Surface Point was set successfully, and false otherwise

Definition at line 160 of file UniversalGroundMap.cpp.

References Isis::Angle::degrees(), Isis::SurfacePoint::GetLatitude(), Isis::SurfacePoint::GetLongitude(), Isis::Camera::InCube(), p_camera, p_projection, Isis::Camera::SetGround(), and Isis::Projection::SetUniversalGround().

bool Isis::UniversalGroundMap::SetGround ( Latitude  lat,
Longitude  lon 
)

Returns whether the lat/lon position was set successfully in the camera model or projection.

Parameters:
lat The latitude
lon The longitude
Returns:
Returns true if the lat/lon position was set successfully, and false if it was not

Definition at line 134 of file UniversalGroundMap.cpp.

References Isis::Angle::degrees(), Isis::Camera::InCube(), p_camera, p_projection, Isis::Camera::SetGround(), and Isis::Projection::SetUniversalGround().

Referenced by Isis::FeatureNomenclatureTool::FeaturePosition::applyExtentType(), Isis::FeatureNomenclatureTool::FeaturePosition::FeaturePosition(), and Isis::StereoTool::measureSaved().

bool Isis::UniversalGroundMap::SetImage ( double  sample,
double  line 
)

Returns whether the sample/line postion was set successfully in the camera model or projection.

Parameters:
sample The sample position
line The line position
Returns:
Returns true if the sample/line position was set successfully, and false if it was not

Definition at line 213 of file UniversalGroundMap.cpp.

References p_camera, p_projection, Isis::Camera::SetImage(), and Isis::Projection::SetWorld().

Referenced by Isis::FindTool::distancePerPixel(), Isis::ControlPointEdit::findPoint(), Isis::SpatialPlotTool::getSpatialStatistics(), Isis::StereoTool::measureSaved(), Isis::FindTool::mouseButtonRelease(), Isis::InterestOperator::Operate(), Isis::ImagePolygon::SetImage(), Isis::ControlPointEdit::updateLeftPositionLabel(), Isis::ControlPointEdit::updateRightPositionLabel(), and Isis::FindTool::updateTool().

bool Isis::UniversalGroundMap::SetUniversalGround ( double  lat,
double  lon 
)

Returns whether the lat/lon position was set successfully in the camera model or projection.

Parameters:
lat The universal latitude
lon The universal longitude
Returns:
Returns true if the lat/lon position was set successfully, and false if it was not

Definition at line 109 of file UniversalGroundMap.cpp.

References Isis::Camera::InCube(), p_camera, p_projection, Isis::Projection::SetUniversalGround(), and Isis::Camera::SetUniversalGround().

Referenced by Isis::FindTool::centerLinkedViewports(), Isis::ProcessGroundPolygons::Convert(), Isis::StereoTool::createPoint(), Isis::FindTool::distancePerPixel(), Isis::MosaicSceneItem::drawImage(), Isis::ControlPointEdit::findPoint(), Isis::ImagePolygon::FixPolePoly(), Isis::FindTool::handleRecordClicked(), Isis::PolygonTools::LatLonToSampleLine(), Isis::FindTool::paintViewport(), and Isis::FindTool::updateTool().

double Isis::UniversalGroundMap::UniversalLatitude (  )  const
double Isis::UniversalGroundMap::UniversalLongitude (  )  const

Member Data Documentation


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