USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::AlphaCube Class Reference
[Low Level Cube I/O]

#include <AlphaCube.h>

Collaboration diagram for Isis::AlphaCube:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class is used to rewrite the "alpha" keywords out of the AlphaCube group or Instrument group.

This class allows programmers to map cube pixel positions back to the first cube they came from.This is critical for camera models or radiometric models in order to map input cube pixels to camera detector position. The alpha keywords are automatically generated in programs like crop, pad, reduce, and enlarge.

Author:
2004-02-13 Jeff Anderson

For internal use only.

History:
2004-02-13 Jeff Anderson - Added another constructor and refactored UpdateGroup method.
History:
2004-06-03 Jeff Anderson - Fixed bug in UpdateGroup which occured when a cube label did not already have a AlphaCube group.
History:
2005-02-14 Leah Dahmer - Modified file to support Doxygen documentation.
Todo:
2005-04-06 Add coded example.

Definition at line 53 of file AlphaCube.h.

Public Member Functions

 AlphaCube (Isis::Pvl &pvl)
 Constructs an AlphaCube object using a PVL object.
 AlphaCube (int alphaSamples, int alphaLines, int betaSamples, int betaLines)
 Constructs an AlphaCube object given alphaSamples, alphaLines, betaSamples and betaLines.
 AlphaCube (int alphaSamples, int alphaLines, int betaSamples, int betaLines, double alphaSs, double alphaSl, double alphaEs, double alphaEl)
 Constructs an AlphaCube object with a basic mapping from corner-to-corner, beta 0.5,0.5 maps to alpha 0.5,0.5 and beta ns+0.5,nl+0.5 maps to alpha ns+0.5, nl+0.5.
 ~AlphaCube ()
 Destroys the AlphaCube object.
int AlphaLines () const
 Returns the number of lines in the alpha cube.
int AlphaSamples () const
 Returns the number of samples in the alpha cube.
int BetaLines () const
 Returns the number of lines in the beta cube.
int BetaSamples () const
 Returns the number of samples in the beta cube.
double AlphaLine (double betaLine)
 Returns an alpha line given a beta line.
double AlphaSample (double betaSample)
 Returns an alpha sample given a beta sample.
double BetaLine (double alphaLine)
 Returns a beta line given an alpha line.
double BetaSample (double alphaSample)
 Returns a beta sample given an alpha sample.
void UpdateGroup (Isis::Pvl &pvl)
 Writes or update the Alpha keywords (AlphaLines, AlphaSamples, AlphaStartingSamples, etc) in the proper group in a PVL object.
void Rehash (AlphaCube &alphaCube)
 Merges two AlphaCube objects.

Private Member Functions

void ComputeSlope ()
 Computes the line and sample slopes.

Private Attributes

int p_alphaLines
 The number of alpha lines in the cube.
int p_alphaSamples
 The number of alpha samples in the cube.
int p_betaLines
 The number of beta lines in the cube.
int p_betaSamples
 The number of beta samples in the cube.
double p_alphaStartingLine
 The starting alpha line.
double p_alphaStartingSample
 The starting alpha sample.
double p_alphaEndingLine
 The ending alpha line.
double p_alphaEndingSample
 The ending alpha sample.
double p_lineSlope
 The slope of the line.
double p_sampSlope
 The slope of the sample set.


Constructor & Destructor Documentation

Isis::AlphaCube::AlphaCube ( Isis::Pvl pvl  ) 

Constructs an AlphaCube object using a PVL object.

Definition at line 28 of file AlphaCube.cpp.

References ComputeSlope(), Isis::PvlObject::FindGroup(), Isis::PvlObject::HasGroup(), p_alphaEndingLine, p_alphaEndingSample, p_alphaLines, p_alphaSamples, p_alphaStartingLine, p_alphaStartingSample, p_betaLines, p_betaSamples, pvl(), and Isis::PvlObject::Traverse.

