Commit 00233cc9 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Updated documentation and coding standards for AbstractProjectItemView,...

Updated documentation and coding standards for AbstractProjectItemView, ControlMeasureEditWidget, ControlPointEditWidget, CubeDnView, Footprint2DView. Updated includes for CubeDnViewWorkOrder and Footprint2DViewWorkOrder. Fixes #4004.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@6871 41f8697f-d340-4b68-9986-7bafba869bb8
parent acd88e04
Loading
Loading
Loading
Loading
+21 −15
Original line number Diff line number Diff line
@@ -22,7 +22,12 @@
 */
#include "AbstractProjectItemView.h"

#include <QtWidgets>
#include <QAction>
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include <QDropEvent>
#include <QList>
#include <QWidget>

#include "ProjectItem.h"
#include "ProjectItemModel.h"
@@ -59,7 +64,7 @@ namespace Isis {
   * Returns the model used by the view. If the internal model is a
   * proxy model, it returns the source model.
   *
   * @return (ProjectItemModel *) The model.
   * @return @b ProjectItemModel * The model.
   */
  ProjectItemModel *AbstractProjectItemView::model() {
    if (ProjectItemProxyModel *proxyModel = 
@@ -69,6 +74,7 @@ namespace Isis {
    return internalModel();
  }


  /**
   * Accepts the drag enter event if the internal model can accept the
   * mime data.
@@ -118,7 +124,7 @@ namespace Isis {
  /**
   * Returns a list of actions appropriate for the permanent tool bar.
   *
   * @return (QList<QAction *>) The actions
   * @return @b QList<QAction *> The actions
   */
  QList<QAction *> AbstractProjectItemView::permToolBarActions() {
    return QList<QAction *>();
@@ -128,7 +134,7 @@ namespace Isis {
  /**
   * Returns a list of actions appropriate for the active tool bar.
   *
   * @return (QList<QAction *>) The actions
   * @return @b QList<QAction *> The actions
   */
  QList<QAction *> AbstractProjectItemView::activeToolBarActions() {
    return QList<QAction *>();
@@ -138,7 +144,7 @@ namespace Isis {
  /**
   * Returns a list of actions appropriate for the tool pad.
   *
   * @return (QList<QAction *>) The actions
   * @return @b QList<QAction *> The actions
   */
  QList<QAction *> AbstractProjectItemView::toolPadActions() {
    return QList<QAction *>();
@@ -148,7 +154,7 @@ namespace Isis {
  /**
   * Returns a list of actions appropriate for a context menu.
   *
   * @return (QList<QAction *>) The actions
   * @return @b QList<QAction *> The actions
   */
  QList<QAction *> AbstractProjectItemView::contextMenuActions() {
    return QList<QAction *>();
@@ -158,7 +164,7 @@ namespace Isis {
  /**
   * Returns a list of actions appropriate for a file menu.
   *
   * @return (QList<QAction *>) The actions
   * @return @b QList<QAction *> The actions
   */
  QList<QAction *> AbstractProjectItemView::fileMenuActions() {
    return QList<QAction *>();
@@ -168,7 +174,7 @@ namespace Isis {
  /**
   * Returns a list of actions appropriate for a project menu.
   *
   * @return (QList<QAction *>) The actions
   * @return @b QList<QAction *> The actions
   */
  QList<QAction *> AbstractProjectItemView::projectMenuActions() {
    return QList<QAction *>();
@@ -178,7 +184,7 @@ namespace Isis {
  /**
   * Returns a list of actions appropriate for an edit menu.
   *
   * @return (QList<QAction *>) The actions
   * @return @b QList<QAction *> The actions
   */
  QList<QAction *> AbstractProjectItemView::editMenuActions() {
    return QList<QAction *>();
@@ -188,7 +194,7 @@ namespace Isis {
  /**
   * Returns a list of actions appropriate for a view menu.
   *
   * @return (QList<QAction *>) The actions
   * @return @b QList<QAction *> The actions
   */
  QList<QAction *> AbstractProjectItemView::viewMenuActions() {
    return QList<QAction *>();
@@ -198,7 +204,7 @@ namespace Isis {
  /**
   * Returns a list of actions appropriate for a settings menu.
   *
   * @return (QList<QAction *>) The actions
   * @return @b QList<QAction *> The actions
   */
  QList<QAction *> AbstractProjectItemView::settingsMenuActions() {
    return QList<QAction *>();
@@ -208,7 +214,7 @@ namespace Isis {
  /**
   * Returns a list of actions appropriate for a help menu.
   *
   * @return (QList<QAction *>) The actions
   * @return @b QList<QAction *> The actions
   */
  QList<QAction *> AbstractProjectItemView::helpMenuActions() {
    return QList<QAction *>();
@@ -218,7 +224,7 @@ namespace Isis {
  /**
   * Returns the current item of the model.
   * 
   * @return (ProjectItem *) The item
   * @return @b ProjectItem * The item
   */
  ProjectItem *AbstractProjectItemView::currentItem() {
    return model()->currentItem();
@@ -228,7 +234,7 @@ namespace Isis {
  /**
   * Return the selected items of the model.
   *
   * @return (QList<ProjectItem *>) The items
   * @return @b QList<ProjectItem *> The items
   */
  QList<ProjectItem *> AbstractProjectItemView::selectedItems() {
    return model()->selectedItems();
@@ -267,7 +273,7 @@ namespace Isis {
   * Returns the internal model of the view. By default it is a proxy
   * model.
   *
   * @return (ProjectItemModel *) The internal model
   * @return @b ProjectItemModel * The internal model
   */
  ProjectItemModel *AbstractProjectItemView::internalModel() {
    return m_internalModel;
+13 −6
Original line number Diff line number Diff line
@@ -23,13 +23,16 @@
 *   http://www.usgs.gov/privacy.html.
 */

#include <QItemSelectionModel>
#include <QWidget>

#include "ProjectItem.h"
#include "ProjectItemModel.h"
#include "ProjectItemProxyModel.h"
class QAction;
class QDragEnterEvent;
template <typename T> class QList;

namespace Isis {

  class ProjectItem;
  class ProjectItemModel;
  /**
   * AbstractProjectItemView is a base class for views of a
   * ProjectItemModel in Qt's model-view
@@ -49,8 +52,12 @@ namespace Isis {
   *
   * Note that AbstractProjectItemView does not inherit from QAbstractItemView.
   *
   * @internal
   *   @author Jeffrey Covington
   *
   *   @history 2015-10-21 Jeffrey Covington - Original version.
   *   @history 2016-06-27 Ian Humphrey - Minor updates to documentation and coding standards. 
   *                           Fixes #4004.
   */
  class AbstractProjectItemView : public QWidget {

@@ -90,7 +97,7 @@ namespace Isis {
      virtual void addItems(QList<ProjectItem *> items);

    private:
      ProjectItemModel *m_internalModel;
      ProjectItemModel *m_internalModel; //!< The internal model used by the view
  };

}
+573 −565

File changed.

Preview size limit exceeded, changes collapsed.

+65 −58
Original line number Diff line number Diff line
@@ -132,6 +132,8 @@ namespace Isis {
    *                           characters in them. Fixes #1551.
    *   @history 2014-07-03 Tracie Sucharski - Renamed from ControlPointEdit. 
    *
    *   @history 2016-06-27 Ian Humphrey - Updated documentation and coding standards. Fixes #4004.
    *  
    *   @todo  Re-think design of the change made on 2012-07-26.  The linking was put into
    *                          ::updateLeftPositionLabel because it was the fastest solution, but
    *                          should this be put somewhere else.
@@ -143,8 +145,13 @@ namespace Isis {
      ControlMeasureEditWidget(QWidget *parent = 0, bool allowLeftMouse = false,
                               bool useGeometry = true);
      ~ControlMeasureEditWidget();
      /**
       * Returns the template filename used for auto-registration.
       * 
       * @return @b QString Template filename
       */
      QString templateFileName() {
        return p_templateFileName;
        return m_templateFileName;
      };
      bool setTemplateFile(QString);
      void allowLeftMouse(bool allowMouse);
@@ -190,63 +197,63 @@ namespace Isis {
    private:
      void createMeasureEditor(QWidget *parent);

      bool p_allowLeftMouse;
      bool p_useGeometry;

      QString p_templateFileName;
      QLabel *p_leftZoomFactor;
      QLabel *p_rightZoomFactor;
      QLabel *p_leftSampLinePosition;
      QLabel *p_rightSampLinePosition;
      QLabel *p_leftLatLonPosition;
      QLabel *p_rightLatLonPosition;
      QRadioButton *p_nogeom;
      QRadioButton *p_geom;
      QToolButton *p_rightZoomIn;
      QToolButton *p_rightZoomOut;
      QToolButton *p_rightZoom1;


      bool p_timerOn;
      QTimer *p_timer;
      std::vector<ChipViewport *> p_blinkList;
      unsigned char p_blinkIndex;

      QDial *p_dial;
      QLCDNumber *p_dialNumber;
      QDoubleSpinBox *p_blinkTimeBox;

      bool p_circle;
      QScrollBar *p_slider;

      QPushButton *p_autoReg;
      QWidget *p_autoRegExtension;
      QLabel *p_oldPosition;
      QLabel *p_goodFit;
      bool   p_autoRegShown;
      bool   p_autoRegAttempted;

      QPushButton *p_saveMeasure;
      QPalette p_saveDefaultPalette;

      ChipViewport *p_leftView;
      ChipViewport *p_rightView;

      Cube *p_leftCube;
      Cube *p_rightCube;
      ControlMeasure *p_leftMeasure;
      ControlMeasure *p_rightMeasure;
      Chip *p_leftChip;
      Chip *p_rightChip;
      UniversalGroundMap *p_leftGroundMap;
      UniversalGroundMap *p_rightGroundMap;

      AutoReg *p_autoRegFact;
      QString p_pointId;

      int p_rotation;
      bool p_geomIt;
      bool p_linkZoom;
      bool m_allowLeftMouse; //!< Whether or not to allow mouse events on left chip viewport
      bool m_useGeometry;    //!< Whether or not to allow geometry/rotation on right chip viewport

      QString m_templateFileName;      //!< Registration template filename
      QLabel *m_leftZoomFactor;        //!< Label for left chip viewport's zoom factor
      QLabel *m_rightZoomFactor;       //!< Label for right chip viewport's zoom factor
      QLabel *m_leftSampLinePosition;  //!< Label for left chip viewport's current sample/line
      QLabel *m_rightSampLinePosition; //!< Label for right chip viewport's current sample/line
      QLabel *m_leftLatLonPosition;    //!< Label for left chip viewport's current lat/lon
      QLabel *m_rightLatLonPosition;   //!< Label for right chip viewport's current lat/lon
      QRadioButton *m_nogeom; //!< Radio button to remove geometry/rotation for right chip viewport
      QRadioButton *m_geom; //!< Radio button to apply geometry/rotation to right chip viewport
      QToolButton *m_rightZoomIn;      //!< Button for zooming in right chip viewport 
      QToolButton *m_rightZoomOut;     //!< Button for zooming out right chip viewport
      QToolButton *m_rightZoom1;       //!< Button for 1:1 zoom on right chip viewport


      bool m_timerOn;  //!< Indicates if the blink timer is on
      QTimer *m_timer; //!< Timer on the blinking
      std::vector<ChipViewport *> m_blinkList; //!< List of chip viewports to blink
      unsigned char m_blinkIndex; //!< Index of the chip to load in the left chip viewport

      QDial *m_dial;                  //!< Rotation dial 
      QLCDNumber *m_dialNumber;       //!< The current amount of rotation (in degrees)
      QDoubleSpinBox *m_blinkTimeBox; //!< The current blink step (in seconds)

      bool m_circle;        //!< Whether or not to draw circle in center of the right chip viewport
      QScrollBar *m_slider; //!< Slider that controls the size of the center circle

      QPushButton *m_autoReg;      //!< Button to auto-register the measure
      QWidget *m_autoRegExtension; //!< Widget that shows after registering a measure
      QLabel *m_oldPosition;       //!< The old sample and line before registering
      QLabel *m_goodFit;           //!< The goodness of fit value after registering
      bool m_autoRegShown;         //!< Whether or not the auto-reg extension is shown
      bool m_autoRegAttempted;     //!< Whether or not auto-registration has been attempted

      QPushButton *m_saveMeasure;    //!< Button to save the current measure
      QPalette m_saveDefaultPalette; //!< Default color palette for the Save button 

      ChipViewport *m_leftView;  //!< Left ChipViewport 
      ChipViewport *m_rightView; //!< Right ChipViewport 

      Cube *m_leftCube;  //!< Left chip viewport's Cube
      Cube *m_rightCube; //!< Right chip viewport's Cube
      ControlMeasure *m_leftMeasure;  //!< Left ControlMeasure
      ControlMeasure *m_rightMeasure; //!< Right ControlMeasure
      Chip *m_leftChip;  //!< Left Chip
      Chip *m_rightChip; //!< Right Chip
      UniversalGroundMap *m_leftGroundMap;  //!< UniversalGroundMap for left cube
      UniversalGroundMap *m_rightGroundMap; //!< UniversalGroundMap for right cube

      AutoReg *m_autoRegFact; //!< Created AutoReg
      QString m_pointId;      //!< Associated control point id of the right measure

      int m_rotation;  //!< Amount to rotate right chip viewport TODO Is this used??
      bool m_geomIt;   //!< Apply geometry to the right chip viewport
      bool m_linkZoom; //!< Link zoom factors between chip viewports 
  };
};

+324 −276

File changed.

Preview size limit exceeded, changes collapsed.

Loading