Isis 3.0 Programmer Reference
Back | Home
Isis::ControlNet Class Reference

a control network More...

#include <ControlNet.h>

Inheritance diagram for Isis::ControlNet:
Inheritance graph
Collaboration diagram for Isis::ControlNet:
Collaboration graph

Classes

class  ControlMeasureLessThanFunctor
 
class  ControlVertex
 Encapsulation of a vertex in a minimum spanning tree. More...
 

Signals

void networkStructureModified ()
 

Public Member Functions

 ControlNet ()
 Creates an empty ControlNet object. More...
 
 ControlNet (const ControlNet &other)
 
 ControlNet (const QString &filename, Progress *progress=0)
 Creates a ControlNet object with the given list of control points and cubes. More...
 
 ~ControlNet ()
 Destructor removes allocated memory. More...
 
void clear ()
 Clear the contents of this object. More...
 
QList< ControlPoint * > take ()
 Transfer ownership of all points to caller. More...
 
void ReadControl (const QString &filename, Progress *progress=0)
 Reads in the control points from the given file. More...
 
void Write (const QString &filename, bool pvl=false)
 Writes out the control network. More...
 
void AddPoint (ControlPoint *point)
 Adds a ControlPoint to the ControlNet. More...
 
int DeletePoint (ControlPoint *point)
 Delete a ControlPoint from the network by the point's address. More...
 
int DeletePoint (QString pointId)
 Delete a ControlPoint from the network using the point's Id. More...
 
int DeletePoint (int index)
 Delete a ControlPoint from the network using the point's index. More...
 
bool ContainsPoint (QString pointId) const
 
QList< QString > GetCubeSerials () const
 Use this method to get a complete list of all the cube serial numbers in the network. More...
 
QList< ControlCubeGraphNode * > GetCubeGraphNodes ()
 
QList< QList< QString > > GetSerialConnections () const
 This method searches through all the cube serial numbers in the network. More...
 
QList< QList
< ControlCubeGraphNode * > > 
GetNodeConnections () const
 This method searches through all the cube serial numbers in the network. More...
 
QSet< ControlMeasure * > MinimumSpanningTree (QList< ControlCubeGraphNode * > &island, bool lessThan(const ControlMeasure *, const ControlMeasure *)) const
 This method uses Kruskal's Algorithm to construct a minimum spanning tree of the given island, with control measures acting as the edges between graph nodes. More...
 
int getEdgeCount () const
 
QString CubeGraphToString () const
 Used for verifying graph intergrity. More...
 
QList< ControlMeasure * > GetMeasuresInCube (QString serialNumber)
 Get all the measures pertaining to a given cube serial number. More...
 
QList< ControlMeasure * > sortedMeasureList (double(ControlMeasure::*statFunc)() const, double min, double max)
 Get a sorted list of all the measures that have values in a given ragen. More...
 
void DeleteMeasuresWithId (QString serialNumber)
 Essentially removes a cube from the networkid. More...
 
void ComputeResiduals ()
 Compute error for each point in the network. More...
 
void ComputeApriori ()
 Compute aprior values for each point in the network. More...
 
const ControlPointGetPoint (QString pointId) const
 
ControlPointGetPoint (QString pointId)
 
const ControlPointGetPoint (int index) const
 
ControlPointGetPoint (int index)
 
const ControlCubeGraphNodegetGraphNode (QString serialNumber) const
 
ControlCubeGraphNodegetGraphNode (QString serialNumber)
 
double AverageResidual ()
 Compute the average error of all points in the network. More...
 
Isis::CameraCamera (int index)
 Returns the camera list from the given image number. More...
 
QString CreatedDate () const
 Return the Created Date. More...
 
QString Description () const
 Return the description of the network. More...
 
