Commit 4a01d3bc authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Footprint views should now be restored when opening a project that had open...

Footprint views should now be restored when opening a project that had open footprint views in cnetsuite. Fixes #4486.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7216 41f8697f-d340-4b68-9986-7bafba869bb8
parent e3358c4f
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -1104,6 +1104,10 @@ namespace Isis {
   * @brief Save the directory to an XML file.
   * @param stream  The XML stream writer
   * @param newProjectRoot The FileName of the project this Directory is attached to.
   * 
   * @internal
   *   @history 2016-11-07 Ian Humphrey - Restored saving of footprints (footprint2view).
   *                           References #4486.
   */
  void Directory::save(QXmlStreamWriter &stream, FileName newProjectRoot) const {
    stream.writeStartElement("directory");
@@ -1118,16 +1122,17 @@ namespace Isis {
      stream.writeEndElement();
    }

    //if ( !m_footprint2DViewWidgets.isEmpty() ) {
    //  //qDebug()<<"Writing footprints";
    //  stream.writeStartElement("footprintViews");
    // Save footprints
    if ( !m_footprint2DViewWidgets.isEmpty() ) {
      //qDebug()<<"Writing footprints";
      stream.writeStartElement("footprintViews");

    //  foreach (MosaicSceneWidget *footprint2DViewWidget, m_footprint2DViewWidgets) {
    //    footprint2DViewWidget->save(stream, project(), newProjectRoot);
    //  }
      foreach (Footprint2DView *footprint2DViewWidget, m_footprint2DViewWidgets) {
        footprint2DViewWidget->mosaicSceneWidget()->save(stream, project(), newProjectRoot);
      }

    //  stream.writeEndElement();
    //}
      stream.writeEndElement();
    }

    stream.writeEndElement();
  }
@@ -1170,7 +1175,7 @@ namespace Isis {

    if (result) {
      if (localName == "footprint2DView") {
        //m_directory->addFootprint2DView()->load( reader() );
        m_directory->addFootprint2DView()->mosaicSceneWidget()->load( reader() );
      }
      else if (localName == "imageFileList") {
        m_directory->addImageFileListView()->load( reader() );
+3 −0
Original line number Diff line number Diff line
@@ -98,6 +98,9 @@ namespace Isis {
   *   @history 2016-08-02 Tracie Sucharski - Added RemoveImagesWorkOrder.
   *   @history 2016-09-14 Tracie Sucharski - Added slots for mouse clicks on Footprint2DView and
   *                           CubeDnViews for modifying, deleting and creating control points.
   *   @history 2016-11-07 Ian Humphrey - Restored saving and loading Footprint2DViews when saving
   *                           and opening a project (modified save() and startElement()).
   *                           Fixes #4486.
   */
  class Directory : public QObject {
    Q_OBJECT
+1 −2
Original line number Diff line number Diff line
@@ -2172,7 +2172,6 @@ namespace Isis {
      const QString &localName, const QString &qName, const QXmlAttributes &atts) {
    bool result = XmlStackedHandler::startElement(namespaceURI, localName, qName, atts);

    /*
    m_characterData = "";

    if (result) {
@@ -2191,7 +2190,7 @@ namespace Isis {
        m_scrollBarYValue = atts.value("scrollBarYValue").toInt();
      }
    }
    */

    return result;
  }

+3 −0
Original line number Diff line number Diff line
@@ -133,6 +133,9 @@ namespace Isis {
   *   @history 2016-09-14 Tracie Sucharski - Added signals for mouse clicks for modifying, deleting
   *                           and creating control points.  These are passed on to Footprint2DView
   *                           signals, then on to Directory slots.
   *   @history 2016-11-07 Ian Humphrey - Restored the startElement() functionality so footprints
   *                           can be correctly loaded from an XML storing the MosaicScenWidget's
   *                           state. Fixes #4486.
   * 
   */
  class MosaicSceneWidget : public QWidget {
+16 −5
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
#include <QProgressDialog>

#include "Directory.h"
#include "Footprint2DView.h"
#include "MosaicSceneWidget.h"

namespace Isis {
@@ -30,21 +31,31 @@ namespace Isis {
  }


  /**
   * Destructor
   */
  MosaicSceneWorkOrder::~MosaicSceneWorkOrder() {
  }


  /**
   * Returns the MosaicSceneWidget corresponding to this work order's interal data
   * (the MosaicSceneWidget's window title).
   * 
   * @return @b MosaicSceneWidget* Returns a pointer to the MosaicSceneWidget with a window title
   *                               that matches this work order's internal data's window title.
   * 
   * @see MosaicSceneWorkOrder::MosaicSceneWorkOrder()
   */
  MosaicSceneWidget *MosaicSceneWorkOrder::scene() {

    MosaicSceneWidget *result = NULL;
    /*  //tjw

    foreach (MosaicSceneWidget *scene, directory()->footprint2DViews()) {
      if (internalData().first() == scene->windowTitle()) {
        result = scene;
    foreach (Footprint2DView *scene, directory()->footprint2DViews()) {
      if (internalData().first() == scene->mosaicSceneWidget()->windowTitle()) {
        result = scene->mosaicSceneWidget();
      }
    }
    */
    return result;
  }

Loading