USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::ControlNet Class Reference

#include <ControlNet.h>

Collaboration diagram for Isis::ControlNet:

Collaboration graph
[legend]
List of all members.

Detailed Description

a control network

This class is used to store a network of ControlPoints

Author:
2005-07-29 Jeff Anderson
See also:
ControlPoint ControlMeasure

For internal use only.

History:
2005-07-29 Jeff Anderson Original version
History:
2006-01-11 Jacob Danton Updated unitTest
History:
2006-06-22 Brendan George Updated to conform to changes in SerialNumberList class
History:
2008-04-04 Christopher Austin Added Exists function
History:
2008-04-18 Debbie A. Cook Added Progress reports to loading and SetImages and calculates the total number of measurements in the control net
History:
2008-06-18 Christopher Austin Fixed documentation errors
History:
2009-01-06 Jeannie Walldren - Fixed typo in SetImages() exception output. Added documentation.
History:
2009-02-05 Christopher Austin - when the created date or the modified date are not set, they default to the time in which Write() is called.
History:
2009-04-07 Tracie Sucharski - Added NumValidMeasures and NumIgnoredMeasures methods.
History:
2009-06-03 Christopher Austin - Added p_invalid functionality along with forceBuild, as well as other small fixes including documentation.
History:
2009-07-13 Stacy Alley - The std::vector of ControlPoints called 'p_points' was replaced with a QVector of QString 'p_pointIds' in conjunction with a QHash of <QString, ControlPoint> called 'p_pointsHash'. This was done to speed up the Add method which was essentially slowing down the reading or creation of Control Networks.

Definition at line 76 of file ControlNet.h.

Public Types

 Singleton
 Singleton is a network that identifies unique points such as reseaus, tic-marks, etc.
 ImageToImage
 ImageToImage is a network used to tie two or more images together using line/sample coordinates only.
 ImageToGround
 ImageToGround is a network used to tie one or more images (typically many) between each other and a target (e.g., Mars).
enum  NetworkType { Singleton, ImageToImage, ImageToGround }
 Enumeration defining network type. More...

Public Member Functions

 ControlNet ()
 Creates an empty ControlNet object.
 ControlNet (const std::string &ptfile, Progress *progress=0, bool forceBuild=false)
 Creates a ControlNet object with the given list of control points and cubes.
 ~ControlNet ()
 Destroy the control network.
void SetType (const NetworkType &type)
 Set the type of network.
NetworkType Type () const
 Return the type of network.
void SetTarget (const std::string &target)
 Set the target name.
std::string Target () const
 Return the target name.
void SetNetworkId (const std::string &id)
 Set the network id.
std::string NetworkId () const
 Return the network id.
void SetUserName (const std::string &name)
 Set the user name.
std::string UserName () const
 Return the user name.
void SetDescription (const std::string &desc)
 Set the description of the network.
std::string Description () const
 Return the description of the network.
void SetCreatedDate (const std::string &date)
 Set the creation time.
void SetModifiedDate (const std::string &date)
 Set the last modified date.
ControlPointoperator[] (int index)
 Return the ith control point.
int Size () const
 Return the number of control points in the network.
int NumValidPoints ()
 Returns the number of non-ignored control points.
bool Invalid () const
 Return if the control point is invalid.
int NumMeasures () const
 Return the total number of measures for all control points in the network.
int NumValidMeasures () const
 Return the number of valid (non-ignored) measures.
int NumIgnoredMeasures () const
 Return the number of ignored measures.
void Add (const ControlPoint &point, bool forceBuild=false)
 Adds a ControlPoint to the ControlNet.
void Delete (int index)
 Deletes the ControlPoint at the specified index in the ControlNet.
void Delete (const std::string &id)
 Deletes the ControlPoint with the given id in the ControlNet.
void ReadControl (const std::string &ptfile, Progress *progress=0, bool forceBuild=false)
 Reads in the control points from the given file.
void Write (const std::string &ptfile)
 Writes out the ControlPoints.
ControlPointFind (const std::string &id)
 Finds and returns a pointer to the ControlPoint with the specified id.
ControlPointFindClosest (const std::string &serialNumber, double sample, double line)
 Finds and returns a pointer to the closest ControlPoint to the ControlMeasure with the given serial number and line sample location.
bool Exists (ControlPoint &point)
 Returns true if the given ControlPoint has the same id as another ControlPoint in class.
double AverageError ()
 Compute the average error of all points in the network.
