Commit b7a59d87 authored by Jesse Mapel's avatar Jesse Mapel
Browse files

Tweaked ControlNetVitals to always update when graph changes.

parent df309e35
Loading
Loading
Loading
Loading
+23 −27
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);
      }
    }

@@ -422,7 +423,6 @@ namespace Isis {
          }
        }
      }
      emit newMeasure(measure);
    }
    emit newPoint(point);
  }
@@ -448,6 +448,9 @@ namespace Isis {
                                                        m_vertexMap[targetSerial],
                                                        m_controlGraph);
    m_controlGraph[connection].strength++;
    if (edgeAdded) {
      emit networkModified(GraphModified);
    }
    return edgeAdded;
  }

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

        return true;
      }
@@ -599,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;
@@ -613,10 +618,7 @@ namespace Isis {


          if (QString::compare(sn, serial) != 0) {
            bool edgeAdded = addEdge(serial, sn);
            if (edgeAdded) {
              emit networkModified(GraphModified);
            }
            addEdge(serial, sn);
          }
        }
      }
@@ -718,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);
          }
        }
      }
@@ -847,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);
        }
      }
    }
+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();
  }