Commit 0d2f236d authored by Kristin Berry's avatar Kristin Berry
Browse files

Correctly update vertex descriptors in the m_vertexMap hash when copying and swapping a control net

parent 99b75a03
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -764,7 +764,6 @@ namespace Isis {
    // Conceptually, I think this belongs in measureIgnored, but it isn't done
    // for the old graph.
    m_controlGraph[m_vertexMap[serial]].measures.remove(measure->Parent());

  }


@@ -1819,7 +1818,6 @@ namespace Isis {
    std::swap(points, other.points);
    std::swap(pointIds, other.pointIds);
    m_controlGraph.swap(other.m_controlGraph);
    std::swap(m_vertexMap, other.m_vertexMap);
    std::swap(m_mutex, other.m_mutex);
    std::swap(p_targetName, other.p_targetName);
    std::swap(p_networkId, other.p_networkId);
@@ -1833,7 +1831,7 @@ namespace Isis {
    std::swap(p_cameraList, other.p_cameraList);
    std::swap(p_targetRadii, other.p_targetRadii);

    // points have parent pointers that need updated too...
    // points have parent pointers that need to be updated too...
    QHashIterator< QString, ControlPoint * > i(*points);
    while (i.hasNext()) {
      i.next().value()->parentNetwork = this;
@@ -1862,6 +1860,14 @@ namespace Isis {
      swap(copy);
    }

    m_vertexMap.clear();
    VertexIterator v, vend;
    for (boost::tie(v, vend) = vertices(m_controlGraph); v != vend; ++v) {
      ImageVertex imVertex = *v;
      QString serialNum = m_controlGraph[*v].serial;
      m_vertexMap[serialNum] = imVertex;
    }

    return *this;
  }

+2 −1
Original line number Diff line number Diff line
@@ -437,8 +437,8 @@ namespace Isis {

      //! Used to define the edges of the graph.
      struct Connection {
        int strength;
        Connection() : strength(0) {}
        int strength;
      };

      //! Defines the graph type as an undirected graph that uses Images for verticies,
@@ -461,6 +461,7 @@ namespace Isis {

      //! Iterates over adjacent verticies
      typedef boost::graph_traits<Network>::adjacency_iterator AdjacencyIterator;
      typedef boost::graph_traits<Network>::vertex_iterator VertexIterator;

      QHash<QString, ImageVertex> m_vertexMap; //! The serial number -> vertex hash used by the graph
      Network m_controlGraph; //! The ControlNet graph