double MaximumError ()
 Determine the maximum error of all points in the network.
void ComputeErrors ()
 Compute error for each point in the network.
void ComputeApriori ()
 Compute aprior values for each point in the network.
void SetImages (const std::string &imageListFile)
 Creates the ControlNet's image cameras based on an input file.
void SetImages (SerialNumberList &list, Progress *progress=0)
 Creates the ControlNet's image camera's based on the list of Serial Numbers.
Isis::CameraCamera (int index)
 Returns the camera list from the given image number.

Private Attributes

QVector< QString > p_pointIds
 QVector of ControlPoint Ids.
QHash< QString, ControlPointp_pointsHash
 Hash table of Control Points.
std::string p_targetName
 Name of the target.
std::string p_networkId
 The Network Id.
std::string p_created
 Creation Date.
std::string p_modified
 Date Last Modified.
std::string p_description
 Textual Description of network.
std::string p_userName
 The user who created the network.
NetworkType p_type
 The type of network being used.
int p_numMeasures
 Total number of measures in the network.
int p_numIgnoredMeasures
 Number of ignored measures.
std::map< std::string, Isis::Camera * > p_cameraMap
 A map from serialnumber to camera.
std::vector< Isis::Camera * > p_cameraList
 Vector of image number to camera.
bool p_invalid
 If the Control Network is currently invalid.


Member Enumeration Documentation

enum Isis::ControlNet::NetworkType

Enumeration defining network type.

Enumerator:
Singleton  Singleton is a network that identifies unique points such as reseaus, tic-marks, etc.
ImageToImage  ImageToImage is a network used to tie two or more images together using line/sample coordinates only.
ImageToGround  ImageToGround is a network used to tie one or more images (typically many) between each other and a target (e.g., Mars).

Definition at line 88 of file ControlNet.h.


Constructor & Destructor Documentation

Isis::ControlNet::ControlNet (  ) 

Creates an empty ControlNet object.

Definition at line 9 of file ControlNet.cpp.

References p_invalid, p_numIgnoredMeasures, and p_numMeasures.

Isis::ControlNet::ControlNet ( const std::string &  ptfile,
Progress progress = 0,
bool  forceBuild = false 
)

Creates a ControlNet object with the given list of control points and cubes.

Parameters:
ptfile Name of file containing a Pvl list of control points
progress A pointer to the progress of reading in the control points
forceBuild Forces invalid Control Points to be added to this Control Network

Definition at line 24 of file ControlNet.cpp.

References p_invalid, p_numIgnoredMeasures, p_numMeasures, and ReadControl().

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

Destroy the control network.

Definition at line 83 of file ControlNet.h.


Member Function Documentation

void Isis::ControlNet::Add ( const ControlPoint point,
bool  forceBuild = false 
)

Adds a ControlPoint to the ControlNet.

Parameters:
point Control point to be added
forceBuild Forces invalid Control Points to be added to this Control Network
Exceptions:
Isis::iException::Programmer - "ControlPoint must have unique Id"

Definition at line 42 of file ControlNet.cpp.

References _FILEINFO_, Isis::ControlPoint::Id(), Isis::iException::Message(), p_pointIds, and p_pointsHash.

Referenced by ReadControl().

double Isis::ControlNet::AverageError (  ) 

Compute the average error of all points in the network.

Returns:
double Average error of points

Definition at line 373 of file ControlNet.cpp.

References p_pointIds, and p_pointsHash.

Referenced by Isis::BundleAdjust::Solve().

Isis::Camera* Isis::ControlNet::Camera ( int  index  )  [inline]

Returns the camera list from the given image number.

Parameters:
index The image number
Returns:
Isis::Camera* The pointer to the resultant camera list

Definition at line 216 of file ControlNet.h.

Referenced by Isis::BundleAdjust::Cmatrix(), Isis::BundleAdjust::Solve(), Isis::BundleAdjust::SpVector(), and Isis::BundleAdjust::Update().

void Isis::ControlNet::ComputeApriori (  ) 

Compute aprior values for each point in the network.

Definition at line 335 of file ControlNet.cpp.

References p_pointIds, and p_pointsHash.

Referenced by Isis::BundleAdjust::Solve().

void Isis::ControlNet::ComputeErrors (  ) 

Compute error for each point in the network.

Definition at line 346 of file ControlNet.cpp.

References p_pointIds, and p_pointsHash.

Referenced by Isis::BundleAdjust::Solve().

