Isis 3 Programmer Reference
ControlNet.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "IsisDebug.h"
10 
11 #include "ControlNet.h"
12 
13 #include <iostream>
14 #include <cmath>
15 #include <sstream>
16 
17 #include <QDebug>
18 #include <QMutex>
19 #include <QMutexLocker>
20 #include <QPair>
21 #include <QScopedPointer>
22 #include <QSet>
23 #include <QStringList>
24 #include <QTime>
25 #include <QVariant>
26 #include <QVector>
27 
28 #include <boost/numeric/ublas/symmetric.hpp>
29 #include <boost/numeric/ublas/io.hpp>
30 
31 #include "Application.h"
32 #include "CameraFactory.h"
33 #include "ControlMeasure.h"
34 #include "ControlNetVersioner.h"
35 #include "ControlPoint.h"
36 #include "Distance.h"
37 #include "FileName.h"
38 #include "IException.h"
39 #include "iTime.h"
40 #include "Progress.h"
41 #include "SerialNumberList.h"
42 #include "SpecialPixel.h"
43 #include "Statistics.h"
44 #include "Target.h"
45 
46 using namespace std;
47 using namespace boost::numeric::ublas;
48 
49 
50 namespace Isis {
51 
52  void ControlNet::nullify() {
53 
54  points = NULL;
55  pointIds = NULL;
56  m_mutex = NULL;
57  }
58 
60  ControlNet::ControlNet(SurfacePoint::CoordinateType coordType) {
61 
63  // ControlNet::ControlNet() {
64  nullify();
65 
67  pointIds = new QStringList;
68 
69  m_ownPoints = true;
70  p_created = Application::DateTime();
71  p_modified = Application::DateTime();
72  m_coordType = coordType;
73  }
74 
75  ControlNet::ControlNet(const ControlNet &other) {
76 
77  nullify();
78 
80  pointIds = new QStringList;
81 
82  for (int cpIndex = 0; cpIndex < other.GetNumPoints(); cpIndex++) {
83  ControlPoint *newPoint = new ControlPoint(*other.GetPoint(cpIndex));
84  AddPoint(newPoint);
85  }
86 
87  m_ownPoints = true;
88 
89  p_targetName = other.p_targetName;
90  p_networkId = other.p_networkId;
91  p_created = other.p_created;
92  p_modified = other.p_modified;
93  p_description = other.p_description;
94  p_userName = other.p_userName;
95  p_cameraMap = other.p_cameraMap;
96  p_cameraList = other.p_cameraList;
97  m_coordType = other.m_coordType;
98  }
99 
100 
107  ControlNet::ControlNet(const QString &ptfile, Progress *progress,
108  SurfacePoint::CoordinateType coordType) {
109 
110  nullify();
111 
113  pointIds = new QStringList;
114 
115  m_ownPoints = true;
116  m_coordType = coordType;
117 
118  try {
119  ReadControl(ptfile, progress);
120  }
121  catch (IException &e) {
122  QString msg = "Invalid control network [" + ptfile + "]";
123  throw IException(e, IException::Io, msg, _FILEINFO_);
124  }
125  }
126 
127 
133  ControlNet::~ControlNet() {
134 
135  clear();
136 
137  delete points;
138  delete pointIds;
139 
140  nullify();
141  }
142 
143 
153  void ControlNet::emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType type, QVariant oldValue, QVariant newValue) {
154  emit measureModified(measure, type, oldValue, newValue);
155  }
156 
157 
167  void ControlNet::emitPointModified(ControlPoint *point, ControlPoint::ModType type, QVariant oldValue, QVariant newValue) {
168  emit pointModified(point, type, oldValue, newValue);
169  }
170 
171 
180  void ControlNet::clear() {
181 
182  // Now must also own points to delete them.
183  if (points) {
184  if (GetNumPoints() > 0) {
185  if (m_ownPoints) {
186  QHashIterator<QString, ControlPoint*> i(*points);
187  while (i.hasNext()) {
188  i.next();
189  delete(*points)[i.key()];
190  (*points)[i.key()] = NULL;
191  }
192  }
193  }
194  points->clear();
195  }
196 
197  m_vertexMap.clear();
198  m_controlGraph.clear();
199 
200  if (pointIds) {
201  pointIds->clear();
202  }
203 
204  return;
205  }
206 
207 
226  QList< ControlPoint * > ControlNet::take() {
227 
228  // First check to see if someone else has taken ownership
229  if (!m_ownPoints) {
230  throw IException(IException::Programmer, "Ownership has already been taken",
231  _FILEINFO_);
232  }
233 
234  QList<ControlPoint *> points = GetPoints();
235  m_ownPoints = false;
236  clear();
237 
238  // Disconnect the parent network reference
239  for (int i = 0; i < points.size(); i++) {
240  points[i]->parentNetwork = NULL;
241  }
242  return (points);
243  }
244 
245 
271  void ControlNet::ReadControl(const QString &filename, Progress *progress) {
272 
273  FileName cnetFileName(filename);
274  ControlNetVersioner versionedReader(cnetFileName, progress);
275  SetTarget( versionedReader.targetName() );
276  p_networkId = versionedReader.netId();
277  p_userName = versionedReader.userName();
278  p_created = versionedReader.creationDate();
279  p_modified = versionedReader.lastModificationDate();
280  p_description = versionedReader.description();
281 
282  int numPoints = versionedReader.numPoints();
283 
284  if (progress) {
285  progress->SetText("Adding Control Points to Network...");
286  progress->SetMaximumSteps(numPoints);
287  progress->CheckStatus();
288  }
289 
290  for (int i = 0; i < numPoints; i++) {
291  AddPoint( versionedReader.takeFirstPoint() );
292  if (progress) {
293  progress->CheckStatus();
294  }
295  }
296  }
297 
298 
311  void ControlNet::Write(const QString &ptfile, bool pvl) {
312  ControlNetVersioner versionedWriter(this);
313 
314  if (pvl) {
315  Pvl network;
316  try {
317  network = versionedWriter.toPvl();
318  }
319  catch (IException &e) {
320  QString msg = "Failed to convert control network to Pvl format.";
321  throw IException(e, IException::Programmer, msg, _FILEINFO_);
322  }
323 
324  try {
325  network.write(ptfile);
326  }
327  catch (IException &e) {
328  QString msg = "Failed writing control network to file [" + ptfile + "]";
329  throw IException(e, IException::Io, msg, _FILEINFO_);
330  }
331  }
332  else {
333  try {
334  versionedWriter.write(FileName(ptfile));
335  }
336  catch (IException &e) {
337  QString msg = "Failed writing control network to file [" + ptfile + "]";
338  throw IException(e, IException::Io, msg, _FILEINFO_);
339  }
340  }
341  }
342 
343 
352  void ControlNet::AddPoint(ControlPoint *point) {
353  if (!point) {
354  IString msg = "Null pointer passed to ControlNet::AddPoint!";
355  throw IException(IException::Programmer, msg, _FILEINFO_);
356  }
357 
358  if (ContainsPoint(point->GetId())) {
359  IString msg = "ControlPoint must have unique Id";
360  throw IException(IException::Programmer, msg, _FILEINFO_);
361  }
362 
363  QString pointId = point->GetId();
364  points->insert(pointId, point);
365  pointIds->append(pointId);
366 
367  point->parentNetwork = this;
368 
369  // notify control network of new point
370  pointAdded(point);
371 
372  emit networkStructureModified();
373  }
374 
375 
384  void ControlNet::pointAdded(ControlPoint *point) {
385  if (!point) {
386  IString msg = "NULL point passed to "
387  "ControlNet::pointAdded!";
388  throw IException(IException::Programmer, msg, _FILEINFO_);
389  }
390 
391  if (!ContainsPoint(point->GetId())) {
392  QString msg = "ControlNet does not contain the point [";
393  msg += point->GetId() + "]";
394  throw IException(IException::Programmer, msg, _FILEINFO_);
395  }
396 
397  // Make sure there is a node for every measure
398  for (int i = 0; i < point->GetNumMeasures(); i++) {
399  QString sn = point->GetMeasure(i)->GetCubeSerialNumber();
400  // If the graph doesn't have the sn, add a node for it
401  if (!m_vertexMap.contains(sn)) {
402  Image newImage;
403  newImage.serial = sn;
404  ImageVertex newVertex = boost::add_vertex(newImage, m_controlGraph);
405  m_vertexMap.insert(sn, newVertex);
406  emit networkModified(GraphModified);
407  }
408  }
409 
410  QList< ControlMeasure * > measures = point->getMeasures();
411  for(int i = 0; i < measures.size(); i++) {
412  ControlMeasure* measure = measures[i];
413  // Add the measure to the corresponding node
414  QString serial = measure->GetCubeSerialNumber();
415  m_controlGraph[m_vertexMap[serial]].measures[measure->Parent()] = measure;
416 
417  // In this measure's node add connections to the other nodes reachable from
418  // its point
419  if (!point->IsIgnored() && !measure->IsIgnored()) {
420  for (int j = i + 1; j < measures.size(); j++) {
421  ControlMeasure *cm = measures[j];
422  if (!cm->IsIgnored()) {
423  QString sn = cm->GetCubeSerialNumber();
424  addEdge(serial, sn);
425  }
426  }
427  }
428  }
429  emit newPoint(point);
430  }
431 
432 
442  bool ControlNet::addEdge(QString sourceSerial, QString targetSerial) {
443  // If the edge doesn't already exist, this adds and returns the edge.
444  // If the edge already exists, this just returns it. (The use of a set
445  // forces the edges to be unique.)
446  ImageConnection connection;
447  bool edgeAdded;
448 
449  boost::tie(connection, edgeAdded) = boost::add_edge(m_vertexMap[sourceSerial],
450  m_vertexMap[targetSerial],
451  m_controlGraph);
452  m_controlGraph[connection].strength++;
453  if (edgeAdded) {
454  emit networkModified(GraphModified);
455  }
456  return edgeAdded;
457  }
458 
459 
471  bool ControlNet::removeEdge(QString sourceSerial, QString targetSerial) {
472  ImageConnection connection;
473  bool edgeExists;
474  boost::tie(connection, edgeExists) = boost::edge(m_vertexMap[sourceSerial],
475  m_vertexMap[targetSerial],
476  m_controlGraph);
477  if (edgeExists) {
478  m_controlGraph[connection].strength--;
479  if (m_controlGraph[connection].strength <= 0) {
480  boost::remove_edge(m_vertexMap[sourceSerial],
481  m_vertexMap[targetSerial],
482  m_controlGraph);
483  emit networkModified(GraphModified);
484 
485  return true;
486  }
487  }
488  return false;
489  }
490 
491 
497  QString ControlNet::GraphToString() const {
498  QString graphString;
499 
500  QStringList images = GetCubeSerials();
501  images.sort();
502 
503  QHash<QString, QStringList> imagePointIds;
504 
505  foreach(QString imageSerial, images) {
506  QList<ControlPoint *> imagePoints = m_controlGraph[m_vertexMap[imageSerial]].measures.keys();
507  QStringList pointIds;
508  foreach(ControlPoint *point, imagePoints) {
509  if (!point->IsIgnored()) {
510  pointIds.append(point->GetId());
511  }
512  }
513  pointIds.sort();
514  imagePointIds.insert(imageSerial, pointIds);
515  }
516 
517  foreach(QString imageSerial, images) {
518  QStringList adjacentImages = getAdjacentImages(imageSerial);
519  adjacentImages.sort();
520  foreach(QString adjacentSerial, adjacentImages) {
521  if (QString::compare(adjacentSerial, imageSerial) < 0) {
522  continue;
523  }
524 
525  QStringList commonPoints;
526  QList<QString>::const_iterator imageIt = imagePointIds[imageSerial].cbegin();
527  QList<QString>::const_iterator adjacentIt = imagePointIds[adjacentSerial].cbegin();
528  while (imageIt != imagePointIds[imageSerial].cend() &&
529  adjacentIt != imagePointIds[adjacentSerial].cend()) {
530  int stringDiff = QString::compare(*imageIt, *adjacentIt);
531  if (stringDiff < 0) {
532  imageIt++;
533  }
534  else if(stringDiff == 0) {
535  commonPoints.append(*imageIt);
536  imageIt++;
537  adjacentIt++;
538  }
539  else {
540  adjacentIt++;
541  }
542  }
543 
544  std::pair<ImageConnection, bool> result = boost::edge(m_vertexMap[imageSerial],
545  m_vertexMap[adjacentSerial],
546  m_controlGraph);
547  QString edgeStrength = "UNKNOWN";
548  if (result.second) {
549  edgeStrength = toString(m_controlGraph[result.first].strength);
550  }
551 
552  graphString.append(imageSerial);
553  graphString.append(" ----(");
554  graphString.append(edgeStrength);
555  graphString.append(") [");
556  graphString.append(commonPoints.join(","));
557  graphString.append("]---- ");
558  graphString.append(adjacentSerial);
559  graphString.append("\n");
560  }
561  }
562 
563  return graphString;
564  }
565 
566 
580  void ControlNet::measureAdded(ControlMeasure *measure) {
581  if (!measure) {
582  IString msg = "NULL measure passed to "
583  "ControlNet::measureAdded!";
584  throw IException(IException::Programmer, msg, _FILEINFO_);
585  }
586 
587  ControlPoint *point = measure->Parent();
588  if (!point) {
589  IString msg = "Control measure with NULL parent passed to "
590  "ControlNet::measureAdded!";
591  throw IException(IException::Programmer, msg, _FILEINFO_);
592  }
593 
594  if (!ContainsPoint(point->GetId())) {
595  QString msg = "ControlNet does not contain the point [";
596  msg += point->GetId() + "]";
597  throw IException(IException::Programmer, msg, _FILEINFO_);
598  }
599  // Add the measure to the corresponding node
600  QString serial = measure->GetCubeSerialNumber();
601 
602  // If the graph doesn't have the sn, add a node for it
603  if (!m_vertexMap.contains(serial)) {
604  Image newImage;
605  newImage.serial = serial;
606  ImageVertex newVertex = boost::add_vertex(newImage, m_controlGraph);
607  m_vertexMap.insert(serial, newVertex);
608  emit networkModified(GraphModified);
609  }
610 
611  m_controlGraph[m_vertexMap[serial]].measures[measure->Parent()] = measure;
612 
613  // in this measure's node add connections to the other nodes reachable from
614  // its point
615  if (!point->IsIgnored() && !measure->IsIgnored()) {
616  for (int i = 0; i < point->GetNumMeasures(); i++) {
617  ControlMeasure *cm = point->GetMeasure(i);
618  if (!cm->IsIgnored()) {
619  QString sn = cm->GetCubeSerialNumber();
620 
621 
622  if (QString::compare(sn, serial) != 0) {
623  addEdge(serial, sn);
624  }
625  }
626  }
627  }
628  emit newMeasure(measure);
629  }
630 
631 
637  void ControlNet::pointUnIgnored(ControlPoint *point) {
638  if (!point) {
639  IString msg = "NULL point passed to "
640  "ControlNet::pointUnIgnored!";
641  throw IException(IException::Programmer, msg, _FILEINFO_);
642  }
643 
644  QList< ControlMeasure * > validMeasures = point->getMeasures(true);
645 
646  for (int i = 0; i < validMeasures.size(); i++) {
647  ControlMeasure *sourceMeasure = validMeasures[i];
648  QString sourceSerial = sourceMeasure->GetCubeSerialNumber();
649 
650  if (!ValidateSerialNumber(sourceSerial)) {
651  QString msg = "Node does not exist for [";
652  msg += sourceSerial + "]";
653  throw IException(IException::Programmer, msg, _FILEINFO_);
654  }
655 
656  for(int j = i+1; j < validMeasures.size(); j++) {
657  ControlMeasure *targetMeasure = validMeasures[j];
658  QString targetSerial = targetMeasure->GetCubeSerialNumber();
659 
660  if (!ValidateSerialNumber(targetSerial)) {
661  QString msg = "Node does not exist for [";
662  msg += targetSerial + "]";
663  throw IException(IException::Programmer, msg, _FILEINFO_);
664  }
665  addEdge(sourceSerial, targetSerial);
666  }
667  }
668  }
669 
670 
683  void ControlNet::measureUnIgnored(ControlMeasure *measure) {
684  if (!measure) {
685  IString msg = "NULL measure passed to "
686  "ControlNet::measureUnIgnored!";
687  throw IException(IException::Programmer, msg, _FILEINFO_);
688  }
689 
690  ControlPoint *point = measure->Parent();
691  if (!point) {
692  IString msg = "Control measure with NULL parent passed to "
693  "ControlNet::measureUnIgnored!";
694  throw IException(IException::Programmer, msg, _FILEINFO_);
695  }
696 
697  if (!ContainsPoint(point->GetId())) {
698  QString msg = "ControlNet does not contain the point [";
699  msg += point->GetId() + "]";
700  throw IException(IException::Programmer, msg, _FILEINFO_);
701  }
702 
703  // Make sure there is a node for every measure in this measure's parent
704  for (int i = 0; i < point->GetNumMeasures(); i++) {
705  ControlMeasure *adjacentMeasure = point->GetMeasure(i);
706  QString sn = adjacentMeasure->GetCubeSerialNumber();
707  if (!adjacentMeasure->IsIgnored() && !m_vertexMap.contains(sn)) {
708  QString msg = "Node does not exist for [";
709  msg += measure->GetCubeSerialNumber() + "]";
710  throw IException(IException::Programmer, msg, _FILEINFO_);
711  }
712  }
713 
714  if (!point->IsIgnored()) {
715  QString serial = measure->GetCubeSerialNumber();
716 
717  // In this measure's node add connections to the other nodes reachable
718  // from its point
719  for (int i = 0; i < point->GetNumMeasures(); i++) {
720  ControlMeasure *cm = point->GetMeasure(i);
721  if (!cm->IsIgnored()) {
722  QString sn = cm->GetCubeSerialNumber();
723 
724  if (QString::compare(sn, serial) != 0) {
725  addEdge(serial, sn);
726  }
727  }
728  }
729  }
730  }
731 
732 
741  void ControlNet::UpdatePointReference(ControlPoint *point, QString oldId) {
742  points->remove(oldId);
743  (*points)[point->GetId()] = point;
744  (*pointIds)[pointIds->indexOf((QString) oldId)] = (QString)point->GetId();
745  }
746 
747 
754  void ControlNet::measureDeleted(ControlMeasure *measure) {
755  ASSERT(measure);
756  QString serial = measure->GetCubeSerialNumber();
757  ASSERT(m_vertexMap.contains(serial));
758 
759  emit measureRemoved(measure);
760 
761  // Remove connections to and from this node
762  if (!measure->IsIgnored() && !measure->Parent()->IsIgnored()) {
763  // Break connections
764  measureIgnored(measure);
765  }
766 
767  // Remove the measure from the associated node.
768  // Conceptually, I think this belongs in measureIgnored, but it isn't done
769  // for the old graph.
770  m_controlGraph[m_vertexMap[serial]].measures.remove(measure->Parent());
771  }
772 
773 
779  void ControlNet::pointIgnored(ControlPoint *point) {
780  if (!point) {
781  IString msg = "NULL point passed to "
782  "ControlNet::pointIgnored!";
783  throw IException(IException::Programmer, msg, _FILEINFO_);
784  }
785 
786  QList< ControlMeasure * > validMeasures = point->getMeasures(true);
787 
788  for (int i = 0; i < validMeasures.size(); i++) {
789  ControlMeasure *sourceMeasure = validMeasures[i];
790  QString sourceSerial = sourceMeasure->GetCubeSerialNumber();
791 
792  if (!ValidateSerialNumber(sourceSerial)) {
793  QString msg = "Node does not exist for [";
794  msg += sourceSerial + "]";
795  throw IException(IException::Programmer, msg, _FILEINFO_);
796  }
797 
798  for(int j = i+1; j < validMeasures.size(); j++) {
799  ControlMeasure *targetMeasure = validMeasures[j];
800  QString targetSerial = targetMeasure->GetCubeSerialNumber();
801 
802  if (!ValidateSerialNumber(targetSerial)) {
803  QString msg = "Node does not exist for [";
804  msg += targetSerial + "]";
805  throw IException(IException::Programmer, msg, _FILEINFO_);
806  }
807  removeEdge(sourceSerial, targetSerial);
808  }
809  }
810  }
811 
812 
813 
821  void ControlNet::measureIgnored(ControlMeasure *measure) {
822  if (!measure) {
823  IString msg = "NULL measure passed to "
824  "ControlNet::measureIgnored!";
825  throw IException(IException::Programmer, msg, _FILEINFO_);
826  }
827 
828  ControlPoint *point = measure->Parent();
829  if (!point) {
830  IString msg = "Control measure with NULL parent passed to "
831  "ControlNet::measureIgnored!";
832  throw IException(IException::Programmer, msg, _FILEINFO_);
833  }
834 
835  QString serial = measure->GetCubeSerialNumber();
836  if (!ValidateSerialNumber(serial)) {
837  QString msg = "Node does not exist for [";
838  msg += serial + "]";
839  throw IException(IException::Programmer, msg, _FILEINFO_);
840  }
841 
842  // Decrement the edge strength for edges from this node
843  // Remove edge if the strength becomes 0.
844  for (int i = 0; i < point->GetNumMeasures(); i++) {
845  ControlMeasure *adjacentMeasure = point->GetMeasure(i);
846  QString sn = adjacentMeasure->GetCubeSerialNumber();
847  if (!adjacentMeasure->IsIgnored() && m_vertexMap.contains(sn)) {
848  if (QString::compare(serial, sn) !=0) {
849  removeEdge(serial, sn);
850  }
851  }
852  }
853  }
854 
855 
861  void ControlNet::SetCoordType(SurfacePoint::CoordinateType coordType) {
862  m_coordType = coordType;
863  }
864 
865 
869  void ControlNet::emitNetworkStructureModified() {
870  emit networkStructureModified();
871  }
872 
873 
879  int ControlNet::DeletePoint(ControlPoint *point) {
880  if (points->values().contains(point)) {
881  return DeletePoint(point->GetId());
882  }
883  else {
884  IString msg = "point [";
885  msg += (long) point;
886  msg += "] does not exist in the network";
887  throw IException(IException::User, msg, _FILEINFO_);
888  }
889  }
890 
891 
899  int ControlNet::DeletePoint(QString pointId) {
900  if (!points->contains(pointId)) {
901  IString msg = "point Id [" + pointId + "] does not exist in the network";
902  throw IException(IException::User, msg, _FILEINFO_);
903  }
904 
905  ControlPoint *point = (*points)[pointId];
906 
907  if (point->IsEditLocked())
908  return ControlPoint::PointLocked;
909 
910  bool wasIgnored = point->IsIgnored();
911 
912  // notify CubeSerialNumbers of the loss of this point
913  foreach(ControlMeasure * measure, point->getMeasures()) {
914  point->Delete(measure);
915  }
916 
917  emit pointDeleted(point);
918 
919  // delete point
920  points->remove(pointId);
921  pointIds->removeAt(pointIds->indexOf(pointId));
922  delete point;
923  point = NULL;
924 
925  if (!wasIgnored)
926  emit networkStructureModified();
927  return ControlPoint::Success;
928  }
929 
930 
936  int ControlNet::DeletePoint(int index) {
937  if (index < 0 || index >= pointIds->size()) {
938  IString msg = "Index [" + IString(index) + "] out of range";
939  throw IException(IException::Programmer, msg, _FILEINFO_);
940  }
941 
942  return DeletePoint(pointIds->at(index));
943  }
944 
945 
951  bool ControlNet::ContainsPoint(QString pointId) const {
952  return points->contains(pointId);
953  }
954 
955 
967  QList< QList< QString > > ControlNet::GetSerialConnections() const {
968 
969  VertexIndexMap indexMap;
970  VertexIndexMapAdaptor indexMapAdaptor(indexMap);
971 
972  // Needed to use connected_componenets
973  QList< QString> serials = m_vertexMap.keys();
974  for (int i = 0; i < serials.size(); i++) {
975  boost::put(indexMapAdaptor, m_vertexMap[serials[i]], i);
976  }
977 
978  VertexIndexMap componentMap;
979  VertexIndexMapAdaptor componentAdaptor(componentMap);
980  int numComponents = boost::connected_components(m_controlGraph, componentAdaptor,
981  boost::vertex_index_map(indexMapAdaptor));
982 
983  QList< QList< QString > > islandStrings;
984  for (int i = 0; i < numComponents; i++) {
985  QList<QString> tempList;
986  islandStrings.append(tempList);
987  }
988  std::map<ImageVertex, size_t>::iterator it = componentMap.begin();
989  while(it != componentMap.end())
990  {
991  QString serial = m_controlGraph[it->first].serial;
992  int group = (int) it->second;
993  islandStrings[group].append(serial);
994  ++it;
995  }
996  return islandStrings;
997  }
998 
999 
1003  int ControlNet::getEdgeCount() const {
1004  return boost::num_edges(m_controlGraph);
1005  }
1006 
1007 
1016  QList< QString > ControlNet::GetCubeSerials() const {
1017  return m_vertexMap.keys();
1018  }
1019 
1020 
1029  bool ControlNet::ValidateSerialNumber(QString serialNumber) const {
1030  return m_vertexMap.contains(serialNumber);
1031  }
1032 
1033 
1041  QList< QString > ControlNet::getAdjacentImages(QString serialNumber) const {
1042  if (!ValidateSerialNumber(serialNumber)) {
1043  QString msg = "Cube Serial Number [" + serialNumber + "] not found in "
1044  "the network";
1045  throw IException(IException::Programmer, msg, _FILEINFO_);
1046  }
1047 
1048  QList< QString > adjacentSerials;
1049 
1050  AdjacencyIterator adjIt, adjEnd;
1051  boost::tie(adjIt, adjEnd) = boost::adjacent_vertices(m_vertexMap[serialNumber], m_controlGraph);
1052  for( ; adjIt != adjEnd; adjIt++) {
1053  adjacentSerials.append(m_controlGraph[*adjIt].serial);
1054  }
1055 
1056  return adjacentSerials;
1057  }
1058 
1059 
1065  QList< ControlMeasure * > ControlNet::GetMeasuresInCube(QString serialNumber) {
1066  if( !ValidateSerialNumber(serialNumber) ) {
1067  IString msg = "Cube Serial Number [" + serialNumber + "] not found in "
1068  "the network";
1069  throw IException(IException::Programmer, msg, _FILEINFO_);
1070 
1071  }
1072  return m_controlGraph[m_vertexMap[serialNumber]].measures.values();
1073  }
1074 
1075 
1081  QList< ControlMeasure * > ControlNet::GetValidMeasuresInCube(QString serialNumber) {
1082  QList< ControlMeasure * > validMeasures;
1083 
1084  // Get measures in cube will validate this for us, so we don't need to re-check
1085  QList< ControlMeasure * > measureList = GetMeasuresInCube(serialNumber);
1086 
1087  foreach(ControlMeasure * measure, measureList) {
1088  if (!measure->IsIgnored())
1089  validMeasures.append(measure);
1090  }
1091 
1092  return validMeasures;
1093  }
1094 
1095 
1102  ControlNet::ControlMeasureLessThanFunctor::operator=(ControlMeasureLessThanFunctor const &other) {
1103 
1104  if (this != &other) {
1105  this->m_accessor = other.m_accessor;
1106  }
1107 
1108  return *this;
1109  }
1110 
1111 
1118  bool ControlNet::ControlMeasureLessThanFunctor::operator()
1119  (ControlMeasure* const &a, ControlMeasure* const &b) {
1120 
1121  return (a->*this->m_accessor)() < (b->*this->m_accessor)();
1122 
1123  }
1124 
1125 
1133  QList< ControlMeasure * > ControlNet::sortedMeasureList(double(ControlMeasure::*statFunc)() const,
1134  double min,double max) {
1135 
1136  QList< ControlMeasure * >measures;
1137 
1138  //build a list of all the pointers to the relevant measures
1139  //get the number of object points
1140  int nObjPts = this->GetNumPoints();
1141  for (int i=0;i<nObjPts;i++) { //for each Object point
1142  ControlPoint *point = this->GetPoint(i);
1143  if (point->IsIgnored()) continue; //if the point is ignored then continue
1144 
1145  // Get the number of measures
1146  int nObs = point->GetNumMeasures();
1147  for (int j=0;j<nObs;j++) { //for every measure
1148  ControlMeasure *measure = point->GetMeasure(j);
1149  if (measure->IsIgnored()) continue;
1150  double temp = (measure->*statFunc)();
1151  if (temp > min)
1152  if (min <= temp && temp <= max) measures.push_back(measure);
1153  }
1154  }
1155 
1156  // Sort the measures
1157  ControlMeasureLessThanFunctor lessThan(statFunc);
1158  qSort(measures.begin(),measures.end(),lessThan);
1159 
1160  return measures;
1161  }
1162 
1163 
1169  void ControlNet::ComputeResiduals() {
1170  // TODO: Make sure the cameras have been initialized
1171 
1172  QHashIterator< QString, ControlPoint * > i(*points);
1173  while (i.hasNext()) {
1174  i.next();
1175  i.value()->ComputeResiduals();
1176  }
1177  }
1178 
1179 
1185  void ControlNet::ComputeApriori() {
1186  // TODO: Make sure the cameras have been initialized
1187  QHashIterator< QString, ControlPoint * > i(*points);
1188  while (i.hasNext()) {
1189  i.next();
1190  ControlPoint *point = i.value();
1191  if ( !point->IsIgnored() )
1192  point->ComputeApriori();
1193  }
1194  }
1195 
1196 
1203  double ControlNet::AverageResidual() {
1204  // TODO: Make sure the cameras have been initialized
1205  double avgResidual = 0.0;
1206  int count = 0;
1207  QHashIterator< QString, ControlPoint * > i(*points);
1208  while (i.hasNext()) {
1209  i.next();
1210  ControlPoint *point = i.value();
1211  if (!point->IsIgnored()) {
1212  avgResidual += point->GetStatistic(
1213  &ControlMeasure::GetResidualMagnitude).Average();
1214  count++;
1215  }
1216  }
1217 
1218  if (count != 0)
1219  avgResidual /= count;
1220 
1221  return avgResidual;
1222  }
1223 
1224 
1232  Isis::Camera *ControlNet::Camera(int index) {
1233  return p_cameraList[index];
1234  }
1235 
1236 
1244  QString ControlNet::CreatedDate() const {
1245  return p_created;
1246  }
1247 
1248 
1254  QString ControlNet::Description() const {
1255  return p_description;
1256  }
1257 
1258 
1271  ControlPoint *ControlNet::FindClosest(QString serialNumber,
1272  double sample, double line) {
1273 
1274  if (!ValidateSerialNumber(serialNumber)) {
1275  QString msg = "serialNumber [";
1276  msg += serialNumber;
1277  msg += "] not found in ControlNet";
1278  throw IException(IException::Programmer, msg, _FILEINFO_);
1279  }
1280 
1281  const double SEARCH_DISTANCE = 99999999.0;
1282  double minDist = SEARCH_DISTANCE;
1283  ControlPoint *closestPoint = NULL;
1284 
1285  QList < ControlMeasure * > measures = m_controlGraph[m_vertexMap[serialNumber]].measures.values();
1286 
1287  for (int i = 0; i < measures.size(); i++) {
1288  ControlMeasure *measureToCheck = measures[i];
1289 
1290  // Find closest line sample & return that controlpoint
1291  double dx = fabs(sample - measureToCheck->GetSample());
1292  double dy = fabs(line - measureToCheck->GetLine());
1293 
1294  double dist = sqrt((dx * dx) + (dy * dy));
1295 
1296  if (dist < minDist) {
1297  minDist = dist;
1298  closestPoint = measureToCheck->Parent();
1299  }
1300  }
1301 
1302  if (!closestPoint) {
1303  IString msg = "No point found within ";
1304  msg += IString(SEARCH_DISTANCE);
1305  msg += "pixels of sample/line [";
1306  msg += IString(sample);
1307  msg += ", ";
1308  msg += IString(line);
1309  msg += "]";
1310  throw IException(IException::Programmer, msg, _FILEINFO_);
1311  }
1312 
1313  return closestPoint;
1314  }
1315 
1316 
1323  double ControlNet::GetMaximumResidual() {
1324  // TODO: Make sure the cameras have been initialized
1325 
1326  double maxResidual = 0.0;
1327  foreach(ControlPoint * p, *points) {
1328  double residual = p->GetStatistic(
1329  &ControlMeasure::GetResidualMagnitude).Maximum();
1330  if (residual > maxResidual)
1331  maxResidual = residual;
1332  }
1333 
1334  return maxResidual;
1335  }
1336 
1337 
1338  QString ControlNet::GetNetworkId() const {
1339  return p_networkId;
1340  }
1341 
1342 
1349  int ControlNet::GetNumEditLockMeasures() {
1350  int numLockedMeasures = 0;
1351  foreach(ControlPoint * p, *points) {
1352  numLockedMeasures += p->GetNumLockedMeasures();
1353  }
1354 
1355  return numLockedMeasures;
1356  }
1357 
1358 
1364  int ControlNet::GetNumEditLockPoints() {
1365  int editLockPoints = 0;
1366  foreach(ControlPoint * p, *points) {
1367  if (p->IsEditLocked())
1368  editLockPoints++;
1369  }
1370 
1371  return editLockPoints;
1372  }
1373 
1374 
1381  int ControlNet::GetNumIgnoredMeasures() {
1382  int numIgnoredMeasures = 0;
1383  foreach(ControlPoint * p, *points) {
1384  numIgnoredMeasures += p->GetNumMeasures() - p->GetNumValidMeasures();
1385  }
1386 
1387  return numIgnoredMeasures;
1388  }
1389 
1390 
1399  int ControlNet::GetNumberOfValidMeasuresInImage(const QString &serialNumber) {
1400  // If SetImage was called, use the map that has been populated with valid measures
1401  if (p_cameraList.size() > 0) {
1402  return p_cameraValidMeasuresMap[serialNumber];
1403  }
1404  return GetValidMeasuresInCube(serialNumber).size();
1405  }
1406 
1407 
1413  int ControlNet::GetNumberOfJigsawRejectedMeasuresInImage(const QString &serialNumber) {
1414  return p_cameraRejectedMeasuresMap[serialNumber];
1415  }
1416 
1417 
1423  void ControlNet::ClearJigsawRejected() {
1424  foreach(ControlPoint * p, *points) {
1425  p->ClearJigsawRejected();
1426  }
1427  }
1428 
1429 
1434  void ControlNet::IncrementNumberOfRejectedMeasuresInImage(const QString &serialNumber) {
1435  p_cameraRejectedMeasuresMap[serialNumber]++;
1436  }
1437 
1438 
1443  void ControlNet::DecrementNumberOfRejectedMeasuresInImage(const QString &serialNumber) {
1444  if (p_cameraRejectedMeasuresMap[serialNumber] > 0)
1445  p_cameraRejectedMeasuresMap[serialNumber]--;
1446  }
1447 
1448 
1454  int ControlNet::GetNumMeasures() const {
1455  int numMeasures = 0;
1456  foreach(ControlPoint * p, *points) {
1457  numMeasures += p->GetNumMeasures();
1458  }
1459 
1460  return numMeasures;
1461  }
1462 
1463 
1465  int ControlNet::GetNumPoints() const {
1466  return points->size();
1467  }
1468 
1469 
1479  int ControlNet::GetNumValidMeasures() {
1480  int numValidMeasures = 0;
1481  foreach(ControlPoint * p, *points) {
1482  if (!p->IsIgnored())
1483  numValidMeasures += p->GetNumValidMeasures();
1484  }
1485 
1486  return numValidMeasures;
1487  }
1488 
1489 
1495  int ControlNet::GetNumValidPoints() {
1496  int validPoints = 0;
1497  foreach(ControlPoint * p, *points) {
1498  if (!p->IsIgnored())
1499  validPoints++;
1500  }
1501 
1502  return validPoints;
1503  }
1504 
1505 
1507  QString ControlNet::GetTarget() const {
1508  return p_targetName;
1509  }
1510 
1511 
1513  QString ControlNet::GetUserName() const {
1514  return p_userName;
1515  }
1516 
1518  QString ControlNet::GetLastModified() const {
1519  return p_modified;
1520  }
1521 
1522 
1524  QList< ControlPoint * > ControlNet::GetPoints() {
1525  QList< ControlPoint * > pointsList;
1526 
1527  for (int i = 0; i < pointIds->size(); i++) {
1528  pointsList.append(GetPoint(i));
1529  }
1530 
1531  return pointsList;
1532  }
1533 
1534 
1536  QList< QString > ControlNet::GetPointIds() const {
1537  return *pointIds;
1538  }
1539 
1540 
1546  void ControlNet::SetCreatedDate(const QString &date) {
1547  p_created = date;
1548  }
1549 
1550 
1556  void ControlNet::SetDescription(const QString &newDescription) {
1557  p_description = newDescription;
1558  }
1559 
1560 
1566  void ControlNet::SetImages(const QString &imageListFile) {
1567  SerialNumberList list(imageListFile);
1568  SetImages(list);
1569  }
1570 
1571 
1587  void ControlNet::SetImages(SerialNumberList &list, Progress *progress) {
1588  // First check if cameras have already been setup via another SetImages call
1589  if (p_cameraList.size() > 0) {
1590  return;
1591  }
1592  // Prep for reporting progress
1593  if (progress != NULL) {
1594  progress->SetText("Setting input images...");
1595  progress->SetMaximumSteps(list.size());
1596  progress->CheckStatus();
1597  }
1598  // Open the camera for all the images in the serial number list
1599  for (int i = 0; i < list.size(); i++) {
1600  QString serialNumber = list.serialNumber(i);
1601  QString filename = list.fileName(i);
1602  Cube cube(filename, "r");
1603 
1604  try {
1605  Isis::Camera *cam = CameraFactory::Create(cube);
1606  p_cameraMap[serialNumber] = cam;
1607  p_cameraValidMeasuresMap[serialNumber] = 0;
1608  p_cameraRejectedMeasuresMap[serialNumber] = 0;
1609  p_cameraList.push_back(cam);
1610  }
1611  catch (IException &e) {
1612  QString msg = "Unable to create camera for cube file ";
1613  msg += filename;
1614  throw IException(e, IException::Unknown, msg, _FILEINFO_);
1615  }
1616 
1617  if (progress != NULL)
1618  progress->CheckStatus();
1619  }
1620 
1621  // Loop through all measures and set the camera
1622  QHashIterator< QString, ControlPoint * > p(*points);
1623  while (p.hasNext()) {
1624  p.next();
1625  ControlPoint *curPoint = p.value();
1626 
1627  QList< QString > serialNums = curPoint->getCubeSerialNumbers();
1628  for (int m = 0; m < serialNums.size(); m++) {
1629  ControlMeasure *curMeasure = (*curPoint)[serialNums[m]];
1630 
1631  QString serialNumber = curMeasure->GetCubeSerialNumber();
1632  if (list.hasSerialNumber(serialNumber)) {
1633  curMeasure->SetCamera(p_cameraMap[serialNumber]);
1634 
1635  // increment number of measures for this image (camera)
1636  if (!curMeasure->IsIgnored()) p_cameraValidMeasuresMap[serialNumber]++;
1637  }
1638  else {
1639  IString msg = "Control point [" + curPoint->GetId() +
1640  "], measure [" + curMeasure->GetCubeSerialNumber() +
1641  "] does not have a cube with a matching serial number";
1642  throw IException(IException::User, msg, _FILEINFO_);
1643  }
1644  }
1645  }
1646  }
1647 
1648 
1654  void ControlNet::SetModifiedDate(const QString &date) {
1655  p_modified = date;
1656  }
1657 
1658 
1666  void ControlNet::SetMutex(QMutex *mutex) {
1667  m_mutex = mutex;
1668  }
1669 
1670 
1676  void ControlNet::SetNetworkId(const QString &id) {
1677  p_networkId = id;
1678  }
1679 
1680 
1692  void ControlNet::SetTarget(const QString &target) {
1693  p_targetName = target;
1694  }
1695 
1696 
1704  void ControlNet::SetTarget(Pvl label) {
1705  PvlGroup mapping;
1706  if ( (label.hasObject("IsisCube") && label.findObject("IsisCube").hasGroup("Mapping"))
1707  || label.hasGroup("Mapping") ) {
1708  mapping = label.findGroup("Mapping", Pvl::Traverse);
1709  }
1710 
1711  if (mapping.hasKeyword("TargetName")) {
1712  p_targetName = mapping["TargetName"][0];
1713  }
1714  else if (label.hasObject("IsisCube")
1715  && label.findObject("IsisCube").hasGroup("Instrument")
1716  && label.findObject("IsisCube").findGroup("Instrument").hasKeyword("TargetName")) {
1717  p_targetName = label.findObject("IsisCube").findGroup("Instrument").findKeyword("TargetName")[0];
1718  }
1719  else {
1720  p_targetName = "";
1721  }
1722  }
1723 
1724 
1730  void ControlNet::SetUserName(const QString &name) {
1731  p_userName = name;
1732  }
1733 
1734 
1749  void ControlNet::swap(ControlNet &other) {
1750  std::swap(points, other.points);
1751  std::swap(pointIds, other.pointIds);
1752  m_controlGraph.swap(other.m_controlGraph);
1753  std::swap(m_mutex, other.m_mutex);
1754  std::swap(p_targetName, other.p_targetName);
1755  std::swap(p_networkId, other.p_networkId);
1756  std::swap(p_created, other.p_created);
1757  std::swap(p_modified, other.p_modified);
1758  std::swap(p_description, other.p_description);
1759  std::swap(p_userName, other.p_userName);
1760  std::swap(p_cameraMap, other.p_cameraMap);
1761  std::swap(p_cameraValidMeasuresMap, other.p_cameraValidMeasuresMap);
1762  std::swap(p_cameraRejectedMeasuresMap, other.p_cameraRejectedMeasuresMap);
1763  std::swap(p_cameraList, other.p_cameraList);
1764 
1765  // points have parent pointers that need to be updated too...
1766  QHashIterator< QString, ControlPoint * > i(*points);
1767  while (i.hasNext()) {
1768  i.next().value()->parentNetwork = this;
1769  }
1770 
1771  QHashIterator< QString, ControlPoint * > i2(*other.points);
1772  while (i2.hasNext()) {
1773  i2.next().value()->parentNetwork = &other;
1774  }
1775 
1776  m_vertexMap.clear();
1777  VertexIterator v, vend;
1778  for (boost::tie(v, vend) = vertices(m_controlGraph); v != vend; ++v) {
1779  ImageVertex imVertex = *v;
1780  QString serialNum = m_controlGraph[*v].serial;
1781  m_vertexMap[serialNum] = imVertex;
1782  }
1783 
1784  other.m_vertexMap.clear();
1785  VertexIterator v2, vend2;
1786  for (boost::tie(v2, vend2) = vertices(other.m_controlGraph); v2 != vend2; ++v2) {
1787  ImageVertex imVertex = *v2;
1788  QString serialNum = other.m_controlGraph[*v2].serial;
1789  other.m_vertexMap[serialNum] = imVertex;
1790  }
1791 
1792  emit networkModified(ControlNet::Swapped);
1793  }
1794 
1795 
1803  ControlNet &ControlNet::operator=(const ControlNet &other) {
1804  // Optimization: if this == other do nothing.
1805  if (this != &other) {
1806  // copy & swap
1807  ControlNet copy(other);
1808  swap(copy);
1809  }
1810 
1811  return *this;
1812  }
1813 
1814 
1815  const ControlPoint *ControlNet::GetPoint(QString id) const {
1816  if (!points->contains(id)) {
1817  IString msg = "The control network has no control points with an ID "
1818  "equal to [" + id + "]";
1819  throw IException(IException::Programmer, msg, _FILEINFO_);
1820  }
1821 
1822  return points->value(id);
1823  }
1824 
1825 
1826  ControlPoint *ControlNet::GetPoint(QString id) {
1827  if (!points->contains(id)) {
1828  IString msg = "The control network has no control points with an ID "
1829  "equal to [" + id + "]";
1830  throw IException(IException::Programmer, msg, _FILEINFO_);
1831  }
1832 
1833  return (*points)[id];
1834  }
1835 
1836 
1837  const ControlPoint *ControlNet::GetPoint(int index) const {
1838  if (index < 0 || index >= pointIds->size()) {
1839  IString msg = "Index [" + IString(index) + "] out of range";
1840  throw IException(IException::Programmer, msg, _FILEINFO_);
1841  }
1842 
1843  return GetPoint(pointIds->at(index));
1844  }
1845 
1846 
1847  ControlPoint *ControlNet::GetPoint(int index) {
1848  if (index < 0 || index >= pointIds->size()) {
1849  IString msg = "Index [" + IString(index) + "] out of range";
1850  throw IException(IException::Programmer, msg, _FILEINFO_);
1851  }
1852 
1853  return GetPoint(pointIds->at(index));
1854  }
1855 
1856 
1862  SurfacePoint::CoordinateType ControlNet::GetCoordType() {
1863  return m_coordType;
1864  }
1865 
1866  const ControlPoint *ControlNet::operator[](QString id) const {
1867  return GetPoint(id);
1868  }
1869 
1870 
1871  ControlPoint *ControlNet::operator[](QString id) {
1872  return GetPoint(id);
1873  }
1874 
1875 
1876  const ControlPoint *ControlNet::operator[](int index) const {
1877  return GetPoint(index);
1878  }
1879 
1880 
1881  ControlPoint *ControlNet::operator[](int index) {
1882  return GetPoint(index);
1883  }
1884 }
Isis::ControlNet::p_cameraRejectedMeasuresMap
QMap< QString, int > p_cameraRejectedMeasuresMap
A map from serialnumber to #rejected measures.
Definition: ControlNet.h:473
Isis::ControlPoint::ClearJigsawRejected
void ClearJigsawRejected()
Set jigsaw rejected flag for all measures to false and set the jigsaw rejected flag for the point its...
Definition: ControlPoint.cpp:2191
Isis::ControlNet::ControlMeasureLessThanFunctor
Definition: ControlNet.h:404
Isis::ControlPoint::getMeasures
QList< ControlMeasure * > getMeasures(bool excludeIgnored=false) const
Definition: ControlPoint.cpp:1873
Isis::ControlNetVersioner::creationDate
QString creationDate() const
Returns the date and time that the network was created.
Definition: ControlNetVersioner.cpp:134
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::Progress::CheckStatus
void CheckStatus()
Checks and updates the status.
Definition: Progress.cpp:105
Isis::ControlPoint::GetMeasure
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
Definition: ControlPoint.cpp:416
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::ControlNet::VertexIndexMap
std::map< ImageVertex, size_t > VertexIndexMap
Represents the edges of the graph.
Definition: ControlNet.h:451
Isis::SerialNumberList::size
int size() const
How many serial number / filename combos are in the list.
Definition: SerialNumberList.cpp:384
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::Progress::SetMaximumSteps
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition: Progress.cpp:85
Isis::ControlNetVersioner::takeFirstPoint
ControlPoint * takeFirstPoint()
Returns the first point stored in the versioner's internal list.
Definition: ControlNetVersioner.cpp:187
Isis::ControlNet::p_cameraList
QVector< Isis::Camera * > p_cameraList
Vector of image number to camera.
Definition: ControlNet.h:475
Isis::ControlPoint::GetStatistic
Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const
This function will call a given method on every control measure that this point has.
Definition: ControlPoint.cpp:1842
Isis::Statistics::Maximum
double Maximum() const
Returns the absolute maximum double found in all data passed through the AddData method.
Definition: Statistics.cpp:403
Isis::PvlObject::hasGroup
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
Definition: PvlObject.h:210
Isis::ControlNet::Image
Used to define the verticies of the graph.
Definition: ControlNet.h:426
Isis::ControlPoint::ComputeApriori
Status ComputeApriori()
Computes a priori lat/lon/radius point coordinates by determining the average lat/lon/radius of all m...
Definition: ControlPoint.cpp:899
Isis::PvlContainer::hasKeyword
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::ControlNet::p_networkId
QString p_networkId
The Network Id.
Definition: ControlNet.h:466
Isis::ControlNet::clear
void clear()
Clear the contents of this object.
Definition: ControlNet.cpp:180
Isis::ControlPoint::parentNetwork
ControlNet * parentNetwork
List of Control Measures.
Definition: ControlPoint.h:602
Isis::Pvl::write
void write(const QString &file)
Opens and writes PVL information to a file and handles the end of line sequence.
Definition: Pvl.cpp:130
Isis::ControlPoint::GetId
QString GetId() const
Return the Id of the control point.
Definition: ControlPoint.cpp:1306
Isis::Camera
Definition: Camera.h:236
Isis::ControlNet::p_description
QString p_description
Textual Description of network.
Definition: ControlNet.h:469
QStringList
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::SerialNumberList
Serial Number list generator.
Definition: SerialNumberList.h:64
Isis::ControlPoint::GetNumValidMeasures
int GetNumValidMeasures() const
Definition: ControlPoint.cpp:1711
Isis::ControlPoint::getCubeSerialNumbers
QList< QString > getCubeSerialNumbers() const
Definition: ControlPoint.cpp:1889
Isis::SerialNumberList::serialNumber
QString serialNumber(const QString &filename)
Return a serial number given a filename.
Definition: SerialNumberList.cpp:426
Isis::ControlNet::m_coordType
SurfacePoint::CoordinateType m_coordType
The coordinate type of the control points.
Definition: ControlNet.h:478
Isis::ControlMeasure::GetCubeSerialNumber
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
Definition: ControlMeasure.cpp:557
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
QHash
This is free and unencumbered software released into the public domain.
Definition: ControlNet.h:32
Isis::ControlNet::GetNumPoints
int GetNumPoints() const
Return the number of control points in the network.
Definition: ControlNet.cpp:1465
Isis::ControlNet::p_modified
QString p_modified
Date Last Modified.
Definition: ControlNet.h:468
Isis::ControlMeasure::ModType
ModType
Control Measure Modification Types.
Definition: ControlMeasure.h:232
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::ControlNet::p_userName
QString p_userName
The user who created the network.
Definition: ControlNet.h:470
Isis::SurfacePoint::CoordinateType
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
Definition: SurfacePoint.h:139
Isis::ControlNetVersioner::description
QString description() const
Returns the network's description.
Definition: ControlNetVersioner.cpp:154
Isis::ControlMeasure::SetCamera
Status SetCamera(Isis::Camera *camera)
Set pointer to camera associated with a measure.
Definition: ControlMeasure.cpp:169
Isis::ControlPoint::GetNumLockedMeasures
int GetNumLockedMeasures() const
Returns the number of locked control measures.
Definition: ControlPoint.cpp:1728
Isis::ControlNet::p_cameraValidMeasuresMap
QMap< QString, int > p_cameraValidMeasuresMap
A map from serialnumber to #measures.
Definition: ControlNet.h:472
Isis::Progress::SetText
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition: Progress.cpp:61
Isis::ControlNetVersioner::userName
QString userName() const
Returns the name of the last person or program to modify the network.
Definition: ControlNetVersioner.cpp:164
Isis::ControlNetVersioner::netId
QString netId() const
Returns the ID for the network.
Definition: ControlNetVersioner.cpp:114
Isis::PvlObject::findObject
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition: PvlObject.h:274
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::ControlNet::m_controlGraph
Network m_controlGraph
The serial number -> vertex hash used by the graph.
Definition: ControlNet.h:461
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::ControlNetVersioner::targetName
QString targetName() const
Returns the target for the network.
Definition: ControlNetVersioner.cpp:124
Isis::Progress
Program progress reporter.
Definition: Progress.h:42
Isis::PvlObject::hasObject
bool hasObject(const QString &name) const
Returns a boolean value based on whether the object exists in the current PvlObject or not.
Definition: PvlObject.h:323
Isis::ControlNetVersioner::numPoints
int numPoints() const
Returns the number of points that have been read in or are ready to write out.
Definition: ControlNetVersioner.cpp:174
Isis::ControlNet::VertexIndexMapAdaptor
boost::associative_property_map< VertexIndexMap > VertexIndexMapAdaptor
Converts VertexIndexMap into the appropriate form to be used by boost.
Definition: ControlNet.h:454
Isis::Statistics::Average
double Average() const
Computes and returns the average.
Definition: Statistics.cpp:300
Isis::ControlNet::points
QHash< QString, ControlPoint * > * points
hash ControlPoints by ControlPoint Id
Definition: ControlNet.h:423
Isis::ControlNet::p_created
QString p_created
Creation Date.
Definition: ControlNet.h:467
Isis::ControlNet::AdjacencyIterator
boost::graph_traits< Network >::adjacency_iterator AdjacencyIterator
Iterates over adjacent verticies.
Definition: ControlNet.h:457
std
Namespace for the standard library.
Isis::ControlPoint::ModType
ModType
Control Point Modification Types.
Definition: ControlPoint.h:431
Isis::ControlNetVersioner::write
void write(FileName netFile)
This will write a control net file object to disk.
Definition: ControlNetVersioner.cpp:1659
Isis::ControlNetVersioner::toPvl
Pvl toPvl()
Generates a Pvl file from the currently stored control points and header.
Definition: ControlNetVersioner.cpp:202
Isis::ControlPoint::Delete
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
Definition: ControlPoint.cpp:354
Isis::ControlNet::p_targetName
QString p_targetName
Name of the target.
Definition: ControlNet.h:465
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
Isis::SerialNumberList::fileName
QString fileName(const QString &sn)
Return a filename given a serial number.
Definition: SerialNumberList.cpp:399
Isis::ControlNetVersioner::lastModificationDate
QString lastModificationDate() const
Returns the date and time of the last modification to the network.
Definition: ControlNetVersioner.cpp:144
Isis::SerialNumberList::hasSerialNumber
bool hasSerialNumber(QString sn)
Determines whether or not the requested serial number exists in the list.
Definition: SerialNumberList.cpp:373
Isis::ControlNet::pointIds
QStringList * pointIds
The ControlNet graph.
Definition: ControlNet.h:462
Isis::ControlNet::ImageConnection
Network::edge_descriptor ImageConnection
Reprents the verticies of the graph.
Definition: ControlNet.h:448
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ControlNetVersioner
Handle various control network file format versions.
Definition: ControlNetVersioner.h:412
Isis::ControlNet::p_cameraMap
QMap< QString, Isis::Camera * > p_cameraMap
A map from serialnumber to camera.
Definition: ControlNet.h:471
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175