Commit 280cada9 authored by Kaitlyn Lee's avatar Kaitlyn Lee
Browse files

Merge branch 'ipceCnetHealth' of github.com:USGS-Astrogeology/ISIS3 into ipceDocks

parents fd25c12d a3041fdc
Loading
Loading
Loading
Loading
+30 −37
Original line number Diff line number Diff line
@@ -401,6 +401,7 @@ namespace Isis {
        newImage.serial = sn;
        ImageVertex newVertex = boost::add_vertex(newImage, m_controlGraph);
        m_vertexMap.insert(sn, newVertex);
        emit networkModified(GraphModified);
      }
    }

@@ -447,6 +448,9 @@ namespace Isis {
                                                        m_vertexMap[targetSerial],
                                                        m_controlGraph);
    m_controlGraph[connection].strength++;
    if (edgeAdded) {
      emit networkModified(GraphModified);
    }
    return edgeAdded;
  }

@@ -474,6 +478,7 @@ namespace Isis {
        boost::remove_edge(m_vertexMap[sourceSerial],
                           m_vertexMap[targetSerial],
                           m_controlGraph);
        emit networkModified(GraphModified);

        return true;
      }
@@ -598,6 +603,7 @@ namespace Isis {
      newImage.serial = serial;
      ImageVertex newVertex = boost::add_vertex(newImage, m_controlGraph);
      m_vertexMap.insert(serial, newVertex);
      emit networkModified(GraphModified);
    }

    m_controlGraph[m_vertexMap[serial]].measures[measure->Parent()] = measure;
@@ -612,10 +618,7 @@ namespace Isis {


          if (QString::compare(sn, serial) != 0) {
            bool edgeAdded = addEdge(serial, sn);
            if (edgeAdded) {
              emit networkModified(GraphModified);
            }
            addEdge(serial, sn);
          }
        }
      }
@@ -717,11 +720,7 @@ namespace Isis {
          QString sn = cm->GetCubeSerialNumber();

          if (QString::compare(sn, serial) != 0) {
            bool edgeAdded = addEdge(serial, sn); 

            if (edgeAdded) {
              emit networkModified(GraphModified);
            }
            addEdge(serial, sn);
          }
        }
      }
@@ -846,9 +845,7 @@ namespace Isis {
      QString sn = adjacentMeasure->GetCubeSerialNumber();
      if (!adjacentMeasure->IsIgnored() && m_vertexMap.contains(sn)) {
        if (QString::compare(serial, sn) !=0) {
          if( removeEdge(serial, sn) ) {
            emit networkModified(GraphModified);
          }
          removeEdge(serial, sn);
        }
      }
    }
@@ -957,7 +954,6 @@ namespace Isis {
   * @returns A list of cube islands as serial numbers
   */
  QList< QList< QString > > ControlNet::GetSerialConnections() const {
    QList< QList< QString > > islandStrings;

    VertexIndexMap indexMap;
    VertexIndexMapAdaptor indexMapAdaptor(indexMap);
@@ -970,23 +966,20 @@ namespace Isis {

    VertexIndexMap componentMap;
    VertexIndexMapAdaptor componentAdaptor(componentMap);
    boost::connected_components(m_controlGraph, componentAdaptor,
    int numComponents = boost::connected_components(m_controlGraph, componentAdaptor,
                                                      boost::vertex_index_map(indexMapAdaptor));

    QList< QList< QString > > islandStrings;
    for (int i = 0; i < numComponents; i++) {
      QList<QString> tempList;
      islandStrings.append(tempList);
    }
    std::map<ImageVertex, size_t>::iterator it = componentMap.begin();
    while(it != componentMap.end())
    {
      QString serial = m_controlGraph[it->first].serial;
      int group = (int) it->second;

      if (group > islandStrings.size() - 1) {
        QList<QString> tempList;
        tempList.append(serial);
        islandStrings.append(tempList);
      }
      else {
      islandStrings[group].append(serial);
      }
      ++it;
    }
    return islandStrings;
+17 −15
Original line number Diff line number Diff line
@@ -254,7 +254,9 @@ namespace Isis {
   *                           code cleaner.
   *   @history 2018-06-25 Jesse Mapel - Fixed ignoring measures with ignored adjacent measures
   *                           incorrectly modifying the edge between the two image vertices.

   *   @history 2018-07-06 Jesse Mapel - Modified addEdge and removeEdge to always emit a graph
   *                           modified signal if an edge is added or removed. Added graph
   *                           modified signal when a vertex is added.
   */
  class ControlNet : public QObject {
      Q_OBJECT
+2 −0
Original line number Diff line number Diff line
@@ -142,6 +142,8 @@ namespace Isis {
    else {
      m_pointMeasureCounts[numValidMeasures]++;
    }

    m_numMeasures = m_controlNet->GetNumMeasures();
    validate();
  }