void Isis::ControlNet::Delete ( const std::string &  id  ) 

Deletes the ControlPoint with the given id in the ControlNet.

Parameters:
id The id of the ControlPoint to be deleted
Exceptions:
Isis::iException::User - "A ControlPoint matching the id was not found in the ControlNet"

Definition at line 97 of file ControlNet.cpp.

References _FILEINFO_, Isis::iException::Message(), p_pointIds, and p_pointsHash.

void Isis::ControlNet::Delete ( int  index  ) 

Deletes the ControlPoint at the specified index in the ControlNet.

Parameters:
index The index of the ControlPoint to be deleted
Exceptions:
Isis::iException::User - "There is no ControlPoint at the given index number"

Definition at line 61 of file ControlNet.cpp.

References _FILEINFO_, Invalid(), Isis::iException::Message(), p_invalid, p_pointIds, p_pointsHash, and Size().

std::string Isis::ControlNet::Description (  )  const [inline]

Return the description of the network.

Returns:
The description of this Control Network

Definition at line 145 of file ControlNet.h.

References p_description.

bool Isis::ControlNet::Exists ( ControlPoint point  ) 

Returns true if the given ControlPoint has the same id as another ControlPoint in class.

Parameters:
point The ControlPoint whos id is being compared
Returns:
bool If the ControlPoint id was found

Definition at line 290 of file ControlNet.cpp.

References Isis::ControlPoint::Id(), and p_pointsHash.

ControlPoint * Isis::ControlNet::Find ( const std::string &  id  ) 

Finds and returns a pointer to the ControlPoint with the specified id.

Parameters:
id The id of the ControlPoint to be deleted
Returns:
ControlPoint* Pointer to the ControlPoint with the given id
Exceptions:
Isis::iException::User - "A ControlPoint matching the id was not found in the ControlNet"

Definition at line 272 of file ControlNet.cpp.

References _FILEINFO_, Isis::iException::Message(), p_pointIds, and p_pointsHash.

Referenced by Qisis::MosaicPointTool::findPoint().

ControlPoint * Isis::ControlNet::FindClosest ( const std::string &  serialNumber,
double  sample,
double  line 
)

Finds and returns a pointer to the closest ControlPoint to the ControlMeasure with the given serial number and line sample location.

Parameters:
serialNumber The serial number of the the file the ControlMeasure is on
sample The sample number of the ControlMeasure
line The line number of the ControlMeasure
Returns:
ControlPoint* Pointer to the ControlPoint closest to the given line, sample position

Definition at line 310 of file ControlNet.cpp.

References dist, p_pointIds, and p_pointsHash.

bool Isis::ControlNet::Invalid (  )  const [inline]

Return if the control point is invalid.

Definition at line 175 of file ControlNet.h.

References p_invalid.

Referenced by Delete().

double Isis::ControlNet::MaximumError (  ) 

Determine the maximum error of all points in the network.

Returns:
double Max error of points

Definition at line 358 of file ControlNet.cpp.

References p_pointIds, and p_pointsHash.

Referenced by Isis::BundleAdjust::Solve().

std::string Isis::ControlNet::NetworkId (  )  const [inline]

Return the network id.

Definition at line 121 of file ControlNet.h.

References p_networkId.

int Isis::ControlNet::NumIgnoredMeasures (  )  const [inline]

Return the number of ignored measures.

Definition at line 184 of file ControlNet.h.

References p_numIgnoredMeasures.

int Isis::ControlNet::NumMeasures (  )  const [inline]

Return the total number of measures for all control points in the network.

Definition at line 178 of file ControlNet.h.

References p_numMeasures.

int Isis::ControlNet::NumValidMeasures (  )  const [inline]

Return the number of valid (non-ignored) measures.

Definition at line 181 of file ControlNet.h.

References p_numIgnoredMeasures, and p_numMeasures.

Referenced by Isis::BundleAdjust::Solve().

int Isis::ControlNet::NumValidPoints (  ) 

Returns the number of non-ignored control points.

Returns:
Number of valid control points

Definition at line 463 of file ControlNet.cpp.

References p_pointIds, p_pointsHash, Size(), and size.

ControlPoint& Isis::ControlNet::operator[] ( int  index  )  [inline]

Return the ith control point.

Parameters:
index Control Point index
Returns:
The Control Point at the provided index

Definition at line 168 of file ControlNet.h.

References p_pointIds, and p_pointsHash.

