Isis 3 Programmer Reference
Isis::FeatureNomenclatureTool::FeaturePosition Class Reference

A named feature's position in a cube. More...

Collaboration diagram for Isis::FeatureNomenclatureTool::FeaturePosition:
Collaboration graph

Public Member Functions

 FeaturePosition ()
 Instiantiates a feature position with no data. More...
 
 FeaturePosition (MdiCubeViewport *, FeatureNomenclature::Feature, VectorType vectorType)
 Instiantiates a feature position. More...
 
 FeaturePosition (const FeaturePosition &other)
 Copies a feature position. More...
 
 ~FeaturePosition ()
 Cleans up allocated memory. More...
 
bool isValid () const
 Test if sample/line coordinates could be found for this feature. More...
 
QPair< double, double > center () const
 Get the center sample/line position of the feature. More...
 
QList< QPair< double, double > > edges () const
 Get the edge sample/line positions of the feature. More...
 
FeatureNomenclature::Featurefeature ()
 Get the feature associated with this feature position. More...
 
const FeatureNomenclature::Featurefeature () const
 Get the feature associated with this feature position. More...
 
void applyExtentType (VectorType vectorType)
 Applies the type of extents to the feature. More...
 
void swap (FeaturePosition &other)
 Trade member data with other. More...
 
FeaturePositionoperator= (const FeaturePosition &rhs)
 Assign rhs to this. More...
 

Private Attributes

double m_centerLine
 The cube line position of the feature center, Null if !isValid() More...
 
double m_centerSample
 The cube sample position of the feature center, Null if !isValid() More...
 
UniversalGroundMapm_gmap
 The map used to determine the sample, line pair from a lat, lon pair. More...
 
QList< QPair< double, double > > * m_featureEdgeLineSamples
 The pair is cube sample, line (first and second) respectively. More...
 
FeatureNomenclature::Feature m_feature
 The feature for which we're encapsulating a viewport position. More...
 

Detailed Description

A named feature's position in a cube.

This class encapsulates the sample,line position and extents of a named feature given an image (in this case, a viewport, because that holds the universal ground map).

Author
2012-03-22 Steven Lambright and Jai Rideout
History:
2012-06-06 Steven Lambright and Kimberly Oyama - Added support for multiple extent/vector types (FeaturePosition(), applyExtentType()). Fixes #852. Fixes #892.

Definition at line 188 of file FeatureNomenclatureTool.h.

Constructor & Destructor Documentation

◆ FeaturePosition() [1/3]

Isis::FeatureNomenclatureTool::FeaturePosition::FeaturePosition ( )

Instiantiates a feature position with no data.

Definition at line 1028 of file FeatureNomenclatureTool.cpp.

References m_centerLine, m_centerSample, m_featureEdgeLineSamples, m_gmap, and Isis::Null.

◆ FeaturePosition() [2/3]

Isis::FeatureNomenclatureTool::FeaturePosition::FeaturePosition ( MdiCubeViewport vp,
FeatureNomenclature::Feature  feature,
VectorType  vectorType 
)

Instiantiates a feature position.

This will calculate the line/sample coordinates of the feature.

Parameters
vpThe viewport to use for ground information
featureThe feature with nomenclature database lat/lon values to be translated into cube line/sample coordinates.
vectorTypeThe type of extent vector to display

Definition at line 1047 of file FeatureNomenclatureTool.cpp.

References Isis::Null, Isis::CubeViewport::universalGroundMap(), and Isis::FeatureNomenclatureTool::vectorType().

◆ FeaturePosition() [3/3]

Isis::FeatureNomenclatureTool::FeaturePosition::FeaturePosition ( const FeaturePosition other)

Copies a feature position.

Parameters
otherThe feature position to copy

Definition at line 1077 of file FeatureNomenclatureTool.cpp.

References m_centerLine, m_centerSample, m_feature, m_featureEdgeLineSamples, and m_gmap.

◆ ~FeaturePosition()

Isis::FeatureNomenclatureTool::FeaturePosition::~FeaturePosition ( )

Cleans up allocated memory.

Definition at line 1097 of file FeatureNomenclatureTool.cpp.

References Isis::Null.

Member Function Documentation

◆ applyExtentType()

void Isis::FeatureNomenclatureTool::FeaturePosition::applyExtentType ( VectorType  vectorType)

Applies the type of extents to the feature.

