Isis 3 Programmer Reference
ControlNet.cpp
1 #include "IsisDebug.h"
2 
3 #include "ControlNet.h"
4 
5 #include <iostream>
6 #include <cmath>
7 #include <sstream>
8 
9 #include <QDebug>
10 #include <QMutex>
11 #include <QMutexLocker>
12 #include <QPair>
13 #include <QScopedPointer>
14 #include <QSet>
15 #include <QStringList>
16 #include <QTime>
17 #include <QVariant>
18 #include <QVector>
19 
20 #include <boost/numeric/ublas/symmetric.hpp>
21 #include <boost/numeric/ublas/io.hpp>
22 
23 #include "Application.h"
24 #include "CameraFactory.h"
25 #include "ControlMeasure.h"
26 #include "ControlNetVersioner.h"
27 #include "ControlPoint.h"
28 #include "Distance.h"
29 #include "FileName.h"
30 #include "IException.h"
31 #include "iTime.h"
32 #include "Progress.h"
33 #include "SerialNumberList.h"
34 #include "SpecialPixel.h"
35 #include "Statistics.h"
36 #include "Target.h"
37 
38 using namespace std;
39 using namespace boost::numeric::ublas;
40 
41 
42 namespace Isis {
43 
44  void ControlNet::nullify() {
45 
46  points = NULL;
47  pointIds = NULL;
48  m_mutex = NULL;
49  }
50 
52  ControlNet::ControlNet(SurfacePoint::CoordinateType coordType) {
53 
55  // ControlNet::ControlNet() {
56  nullify();
57 
59  pointIds = new QStringList;
60 
61  m_ownPoints = true;
62  p_created = Application::DateTime();
63  p_modified = Application::DateTime();
64  m_coordType = coordType;
65  }
66 
67  ControlNet::ControlNet(const ControlNet &other) {
68 
69  nullify();
70 
72  pointIds = new QStringList;
73 
74  for (int cpIndex = 0; cpIndex < other.GetNumPoints(); cpIndex++) {
75  ControlPoint *newPoint = new ControlPoint(*other.GetPoint(cpIndex));
76  AddPoint(newPoint);
77  }
78 
79  m_ownPoints = true;
80 
81  p_targetName = other.p_targetName;
82  p_networkId = other.p_networkId;
83  p_created = other.p_created;
84  p_modified = other.p_modified;
85  p_description = other.p_description;
86  p_userName = other.p_userName;
87  p_cameraMap = other.p_cameraMap;
88  p_cameraList = other.p_cameraList;
89  m_coordType = other.m_coordType;
90  }
91 
92 
99  ControlNet::ControlNet(const QString &ptfile, Progress *progress,
100  SurfacePoint::CoordinateType coordType) {
101 
102  nullify();
103 
105  pointIds = new QStringList;
106 
107  m_ownPoints = true;
108  m_coordType = coordType;
109 
110  try {
111  ReadControl(ptfile, progress);
112  }
113  catch (IException &e) {
114  QString msg = "Invalid control network [" + ptfile + "]";
115  throw IException(e, IException::Io, msg, _FILEINFO_);
116  }
117  }
118 
119 
125  ControlNet::~ControlNet() {
126 
127  clear();
128 
129  delete points;
130  delete pointIds;
131 
132  nullify();
133  }
134 
135 
145  void ControlNet::emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType type, QVariant oldValue, QVariant newValue) {
146  emit measureModified(measure, type, oldValue, newValue);
147  }
148 
149 
159  void ControlNet::emitPointModified(ControlPoint *point, ControlPoint::ModType type, QVariant oldValue, QVariant newValue) {
160  emit pointModified(point, type, oldValue, newValue);
161  }
162 
163 
172  void ControlNet::clear() {
173 
174  // Now must also own points to delete them.
175  if (points) {
176  if (GetNumPoints() > 0) {
177  if (m_ownPoints) {
178  QHashIterator<QString, ControlPoint*> i(*points);
179  while (i.hasNext()) {
180  i.next();
181  delete(*points)[i.key()];
182  (*points)[i.key()] = NULL;
183  }
184  }
185  }
186  points->clear();
187  }
188 
189  m_vertexMap.clear();
190  m_controlGraph.clear();
191 
192  if (pointIds) {
193  pointIds->clear();
194  }
195 
196  return;
197  }
198 
199 
218  QList< ControlPoint * > ControlNet::take() {
219 
220  // First check to see if someone else has taken ownership
221  if (!m_ownPoints) {
222  throw IException(IException::Programmer, "Ownership has already been taken",
223  _FILEINFO_);
224  }
225 
226  QList<ControlPoint *> points = GetPoints();
227  m_ownPoints = false;
228  clear();
229 
230  // Disconnect the parent network reference
231  for (int i = 0; i < points.size(); i++) {
232  points[i]->parentNetwork = NULL;
233  }
234  return (points);
235  }
236 
237 
263  void ControlNet::ReadControl(const QString &filename, Progress *progress) {
264 
265  FileName cnetFileName(filename);
266  ControlNetVersioner versionedReader(cnetFileName, progress);
267  SetTarget( versionedReader.targetName() );
268  p_networkId = versionedReader.netId();
269  p_userName = versionedReader.userName();
270  p_created = versionedReader.creationDate();
271  p_modified = versionedReader.lastModificationDate();
272  p_description = versionedReader.description();
273 
274  int numPoints = versionedReader.numPoints();
275 
276  if (progress) {
277  progress->SetText("Adding Control Points to Network...");
278  progress->SetMaximumSteps(numPoints);
279  progress->CheckStatus();
280  }
281 
282  for (int i = 0; i < numPoints; i++) {
283  AddPoint( versionedReader.takeFirstPoint() );
284  if (progress) {
285  progress->CheckStatus();
286  }
287  }
288  }
289 
290 
303  void ControlNet::Write(const QString &ptfile, bool pvl) {
304  ControlNetVersioner versionedWriter(this);
305 
306  if (pvl) {
307  Pvl network;
308  try {
309  network = versionedWriter.toPvl();
310  }
311  catch (IException &e) {
312  QString msg = "Failed to convert control network to Pvl format.";
313  throw IException(e, IException::Programmer, msg, _FILEINFO_);
314  }
315 
316  try {
317  network.write(ptfile);
318  }
319  catch (IException &e) {
320  QString msg = "Failed writing control network to file [" + ptfile + "]";
321  throw IException(e, IException::Io, msg, _FILEINFO_);
322  }
323  }
324  else {
325  try {
326  versionedWriter.write(FileName(ptfile));
327  }
328  catch (IException &e) {
329  QString msg = "Failed writing control network to file [" + ptfile + "]";
330  throw IException(e, IException::Io, msg, _FILEINFO_);
331  }
332  }
333  }
334 
335 
344  void ControlNet::AddPoint(ControlPoint *point) {
345  if (!point) {
346  IString msg = "Null pointer passed to ControlNet::AddPoint!";
347  throw IException(IException::Programmer, msg, _FILEINFO_);
348  }
349 
350  if (ContainsPoint(point->GetId())) {
351  IString msg = "ControlPoint must have unique Id";
352  throw IException(IException::Programmer, msg, _FILEINFO_);
353  }
354 
355  QString pointId = point->GetId();
356  points->insert(pointId, point);
357  pointIds->append(pointId);
358 
359  point->parentNetwork = this;
360 
361  // notify control network of new point
362  pointAdded(point);
363 
364  emit networkStructureModified();
365  }
366 
367 
376  void ControlNet::pointAdded(ControlPoint *point) {
377  if (!point) {
378  IString msg = "NULL point passed to "
379  "ControlNet::pointAdded!";
380  throw IException(IException::Programmer, msg, _FILEINFO_);
381  }
382 
383  if (!ContainsPoint(point->GetId())) {
384  QString msg = "ControlNet does not contain the point [";
385  msg += point->GetId() + "]";
386  throw IException(IException::Programmer, msg, _FILEINFO_);
387  }
388 
389  // Make sure there is a node for every measure
390  for (int i = 0; i < point->GetNumMeasures(); i++) {
391  QString sn = point->GetMeasure(i)->GetCubeSerialNumber();
392  // If the graph doesn't have the sn, add a node for it
393  if (!m_vertexMap.contains(sn)) {
394  Image newImage;
395  newImage.serial = sn;
396  ImageVertex newVertex = boost::add_vertex(newImage, m_controlGraph);
397  m_vertexMap.insert(sn, newVertex);
398  emit networkModified(GraphModified);
399  }
400  }
401 
402  QList< ControlMeasure * > measures = point->getMeasures();
403  for(int i = 0; i < measures.size(); i++) {
404  ControlMeasure* measure = measures[i];
405  // Add the measure to the corresponding node
406  QString serial = measure->GetCubeSerialNumber();
407  m_controlGraph[m_vertexMap[serial]].measures[measure->Parent()] = measure;
408 
409  // In this measure's node add connections to the other nodes reachable from
410  // its point
411  if (!point->IsIgnored() && !measure->IsIgnored()) {
412  for (int j = i + 1; j < measures.size(); j++) {
413  ControlMeasure *cm = measures[j];
414  if (!cm->IsIgnored()) {
415  QString sn = cm->GetCubeSerialNumber();
416  addEdge(serial, sn);
417  }
418  }
419  }
420  }
421  emit newPoint(point);
422  }
423 
424 
434  bool ControlNet::addEdge(QString sourceSerial, QString targetSerial) {
435  // If the edge doesn't already exist, this adds and returns the edge.
436  // If the edge already exists, this just returns it. (The use of a set
437  // forces the edges to be unique.)
438  ImageConnection connection;
439  bool edgeAdded;
440 
441  boost::tie(connection, edgeAdded) = boost::add_edge(m_vertexMap[sourceSerial],
442  m_vertexMap[targetSerial],
443  m_controlGraph);
444  m_controlGraph[connection].strength++;
445  if (edgeAdded) {
446  emit networkModified(GraphModified);
447  }
448  return edgeAdded;
449  }
450 
451 
463  bool ControlNet::removeEdge(QString sourceSerial, QString targetSerial) {
464  ImageConnection connection;
465  bool edgeExists;
466  boost::tie(connection, edgeExists) = boost::edge(m_vertexMap[sourceSerial],
467  m_vertexMap[targetSerial],
468  m_controlGraph);
469  if (edgeExists) {
470  m_controlGraph[connection].strength--;
471  if (m_controlGraph[connection].strength <= 0) {
472  boost::remove_edge(m_vertexMap[sourceSerial],
473  m_vertexMap[targetSerial],
474  m_controlGraph);
475  emit networkModified(GraphModified);
476 
477  return true;
478  }
479  }
480  return false;
481  }
482 
483 
489  QString ControlNet::GraphToString() const {
490  QString graphString;
491 
492  QStringList images = GetCubeSerials();
493  images.sort();
494 
495  QHash<QString, QStringList> imagePointIds;
496 
497  foreach(QString imageSerial, images) {
498  QList<ControlPoint *> imagePoints = m_controlGraph[m_vertexMap[imageSerial]].measures.keys();
499  QStringList pointIds;
500  foreach(ControlPoint *point, imagePoints) {
501  if (!point->IsIgnored()) {
502  pointIds.append(point->GetId());
503  }
504  }
505  pointIds.sort();
506  imagePointIds.insert(imageSerial, pointIds);
507  }
508 
509  foreach(QString imageSerial, images) {
510  QStringList adjacentImages = getAdjacentImages(imageSerial);
511  adjacentImages.sort();
512  foreach(QString adjacentSerial, adjacentImages) {
513  if (QString::compare(adjacentSerial, imageSerial) < 0) {
514  continue;
515  }
516 
517  QStringList commonPoints;
518  QList<QString>::const_iterator imageIt = imagePointIds[imageSerial].cbegin();
519  QList<QString>::const_iterator adjacentIt = imagePointIds[adjacentSerial].cbegin();
520  while (imageIt != imagePointIds[imageSerial].cend() &&
521  adjacentIt != imagePointIds[adjacentSerial].cend()) {
522  int stringDiff = QString::compare(*imageIt, *adjacentIt);
523  if (stringDiff < 0) {
524  imageIt++;
525  }
526  else if(stringDiff == 0) {
527  commonPoints.append(*imageIt);
528  imageIt++;
529  adjacentIt++;
530  }
531  else {
532  adjacentIt++;
533  }
534  }
535 
536  std::pair<ImageConnection, bool> result = boost::edge(m_vertexMap[imageSerial],
537  m_vertexMap[adjacentSerial],
538  m_controlGraph);
539  QString edgeStrength = "UNKNOWN";
540  if (result.second) {
541  edgeStrength = toString(m_controlGraph[result.first].strength);
542  }
543 
544  graphString.append(imageSerial);
545  graphString.append(" ----(");
546  graphString.append(edgeStrength);
547  graphString.append(") [");
548  graphString.append(commonPoints.join(","));
549  graphString.append("]---- ");
550  graphString.append(adjacentSerial);
551  graphString.append("\n");
552  }
553  }
554 
555  return graphString;
556  }
557 
558 
572  void ControlNet::measureAdded(ControlMeasure *measure) {
573  if (!measure) {
574  IString msg = "NULL measure passed to "
575  "ControlNet::measureAdded!";
576  throw IException(IException::Programmer, msg, _FILEINFO_);
577  }
578 
579  ControlPoint *point = measure->Parent();
580  if (!point) {
581  IString msg = "Control measure with NULL parent passed to "
582  "ControlNet::measureAdded!";
583  throw IException(IException::Programmer, msg, _FILEINFO_);
584  }
585 
586  if (!ContainsPoint(point->GetId())) {
587  QString msg = "ControlNet does not contain the point [";
588  msg += point->GetId() + "]";
589  throw IException(IException::Programmer, msg, _FILEINFO_);
590  }
591  // Add the measure to the corresponding node
592  QString serial = measure->GetCubeSerialNumber();
593 
594  // If the graph doesn't have the sn, add a node for it
595  if (!m_vertexMap.contains(serial)) {
596  Image newImage;
597  newImage.serial = serial;
598  ImageVertex newVertex = boost::add_vertex(newImage, m_controlGraph);
599  m_vertexMap.insert(serial, newVertex);
600  emit networkModified(GraphModified);
601  }
602 
603  m_controlGraph[m_vertexMap[serial]].measures[measure->Parent()] = measure;
604 
605  // in this measure's node add connections to the other nodes reachable from
606  // its point
607  if (!point->IsIgnored() && !measure->IsIgnored()) {
608  for (int i = 0; i < point->GetNumMeasures(); i++) {
609  ControlMeasure *cm = point->GetMeasure(i);
610  if (!cm->IsIgnored()) {
611  QString sn = cm->GetCubeSerialNumber();
612 
613 
614  if (QString::compare(sn, serial) != 0) {
615  addEdge(serial, sn);
616  }
617  }
618  }
619  }
620  emit newMeasure(measure);
621  }
622 
623 
629  void ControlNet::pointUnIgnored(ControlPoint *point) {
630  if (!point) {
631  IString msg = "NULL point passed to "
632  "ControlNet::pointUnIgnored!";
633  throw IException(IException::Programmer, msg, _FILEINFO_);
634  }
635 
636  QList< ControlMeasure * > validMeasures = point->getMeasures(true);
637 
638  for (int i = 0; i < validMeasures.size(); i++) {
639  ControlMeasure *sourceMeasure = validMeasures[i];
640  QString sourceSerial = sourceMeasure->GetCubeSerialNumber();
641 
642  if (!ValidateSerialNumber(sourceSerial)) {
643  QString msg = "Node does not exist for [";
644  msg += sourceSerial + "]";
645  throw IException(IException::Programmer, msg, _FILEINFO_);
646  }
647 
648  for(int j = i+1; j < validMeasures.size(); j++) {
649  ControlMeasure *targetMeasure = validMeasures[j];
650  QString targetSerial = targetMeasure->GetCubeSerialNumber();
651 
652  if (!ValidateSerialNumber(targetSerial)) {
653  QString msg = "Node does not exist for [";
654  msg += targetSerial + "]";
655  throw IException(IException::Programmer, msg, _FILEINFO_);
656  }
657  addEdge(sourceSerial, targetSerial);
658  }
659  }
660  }
661 
662 
675  void ControlNet::measureUnIgnored(ControlMeasure *measure) {
676  if (!measure) {
677  IString msg = "NULL measure passed to "
678  "ControlNet::measureUnIgnored!";
679  throw IException(IException::Programmer, msg, _FILEINFO_);
680  }
681 
682  ControlPoint *point = measure->Parent();
683  if (!point) {
684  IString msg = "Control measure with NULL parent passed to "
685  "ControlNet::measureUnIgnored!";
686  throw IException(IException::Programmer, msg, _FILEINFO_);
687  }
688 
689  if (!ContainsPoint(point->GetId())) {
690  QString msg = "ControlNet does not contain the point [";
691  msg += point->GetId() + "]";
692  throw IException(IException::Programmer, msg, _FILEINFO_);
693  }
694 
695  // Make sure there is a node for every measure in this measure's parent
696  for (int i = 0; i < point->GetNumMeasures(); i++) {
697  ControlMeasure *adjacentMeasure = point->GetMeasure(i);
698  QString sn = adjacentMeasure->GetCubeSerialNumber();
699  if (!adjacentMeasure->IsIgnored() && !m_vertexMap.contains(sn)) {
700  QString msg = "Node does not exist for [";
701  msg += measure->GetCubeSerialNumber() + "]";
702  throw IException(IException::Programmer, msg, _FILEINFO_);
703  }
704  }
705 
706  if (!point->IsIgnored()) {
707  QString serial = measure->GetCubeSerialNumber();
708 
709  // In this measure's node add connections to the other nodes reachable
710  // from its point
711  for (int i = 0; i < point->GetNumMeasures(); i++) {
712  ControlMeasure *cm = point->GetMeasure(i);
713  if (!cm->IsIgnored()) {
714  QString sn = cm->GetCubeSerialNumber();
715 
716  if (QString::compare(sn, serial) != 0) {
717  addEdge(serial, sn);
718  }
719  }
720  }
721  }
722  }
723 
724 
733  void ControlNet::UpdatePointReference(ControlPoint *point, QString oldId) {
734  points->remove(oldId);
735  (*points)[point->GetId()] = point;
736  (*pointIds)[pointIds->indexOf((QString) oldId)] = (QString)point->GetId();
737  }
738 
739 
746  void ControlNet::measureDeleted(ControlMeasure *measure) {
747  ASSERT(measure);
748  QString serial = measure->GetCubeSerialNumber();
749  ASSERT(m_vertexMap.contains(serial));
750 
751  emit measureRemoved(measure);
752 
753  // Remove connections to and from this node
754  if (!measure->IsIgnored() && !measure->Parent()->IsIgnored()) {
755  // Break connections
756  measureIgnored(measure);
757  }
758 
759  // Remove the measure from the associated node.
760  // Conceptually, I think this belongs in measureIgnored, but it isn't done
761  // for the old graph.
762  m_controlGraph[m_vertexMap[serial]].measures.remove(measure->Parent());
763  }
764 
765 
771  void ControlNet::pointIgnored(ControlPoint *point) {
772  if (!point) {
773  IString msg = "NULL point passed to "
774  "ControlNet::pointIgnored!";
775  throw IException(IException::Programmer, msg, _FILEINFO_);
776  }
777 
778  QList< ControlMeasure * > validMeasures = point->getMeasures(true);
779 
780  for (int i = 0; i < validMeasures.size(); i++) {
781  ControlMeasure *sourceMeasure = validMeasures[i];
782  QString sourceSerial = sourceMeasure->GetCubeSerialNumber();
783 
784  if (!ValidateSerialNumber(sourceSerial)) {
785  QString msg = "Node does not exist for [";
786  msg += sourceSerial + "]";
787  throw IException(IException::Programmer, msg, _FILEINFO_);
788  }
789 
790  for(int j = i+1; j < validMeasures.size(); j++) {
791  ControlMeasure *targetMeasure = validMeasures[j];
792  QString targetSerial = targetMeasure->GetCubeSerialNumber();
793 
794  if (!ValidateSerialNumber(targetSerial)) {
795  QString msg = "Node does not exist for [";
796  msg += targetSerial + "]";
797  throw IException(IException::Programmer, msg, _FILEINFO_);
798  }
799  removeEdge(sourceSerial, targetSerial);
800  }
801  }
802  }
803 
804 
805 
813  void ControlNet::measureIgnored(ControlMeasure *measure) {
814  if (!measure) {
815  IString msg = "NULL measure passed to "
816  "ControlNet::measureIgnored!";
817  throw IException(IException::Programmer, msg, _FILEINFO_);
818  }
819 
820  ControlPoint *point = measure->Parent();
821  if (!point) {
822  IString msg = "Control measure with NULL parent passed to "
823  "ControlNet::measureIgnored!";
824  throw IException(IException::Programmer, msg, _FILEINFO_);
825  }
826 
827  QString serial = measure->GetCubeSerialNumber();
828  if (!ValidateSerialNumber(serial)) {
829  QString msg = "Node does not exist for [";
830  msg += serial + "]";
831  throw IException(IException::Programmer, msg, _FILEINFO_);
832  }
833 
834  // Decrement the edge strength for edges from this node
835  // Remove edge if the strength becomes 0.
836  for (int i = 0; i < point->GetNumMeasures(); i++) {
837  ControlMeasure *adjacentMeasure = point->GetMeasure(i);
838  QString sn = adjacentMeasure->GetCubeSerialNumber();
839  if (!adjacentMeasure->IsIgnored() && m_vertexMap.contains(sn)) {
840  if (QString::compare(serial, sn) !=0) {
841  removeEdge(serial, sn);
842  }
843  }
844  }
845  }
846 
847 
853  void ControlNet::SetCoordType(SurfacePoint::CoordinateType coordType) {
854  m_coordType = coordType;
855  }
856 
857 
861  void ControlNet::emitNetworkStructureModified() {
862  emit networkStructureModified();
863  }
864 
865 
871  int ControlNet::DeletePoint(ControlPoint *point) {
872  if (points->values().contains(point)) {
873  return DeletePoint(point->GetId());
874  }
875  else {
876  IString msg = "point [";
877  msg += (long) point;
878  msg += "] does not exist in the network";
879  throw IException(IException::User, msg, _FILEINFO_);
880  }
881  }
882 
883 
891  int ControlNet::DeletePoint(QString pointId) {
892  if (!points->contains(pointId)) {
893  IString msg = "point Id [" + pointId + "] does not exist in the network";
894  throw IException(IException::User, msg, _FILEINFO_);
895  }
896 
897  ControlPoint *point = (*points)[pointId];
898 
899  if (point->IsEditLocked())
900  return ControlPoint::PointLocked;
901 
902  bool wasIgnored = point->IsIgnored();
903 
904  // notify CubeSerialNumbers of the loss of this point
905  foreach(ControlMeasure * measure, point->getMeasures()) {
906  point->Delete(measure);
907  }
908 
909  emit pointDeleted(point);
910 
911  // delete point
912  points->remove(pointId);
913  pointIds->removeAt(pointIds->indexOf(pointId));
914  delete point;
915  point = NULL;
916 
917  if (!wasIgnored)
918  emit networkStructureModified();
919  return ControlPoint::Success;
920  }
921 
922 
928  int ControlNet::DeletePoint(int index) {
929  if (index < 0 || index >= pointIds->size()) {
930  IString msg = "Index [" + IString(index) + "] out of range";
931  throw IException(IException::Programmer, msg, _FILEINFO_);
932  }
933 
934  return DeletePoint(pointIds->at(index));
935  }
936 
937 
943  bool ControlNet::ContainsPoint(QString pointId) const {
944  return points->contains(pointId);
945  }
946 
947 
959  QList< QList< QString > > ControlNet::GetSerialConnections() const {
960 
961  VertexIndexMap indexMap;
962  VertexIndexMapAdaptor indexMapAdaptor(indexMap);
963 
964  // Needed to use connected_componenets
965  QList< QString> serials = m_vertexMap.keys();
966  for (int i = 0; i < serials.size(); i++) {
967  boost::put(indexMapAdaptor, m_vertexMap[serials[i]], i);
968  }
969 
970  VertexIndexMap componentMap;
971  VertexIndexMapAdaptor componentAdaptor(componentMap);
972  int numComponents = boost::connected_components(m_controlGraph, componentAdaptor,
973  boost::vertex_index_map(indexMapAdaptor));
974 
975  QList< QList< QString > > islandStrings;
976  for (int i = 0; i < numComponents; i++) {
977  QList<QString> tempList;
978  islandStrings.append(tempList);
979  }
980  std::map<ImageVertex, size_t>::iterator it = componentMap.begin();
981  while(it != componentMap.end())
982  {
983  QString serial = m_controlGraph[it->first].serial;
984  int group = (int) it->second;
985  islandStrings[group].append(serial);
986  ++it;
987  }
988  return islandStrings;
989  }
990 
991 
995  int ControlNet::getEdgeCount() const {
996  return boost::num_edges(m_controlGraph);
997  }
998 
999 
1008  QList< QString > ControlNet::GetCubeSerials() const {
1009  return m_vertexMap.keys();
1010  }
1011 
1012 
1021  bool ControlNet::ValidateSerialNumber(QString serialNumber) const {
1022  return m_vertexMap.contains(serialNumber);
1023  }
1024 
1025 
1033  QList< QString > ControlNet::getAdjacentImages(QString serialNumber) const {
1034  if (!ValidateSerialNumber(serialNumber)) {
1035  QString msg = "Cube Serial Number [" + serialNumber + "] not found in "
1036  "the network";
1037  throw IException(IException::Programmer, msg, _FILEINFO_);
1038  }
1039 
1040  QList< QString > adjacentSerials;
1041 
1042  AdjacencyIterator adjIt, adjEnd;
1043  boost::tie(adjIt, adjEnd) = boost::adjacent_vertices(m_vertexMap[serialNumber], m_controlGraph);
1044  for( ; adjIt != adjEnd; adjIt++) {
1045  adjacentSerials.append(m_controlGraph[*adjIt].serial);
1046  }
1047 
1048  return adjacentSerials;
1049  }
1050 
1051 
1057  QList< ControlMeasure * > ControlNet::GetMeasuresInCube(QString serialNumber) {
1058  if( !ValidateSerialNumber(serialNumber) ) {
1059  IString msg = "Cube Serial Number [" + serialNumber + "] not found in "
1060  "the network";
1061  throw IException(IException::Programmer, msg, _FILEINFO_);
1062 
1063  }
1064  return m_controlGraph[m_vertexMap[serialNumber]].measures.values();
1065  }
1066 
1067 
1073  QList< ControlMeasure * > ControlNet::GetValidMeasuresInCube(QString serialNumber) {
1074  QList< ControlMeasure * > validMeasures;
1075 
1076  // Get measures in cube will validate this for us, so we don't need to re-check
1077  QList< ControlMeasure * > measureList = GetMeasuresInCube(serialNumber);
1078 
1079  foreach(ControlMeasure * measure, measureList) {
1080  if (!measure->IsIgnored())
1081  validMeasures.append(measure);
1082  }
1083 
1084  return validMeasures;
1085  }
1086 
1087 
1094  ControlNet::ControlMeasureLessThanFunctor::operator=(ControlMeasureLessThanFunctor const &other) {
1095 
1096  if (this != &other) {
1097  this->m_accessor = other.m_accessor;
1098  }
1099 
1100  return *this;
1101  }
1102 
1103 
1110  bool ControlNet::ControlMeasureLessThanFunctor::operator()
1111  (ControlMeasure* const &a, ControlMeasure* const &b) {
1112 
1113  return (a->*this->m_accessor)() < (b->*this->m_accessor)();
1114 
1115  }
1116 
1117 
1125  QList< ControlMeasure * > ControlNet::sortedMeasureList(double(ControlMeasure::*statFunc)() const,
1126  double min,double max) {
1127 
1128  QList< ControlMeasure * >measures;
1129 
1130  //build a list of all the pointers to the relevant measures
1131  //get the number of object points
1132  int nObjPts = this->GetNumPoints();
1133  for (int i=0;i<nObjPts;i++) { //for each Object point
1134  ControlPoint *point = this->GetPoint(i);
1135  if (point->IsIgnored()) continue; //if the point is ignored then continue
1136 
1137  // Get the number of measures
1138  int nObs = point->GetNumMeasures();
1139  for (int j=0;j<nObs;j++) { //for every measure
1140  ControlMeasure *measure = point->GetMeasure(j);
1141  if (measure->IsIgnored()) continue;
1142  double temp = (measure->*statFunc)();
1143  if (temp > min)
1144  if (min <= temp && temp <= max) measures.push_back(measure);
1145  }
1146  }
1147 
1148  // Sort the measures
1149  ControlMeasureLessThanFunctor lessThan(statFunc);
1150  qSort(measures.begin(),measures.end(),lessThan);
1151 
1152  return measures;
1153  }
1154 
1155 
1161  void ControlNet::ComputeResiduals() {
1162  // TODO: Make sure the cameras have been initialized
1163 
1164  QHashIterator< QString, ControlPoint * > i(*points);
1165  while (i.hasNext()) {
1166  i.next();
1167  i.value()->ComputeResiduals();
1168  }
1169  }
1170 
1171 
1177  void ControlNet::ComputeApriori() {
1178  // TODO: Make sure the cameras have been initialized
1179  QHashIterator< QString, ControlPoint * > i(*points);
1180  while (i.hasNext()) {
1181  i.next();
1182  ControlPoint *point = i.value();
1183  if ( !point->IsIgnored() )
1184  point->ComputeApriori();
1185  }
1186  }
1187 
1188 
1195  double ControlNet::AverageResidual() {
1196  // TODO: Make sure the cameras have been initialized
1197  double avgResidual = 0.0;
1198  int count = 0;
1199  QHashIterator< QString, ControlPoint * > i(*points);
1200  while (i.hasNext()) {
1201  i.next();
1202  ControlPoint *point = i.value();
1203  if (!point->IsIgnored()) {
1204  avgResidual += point->GetStatistic(
1205  &ControlMeasure::GetResidualMagnitude).Average();
1206  count++;
1207  }
1208  }
1209 
1210  if (count != 0)
1211  avgResidual /= count;
1212 
1213  return avgResidual;
1214  }
1215 
1216 
1224  Isis::Camera *ControlNet::Camera(int index) {
1225  return p_cameraList[index];
1226  }
1227 
1228 
1236  QString ControlNet::CreatedDate() const {
1237  return p_created;
1238  }
1239 
1240 
1246  QString ControlNet::Description() const {
1247  return p_description;
1248  }
1249 
1250 
1263  ControlPoint *ControlNet::FindClosest(QString serialNumber,
1264  double sample, double line) {
1265 
1266  if (!ValidateSerialNumber(serialNumber)) {
1267  QString msg = "serialNumber [";
1268  msg += serialNumber;
1269  msg += "] not found in ControlNet";
1270  throw IException(IException::Programmer, msg, _FILEINFO_);
1271  }
1272 
1273  const double SEARCH_DISTANCE = 99999999.0;
1274  double minDist = SEARCH_DISTANCE;
1275  ControlPoint *closestPoint = NULL;
1276 
1277  QList < ControlMeasure * > measures = m_controlGraph[m_vertexMap[serialNumber]].measures.values();
1278 
1279  for (int i = 0; i < measures.size(); i++) {
1280  ControlMeasure *measureToCheck = measures[i];
1281 
1282  // Find closest line sample & return that controlpoint
1283  double dx = fabs(sample - measureToCheck->GetSample());
1284  double dy = fabs(line - measureToCheck->GetLine());
1285 
1286  double dist = sqrt((dx * dx) + (dy * dy));
1287 
1288  if (dist < minDist) {
1289  minDist = dist;
1290  closestPoint = measureToCheck->Parent();
1291  }
1292  }
1293 
1294  if (!closestPoint) {
1295  IString msg = "No point found within ";
1296  msg += IString(SEARCH_DISTANCE);
1297  msg += "pixels of sample/line [";
1298  msg += IString(sample);
1299  msg += ", ";
1300  msg += IString(line);
1301  msg += "]";
1302  throw IException(IException::Programmer, msg, _FILEINFO_);
1303  }
1304 
1305  return closestPoint;
1306  }
1307 
1308 
1315  double ControlNet::GetMaximumResidual() {
1316  // TODO: Make sure the cameras have been initialized
1317 
1318  double maxResidual = 0.0;
1319  foreach(ControlPoint * p, *points) {
1320  double residual = p->GetStatistic(
1321  &ControlMeasure::GetResidualMagnitude).Maximum();
1322  if (residual > maxResidual)
1323  maxResidual = residual;
1324  }
1325 
1326  return maxResidual;
1327  }
1328 
1329 
1330  QString ControlNet::GetNetworkId() const {
1331  return p_networkId;
1332  }
1333 
1334 
1341  int ControlNet::GetNumEditLockMeasures() {
1342  int numLockedMeasures = 0;
1343  foreach(ControlPoint * p, *points) {
1344  numLockedMeasures += p->GetNumLockedMeasures();
1345  }
1346 
1347  return numLockedMeasures;
1348  }
1349 
1350 
1356  int ControlNet::GetNumEditLockPoints() {
1357  int editLockPoints = 0;
1358  foreach(ControlPoint * p, *points) {
1359  if (p->IsEditLocked())
1360  editLockPoints++;
1361  }
1362 
1363  return editLockPoints;
1364  }
1365 
1366 
1373  int ControlNet::GetNumIgnoredMeasures() {
1374  int numIgnoredMeasures = 0;
1375  foreach(ControlPoint * p, *points) {
1376  numIgnoredMeasures += p->GetNumMeasures() - p->GetNumValidMeasures();
1377  }
1378 
1379  return numIgnoredMeasures;
1380  }
1381 
1382 
1391  int ControlNet::GetNumberOfValidMeasuresInImage(const QString &serialNumber) {
1392  // If SetImage was called, use the map that has been populated with valid measures
1393  if (p_cameraList.size() > 0) {
1394  return p_cameraValidMeasuresMap[serialNumber];
1395  }
1396  return GetValidMeasuresInCube(serialNumber).size();
1397  }
1398 
1399 
1405  int ControlNet::GetNumberOfJigsawRejectedMeasuresInImage(const QString &serialNumber) {
1406  return p_cameraRejectedMeasuresMap[serialNumber];
1407  }
1408 
1409 
1415  void ControlNet::ClearJigsawRejected() {
1416  foreach(ControlPoint * p, *points) {
1417  p->ClearJigsawRejected();
1418  }
1419  }
1420 
1421 
1426  void ControlNet::IncrementNumberOfRejectedMeasuresInImage(const QString &serialNumber) {
1427  p_cameraRejectedMeasuresMap[serialNumber]++;
1428  }
1429 
1430 
1435  void ControlNet::DecrementNumberOfRejectedMeasuresInImage(const QString &serialNumber) {
1436  if (p_cameraRejectedMeasuresMap[serialNumber] > 0)
1437  p_cameraRejectedMeasuresMap[serialNumber]--;
1438  }
1439 
1440 
1446  int ControlNet::GetNumMeasures() const {
1447  int numMeasures = 0;
1448  foreach(ControlPoint * p, *points) {
1449  numMeasures += p->GetNumMeasures();
1450  }
1451 
1452  return numMeasures;
1453  }
1454 
1455 
1457  int ControlNet::GetNumPoints() const {
1458  return points->size();
1459  }
1460 
1461 
1471  int ControlNet::GetNumValidMeasures() {
1472  int numValidMeasures = 0;
1473  foreach(ControlPoint * p, *points) {
1474  if (!p->IsIgnored())
1475  numValidMeasures += p->GetNumValidMeasures();
1476  }
1477 
1478  return numValidMeasures;
1479  }
1480 
1481 
1487  int ControlNet::GetNumValidPoints() {
1488  int validPoints = 0;
1489  foreach(ControlPoint * p, *points) {
1490  if (!p->IsIgnored())
1491  validPoints++;
1492  }
1493 
1494  return validPoints;
1495  }
1496 
1497 
1499  QString ControlNet::GetTarget() const {
1500  return p_targetName;
1501  }
1502 
1503 
1505  QString ControlNet::GetUserName() const {
1506  return p_userName;
1507  }
1508 
1510  QString ControlNet::GetLastModified() const {
1511  return p_modified;
1512  }
1513 
1514 
1516  QList< ControlPoint * > ControlNet::GetPoints() {
1517  QList< ControlPoint * > pointsList;
1518 
1519  for (int i = 0; i < pointIds->size(); i++) {
1520  pointsList.append(GetPoint(i));
1521  }
1522 
1523  return pointsList;
1524  }
1525 
1526 
1528  QList< QString > ControlNet::GetPointIds() const {
1529  return *pointIds;
1530  }
1531 
1532 
1538  void ControlNet::SetCreatedDate(const QString &date) {
1539  p_created = date;
1540  }
1541 
1542 
1548  void ControlNet::SetDescription(const QString &newDescription) {
1549  p_description = newDescription;
1550  }
1551 
1552 
1558  void ControlNet::SetImages(const QString &imageListFile) {
1559  SerialNumberList list(imageListFile);
1560  SetImages(list);
1561  }
1562 
1563 
1579  void ControlNet::SetImages(SerialNumberList &list, Progress *progress) {
1580  // First check if cameras have already been setup via another SetImages call
1581  if (p_cameraList.size() > 0) {
1582  return;
1583  }
1584  // Prep for reporting progress
1585  if (progress != NULL) {
1586  progress->SetText("Setting input images...");
1587  progress->SetMaximumSteps(list.size());
1588  progress->CheckStatus();
1589  }
1590  // Open the camera for all the images in the serial number list
1591  for (int i = 0; i < list.size(); i++) {
1592  QString serialNumber = list.serialNumber(i);
1593  QString filename = list.fileName(i);
1594  Cube cube(filename, "r");
1595 
1596  try {
1597  Isis::Camera *cam = CameraFactory::Create(cube);
1598  p_cameraMap[serialNumber] = cam;
1599  p_cameraValidMeasuresMap[serialNumber] = 0;
1600  p_cameraRejectedMeasuresMap[serialNumber] = 0;
1601  p_cameraList.push_back(cam);
1602  }
1603  catch (IException &e) {
1604  QString msg = "Unable to create camera for cube file ";
1605  msg += filename;
1606  throw IException(e, IException::Unknown, msg, _FILEINFO_);
1607  }
1608 
1609  if (progress != NULL)
1610  progress->CheckStatus();
1611  }
1612 
1613  // Loop through all measures and set the camera
1614  QHashIterator< QString, ControlPoint * > p(*points);
1615  while (p.hasNext()) {
1616  p.next();
1617  ControlPoint *curPoint = p.value();
1618 
1619  QList< QString > serialNums = curPoint->getCubeSerialNumbers();
1620  for (int m = 0; m < serialNums.size(); m++) {
1621  ControlMeasure *curMeasure = (*curPoint)[serialNums[m]];
1622 
1623  QString serialNumber = curMeasure->GetCubeSerialNumber();
1624  if (list.hasSerialNumber(serialNumber)) {
1625  curMeasure->SetCamera(p_cameraMap[serialNumber]);
1626 
1627  // increment number of measures for this image (camera)
1628  if (!curMeasure->IsIgnored()) p_cameraValidMeasuresMap[serialNumber]++;
1629  }
1630  else {
1631  IString msg = "Control point [" + curPoint->GetId() +
1632  "], measure [" + curMeasure->GetCubeSerialNumber() +
1633  "] does not have a cube with a matching serial number";
1634  throw IException(IException::User, msg, _FILEINFO_);
1635  }
1636  }
1637  }
1638  }
1639 
1640 
1646  void ControlNet::SetModifiedDate(const QString &date) {
1647  p_modified = date;
1648  }
1649 
1650 
1658  void ControlNet::SetMutex(QMutex *mutex) {
1659  m_mutex = mutex;
1660  }
1661 
1662 
1668  void ControlNet::SetNetworkId(const QString &id) {
1669  p_networkId = id;
1670  }
1671 
1672 
1684  void ControlNet::SetTarget(const QString &target) {
1685  p_targetName = target;
1686  }
1687 
1688 
1696  void ControlNet::SetTarget(Pvl label) {
1697  PvlGroup mapping;
1698  if ( (label.hasObject("IsisCube") && label.findObject("IsisCube").hasGroup("Mapping"))
1699  || label.hasGroup("Mapping") ) {
1700  mapping = label.findGroup("Mapping", Pvl::Traverse);
1701  }
1702 
1703  if (mapping.hasKeyword("TargetName")) {
1704  p_targetName = mapping["TargetName"][0];
1705  }
1706  else if (label.hasObject("IsisCube")
1707  && label.findObject("IsisCube").hasGroup("Instrument")
1708  && label.findObject("IsisCube").findGroup("Instrument").hasKeyword("TargetName")) {
1709  p_targetName = label.findObject("IsisCube").findGroup("Instrument").findKeyword("TargetName")[0];
1710  }
1711  else {
1712  p_targetName = "";
1713  }
1714  }
1715 
1716 
1722  void ControlNet::SetUserName(const QString &name) {
1723  p_userName = name;
1724  }
1725 
1726 
1741  void ControlNet::swap(ControlNet &other) {
1742  std::swap(points, other.points);
1743  std::swap(pointIds, other.pointIds);
1744  m_controlGraph.swap(other.m_controlGraph);
1745  std::swap(m_mutex, other.m_mutex);
1746  std::swap(p_targetName, other.p_targetName);
1747  std::swap(p_networkId, other.p_networkId);
1748  std::swap(p_created, other.p_created);
1749  std::swap(p_modified, other.p_modified);
1750  std::swap(p_description, other.p_description);
1751  std::swap(p_userName, other.p_userName);
1752  std::swap(p_cameraMap, other.p_cameraMap);
1753  std::swap(p_cameraValidMeasuresMap, other.p_cameraValidMeasuresMap);
1754  std::swap(p_cameraRejectedMeasuresMap, other.p_cameraRejectedMeasuresMap);
1755  std::swap(p_cameraList, other.p_cameraList);
1756 
1757  // points have parent pointers that need to be updated too...
1758  QHashIterator< QString, ControlPoint * > i(*points);
1759  while (i.hasNext()) {
1760  i.next().value()->parentNetwork = this;
1761  }
1762 
1763  QHashIterator< QString, ControlPoint * > i2(*other.points);
1764  while (i2.hasNext()) {
1765  i2.next().value()->parentNetwork = &other;
1766  }
1767 
1768  m_vertexMap.clear();
1769  VertexIterator v, vend;
1770  for (boost::tie(v, vend) = vertices(m_controlGraph); v != vend; ++v) {
1771  ImageVertex imVertex = *v;
1772  QString serialNum = m_controlGraph[*v].serial;
1773  m_vertexMap[serialNum] = imVertex;
1774  }
1775 
1776  other.m_vertexMap.clear();
1777  VertexIterator v2, vend2;
1778  for (boost::tie(v2, vend2) = vertices(other.m_controlGraph); v2 != vend2; ++v2) {
1779  ImageVertex imVertex = *v2;
1780  QString serialNum = other.m_controlGraph[*v2].serial;
1781  other.m_vertexMap[serialNum] = imVertex;
1782  }
1783 
1784  emit networkModified(ControlNet::Swapped);
1785  }
1786 
1787 
1795  ControlNet &ControlNet::operator=(const ControlNet &other) {
1796  // Optimization: if this == other do nothing.
1797  if (this != &other) {
1798  // copy & swap
1799  ControlNet copy(other);
1800  swap(copy);
1801  }
1802 
1803  return *this;
1804  }
1805 
1806 
1807  const ControlPoint *ControlNet::GetPoint(QString id) const {
1808  if (!points->contains(id)) {
1809  IString msg = "The control network has no control points with an ID "
1810  "equal to [" + id + "]";
1811  throw IException(IException::Programmer, msg, _FILEINFO_);
1812  }
1813 
1814  return points->value(id);
1815  }
1816 
1817 
1818  ControlPoint *ControlNet::GetPoint(QString id) {
1819  if (!points->contains(id)) {
1820  IString msg = "The control network has no control points with an ID "
1821  "equal to [" + id + "]";
1822  throw IException(IException::Programmer, msg, _FILEINFO_);
1823  }
1824 
1825  return (*points)[id];
1826  }
1827 
1828 
1829  const ControlPoint *ControlNet::GetPoint(int index) const {
1830  if (index < 0 || index >= pointIds->size()) {
1831  IString msg = "Index [" + IString(index) + "] out of range";
1832  throw IException(IException::Programmer, msg, _FILEINFO_);
1833  }
1834 
1835  return GetPoint(pointIds->at(index));
1836  }
1837 
1838 
1839  ControlPoint *ControlNet::GetPoint(int index) {
1840  if (index < 0 || index >= pointIds->size()) {
1841  IString msg = "Index [" + IString(index) + "] out of range";
1842  throw IException(IException::Programmer, msg, _FILEINFO_);
1843  }
1844 
1845  return GetPoint(pointIds->at(index));
1846  }
1847 
1848 
1854  SurfacePoint::CoordinateType ControlNet::GetCoordType() {
1855  return m_coordType;
1856  }
1857 
1858  const ControlPoint *ControlNet::operator[](QString id) const {
1859  return GetPoint(id);
1860  }
1861 
1862 
1863  ControlPoint *ControlNet::operator[](QString id) {
1864  return GetPoint(id);
1865  }
1866 
1867 
1868  const ControlPoint *ControlNet::operator[](int index) const {
1869  return GetPoint(index);
1870  }
1871 
1872 
1873  ControlPoint *ControlNet::operator[](int index) {
1874  return GetPoint(index);
1875  }
1876 }
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
boost::graph_traits< Network >::adjacency_iterator AdjacencyIterator
Iterates over adjacent verticies.
Definition: ControlNet.h:471
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition: Progress.cpp:101
QString p_targetName
Name of the target.
Definition: ControlNet.h:479
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:141
bool hasSerialNumber(QString sn)
Determines whether or not the requested serial number exists in the list.
QString creationDate() const
Returns the date and time that the network was created.
Used to define the verticies of the graph.
Definition: ControlNet.h:440
File name manipulation and expansion.
Definition: FileName.h:116
Status ComputeApriori()
Computes a priori lat/lon/radius point coordinates by determining the average lat/lon/radius of all ...
Pvl toPvl()
Generates a Pvl file from the currently stored control points and header.
QStringList * pointIds
The ControlNet graph.
Definition: ControlNet.h:476
QString lastModificationDate() const
Returns the date and time of the last modification to the network.
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube&#39;s serial number.
ModType
Control Measure Modification Types.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition: PvlObject.h:286
void ClearJigsawRejected()
Set jigsaw rejected flag for all measures to false and set the jigsaw rejected flag for the point its...
QString p_description
Textual Description of network.
Definition: ControlNet.h:483
boost::associative_property_map< VertexIndexMap > VertexIndexMapAdaptor
Converts VertexIndexMap into the appropriate form to be used by boost.
Definition: ControlNet.h:468
QMap< QString, Isis::Camera * > p_cameraMap
A map from serialnumber to camera.
Definition: ControlNet.h:485
QString serialNumber(const QString &filename)
Return a serial number given a filename.
Handle various control network file format versions.
Namespace for the standard library.
QString p_networkId
The Network Id.
Definition: ControlNet.h:480
ControlNet * parentNetwork
List of Control Measures.
Definition: ControlPoint.h:617
Network m_controlGraph
The serial number -> vertex hash used by the graph.
Definition: ControlNet.h:475
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
Definition: PvlObject.h:222
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:226
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
std::map< ImageVertex, size_t > VertexIndexMap
Represents the edges of the graph.
Definition: ControlNet.h:465
int GetNumValidMeasures() const
QString p_created
Creation Date.
Definition: ControlNet.h:481
void CheckStatus()
Checks and updates the status.
Definition: Progress.cpp:121
Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const
This function will call a given method on every control measure that this point has.
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:335
QString fileName(const QString &sn)
Return a filename given a serial number.
double Maximum() const
Returns the absolute maximum double found in all data passed through the AddData method.
Definition: Statistics.cpp:416
int GetNumPoints() const
Return the number of control points in the network.
SurfacePoint::CoordinateType m_coordType
The coordinate type of the control points.
Definition: ControlNet.h:492
Program progress reporter.
Definition: Progress.h:58
QString description() const
Returns the network&#39;s description.
QString p_userName
The user who created the network.
Definition: ControlNet.h:484
a control network
Definition: ControlNet.h:271
int GetNumLockedMeasures() const
Returns the number of locked control measures.
QString GetId() const
Return the Id of the control point.
Status SetCamera(Isis::Camera *camera)
Set pointer to camera associated with a measure.
QMap< QString, int > p_cameraValidMeasuresMap
A map from serialnumber to #measures.
Definition: ControlNet.h:486
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition: Progress.cpp:77
void clear()
Clear the contents of this object.
Definition: ControlNet.cpp:172
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
QList< QString > getCubeSerialNumbers() const
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
QList< ControlMeasure *> getMeasures(bool excludeIgnored=false) const
A single control point.
Definition: ControlPoint.h:369
Container for cube-like labels.
Definition: Pvl.h:135
QHash< QString, ControlPoint *> * points
hash ControlPoints by ControlPoint Id
Definition: ControlNet.h:437
Network::edge_descriptor ImageConnection
Reprents the verticies of the graph.
Definition: ControlNet.h:462
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
Definition: SurfacePoint.h:155
int size() const
How many serial number / filename combos are in the list.
QString targetName() const
Returns the target for the network.
ModType
Control Point Modification Types.
Definition: ControlPoint.h:446
void write(FileName netFile)
This will write a control net file object to disk.
ControlPoint * takeFirstPoint()
Returns the first point stored in the versioner&#39;s internal list.
QVector< Isis::Camera * > p_cameraList
Vector of image number to camera.
Definition: ControlNet.h:489
QMap< QString, int > p_cameraRejectedMeasuresMap
A map from serialnumber to #rejected measures.
Definition: ControlNet.h:487
QString netId() const
Returns the ID for the network.
Isis exception class.
Definition: IException.h:107
Adds specific functionality to C++ strings.
Definition: IString.h:181
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
a control measurement
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
void write(const QString &file)
Opens and writes PVL information to a file and handles the end of line sequence.
Definition: Pvl.cpp:116
QString p_modified
Date Last Modified.
Definition: ControlNet.h:482
Serial Number list generator.
QString userName() const
Returns the name of the last person or program to modify the network.
double Average() const
Computes and returns the average.
Definition: Statistics.cpp:313
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
IO Handler for Isis Cubes.
Definition: Cube.h:170
int numPoints() const
Returns the number of points that have been read in or are ready to write out.