Commit 5ba7c0d3 authored by Marjorie Hahn's avatar Marjorie Hahn
Browse files

Added Bring to Front, Bring Forward, Send to Back, Send Backwards, and Zoom...

Added Bring to Front, Bring Forward, Send to Back, Send Backwards, and Zoom Fit to ImageListActionWorkOrder. Fixes #5055.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7944 41f8697f-d340-4b68-9986-7bafba869bb8
parent 672f4caf
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -633,12 +633,13 @@ namespace Isis {

    if (allSupport(ImageDisplayProperties::ZOrdering)) {
                
      QAction *moveToTopAct = new QAction(tr("Bring to Front"), this);
      QAction *moveUpAct = new QAction(tr("Bring Forward"), this);
      QAction *moveToBottomAct = new QAction(tr("Send to Back"), this);
      QAction *moveDownAct = new QAction(tr("Send Backward"), this);
      QAction *moveToTopAct = createWorkOrder(project, ImageListActionWorkOrder::MoveToTop);
      QAction *moveUpAct = createWorkOrder(project, ImageListActionWorkOrder::MoveUpOne);
      QAction *moveToBottomAct = createWorkOrder(project, ImageListActionWorkOrder::MoveToBottom);
      QAction *moveDownAct = createWorkOrder(project, ImageListActionWorkOrder::MoveDownOne);

      foreach (Image *image, *this) {
        
        connect(moveToTopAct, SIGNAL(triggered()),
                image->displayProperties(), SIGNAL(moveToTop()));

@@ -661,7 +662,7 @@ namespace Isis {
    actions.append(NULL);

    if (size() == 1 && allSupport(ImageDisplayProperties::Zooming)) {
      QAction *zoomFit = new QAction(tr("Zoom Fit"), this);
      QAction *zoomFit = createWorkOrder(project, ImageListActionWorkOrder::ZoomFit);
      connect(zoomFit, SIGNAL(triggered()),
              first()->displayProperties(), SIGNAL(zoomFit()));
      actions.append(zoomFit);
+3 −1
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ namespace Isis {
   *                         changes, update the serial number list.
   * @history 2017-06-08 Makayla Shepherd - Modified ImageList(QStringList &) to close the image
   *                         cubes after adding them to the list. Fixes #4908.
   * @history 2017-08-04 Marjorie Hahn - Turned Bring to Front, Bring Forward, Send to Back, Send 
   *                         Backwards, and Zoom Fit into work orders. Fixes #5055.
   */
  class ImageList : public QObject, public QList<Image *> {
    Q_OBJECT
+77 −5
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ namespace Isis {
   */
  ImageListActionWorkOrder::ImageListActionWorkOrder(Project *project) :
      WorkOrder(project) {
        
    m_isSavedToHistory = false;
  }


@@ -26,6 +28,9 @@ namespace Isis {
   */
  ImageListActionWorkOrder::ImageListActionWorkOrder(Action action, Project *project) :
      WorkOrder(project) {      
    
    m_isSavedToHistory = false;
    
    QAction::setText(toString(action));
    QUndoCommand::setText(toString(action));

@@ -42,6 +47,9 @@ namespace Isis {
   */
  ImageListActionWorkOrder::ImageListActionWorkOrder(
      const ImageListActionWorkOrder &other) : WorkOrder(other) {
              
    m_isSavedToHistory = false; 
        
    foreach (const Image *image, *other.imageList()) {
      connect(this, SIGNAL(bringToFront()), image->displayProperties(), SIGNAL(moveToTop()));
    }
@@ -104,7 +112,6 @@ namespace Isis {

  /**
   * @brief If needed, prompt the user for input and save it.  ChangeTransparency, ChangeColor,
   * 
   * and potentially ToggleShowLabel will prompt for input from the user. This was renamed from 
   * execute() to setupExecution() according to WorkOrder's redesign.
   * 
@@ -171,6 +178,21 @@ namespace Isis {

        case ToggleShowOutline:
          break;
          
        case MoveToTop:
          break;
          
        case MoveUpOne:
          break;
          
        case MoveToBottom:
          break;
          
        case MoveDownOne:
          break;
          
        case ZoomFit:
          break;
      }

      setInternalData(state);
@@ -182,7 +204,7 @@ namespace Isis {

  /**
   * @brief Perform the action stored in the work order and update the work order's
   * internal data with the restuls of the action. 
   * internal data with the results of the action. 
   * 
   * @see ImageList::saveAndApplyAlpha
   * @see ImageList::saveAndApplyColor
@@ -239,6 +261,21 @@ namespace Isis {
        state = state.mid(0, 1);
        state.append(imageList()->saveAndToggleShowOutline());
        break;
        
      case MoveToTop:
        break;
        
      case MoveUpOne:
        break;
        
      case MoveToBottom:
        break;
        
      case MoveDownOne:
        break;
        
      case ZoomFit:
        break;
    }

    setInternalData(state);
@@ -292,6 +329,21 @@ namespace Isis {
      case ToggleShowOutline:
        imageList()->applyShowOutline(state.mid(1));
        break;
        
      case MoveToTop:
        break;
        
      case MoveUpOne:
        break;
        
      case MoveToBottom:
        break;
        
      case MoveDownOne:
        break;
        
      case ZoomFit:
        break;
    }

    setInternalData(state);
@@ -397,6 +449,26 @@ namespace Isis {
      case ToggleShowOutline:
        result = tr("Toggle Show Outline");
        break;
        
      case MoveToTop:
        result = tr("Bring to Front");
        break;
        
      case MoveUpOne:
        result = tr("Bring Forward");
        break;
        
      case MoveToBottom:
        result = tr("Send to Back");
        break;
        
      case MoveDownOne:
        result = tr("Send Backward");
        break;
        
      case ZoomFit:
        result = tr("Zoom Fit");
        break;
    }

    return result;
@@ -414,8 +486,8 @@ namespace Isis {
      QString actionString) {
    Action result = UnknownAction;

    for (Action act = UnknownAction;
         result == UnknownAction && act <= ToggleShowOutline;
    for (Action act = FirstAction;
         result == UnknownAction && act <= LastAction;
         act = (Action)(act + 1)) {
      if (toString(act).toUpper() == actionString.toUpper()) {
        result = act;
+11 −2
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@ namespace Isis {
   *   @history 2016-06-08 Jesse Mapel - Added documentation.  Fixes #3995.
   *   @history 2017-04-07 Makayla Shepherd - Renamed syncRedo() to execute() and syncUndo() to 
   *                           undoExecution() according to the WorkOrder redesign.
   *   @history 2017-08-04 Marjorie Hahn - Added Bring to Front, Bring Forward, Send to Back, Send 
   *                           Backwards, and Zoom Fit actions. Fixes #5055.
   */
  class ImageListActionWorkOrder : public WorkOrder {
    Q_OBJECT
@@ -64,14 +66,21 @@ namespace Isis {
       * Type of action to be performed by the work order
       */
      enum Action {
        UnknownAction = 0,  //!< Unkown action
        UnknownAction = 0,  //!< Unknown action
        ChangeTransparency, //!< Change the alpha values of the image list
        ChangeColor,        //!< Change the color values of the image list
        RandomizeColor,     //!< Set each image in the list to a random color
        ToggleShowLabel,    //!< Show or hide each image's display name
        ToggleShowFilled,   //!< Show or hide each image's fill area
        ToggleShowCubeData, //!< Show or hide each image's DNs
        ToggleShowOutline   //!< Show or hide each image's outline
        ToggleShowOutline,  //!< Show or hide each image's outline
        MoveToTop,          //!< Move the image to the front 
        MoveUpOne,          //!< Move the image forward
        MoveToBottom,       //!< Move the image to the back
        MoveDownOne,        //!< Move the image backward
        ZoomFit,            //!< Zoom in on the image so that it fits the screen
        FirstAction = UnknownAction,
        LastAction = ZoomFit,
      };

      ImageListActionWorkOrder(Project *project);