void Isis::ControlNet::ReadControl ( const std::string &  ptfile,
Progress progress = 0,
bool  forceBuild = false 
)

Reads in the control points from the given file.

Parameters:
ptfile Name of file containing a Pvl list of control points
progress A pointer to the progress of reading in the control points
forceBuild Forces invalid Control Points to be added to this Control Network
Exceptions:
Isis::iException::User - "Invalid Network Type"
Isis::iException::User - "Invalid Control Point"
Isis::iException::User - "Invalid Format"

For internal use only.

History:
2009-04-07 Tracie Sucharski - Keep track of ignored measures.

Definition at line 139 of file ControlNet.cpp.

References _FILEINFO_, Add(), Isis::Progress::CheckStatus(), e, Isis::PvlObject::FindObject(), ImageToGround, ImageToImage, Isis::PvlContainer::IsNamed(), Isis::iException::Message(), Isis::PvlObject::Object(), Isis::PvlObject::Objects(), p_created, p_description, p_modified, p_networkId, p_numIgnoredMeasures, p_numMeasures, p_targetName, p_type, p_userName, Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), and Singleton.

Referenced by ControlNet().

void Isis::ControlNet::SetCreatedDate ( const std::string &  date  )  [inline]

Set the creation time.

Parameters:
date The date this Control Network was created

Definition at line 152 of file ControlNet.h.

References p_created.

Referenced by Write().

void Isis::ControlNet::SetDescription ( const std::string &  desc  )  [inline]

Set the description of the network.

Parameters:
desc The description of this Control Network

Definition at line 138 of file ControlNet.h.

References p_description.

void Isis::ControlNet::SetImages ( SerialNumberList list,
Progress progress = 0 
)

Creates the ControlNet's image camera's based on the list of Serial Numbers.

Parameters:
list The list of Serial Numbers
progress A pointer to the progress of creating the cameras
Exceptions:
Isis::iException::System - "Unable to create camera for cube file"
Isis::iException::User - "Control point measure does not have a cube with a matching serial number"

For internal use only.

History:
2009-01-06 Jeannie Walldren - Fixed typo in exception output.

Definition at line 411 of file ControlNet.cpp.