Isis::AlphaCube::AlphaCube ( int  alphaSamples,
int  alphaLines,
int  betaSamples,
int  betaLines 
)

Constructs an AlphaCube object given alphaSamples, alphaLines, betaSamples and betaLines.

Definition at line 80 of file AlphaCube.cpp.

References ComputeSlope(), p_alphaEndingLine, p_alphaEndingSample, p_alphaLines, p_alphaSamples, p_alphaStartingLine, p_alphaStartingSample, p_betaLines, and p_betaSamples.

Isis::AlphaCube::AlphaCube ( int  alphaSamples,
int  alphaLines,
int  betaSamples,
int  betaLines,
double  alphaSs,
double  alphaSl,
double  alphaEs,
double  alphaEl 
)

Constructs an AlphaCube object with a basic mapping from corner-to-corner, beta 0.5,0.5 maps to alpha 0.5,0.5 and beta ns+0.5,nl+0.5 maps to alpha ns+0.5, nl+0.5.

Definition at line 60 of file AlphaCube.cpp.

References ComputeSlope(), p_alphaEndingLine, p_alphaEndingSample, p_alphaLines, p_alphaSamples, p_alphaStartingLine, p_alphaStartingSample, p_betaLines, and p_betaSamples.

Isis::AlphaCube::~AlphaCube (  )  [inline]

Destroys the AlphaCube object.

Definition at line 63 of file AlphaCube.h.


Member Function Documentation

double Isis::AlphaCube::AlphaLine ( double  betaLine  )  [inline]

Returns an alpha line given a beta line.

Definition at line 74 of file AlphaCube.h.

References p_alphaStartingLine, and p_lineSlope.

Referenced by Rehash(), and Isis::Camera::SetImage().

int Isis::AlphaCube::AlphaLines (  )  const [inline]

Returns the number of lines in the alpha cube.

Definition at line 66 of file AlphaCube.h.

References p_alphaLines.

Referenced by Isis::Camera::ParentLines().

double Isis::AlphaCube::AlphaSample ( double  betaSample  )  [inline]

Returns an alpha sample given a beta sample.

Definition at line 78 of file AlphaCube.h.

References p_alphaStartingSample, and p_sampSlope.

Referenced by Rehash(), and Isis::Camera::SetImage().

int Isis::AlphaCube::AlphaSamples (  )  const [inline]

Returns the number of samples in the alpha cube.

Definition at line 68 of file AlphaCube.h.

References p_alphaSamples.

Referenced by Isis::Camera::ParentSamples().

double Isis::AlphaCube::BetaLine ( double  alphaLine  )  [inline]

Returns a beta line given an alpha line.

Definition at line 82 of file AlphaCube.h.

References p_alphaStartingLine, and p_lineSlope.

Referenced by Isis::Camera::RawFocalPlanetoImage(), and Isis::Camera::SetRightAscensionDeclination().

int Isis::AlphaCube::BetaLines (  )  const [inline]

Returns the number of lines in the beta cube.

Definition at line 70 of file AlphaCube.h.

References p_betaLines.

Referenced by Isis::Camera::LoadCache().

double Isis::AlphaCube::BetaSample ( double  alphaSample  )  [inline]

Returns a beta sample given an alpha sample.

Definition at line 86 of file AlphaCube.h.

References p_alphaStartingSample, and p_sampSlope.

Referenced by Isis::Camera::RawFocalPlanetoImage(), and Isis::Camera::SetRightAscensionDeclination().

int Isis::AlphaCube::BetaSamples (  )  const [inline]

Returns the number of samples in the beta cube.

Definition at line 72 of file AlphaCube.h.

References p_betaSamples.

Referenced by Isis::Camera::LoadCache().

void Isis::AlphaCube::ComputeSlope (  )  [private]

Computes the line and sample slopes.

(Starting and ending alpha lines/samples divided by the number of beta lines/samples).

For internal use only.

Todo:
Why the +0.5 and -0.5?

Definition at line 171 of file AlphaCube.cpp.

