Commit c0c420cd authored by Kristin Berry's avatar Kristin Berry
Browse files

Updated ControlNet to re-add in code needed for other classes to compile and...

Updated ControlNet to re-add in code needed for other classes to compile and switch to using correct graph for GetMeasuresInCube
parent 2eaa6731
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -870,8 +870,8 @@ namespace Isis {
   */
  QList< ControlMeasure * > ControlNet::GetMeasuresInCube(QString serialNumber) {
    ValidateSerialNumber(serialNumber);
//    return m_controlGraph[m_vertexMap[serialNumber]].measures;  <--- segfaults. 
    return (*cubeGraphNodes)[serialNumber]->getMeasures();
    return m_controlGraph[m_vertexMap[serialNumber]].measures;
//    return (*cubeGraphNodes)[serialNumber]->getMeasures();
  }


+19 −21
Original line number Diff line number Diff line
@@ -42,10 +42,6 @@ template< typename T > class QList;
template< typename A, typename B > struct QPair;
template< typename T > class QSet;





class QMutex;
class QString;

@@ -237,24 +233,10 @@ namespace Isis {
      friend class ControlPoint;

    public:
      struct Image {
        QString serial;
        QList<ControlMeasure* > measures;
      };

      struct Connection {
        int strength = 0;
      };

      // typedefs to help cut down on templated type bloat
      typedef boost::adjacency_list<boost::setS, boost::listS, boost::undirectedS, Image, Connection> Network;
      typedef Network::vertex_descriptor ImageVertex;
      typedef Network::edge_descriptor ImageConnection;
      typedef std::map<ImageVertex, size_t> VertexIndexMap;
      typedef boost::associative_property_map<VertexIndexMap> VertexIndexMapAdaptor;
      typedef Network::out_edge_iterator ConnectionIterator;


      QList< ControlCubeGraphNode * > GetCubeGraphNodes() { 
        QList<ControlCubeGraphNode *> lst;
        return lst;} ; // TEMPORARY DELETE

      ControlNet();
      ControlNet(const ControlNet &other);
@@ -391,6 +373,22 @@ namespace Isis {
      //! hash ControlCubeGraphNodes by CubeSerialNumber
      QHash< QString, ControlCubeGraphNode * > * cubeGraphNodes; // TODO : delete

      // structs and typedefs for the boost graph
      struct Image {
        QString serial;
        QList<ControlMeasure* > measures;
      };

      struct Connection {
        int strength = 0;
      };

      typedef boost::adjacency_list<boost::setS, boost::listS, boost::undirectedS, Image, Connection> Network;
      typedef Network::vertex_descriptor ImageVertex;
      typedef Network::edge_descriptor ImageConnection;
      typedef std::map<ImageVertex, size_t> VertexIndexMap;
      typedef boost::associative_property_map<VertexIndexMap> VertexIndexMapAdaptor;
      typedef Network::out_edge_iterator ConnectionIterator;
      QHash<QString, ImageVertex> m_vertexMap; //!< The SN -> vertex hash for the boost graph
      Network m_controlGraph; //!< The boost graph
      QStringList *pointIds;
+4 −0
Original line number Diff line number Diff line
@@ -145,6 +145,10 @@ void testConnectivity() {
  net.AddPoint(p4);
  net.AddPoint(p5);

  std::cout << "Getting measures in cube: " << std::endl; 
  QList< ControlMeasure *> measures = net.GetMeasuresInCube("ALPHA");
  std::cout << "Serial Number: " << measures[0]->GetCubeSerialNumber() << std::endl; 

// This region is to test the unused and now removed GetNodeConnections methods. It's tempoararily
// left here commented out in case we want to test something similar after updating ControlNet to
// use boost.