References _FILEINFO_, cam, Isis::Progress::CheckStatus(), Isis::CameraFactory::Create(), e, Isis::SerialNumberList::Filename(), Isis::SerialNumberList::HasSerialNumber(), Isis::iException::Message(), p_cameraList, p_cameraMap, p_pointIds, p_pointsHash, pvl(), Isis::SerialNumberList::SerialNumber(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Size(), and Isis::SerialNumberList::Size().

void Isis::ControlNet::SetImages ( const std::string &  imageListFile  ) 

Creates the ControlNet's image cameras based on an input file.

Parameters:
imageListFile The list of images

Definition at line 392 of file ControlNet.cpp.

Referenced by Isis::BundleAdjust::Init().

void Isis::ControlNet::SetModifiedDate ( const std::string &  date  )  [inline]

Set the last modified date.

Parameters:
date The last date this Control Network was modified

Definition at line 159 of file ControlNet.h.

References p_modified.

Referenced by Write().

void Isis::ControlNet::SetNetworkId ( const std::string &  id  )  [inline]

Set the network id.

Parameters:
id The Id of this Control Network

Definition at line 118 of file ControlNet.h.

References p_networkId.

void Isis::ControlNet::SetTarget ( const std::string &  target  )  [inline]

Set the target name.

Parameters:
target The name of the target of this Control Network

Definition at line 108 of file ControlNet.h.

References p_targetName.

void Isis::ControlNet::SetType ( const NetworkType type  )  [inline]

Set the type of network.

Parameters:
type This Control Network's type

Definition at line 98 of file ControlNet.h.

References p_type.

void Isis::ControlNet::SetUserName ( const std::string &  name  )  [inline]

Set the user name.

Parameters:
name The name of the user creating or modifying this Control Net

Definition at line 128 of file ControlNet.h.

References p_userName.

int Isis::ControlNet::Size (  )  const [inline]

Return the number of control points in the network.

Definition at line 171 of file ControlNet.h.

References p_pointsHash.

Referenced by Isis::BundleAdjust::ApplyHeldList(), Isis::BundleAdjust::BasisColumns(), Delete(), Qisis::MosaicItem::displayControlPoints(), Isis::BundleAdjust::Init(), NumValidPoints(), SetImages(), Isis::BundleAdjust::Solve(), and Isis::BundleAdjust::Update().

std::string Isis::ControlNet::Target (  )  const [inline]

Return the target name.

Definition at line 111 of file ControlNet.h.

References p_targetName.

NetworkType Isis::ControlNet::Type (  )  const [inline]

Return the type of network.

Definition at line 101 of file ControlNet.h.

References p_type.

std::string Isis::ControlNet::UserName (  )  const [inline]

Return the user name.

Definition at line 131 of file ControlNet.h.

References p_userName.

void Isis::ControlNet::Write ( const std::string &  ptfile  ) 

Writes out the ControlPoints.

Parameters:
ptfile Name of file containing a Pvl list of control points
Exceptions:
Isis::iException::Programmer - "Invalid Net Enumeration"
Isis::iException::Io - "Unable to write PVL infomation to file"

Definition at line 211 of file ControlNet.cpp.

References _FILEINFO_, Isis::PvlObject::AddObject(), Isis::iTime::CurrentLocalTime(), e, ImageToGround, ImageToImage, Isis::iException::Message(), p_created, p_description, p_modified, p_networkId, p_pointIds, p_pointsHash, p_targetName, p_type, p_userName, SetCreatedDate(), SetModifiedDate(), Singleton, and Isis::Pvl::Write().


Member Data Documentation

std::vector<Isis::Camera *> Isis::ControlNet::p_cameraList [private]

Vector of image number to camera.

Definition at line 231 of file ControlNet.h.

Referenced by SetImages().

std::map<std::string,Isis::Camera *> Isis::ControlNet::p_cameraMap [private]

A map from serialnumber to camera.

Definition at line 230 of file ControlNet.h.

Referenced by SetImages().

std::string Isis::ControlNet::p_created [private]

Creation Date.

Definition at line 223 of file ControlNet.h.

Referenced by ReadControl(), SetCreatedDate(), and Write().

std::string Isis::ControlNet::p_description [private]

Textual Description of network.

Definition at line 225 of file ControlNet.h.

Referenced by Description(), ReadControl(), SetDescription(), and Write().

bool Isis::ControlNet::p_invalid [private]

If the Control Network is currently invalid.

Definition at line 233 of file ControlNet.h.

Referenced by ControlNet(), Delete(), and Invalid().

std::string Isis::ControlNet::p_modified [private]

Date Last Modified.

Definition at line 224 of file ControlNet.h.

Referenced by ReadControl(), SetModifiedDate(), and Write().

std::string Isis::ControlNet::p_networkId [private]

The Network Id.

Definition at line 222 of file ControlNet.h.

Referenced by NetworkId(), ReadControl(), SetNetworkId(), and Write().

int Isis::ControlNet::p_numIgnoredMeasures [private]

Number of ignored measures.

Definition at line 229 of file ControlNet.h.

Referenced by ControlNet(), NumIgnoredMeasures(), NumValidMeasures(), and ReadControl().

int Isis::ControlNet::p_numMeasures [private]

Total number of measures in the network.

Definition at line 228 of file ControlNet.h.

Referenced by ControlNet(), NumMeasures(), NumValidMeasures(), and ReadControl().

QVector<QString> Isis::ControlNet::p_pointIds [private]

QVector of ControlPoint Ids.

Definition at line 216 of file ControlNet.h.

Referenced by Add(), AverageError(), ComputeApriori(), ComputeErrors(), Delete(), Find(), FindClosest(), MaximumError(), NumValidPoints(), operator[](), SetImages(), and Write().

QHash<QString, ControlPoint> Isis::ControlNet::p_pointsHash [private]

Hash table of Control Points.

Definition at line 220 of file ControlNet.h.

Referenced by Add(), AverageError(), ComputeApriori(), ComputeErrors(), Delete(), Exists(), Find(), FindClosest(), MaximumError(), NumValidPoints(), operator[](), SetImages(), Size(), and Write().

std::string Isis::ControlNet::p_targetName [private]

Name of the target.

Definition at line 221 of file ControlNet.h.

Referenced by ReadControl(), SetTarget(), Target(), and Write().

NetworkType Isis::ControlNet::p_type [private]

The type of network being used.

Definition at line 227 of file ControlNet.h.

Referenced by ReadControl(), SetType(), Type(), and Write().

std::string Isis::ControlNet::p_userName [private]

The user who created the network.

Definition at line 226 of file ControlNet.h.

Referenced by ReadControl(), SetUserName(), UserName(), and Write().


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