References p_alphaEndingLine, p_alphaEndingSample, p_alphaStartingLine, p_alphaStartingSample, p_betaLines, p_betaSamples, p_lineSlope, and p_sampSlope.

Referenced by AlphaCube(), and Rehash().

void Isis::AlphaCube::Rehash ( AlphaCube add  ) 

Merges two AlphaCube objects.

This facilities combinations of programs crop-enlarge, crop-crop, reduce-pad, etc.

Parameters:
add The AlphaCube object to be merged.

Definition at line 101 of file AlphaCube.cpp.

References add, AlphaLine(), AlphaSample(), ComputeSlope(), p_alphaEndingLine, p_alphaEndingSample, p_alphaStartingLine, p_alphaStartingSample, p_betaLines, p_betaSamples, sl, and ss.

void Isis::AlphaCube::UpdateGroup ( Isis::Pvl pvl  ) 

Writes or update the Alpha keywords (AlphaLines, AlphaSamples, AlphaStartingSamples, etc) in the proper group in a PVL object.

It chooses first to write and AlphaGroup if the Mapping group exists. If not then is will write the keywords in the Instrument group if it exists. Otherwise it will write to the AlphaCube group.

Parameters:
&pvl The PVL object to write to.

Definition at line 127 of file AlphaCube.cpp.

References cube, Isis::Cube::HasGroup(), p_alphaEndingLine, p_alphaEndingSample, p_alphaLines, p_alphaSamples, p_alphaStartingLine, p_alphaStartingSample, p_betaLines, p_betaSamples, and pvl().


Member Data Documentation

double Isis::AlphaCube::p_alphaEndingLine [private]

The ending alpha line.

Definition at line 102 of file AlphaCube.h.

Referenced by AlphaCube(), ComputeSlope(), Rehash(), and UpdateGroup().

double Isis::AlphaCube::p_alphaEndingSample [private]

The ending alpha sample.

Definition at line 103 of file AlphaCube.h.

Referenced by AlphaCube(), ComputeSlope(), Rehash(), and UpdateGroup().

int Isis::AlphaCube::p_alphaLines [private]

The number of alpha lines in the cube.

Definition at line 96 of file AlphaCube.h.

Referenced by AlphaCube(), AlphaLines(), and UpdateGroup().

int Isis::AlphaCube::p_alphaSamples [private]

The number of alpha samples in the cube.

Definition at line 97 of file AlphaCube.h.

Referenced by AlphaCube(), AlphaSamples(), and UpdateGroup().

double Isis::AlphaCube::p_alphaStartingLine [private]

The starting alpha line.

Definition at line 100 of file AlphaCube.h.

Referenced by AlphaCube(), AlphaLine(), BetaLine(), ComputeSlope(), Rehash(), and UpdateGroup().

double Isis::AlphaCube::p_alphaStartingSample [private]

The starting alpha sample.

Definition at line 101 of file AlphaCube.h.

Referenced by AlphaCube(), AlphaSample(), BetaSample(), ComputeSlope(), Rehash(), and UpdateGroup().

int Isis::AlphaCube::p_betaLines [private]

The number of beta lines in the cube.

Definition at line 98 of file AlphaCube.h.

Referenced by AlphaCube(), BetaLines(), ComputeSlope(), Rehash(), and UpdateGroup().

int Isis::AlphaCube::p_betaSamples [private]

The number of beta samples in the cube.

Definition at line 99 of file AlphaCube.h.

Referenced by AlphaCube(), BetaSamples(), ComputeSlope(), Rehash(), and UpdateGroup().

double Isis::AlphaCube::p_lineSlope [private]

The slope of the line.

Definition at line 104 of file AlphaCube.h.

Referenced by AlphaLine(), BetaLine(), and ComputeSlope().

double Isis::AlphaCube::p_sampSlope [private]

The slope of the sample set.

Definition at line 105 of file AlphaCube.h.

Referenced by AlphaSample(), BetaSample(), and ComputeSlope().


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