File failed to load: https://isis.astrogeology.usgs.gov/3.9.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Developer Reference
ControlNet.h
Go to the documentation of this file.
1 #ifndef ControlNet_h
2 #define ControlNet_h
3 
26 // This is needed for the QVariant macro
27 #include <QMetaType>
28 #include <QObject> // parent class
29 #include <QSharedPointer>
30 #include "SurfacePoint.h"
31 #include <QString>
32 #include <QMap>
33 #include <QVariant>
34 #include <QVector>
35 #include <QVariant>
36 
37 
38 // Boost includes
39 #include <boost/graph/graph_traits.hpp>
40 #include <boost/graph/adjacency_list.hpp>
41 #include <boost/graph/connected_components.hpp>
42 
43 #include "ControlMeasure.h"
44 #include "ControlPoint.h"
45 
46 template< typename A, typename B > class QHash;
47 template< typename T > class QList;
48 template< typename A, typename B > struct QPair;
49 template< typename T > class QSet;
50 
51 class QMutex;
52 class QString;
53 
54 namespace Isis {
55  class Camera;
56  class ControlMeasure;
57  class ControlPoint;
58  class Distance;
59  class Progress;
60  class Pvl;
61  class SerialNumberList;
62 
271  class ControlNet : public QObject {
272  Q_OBJECT
273 
274  friend class ControlMeasure;
275  friend class ControlPoint;
276 
277  public:
278 
288  enum ModType {
291  };
292 
294  ControlNet(const ControlNet &other);
295  ControlNet(const QString &filename, Progress *progress = 0,
297 
298  ~ControlNet();
299 
300  void clear();
302 
303  void ReadControl(const QString &filename, Progress *progress = 0);
304  void Write(const QString &filename, bool pvl = false);
305 
306  void AddPoint(ControlPoint *point);
307  int DeletePoint(ControlPoint *point);
308  int DeletePoint(QString pointId);
309  int DeletePoint(int index);
310  bool ContainsPoint(QString pointId) const;
311 
313  QString GraphToString() const;
315  int getEdgeCount() const;
316  QList< QString > getAdjacentImages(QString serialNumber) const;
317  QList< ControlMeasure * > GetMeasuresInCube(QString serialNumber);
320  double min,double max);
321 
322  void ComputeResiduals();
323  void ComputeApriori();
324 
325  const ControlPoint *GetPoint(QString pointId) const;
326  ControlPoint *GetPoint(QString pointId);
327  const ControlPoint *GetPoint(int index) const;
328  ControlPoint *GetPoint(int index);
329 
330  double AverageResidual();
331  Isis::Camera *Camera(int index);
332  QString CreatedDate() const;
333  QString Description() const;
334  ControlPoint *FindClosest(QString serialNumber,
335  double sample, double line);
336  //bool IsValid() const;
337  double GetMaximumResidual();
338  QString GetNetworkId() const;
340  int GetNumEditLockPoints();
341  int GetNumIgnoredMeasures();
342  int GetNumberOfValidMeasuresInImage(const QString &serialNumber);
343  int GetNumberOfJigsawRejectedMeasuresInImage(const QString &serialNumber);
344  void ClearJigsawRejected();
345  void IncrementNumberOfRejectedMeasuresInImage(const QString &serialNumber);
346  void DecrementNumberOfRejectedMeasuresInImage(const QString &serialNumber);
347  int GetNumMeasures() const;
348  int GetNumPoints() const;
349  int GetNumValidMeasures();
350  int GetNumValidPoints();
351  QString GetTarget() const;
352  QString GetUserName() const;
353  QString GetLastModified() const;
357 
358  void SetCreatedDate(const QString &date);
359  void SetDescription(const QString &newDescription);
360  void SetImages(const QString &imageListFile);
361  void SetImages(SerialNumberList &list, Progress *progress = 0);
362 
363  void SetModifiedDate(const QString &date);
364  void SetMutex(QMutex *mutex);
365  void SetNetworkId(const QString &id);
366  void SetTarget(const QString &target);
367  void SetTarget(Pvl label);
368  void SetTarget(const ControlNet &other);
369  void SetUserName(const QString &name);
371 
372  void swap(ControlNet &other);
373  ControlNet &operator=(const ControlNet &other);
374 
375  const ControlPoint *operator[](QString id) const;
376  ControlPoint *operator[](QString id);
377  const ControlPoint *operator[](int id) const;
378  ControlPoint *operator[](int id);
379 
380 
381  signals:
384  void pointModified(ControlPoint *point, ControlPoint::ModType type, QVariant oldValue, QVariant newValue);
385  void measureModified(ControlMeasure *measure, ControlMeasure::ModType type, QVariant oldValue, QVariant newValue);
386  void pointDeleted(ControlPoint *point);
387  void newPoint(ControlPoint *);
388  void newMeasure(ControlMeasure *);
390 
391 
392 
393  private:
394  void nullify();
395  bool ValidateSerialNumber(QString serialNumber) const;
396  void measureAdded(ControlMeasure *measure);
397  void measureDeleted(ControlMeasure *measure);
398  void measureIgnored(ControlMeasure *measure);
399  void measureUnIgnored(ControlMeasure *measure);
400  void pointIgnored(ControlPoint *point);
401  void pointUnIgnored(ControlPoint *point);
402  void UpdatePointReference(ControlPoint *point, QString oldId);
403  void emitNetworkStructureModified();
404  void emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType type, QVariant oldValue, QVariant newValue);
405  void emitPointModified(ControlPoint *point, ControlPoint::ModType type, QVariant oldValue, QVariant newValue);
406  void pointAdded(ControlPoint *point);
407  bool addEdge(QString sourceSerial, QString targetSerial);
408  bool removeEdge(QString sourceSerial, QString targetSerial);
409 
410  private: // graphing functions
416  class ControlMeasureLessThanFunctor :
417  public std::binary_function<ControlMeasure* const &,
418  ControlMeasure * const &, bool > {
419  public:
420  ControlMeasureLessThanFunctor(double(ControlMeasure::*accessorMethod)() const) {
421  m_accessor = accessorMethod;
422  }
423  ControlMeasureLessThanFunctor(ControlMeasureLessThanFunctor const &other) {
424  this->m_accessor = other.m_accessor;
425  }
426  ~ControlMeasureLessThanFunctor() {}
427 
428  bool operator()(ControlMeasure* const &, ControlMeasure* const &);
429  ControlMeasureLessThanFunctor & operator=(ControlMeasureLessThanFunctor const &other);
430 
431  private:
432  double(ControlMeasure::*m_accessor)() const;
433  };
434 
435  private: // data
438 
440  struct Image {
441  QString serial;
444  };
445 
447  struct Connection {
448  Connection() : strength(0) {}
449  int strength;
450  };
451 
455  typedef boost::adjacency_list<boost::setS,
456  boost::listS,
457  boost::undirectedS,
458  Image,
459  Connection> Network;
460 
461  typedef Network::vertex_descriptor ImageVertex;
462  typedef Network::edge_descriptor ImageConnection;
463 
465  typedef std::map<ImageVertex, size_t> VertexIndexMap;
466 
468  typedef boost::associative_property_map<VertexIndexMap> VertexIndexMapAdaptor;
469 
471  typedef boost::graph_traits<Network>::adjacency_iterator AdjacencyIterator;
472  typedef boost::graph_traits<Network>::vertex_iterator VertexIterator;
473 
474  QHash<QString, ImageVertex> m_vertexMap;
475  Network m_controlGraph;
476  QStringList *pointIds;
477  QMutex *m_mutex;
478 
479  QString p_targetName;
480  QString p_networkId;
481  QString p_created;
482  QString p_modified;
483  QString p_description;
484  QString p_userName;
485  QMap<QString, Isis::Camera *> p_cameraMap;
486  QMap<QString, int> p_cameraValidMeasuresMap;
487  QMap<QString, int> p_cameraRejectedMeasuresMap;
488  QVector<Isis::Camera *> p_cameraList;
490 
491  bool m_ownPoints;
492  SurfacePoint::CoordinateType m_coordType;
493  };
494 
497 }
498 
501 
502 #endif
Definition: Process.h:32
void SetTarget(const QString &target)
Sets the target name and target radii, if available.
Definition: ControlNet.cpp:1684
void ReadControl(const QString &filename, Progress *progress=0)
Reads in the control points from the given file.
Definition: ControlNet.cpp:263
void pointDeleted(ControlPoint *point)
void ClearJigsawRejected()
Sets jigsaw rejected flag to false for all points and measures.
Definition: ControlNet.cpp:1415
friend class ControlMeasure
Definition: ControlNet.h:274
void SetMutex(QMutex *mutex)
Set mutex to lock for making Naif calls.
Definition: ControlNet.cpp:1658
QSharedPointer< ControlNet > ControlNetQsp
This typedef is for future implementation of target body.
Definition: ControlNet.h:496
double GetMaximumResidual()
Determine the maximum error of all points in the network.
Definition: ControlNet.cpp:1315
ModType
Control Measure Modification Types.
Definition: ControlMeasure.h:246
void ComputeResiduals()
Compute error for each point in the network.
Definition: ControlNet.cpp:1161
int GetNumValidMeasures()
Return the number of valid (non-ignored) measures for all control points in the network.
Definition: ControlNet.cpp:1471
void pointModified(ControlPoint *point, ControlPoint::ModType type, QVariant oldValue, QVariant newValue)
void DecrementNumberOfRejectedMeasuresInImage(const QString &serialNumber)
Decrement number of jigsaw rejected measures in image specified by serialNumber.
Definition: ControlNet.cpp:1435
double AverageResidual()
Compute the average error of all points in the network.
Definition: ControlNet.cpp:1195
QString GetUserName() const
Return the user name.
Definition: ControlNet.cpp:1505
void swap(ControlNet &other)
Swaps the member data with the given control net.
Definition: ControlNet.cpp:1741
QList< QList< QString > > GetSerialConnections() const
This method searches through all the cube serial numbers in the network.
Definition: ControlNet.cpp:959
QList< ControlPoint *> GetPoints()
Return QList of all the ControlPoints in the network.
Definition: ControlNet.cpp:1516
void SetUserName(const QString &name)
Set the user name of the control network.
Definition: ControlNet.cpp:1722
QList< QString > GetPointIds() const
Return QList of ControlPoint Ids used in hash, in order of addition.
Definition: ControlNet.cpp:1528
const ControlPoint * operator[](QString id) const
Definition: ControlNet.cpp:1858
QString GetTarget() const
Return the target name.
Definition: ControlNet.cpp:1499
void SetCoordType(SurfacePoint::CoordinateType coordType)
Sets the control point coordinate type.
Definition: ControlNet.cpp:853
QString GraphToString() const
Used for verifying graph intergrity.
Definition: ControlNet.cpp:489
Planetocentric latitudinal (lat/lon/rad) coordinates.
Definition: SurfacePoint.h:156
Definition: Camera.h:249
Q_DECLARE_METATYPE(Isis::ControlNet *)
This allows ControlNet *&#39;s to be stored in a QVariant.
int GetNumPoints() const
Return the number of control points in the network.
Definition: ControlNet.cpp:1457
QString GetNetworkId() const
Definition: ControlNet.cpp:1330
Program progress reporter.
Definition: Progress.h:58
QString Description() const
Return the description of the network.
Definition: ControlNet.cpp:1246
a control network
Definition: ControlNet.h:271
Definition: ControlNet.h:289
void clear()
Clear the contents of this object.
Definition: ControlNet.cpp:172
void newMeasure(ControlMeasure *)
int getEdgeCount() const
Definition: ControlNet.cpp:995
void SetNetworkId(const QString &id)
Set the network id.
Definition: ControlNet.cpp:1668
const ControlPoint * GetPoint(QString pointId) const
Definition: ControlNet.cpp:1807
void IncrementNumberOfRejectedMeasuresInImage(const QString &serialNumber)
Increment number of jigsaw rejected measures in image specified by serialNumber.
Definition: ControlNet.cpp:1426
int GetNumMeasures() const
Returns the total number of measures for all control points in the network.
Definition: ControlNet.cpp:1446
QList< QString > GetCubeSerials() const
Use this method to get a complete list of all the cube serial numbers in the network.
Definition: ControlNet.cpp:1008
QList< QString > getAdjacentImages(QString serialNumber) const
Get all images connected to a given image by common control points.
Definition: ControlNet.cpp:1033
int DeletePoint(ControlPoint *point)
Delete a ControlPoint from the network by the point&#39;s address.
Definition: ControlNet.cpp:871
A single control point.
Definition: ControlPoint.h:369
Definition: ControlNet.h:290
ModType
Control Point Modification Types.
Definition: ControlNet.h:288
void SetImages(const QString &imageListFile)
Creates the ControlNet&#39;s image cameras based on an input file.
Definition: ControlNet.cpp:1558
Container for cube-like labels.
Definition: Pvl.h:135
int GetNumValidPoints()
Returns the number of non-ignored control points.
Definition: ControlNet.cpp:1487
SurfacePoint::CoordinateType GetCoordType()
Get the control point coordinate type (see the available types in SurfacePoint.h).
Definition: ControlNet.cpp:1854
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
Definition: SurfacePoint.h:155
ControlNet(SurfacePoint::CoordinateType=SurfacePoint::Latitudinal)
Creates an empty ControlNet object.
Definition: ControlNet.cpp:52
int GetNumEditLockMeasures()
Return the total number of edit locked measures for all control points in the network.
Definition: ControlNet.cpp:1341
ModType
Control Point Modification Types.
Definition: ControlPoint.h:446
QString CreatedDate() const
Return the Created Date.
Definition: ControlNet.cpp:1236
int GetNumIgnoredMeasures()
Return the total number of ignored measures for all control points in the network.
Definition: ControlNet.cpp:1373
Definition: Calculator.h:33
void newPoint(ControlPoint *)
bool ContainsPoint(QString pointId) const
Definition: ControlNet.cpp:943
void AddPoint(ControlPoint *point)
Adds a ControlPoint to the ControlNet.
Definition: ControlNet.cpp:344
void networkStructureModified()
int GetNumEditLockPoints()
Returns the number of edit locked control points.
Definition: ControlNet.cpp:1356
void SetModifiedDate(const QString &date)
Set the last modified date.
Definition: ControlNet.cpp:1646
QList< ControlMeasure *> GetMeasuresInCube(QString serialNumber)
Get all the measures pertaining to a given cube serial number.
Definition: ControlNet.cpp:1057
void measureRemoved(ControlMeasure *)
Definition: BoxcarCachingAlgorithm.h:29
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
a control measurement
Definition: ControlMeasure.h:189
void measureModified(ControlMeasure *measure, ControlMeasure::ModType type, QVariant oldValue, QVariant newValue)
int GetNumberOfJigsawRejectedMeasuresInImage(const QString &serialNumber)
Return the number of jigsaw rejected measures in image specified by serialNumber. ...
Definition: ControlNet.cpp:1405
Isis::Camera * Camera(int index)
Returns the camera list from the given image number.
Definition: ControlNet.cpp:1224
QList< ControlPoint *> take()
Transfer ownership of all points to caller.
Definition: ControlNet.cpp:218
void ComputeApriori()
Compute aprior values for each point in the network.
Definition: ControlNet.cpp:1177
void SetCreatedDate(const QString &date)
Set the creation time.
Definition: ControlNet.cpp:1538
void SetDescription(const QString &newDescription)
Set the description of the network.
Definition: ControlNet.cpp:1548
ControlNet & operator=(const ControlNet &other)
Assign other to this.
Definition: ControlNet.cpp:1795
Serial Number list generator.
Definition: SerialNumberList.h:80
Definition: CubeIoHandler.h:39
~ControlNet()
Destructor removes allocated memory.
Definition: ControlNet.cpp:125
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.
Definition: ControlNet.cpp:1125
ControlPoint * FindClosest(QString serialNumber, double sample, double line)
Finds and returns a pointer to the closest ControlPoint to the ControlMeasure with the given serial n...
Definition: ControlNet.cpp:1263
void networkModified(ControlNet::ModType type)
Definition: CubeIoHandler.h:38
void Write(const QString &filename, bool pvl=false)
Writes out the control network.
Definition: ControlNet.cpp:303
int GetNumberOfValidMeasuresInImage(const QString &serialNumber)
Return the number of measures in image specified by serialNumber.
Definition: ControlNet.cpp:1391
QString GetLastModified() const
Return the last modified date.
Definition: ControlNet.cpp:1510
Definition: ControlNet.h:46
QList< ControlMeasure *> GetValidMeasuresInCube(QString serialNumber)
Get all the valid measures pertaining to a given cube serial number.
Definition: ControlNet.cpp:1073

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 USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/12/2023 23:16:47