ControlPointFindClosest (QString 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. More...
 
bool IsValid () const
 Return if the control point is invalid. More...
 
double GetMaximumResidual ()
 Determine the maximum error of all points in the network. More...
 
QString GetNetworkId () const
 
int GetNumEditLockMeasures ()
 Return the total number of edit locked measures for all control points in the network. More...
 
int GetNumEditLockPoints ()
 Returns the number of edit locked control points. More...
 
int GetNumIgnoredMeasures ()
 Return the total number of ignored measures for all control points in the network. More...
 
int GetNumberOfValidMeasuresInImage (const QString &serialNumber)
 Return the number of measures in image specified by serialNumber. More...
 
int GetNumberOfJigsawRejectedMeasuresInImage (const QString &serialNumber)
 Return the number of jigsaw rejected measures in image specified by serialNumber. More...
 
void ClearJigsawRejected ()
 Sets jigsaw rejected flag to false for all points and measures. More...
 
void IncrementNumberOfRejectedMeasuresInImage (const QString &serialNumber)
 Increment number of jigsaw rejected measures in image specified by serialNumber. More...
 
void DecrementNumberOfRejectedMeasuresInImage (const QString &serialNumber)
 Decrement number of jigsaw rejected measures in image specified by serialNumber. More...
 
int GetNumMeasures () const
 Returns the total number of measures for all control points in the network. More...
 
int GetNumPoints () const
 Return the number of control points in the network. More...
 
int GetNumValidMeasures ()
 Return the number of valid (non-ignored) measures for all control points in the network. More...
 
int GetNumValidPoints ()
 Returns the number of non-ignored control points. More...
 
QString GetTarget () const
 Return the target name. More...
 
QString GetUserName () const
 Return the user name. More...
 
QList< ControlPoint * > GetPoints ()
 Return QList of ControlPoints ordered by point ID. More...
 
QList< QString > GetPointIds () const
 Return QList of ControlPoint Ids used in hash, in order of addition. More...
 
std::vector< DistanceGetTargetRadii ()
 Get the target radii. More...
 
void SetCreatedDate (const QString &date)
 Set the creation time. More...
 
void SetDescription (const QString &newDescription)
 Set the description of the network. More...
 
void SetImages (const QString &imageListFile)
 Creates the ControlNet's image cameras based on an input file. More...
 
void SetImages (SerialNumberList &list, Progress *progress=0)
 Creates the ControlNet's image camera's based on the list of Serial Numbers. More...
 
void SetModifiedDate (const QString &date)
 Set the last modified date. More...
 
void SetMutex (QMutex *mutex)
 Set mutex to lock for making Naif calls. More...
 
void SetNetworkId (const QString &id)
 Set the network id. More...
 
void SetTarget (const QString &target)
 Sets the target name and target radii, if available. More...
 
void SetTarget (Pvl label)
 Sets the target name and radii using values found in the mapping group of the given label, if available. More...
 
void SetTarget (const ControlNet &other)
 
void SetTarget (const QString &target, const QVector< Distance > &radii)
 Directly sets the target name and radii using the given information. More...
 
void SetUserName (const QString &name)
 Set the user name of the control network. More...
 
void swap (ControlNet &other)
 Swaps the member data with the given control net. More...
 
ControlNetoperator= (const ControlNet &other)
 Assign other to this. More...
 
const ControlPointoperator[] (QString id) const
 
ControlPointoperator[] (QString id)
 
const ControlPointoperator[] (int id) const
 
ControlPointoperator[] (int id)
 

Private Member Functions

void nullify ()
 
void ValidateSerialNumber (QString serialNumber) const
 Does a check to ensure that the given serial number is contained within the network. More...
 
void measureAdded (ControlMeasure *measure)
 Updates the ControlCubeGraphNode for the measure's serial number to reflect the addition. More...
 
void measureDeleted (ControlMeasure *measure)
 Updates the ControlCubeGraphNode for this measure's serial number to reflect the deletion. More...
 
void measureIgnored (ControlMeasure *measure)
 
void measureUnIgnored (ControlMeasure *measure)
 Updates the connections for the ControlCubeGraphNode associated with the measure's serial number to reflect the unignoration. More...
 
void UpdatePointReference (ControlPoint *point, QString oldId)
 Updates the key reference (poind Id) from the old one to what the point id was changet to. More...
 
void emitNetworkStructureModified ()
 
QList< ControlCubeGraphNode * > RandomBFS (QList< ControlCubeGraphNode * > list) const
 Random breadth-first search. More...
 
void Shuffle (QList< ControlCubeGraphNode * > &list) const
 Shuffles the QStrings in a QList< QString > More...
 
QPair< int, int > CalcBWAndCE (QList< QString > serials) const
 Calculate the band width and critical edges needed by the adjacency matrix that could store cube connectivity if that matrix used the same ordering as is in the provided list. More...
 

Private Attributes

QHash< QString, ControlPoint * > * points
 hash ControlPoints by ControlPoint Id More...
 
QHash< QString,
ControlCubeGraphNode * > * 
cubeGraphNodes
 hash ControlCubeGraphNodes by CubeSerialNumber More...
 
QStringListpointIds
 
QMutex * m_mutex
 
QString p_targetName
 Name of the target. More...
 
QString p_networkId
 The Network Id. More...
 
QString p_created
 Creation Date. More...
 
QString p_modified
 Date Last Modified. More...
 
QString p_description
 Textual Description of network. More...
 
QString p_userName
 The user who created the network. More...
 
std::map< QString, Isis::Camera * > p_cameraMap
 A map from serialnumber to camera. More...
 
std::map< QString, int > p_cameraValidMeasuresMap
 A map from serialnumber to #measures. More...
 
std::map< QString, int > p_cameraRejectedMeasuresMap
 
                                     A map from serialnumber to

#rejected measures More...

 
std::vector< Isis::Camera * > p_cameraList
 Vector of image number to camera. More...
 
std::vector< Distancep_targetRadii
 Radii of target body. More...
 
bool p_invalid
 If the Control Network is currently invalid. More...
 
bool m_ownPoints
 Specifies ownership of point list. True if owned by this object. More...
 

Friends

class ControlMeasure
 
class ControlPoint
 

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
History:

2005-07-29 Jeff Anderson Original version

2006-01-11 Jacob Danton Updated unitTest

2006-06-22 Brendan George Updated to conform to changes in SerialNumberList class

2008-04-04 Christopher Austin Added Exists function

2008-04-18 Debbie A. Cook Added Progress reports to loading and SetImages and calculates the total number of measurements in the control net

2008-06-18 Christopher Austin Fixed documentation errors

2009-01-06 Jeannie Walldren Fixed typo in SetImages() exception output. Added documentation.

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.

2009-04-07 Tracie Sucharski Added NumValidMeasures and NumIgnoredMeasures methods.

2009-06-03 Christopher Austin Added p_invalid functionality along with forceBuild, as well as other small fixes including documentation.

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.

2010-05-06 Tracie Sucharski Use defaults of 0. instead of Isis::Null, because 0. is the default in the protocol buffers.

2010-08-06 Tracie Sucharski Updated for changes made after additional working sessions for Control network design.

2009-09-01 Eric Hyer Added two includes: QVector and QString

2010-09-09 Sharmila Prasad Added API to sort Control Net by Point ID Changed PointID's vector to StringList

2009-09-25 Travis Addair Changed methods which return the number of control measures in the network to compute those values at the time the method is called, not when the control network is first initialized.

2010-10-05 Tracie Sucharski Renamed the Write method to WritePvl. Create new method, Write which takes another parameter indicating whether to write pvl format or binary format, The default will write binary.

2010-10-05 Eric Hyer ControlMeasure and ControlPoint now return QStrings for some methods. Fixed breakages caused by this.

2010-10-06 Sharmila Prasad Added method to get CreatedDate

2010-11-21 Tracie Sucharski - Added new keyword, jigsawRejected to the read and write methods.

2011-01-13 Mackenzie Boyd Added copy constructor and assignment operator.

2011-01-17 Eric Hyer - Points are now owned and deleted by the network. Network now stored in such a way that access to all points in a cube is just as cheap as accessing measures in a point. Removed redundant methods and made other api changes.

2011-02-18 Eric Hyer - Made improvements and bug fixes related to interaction to other control network classes including ControlPoint and ControlMesure, but most significantly to ControlCubeGraphNode. Most important fix was network notification of measures added to or removed from points after the point is added to the network.

2011-02-23 Eric Hyer - Added some methods to support graphing calculations (RandomBFS, Shuffle, CalcBWAndCE, and GetNodeConnections).

2011-03-08 Ken Edmundson - Added methods GetNumberOfMeasuresInImage, GetNumberOfJigsawRejectedMeasuresInImage, IncrementNumberOfRejectedMeasuresInImage, DecrementNumberOfRejectedMeasuresInImage, and members p_cameraMeasuresMap and p_cameraRejectedMeasuresMap.

2011-03-12 Debbie A. Cook - Added member p_targetRadii and method GetTargetRadii to support SurfacePoint sigma conversions in ControlPoint.

2011-03-14 Eric Hyer - Cube connection graph now updated when points or measures are ignored.

2011-03-15 Eric Hyer - Some cube graph bugs were fixed.

2011-03-25 Christopher Austin - Added UpdatePointReference() to work with ControlPoint's SetId()

2011-03-29 Steven Lambright - Made versioning viable for first release.

2011-04-27 Steven Lambright - UpdatePointReference had a bug where the pointIds list was not being correctly updated.

2011-05-04 Eric Hyer - References in graph data structure now kept for ignored points and measures

2011-05-25 Eric Hyer - Added getPoints method

2011-06-22 James Alexander Crough and Eric Hyer - Added getGraphNode method.

2011-06-28 Eric Hyer - Added getEdgeCount() method

2011-07-08 Travis Addair - Locked points can no longer be deleted

2011-07-27 Sharmila Prasad - Fixed bug in GetNumEditLockMeasures()

2011-08-01 Eric Hyer - Addressed some graphing issues

2011-08-24 Steven Lambright - Fixed bug in graph code

2011-10-06 Steven Lambright - Having a target is no longer required.

2011-10-14 Ken Edmundson Added method ClearJigsawRejected(); to set all measure/point JigsawRejected flags to false prior to bundle adjustment.

2012-04-13 Orrin Thomas Added method sortedMeasureList, and functor ControlMeasureLessThanFunctor.

2012-11-22 Debbie A. Cook - Changed to use TProjection instead of Projection. References #775.

2012-09-11 Tracie Sucharski - Added a Mutex and MutexLocker for the SetTarget method.

2012-09-26 Steven Lambright - Fixed assignment operator to return a non-const ControlNet reference. Added swap(). Refactored assignment operator to use copy-and-swap idiom which fixed a bug where you couldn't access control points by index after an assignment.

2013-11-08 Tracie Sucharski - Add camera to ignored measures. References #1603.

2013-12-18 Tracie Sucharski - Previous change caused problems for jigsaw app. It was expecting the method GetNumberOfMeasuresInImage to only return the number of VALID (Ignore=False) measures. Renamed method to GetNumberOfValidMeasuresInImage and the private variable p_cameraMeasuresMap to p_cameraValidMeasuresMap. References #1603.

2015-09-05 Ken Edmundson - Added QSharedPointer and typedef for later use.

2016-02-15 Kris Becker - Added feature to take ownership of points from ControlNet. To support this option, added clear() and take() methods. (Merged by Kristin Berry. References #2392)

2016-04-22 Jeannie Backer - Added try/catch to SetTarget()'s call to TProjection::TargetRadii(). If an error is thrown, the radii are now set to Isis:Null. Added SetTarget(Pvl), SetTarget(ControlNet), and SetTarget(QString, vector) methods to attempt to read radii from various sources, if not found using the TargetName. References #3892

2016-04-28 Tracie Sucharski - Updated toAscii() calls to toLatin1() for QT 5 upgrade.

2016-05-10 Jeannie Backer - Replaced calls to TProjection::TargetRadii() with calls to Target::radiiGroup(). References #3934

2016-06-21 Kris Becker - Properly forward declare QPair as struct not class

2016-06-08 Jesse Mapel - Merged changes from IPCE to ISIS. Fixes #3948.

2016-10-13 Ian Humphrey - Added check to SetImages() to make sure it isn't called more than once, which messes up the p_cameraList member. References #4293.

Definition at line 207 of file ControlNet.h.

Constructor & Destructor Documentation

Isis::ControlNet::ControlNet ( )

Creates an empty ControlNet object.

Definition at line 54 of file ControlNet.cpp.

Isis::ControlNet::ControlNet ( const QString &  ptfile,
Progress progress = 0 
)

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

Parameters
ptfileName of file containing a Pvl list of control points
progressA pointer to the progress of reading in the control points

Definition at line 103 of file ControlNet.cpp.

Isis::ControlNet::~ControlNet ( )

Destructor removes allocated memory.

Author
Kris Becker

Definition at line 128 of file ControlNet.cpp.

Member Function Documentation

void Isis::ControlNet::AddPoint ( ControlPoint point)

Adds a ControlPoint to the ControlNet.

Parameters
pointControl point to be added
Exceptions
IException::Programmer"Null pointer passed to ControlNet::AddPoint!"
IException::Programmer"ControlPoint must have unique Id"

Definition at line 339 of file ControlNet.cpp.

References _FILEINFO_, Isis::ControlPoint::GetId(), Isis::ControlPoint::getMeasures(), and Isis::ControlPoint::parentNetwork.

double Isis::ControlNet::AverageResidual ( )

Compute the average error of all points in the network.

Returns
double Average error of points
History:
2010-01-12 Tracie Sucharski - Renamed from AverageError

Definition at line 1210 of file ControlNet.cpp.

References Isis::Statistics::Average(), and Isis::ControlPoint::GetStatistic().

QPair< int, int > Isis::ControlNet::CalcBWAndCE ( QList< QString >  serials) const
private

Calculate the band width and critical edges needed by the adjacency matrix that could store cube connectivity if that matrix used the same ordering as is in the provided list.

Note that no adjacency matrices are ever used in this class!

Critical edges are edges that contribute to band width.

Parameters
serialsA list of cube serial numbers.
Returns
A QPair such that the first element is the needed bandwidth for the serials how they are currently ordered in the list, and the second element is the number of critical edges.

Definition at line 653 of file ControlNet.cpp.

Isis::Camera * Isis::ControlNet::Camera ( int  index)

Returns the camera list from the given image number.

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

Definition at line 1239 of file ControlNet.cpp.

Referenced by Isis::QnetSetAprioriDialog::fillReferenceAprioriLineEdits(), Isis::QnetPointDistanceFilter::filter(), and Isis::QnetCubeDistanceFilter::filter().

void Isis::ControlNet::clear ( )

Clear the contents of this object.

The contents of the ControlNet object are deleted. The internal variables that hold the contents are not. See the destructor.

Author
Kris Becker

Definition at line 148 of file ControlNet.cpp.

void Isis::ControlNet::ClearJigsawRejected ( )

Sets jigsaw rejected flag to false for all points and measures.

Called by BundleAdjust::Init method

Definition at line 1431 of file ControlNet.cpp.

References Isis::ControlPoint::ClearJigsawRejected().

void Isis::ControlNet::ComputeApriori ( )

Compute aprior values for each point in the network.

History:
2010-08-23 Ken Edmundson, skipping ignored points

Definition at line 1192 of file ControlNet.cpp.

References Isis::ControlPoint::ComputeApriori().

void Isis::ControlNet::ComputeResiduals ( )

Compute error for each point in the network.

History:
2010-01-11 Tracie Sucharski, Renamed from ComputeErrors

Definition at line 1176 of file ControlNet.cpp.

bool Isis::ControlNet::ContainsPoint ( QString  pointId) const
Parameters
pointIdthe point Id to check for in the network.
Returns
True if the point is in the network, false otherwise.

Definition at line 781 of file ControlNet.cpp.

Referenced by Isis::QnetNewPointDialog::enableOkButton(), Isis::NewControlPointDialog::enableOkButton(), and Isis::MatchToolNewPointDialog::MatchToolNewPointDialog().

QString Isis::ControlNet::CreatedDate ( ) const

Return the Created Date.

Author
Sharmila Prasad (10/6/2010)
Returns
std::string

Definition at line 1251 of file ControlNet.cpp.

QString Isis::ControlNet::CubeGraphToString ( ) const

Used for verifying graph intergrity.

Returns
A string representation of the cube graph

Definition at line 1021 of file ControlNet.cpp.

void Isis::ControlNet::DecrementNumberOfRejectedMeasuresInImage ( const QString &  serialNumber)

Decrement number of jigsaw rejected measures in image specified by serialNumber.

Definition at line 1451 of file ControlNet.cpp.

void Isis::ControlNet::DeleteMeasuresWithId ( QString  serialNumber)

Essentially removes a cube from the networkid.

Parameters
serialNumberThe cube serial number to be removed from the network

Definition at line 1160 of file ControlNet.cpp.

References Isis::ControlPoint::Delete().

int Isis::ControlNet::DeletePoint ( ControlPoint point)

Delete a ControlPoint from the network by the point's address.

Parameters
pointThe point to delete

Definition at line 692 of file ControlNet.cpp.

References _FILEINFO_, and Isis::ControlPoint::GetId().

Referenced by Isis::ControlNetFilter::FilterOutPoint().

int Isis::ControlNet::DeletePoint ( QString  pointId)

Delete a ControlPoint from the network using the point's Id.

Parameters
pointIdThe Point Id of the ControlPoint to be deleted.
Exceptions
IException::User"the point Id does not exist in the network"

Definition at line 712 of file ControlNet.cpp.

References _FILEINFO_, and Isis::ControlPoint::getMeasures().

int Isis::ControlNet::DeletePoint ( int  index)

Delete a ControlPoint from the network using the point's index.

Parameters
indexThe index of the Control Point to be deleted.

Definition at line 766 of file ControlNet.cpp.

References _FILEINFO_.

QString Isis::ControlNet::Description ( ) const

Return the description of the network.

Returns
The description of this Control Network

Definition at line 1261 of file ControlNet.cpp.

ControlPoint * Isis::ControlNet::FindClosest ( QString  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
serialNumberThe serial number of the the file the ControlMeasure is on
sampleThe sample number of the ControlMeasure
lineThe line number of the ControlMeasure
Returns
ControlPoint* Pointer to the ControlPoint closest to the given line, sample position

Definition at line 1278 of file ControlNet.cpp.

References _FILEINFO_.

QList< ControlCubeGraphNode * > Isis::ControlNet::GetCubeGraphNodes ( )
Returns
A list of all the cube graph nodes in the network

Definition at line 1056 of file ControlNet.cpp.

QList< QString > Isis::ControlNet::GetCubeSerials ( ) const

Use this method to get a complete list of all the cube serial numbers in the network.

Note that the order in which the serials are ordered in the returned list is arbitrary and could change each time this method is called (but the operation is done in constant time).

Returns
A list of the Cube Serial Numbers in the ControlNet.

Definition at line 1048 of file ControlNet.cpp.

Referenced by Isis::CnetDisplayProperties::getCubeList(), and Isis::ChipViewport::paintEvent().

int Isis::ControlNet::getEdgeCount ( ) const
Returns
The total number of edges in the bi-directional graph for images

Definition at line 1006 of file ControlNet.cpp.

double Isis::ControlNet::GetMaximumResidual ( )

Determine the maximum error of all points in the network.

Returns
double Max error of points
History:
2010-01-12 Tracie Sucharski - Renamed from MaximumError

Definition at line 1335 of file ControlNet.cpp.

References Isis::ControlPoint::GetStatistic(), and Isis::Statistics::Maximum().

QList< ControlMeasure * > Isis::ControlNet::GetMeasuresInCube ( QString  serialNumber)

Get all the measures pertaining to a given cube serial number.

Returns
A list of all measures which are in a given cube

Definition at line 1081 of file ControlNet.cpp.

Referenced by Isis::ChipViewport::paintEvent().

QList< QList< ControlCubeGraphNode * > > Isis::ControlNet::GetNodeConnections ( ) const

This method searches through all the cube serial numbers in the network.

Serials which are connected to other serials through points are grouped together in the same lists. The list containing the lists of strings is nothing more than a list of islands such that each island is a list of serials which are connected to each other. If the control network is completely connected, then this list will only have one element (a list of all the serials in the network).

Returns
A list of cube islands as graph nodes

Definition at line 821 of file ControlNet.cpp.

int Isis::ControlNet::GetNumberOfJigsawRejectedMeasuresInImage ( const QString &  serialNumber)

Return the number of jigsaw rejected measures in image specified by serialNumber.

Returns
Number of jigsaw rejected measures in image

Definition at line 1421 of file ControlNet.cpp.

int Isis::ControlNet::GetNumberOfValidMeasuresInImage ( const QString &  serialNumber)

Return the number of measures in image specified by serialNumber.

Returns
Number of valid measures in image
History:
2013-12-18 Tracie Sucharski - Renamed from GetNumberOfMeasuresInImage, it is returning a count of only valid measures (Ignore=False).

Definition at line 1411 of file ControlNet.cpp.

int Isis::ControlNet::GetNumEditLockMeasures ( )

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

Returns
Number of edit locked measures

Definition at line 1361 of file ControlNet.cpp.

References Isis::ControlPoint::GetNumLockedMeasures().

int Isis::ControlNet::GetNumEditLockPoints ( )

Returns the number of edit locked control points.

Returns
Number of edit locked control points

Definition at line 1376 of file ControlNet.cpp.

int Isis::ControlNet::GetNumIgnoredMeasures ( )

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

Returns
Number of valid measures

Definition at line 1393 of file ControlNet.cpp.

References Isis::ControlPoint::GetNumValidMeasures().

int Isis::ControlNet::GetNumMeasures ( ) const

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

Returns
Number of control measures

Definition at line 1462 of file ControlNet.cpp.

int Isis::ControlNet::GetNumValidMeasures ( )

Return the number of valid (non-ignored) measures for all control points in the network.

Returns
Number of valid measures
History:
2011-03-17 Debbie A. Cook - Modified to not count ignored measures.

Definition at line 1487 of file ControlNet.cpp.

References Isis::ControlPoint::GetNumValidMeasures().

int Isis::ControlNet::GetNumValidPoints ( )

Returns the number of non-ignored control points.

Returns
Number of valid control points

Definition at line 1503 of file ControlNet.cpp.

QList< QString > Isis::ControlNet::GetPointIds ( ) const

Return QList of ControlPoint Ids used in hash, in order of addition.

Definition at line 1539 of file ControlNet.cpp.

QList< ControlPoint * > Isis::ControlNet::GetPoints ( )

Return QList of ControlPoints ordered by point ID.

Definition at line 1527 of file ControlNet.cpp.

QList< QList< QString > > Isis::ControlNet::GetSerialConnections ( ) const

This method searches through all the cube serial numbers in the network.

Serials which are connected to other serials through points are grouped together in the same lists. The list containing the lists of strings is nothing more than a list of islands such that each island is a list of serials which are connected to each other. If the control network is completely connected, then this list will only have one element (a list of all the serials in the network).

Returns
A list of cube islands as serial numbers

Definition at line 797 of file ControlNet.cpp.

Referenced by Isis::MosaicControlNetTool::displayConnectivity().

QString Isis::ControlNet::GetTarget ( ) const

Return the target name.

Definition at line 1515 of file ControlNet.cpp.

QString Isis::ControlNet::GetUserName ( ) const

Return the user name.

Definition at line 1521 of file ControlNet.cpp.

void Isis::ControlNet::IncrementNumberOfRejectedMeasuresInImage ( const QString &  serialNumber)

Increment number of jigsaw rejected measures in image specified by serialNumber.

Definition at line 1442 of file ControlNet.cpp.

bool Isis::ControlNet::IsValid ( ) const

Return if the control point is invalid.

Definition at line 1324 of file ControlNet.cpp.

void Isis::ControlNet::measureAdded ( ControlMeasure measure)
private

Updates the ControlCubeGraphNode for the measure's serial number to reflect the addition.

If there is currently no ControlCubeGraphNode for this measure's serial, then a new ControlCubeGraphNode is created with this measure as its first.

Parameters
measureThe measure added to the network.
Exceptions
IException::Programmer"NULL measure passed to ControlNet::AddControlCubeGraphNode!"
IException::Programmer"Control measure with NULL parent passed to ControlNet::AddControlCubeGraphNode!"
IException::Programmer"ControlNet does not contain the point."

Definition at line 377 of file ControlNet.cpp.

References _FILEINFO_, Isis::ControlCubeGraphNode::addMeasure(), Isis::ControlMeasure::GetCubeSerialNumber(), Isis::ControlPoint::GetId(), and Isis::ControlPoint::GetMeasure().

Referenced by Isis::ControlPoint::AddMeasure().

void Isis::ControlNet::measureDeleted ( ControlMeasure measure)
private

Updates the ControlCubeGraphNode for this measure's serial number to reflect the deletion.

If this is the only measure left in the containing ControlCubeGraphNode, then the ControlCubeGraphNode is deleted as well.

Parameters
measureThe measure removed from the network.

Definition at line 514 of file ControlNet.cpp.

References Isis::ControlMeasure::GetCubeSerialNumber().

Referenced by Isis::ControlPoint::Delete().

void Isis::ControlNet::measureUnIgnored ( ControlMeasure measure)
private

Updates the connections for the ControlCubeGraphNode associated with the measure's serial number to reflect the unignoration.

Parameters
measureThe measure unignored from the network.
Exceptions
IException::Programmer"NULL measure passed to ControlNet::AddControlCubeGraphNode!"
IException::Programmer"Control measure with NULL parent passed to ControlNet::AddControlCubeGraphNode!"
IException::Programmer"ControlNet does not contain the point."
IException::Programmer"Node does not exist for the cube serial number."

Definition at line 441 of file ControlNet.cpp.

References _FILEINFO_, Isis::ControlMeasure::GetCubeSerialNumber(), Isis::ControlPoint::GetId(), and Isis::ControlPoint::GetMeasure().

Referenced by Isis::ControlPoint::SetIgnored().

QSet< ControlMeasure * > Isis::ControlNet::MinimumSpanningTree ( QList< ControlCubeGraphNode * > &  island,
bool   lessThanconst ControlMeasure *, const ControlMeasure * 
) const

This method uses Kruskal's Algorithm to construct a minimum spanning tree of the given island, with control measures acting as the edges between graph nodes.

Because measures do not directly connect graph nodes, but rather connect graph nodes to control points, points are considered "intermediate vertices". When building the tree, we treat points like normal graph node vertices, but after the tree is built, we prune away any measures that, in conjunction with a point, form an "incomplete edge". Such an edge goes from a graph node to a point, but does not have another edge going from that point to another node. Since the primary purpose of this tree is to evaluate image connectivity, such edges are unnecessary. A "complete edge" consists of two measures and a point, and connects two graph nodes, or images.

The cost of each edge is determined by the provided less-than comparison function. If a Control Measure is less-than another, it is said to have a lower cost, and is thus more likely to appear in the minimum spanning tree.

Minimum spanning trees are constructed on islands, not networks, so it is important that the caller first retrieve the list of islands in the network from the GetNodeConnections() method before invoking this method. Creating a minimum spanning tree for an entire network with multiple islands would be impractical, as this method does not account for the possibility that some nodes are disconnected in the input.

A common usage of the minimum spanning tree is to measure the importance of a given measure or point to the overall connectivity of a network. If a measurement is not in the MST, we do not need to worry about creating additional islands by removing it.

It is important that the user choose their less-than function carefully. If a poor less-than function is used, then "bad" measures could end up in the MST while "good" measures are excluded, thus giving the user the false impression that a good measure can be safely deleted, while a bad measure must be preserved. The application "cnetwinnow", for example, tries to remove as many measures with high residuals as possible without increasing the island count of the network, so its less-than function compares the residual magnitude of the two input measures.

Parameters
islandThe list of graph nodes forming the island to be minimized
lessThanA comparison function telling us if one measure is better than another
Returns
The set of all measures (edges) in the minimum spanning tree

Definition at line 887 of file ControlNet.cpp.

References _FILEINFO_, Isis::ControlPoint::GetId(), Isis::ControlNet::ControlVertex::getPoint(), and Isis::ControlNet::ControlVertex::getRoot().

ControlNet & Isis::ControlNet::operator= ( const ControlNet other)

Assign other to this.

This is an exception-safe assignment operator.

Parameters
otherThe control net to assign to this.

Definition at line 1872 of file ControlNet.cpp.

QList< ControlCubeGraphNode * > Isis::ControlNet::RandomBFS ( QList< ControlCubeGraphNode * >  nodes) const
private

Random breadth-first search.

This meathod starts at a random serial, and returns a list with the start serial as well as any serial which is directly or indirectly connected to it. The list returned will contain all the serials in the network if and only if the network is completely connected. Otherwise, the list returned will be the entire island on which a random image resides.

Returns
A List of connected graph nodes

Definition at line 590 of file ControlNet.cpp.

void Isis::ControlNet::ReadControl ( const QString &  filename,
Progress progress = 0 
)

Reads in the control points from the given file.

Parameters
ptfileName of file containing a Pvl list of control points
progressA pointer to the progress of reading in the control points
Exceptions
Isis::iException::User- "Invalid Network Type"
Isis::iException::User- "Invalid Control Point"
Isis::iException::User- "Invalid Format"
History:

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

2010-08-06 Tracie Sucharski, Updated for changes made after additional working sessions for Control network design.

2011-04-02 Debbie A. Cook - Added code to set the target radii in the surface points of the control points as they are read into memory instead of setting parent prematurely to be able to set the radii in ControlPoint.

Definition at line 243 of file ControlNet.cpp.

References Isis::Progress::CheckStatus(), Isis::ControlNetFileV0002::GetNetworkHeader(), Isis::ControlNetFileV0002::GetNetworkPoints(), Isis::Progress::SetMaximumSteps(), and Isis::Progress::SetText().

void Isis::ControlNet::SetCreatedDate ( const QString &  date)

Set the creation time.

Parameters
dateThe date this Control Network was created

Definition at line 1549 of file ControlNet.cpp.

void Isis::ControlNet::SetDescription ( const QString &  newDescription)

Set the description of the network.

Parameters
descThe description of this Control Network

Definition at line 1559 of file ControlNet.cpp.

void Isis::ControlNet::SetImages ( const QString &  imageListFile)

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

Parameters
imageListFileThe list of images

Definition at line 1569 of file ControlNet.cpp.

Referenced by Isis::SetActiveControlWorkOrder::execute(), and Isis::QnetFileTool::open().

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

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

Parameters
listThe list of Serial Numbers
progressA 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"
History:

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

2016-10-13 Ian Humphrey - Added initial check to see if cameras have already been set, and immediately return if yes. References #4293.

Definition at line 1590 of file ControlNet.cpp.

References _FILEINFO_, Isis::Progress::CheckStatus(), Isis::SerialNumberList::fileName(), Isis::ControlMeasure::GetCubeSerialNumber(), Isis::ControlPoint::getCubeSerialNumbers(), Isis::ControlPoint::GetId(), Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::serialNumber(), Isis::ControlMeasure::SetCamera(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), and Isis::SerialNumberList::size().

void Isis::ControlNet::SetModifiedDate ( const QString &  date)

Set the last modified date.

Parameters
dateThe last date this Control Network was modified

Definition at line 1657 of file ControlNet.cpp.

void Isis::ControlNet::SetMutex ( QMutex *  mutex)

Set mutex to lock for making Naif calls.

Author
2012-09-11 Tracie Sucharski
Parameters
mutex

Definition at line 1669 of file ControlNet.cpp.

void Isis::ControlNet::SetNetworkId ( const QString &  id)

Set the network id.

Parameters
idThe Id of this Control Network

Definition at line 1679 of file ControlNet.cpp.

void Isis::ControlNet::SetTarget ( const QString &  target)

Sets the target name and target radii, if available.

Note: The target radii are found using NAIF target codes. If the given target name is not recognized, the target radii vector will be filled with Isis::Null values.

See Also
Target::radiiGroup(QString)
Parameters
targetThe name of the target of this Control Network

Definition at line 1695 of file ControlNet.cpp.

Referenced by Isis::QnetFileTool::open().

void Isis::ControlNet::SetTarget ( Pvl  label)

Sets the target name and radii using values found in the mapping group of the given label, if available.

If this fails, calls SetTarget(QString).

Parameters
labelA PVL Containing Target information (usually in a Mapping group or NaifKeywords object).

Definition at line 1731 of file ControlNet.cpp.

References Isis::PvlContainer::clear(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), and Isis::PvlObject::hasObject().

void Isis::ControlNet::SetTarget ( const QString &  target,
const QVector< Distance > &  radii 
)

Directly sets the target name and radii using the given information.

See Also
Target::radiiGroup(Pvl, PvlGroup)
Parameters
targetThe name of the target for this Control Network
targetA 3-dimensional vector containing the A (equatorial major), B (equatorial minor), and C (polar) triaxial radii values of the target for this Control Network

Definition at line 1790 of file ControlNet.cpp.

References _FILEINFO_.

void Isis::ControlNet::SetUserName ( const QString &  name)

Set the user name of the control network.

Parameters
nameThe name of the user creating or modifying this ControlNet

Definition at line 1815 of file ControlNet.cpp.

Referenced by Isis::QnetFileTool::open().

void Isis::ControlNet::Shuffle ( QList< ControlCubeGraphNode * > &  list) const
private

Shuffles the QStrings in a QList< QString >

Parameters
listThe list to be shuffled

Definition at line 629 of file ControlNet.cpp.

QList< ControlMeasure * > Isis::ControlNet::sortedMeasureList ( double(ControlMeasure::*)() const  statFunc,
double  min,
double  max 
)

Get a sorted list of all the measures that have values in a given ragen.

Parameters
statFuncA pointer to a control Measure acessor
minthe minimum value of acessor return for list inclusion
maxthe maximum value of acessor return for list inclusion

Definition at line 1124 of file ControlNet.cpp.

References Isis::ControlPoint::GetMeasure().

void Isis::ControlNet::swap ( ControlNet other)

Swaps the member data with the given control net.

This is an optimized form of: ControlNet a = ... ControlNet b = ...

Swap 'a' and 'b' ControlNet tmp = a; a = b; b = tmp;

This is used primarily for the assignment operator in order to do copy-and-swap.

Parameters
otherThe control net to swap with.

Definition at line 1834 of file ControlNet.cpp.

References cubeGraphNodes, p_cameraList, p_cameraMap, p_cameraRejectedMeasuresMap, p_cameraValidMeasuresMap, p_created, p_description, p_invalid, p_modified, p_networkId, p_targetName, p_targetRadii, p_userName, and points.

QList< ControlPoint * > Isis::ControlNet::take ( )

Transfer ownership of all points to caller.

This method is used to transfer ownership to the caller. This method is not reintrant in the sense that if someone else has already made this call, it is an error to attempt to take ownership again.

Note that it now becomes the responsibility of the caller to delete all the pointers to ControlPoints that are returned in the list.

WARNING!!! This call alone can create a situation where the owner could delete point memory after the point list is exported from this class creating a problem. For this reason, the clear() method be called!!!

Author
Kris Becker
Returns
QList<ControlPoint*> Returns the list of all control points to caller

Definition at line 201 of file ControlNet.cpp.

References _FILEINFO_.

void Isis::ControlNet::UpdatePointReference ( ControlPoint point,
QString  oldId 
)
private

Updates the key reference (poind Id) from the old one to what the point id was changet to.

This method should only be called from ControlPoint's SetId().

Parameters
pointThe point that needs to be updated.
oldIdThe pointId that the point had.

Definition at line 500 of file ControlNet.cpp.

References Isis::ControlPoint::GetId().

Referenced by Isis::ControlPoint::SetId().

void Isis::ControlNet::ValidateSerialNumber ( QString  serialNumber) const
private

Does a check to ensure that the given serial number is contained within the network.

If it is not, then an exception is thrown

Parameters
serialNumberthe cube serial number to validate

Definition at line 1067 of file ControlNet.cpp.

References _FILEINFO_.

void Isis::ControlNet::Write ( const QString &  ptfile,
bool  pvl = false 
)

Writes out the control network.

Parameters
ptfileName of file containing a Pvl list of control points
pvlBoolean indicating whether to write in pvl format (Default=false)
Exceptions
Isis::iException::Programmer- "Invalid Net Enumeration"
Isis::iException::Io- "Unable to write PVL infomation to file"
History:
2010-10-05 Tracie Sucharski - Renamed old WRite method to WritePvl and created this new method to determine format to be written.

Definition at line 302 of file ControlNet.cpp.

References Isis::ControlNetFileV0002::GetNetworkHeader(), and Isis::ControlNetFileV0002::GetNetworkPoints().

Referenced by Isis::ExportControlNetWorkOrder::asyncRedo(), Isis::Control::copyToNewProjectRoot(), Isis::QnetFileTool::save(), and Isis::QnetFileTool::saveAs().

Member Data Documentation

QHash< QString, ControlCubeGraphNode * >* Isis::ControlNet::cubeGraphNodes
private

hash ControlCubeGraphNodes by CubeSerialNumber

Definition at line 424 of file ControlNet.h.

Referenced by swap().

bool Isis::ControlNet::m_ownPoints
private

Specifies ownership of point list. True if owned by this object.

Definition at line 442 of file ControlNet.h.

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

Vector of image number to camera.

Definition at line 438 of file ControlNet.h.

Referenced by swap().

std::map<QString, Isis::Camera *> Isis::ControlNet::p_cameraMap
private

A map from serialnumber to camera.

Definition at line 434 of file ControlNet.h.

Referenced by swap().

std::map<QString, int> Isis::ControlNet::p_cameraRejectedMeasuresMap
private

                                     A map from serialnumber to

#rejected measures

Definition at line 436 of file ControlNet.h.

Referenced by swap().

std::map<QString, int> Isis::ControlNet::p_cameraValidMeasuresMap
private

A map from serialnumber to #measures.

Definition at line 435 of file ControlNet.h.

Referenced by swap().

QString Isis::ControlNet::p_created
private

Creation Date.

Definition at line 430 of file ControlNet.h.

Referenced by swap().

QString Isis::ControlNet::p_description
private

Textual Description of network.

Definition at line 432 of file ControlNet.h.

Referenced by swap().

bool Isis::ControlNet::p_invalid
private

If the Control Network is currently invalid.

Definition at line 441 of file ControlNet.h.

Referenced by swap().

QString Isis::ControlNet::p_modified
private

Date Last Modified.

Definition at line 431 of file ControlNet.h.

Referenced by swap().

QString Isis::ControlNet::p_networkId
private

The Network Id.

Definition at line 429 of file ControlNet.h.

Referenced by swap().

QString Isis::ControlNet::p_targetName
private

Name of the target.

Definition at line 428 of file ControlNet.h.

Referenced by swap().

std::vector<Distance> Isis::ControlNet::p_targetRadii
private

Radii of target body.

Definition at line 439 of file ControlNet.h.

Referenced by swap().

QString Isis::ControlNet::p_userName
private

The user who created the network.

Definition at line 433 of file ControlNet.h.

Referenced by swap().

QHash< QString, ControlPoint * >* Isis::ControlNet::points
private

hash ControlPoints by ControlPoint Id

Definition at line 421 of file ControlNet.h.

Referenced by swap().


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

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:43:38