4 Arrows - N, S, E, W 8 Arrows - N, NE, NW, E, W, S, SE, SW Box - Corners at: NE, NW, SE, SW

Parameters
vectorTypeThe type of extents that will be drawn with the feature

Definition at line 1158 of file FeatureNomenclatureTool.cpp.

References Isis::FeatureNomenclatureTool::Arrows4, Isis::FeatureNomenclatureTool::Arrows8, Isis::FeatureNomenclatureTool::Box, Isis::Angle::isValid(), and Isis::FeatureNomenclatureTool::vectorType().

◆ center()

QPair< double, double > Isis::FeatureNomenclatureTool::FeaturePosition::center ( ) const

Get the center sample/line position of the feature.

Returns
first = sample, second = line.

Definition at line 1122 of file FeatureNomenclatureTool.cpp.

◆ edges()

QList< QPair< double, double > > Isis::FeatureNomenclatureTool::FeaturePosition::edges ( ) const

Get the edge sample/line positions of the feature.

Returns
In the pair, first = sample, second = line.

Definition at line 1134 of file FeatureNomenclatureTool.cpp.

◆ feature() [1/2]

FeatureNomenclature::Feature & Isis::FeatureNomenclatureTool::FeaturePosition::feature ( )

Get the feature associated with this feature position.

Returns
The feature

Definition at line 1145 of file FeatureNomenclatureTool.cpp.

◆ feature() [2/2]

const FeatureNomenclature::Feature & Isis::FeatureNomenclatureTool::FeaturePosition::feature ( ) const

Get the feature associated with this feature position.

Returns
The feature

Definition at line 1277 of file FeatureNomenclatureTool.cpp.

◆ isValid()

bool Isis::FeatureNomenclatureTool::FeaturePosition::isValid ( ) const

Test if sample/line coordinates could be found for this feature.

Returns
True if this feature has a sample/line position.

Definition at line 1112 of file FeatureNomenclatureTool.cpp.

References Isis::Null.

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

◆ operator=()

FeatureNomenclatureTool::FeaturePosition & Isis::FeatureNomenclatureTool::FeaturePosition::operator= ( const FeaturePosition rhs)

Assign rhs to this.

We'll be taking on (mirroring) the state of the other feature position.

Parameters
rhsThe FeaturePosition on the right hand side of the '=' operator
Returns
*this

Definition at line 1263 of file FeatureNomenclatureTool.cpp.

◆ swap()

void Isis::FeatureNomenclatureTool::FeaturePosition::swap ( FeaturePosition other)

Trade member data with other.

This should never throw an exception.

Parameters
otherThe instance to trade state with

Definition at line 1245 of file FeatureNomenclatureTool.cpp.

References m_centerLine, m_centerSample, m_feature, m_featureEdgeLineSamples, and m_gmap.

Member Data Documentation

◆ m_centerLine

double Isis::FeatureNomenclatureTool::FeaturePosition::m_centerLine
private

The cube line position of the feature center, Null if !isValid()

Definition at line 208 of file FeatureNomenclatureTool.h.

Referenced by FeaturePosition(), and swap().

◆ m_centerSample

double Isis::FeatureNomenclatureTool::FeaturePosition::m_centerSample
private

The cube sample position of the feature center, Null if !isValid()

Definition at line 210 of file FeatureNomenclatureTool.h.

Referenced by FeaturePosition(), and swap().

◆ m_feature

FeatureNomenclature::Feature Isis::FeatureNomenclatureTool::FeaturePosition::m_feature
private

The feature for which we're encapsulating a viewport position.

Definition at line 221 of file FeatureNomenclatureTool.h.

Referenced by FeaturePosition(), and swap().

◆ m_featureEdgeLineSamples

QList< QPair<double, double> >* Isis::FeatureNomenclatureTool::FeaturePosition::m_featureEdgeLineSamples
private

The pair is cube sample, line (first and second) respectively.

This holds the edge points/extents of the feature.

Definition at line 219 of file FeatureNomenclatureTool.h.

Referenced by FeaturePosition(), and swap().

◆ m_gmap

UniversalGroundMap* Isis::FeatureNomenclatureTool::FeaturePosition::m_gmap
private

The map used to determine the sample, line pair from a lat, lon pair.

Definition at line 213 of file FeatureNomenclatureTool.h.

Referenced by FeaturePosition(), and swap().


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