isis/src/qisis/objs/RubberBandTool/RubberBandTool.cpp
void RubberBandTool::mouseButtonPress(QPoint p, Qt::MouseButton s) {
    *p_mouseLoc = p;
    p_mouseButton = s;

    if((s & Qt::LeftButton) != Qt::LeftButton && !p_allClicks) {
      return;
    }

    switch(p_bandingMode) {
      case AngleMode:
        break;

      case CircleMode:
      case EllipseMode:
      case LineMode:
      case RectangleMode:
        reset();
        p_tracking = true;
        p_vertices->push_back(p);
        break;

      case RotatedRectangleMode:
        if(p_vertices->size() == 4) {
          reset();
        }

        if(p_vertices->size() == 0) {
          p_vertices->push_back(p);
          p_tracking = true;
        }
        break;

      case SegmentedLineMode:
      case PolygonMode:
        if(!p_tracking) {
          reset();
          p_tracking = true;
        }

        if(p_vertices->size() == 0 || (*p_vertices)[ p_vertices->size() - 1 ] != p) {
          p_vertices->push_back(p);
        }

        break;
    }

    p_mouseDown = true;
  }
/**
   * If the click is not the left mouse button, this does nothing.
   *
   * This will set mouseDown as true. When the calculations are complete,
   *   p_mouseDown is set to true.
   *
   * For drag-only,
   *   A press means starting a new rubber band so reset & record the point. This applies to
   *     CircleModes, Eliipsoids, LineModes and RectangleModes.
   *
   * For Rotated RectangleModes,
   *   A mount press means we're starting over, setting the first point, or completing.
   *     For the first two, simply reset and record the point. For the latter, figure out the
   *     corners and store those points.
   *
   * For polygons,
   *   A press means record the current point. Reset first if we're not currently drawing.
   *
   * @param p
   * @param s
   */
If the click is not the left mouse button, this does nothing.
This will set mouseDown as true. When the calculations are complete,
p_mouseDown is set to true.

For drag-only,
A press means starting a new rubber band so reset & record the point.

For Rotated RectangleModes,
A mount press means we're starting over, setting the first point, or completing.
For the first two, simply reset and record the point. For the latter, figure out the
corners and store those points.

For polygons,
A press means record the current point. Reset first if we're not currently drawing.

@param p
@param s
If the click is not the left mouse button this does nothing . This will set mouseDown as true . When the calculations are complete p_mouseDown is set to true . For drag - only A press means starting a new rubber band so reset & record the point . For Rotated RectangleModes A mount press means we ' re starting over setting the first point or completing . For the first two simply reset and record the point . For the latter figure out the corners and store those points . For polygons A press means record the current point . Reset first if we ' re not currently drawing . @param p @param s
void RubberBandTool::mouseButtonPress(QPoint p, Qt::MouseButton s) {
    *p_mouseLoc = p;
    p_mouseButton = s;
    if((s & Qt::LeftButton) != Qt::LeftButton && !p_allClicks) {
      return;
    }
    switch(p_bandingMode) {
      case AngleMode:
        break;
      case CircleMode:
      case EllipseMode:
      case LineMode:
      case RectangleMode:
        reset();
        p_tracking = true;
        p_vertices->push_back(p);
        break;
      case RotatedRectangleMode:
        if(p_vertices->size() == 4) {
          reset();
        }
        if(p_vertices->size() == 0) {
          p_vertices->push_back(p);
          p_tracking = true;
        }
        break;
      case SegmentedLineMode:
      case PolygonMode:
        if(!p_tracking) {
          reset();
          p_tracking = true;
        }
        if(p_vertices->size() == 0 || (*p_vertices)[ p_vertices->size() - 1 ] != p) {
          p_vertices->push_back(p);
        }
        break;
    }
    p_mouseDown = true;
  }
void RubberBandTool :: mouseButtonPress ( QPoint p , Qt :: MouseButton s ) { * p_mouseLoc = p ; p_mouseButton = s ; if ( ( s & Qt :: LeftButton ) != Qt :: LeftButton && ! p_allClicks ) { return ; } switch ( p_bandingMode ) { case AngleMode : break ; case CircleMode : case EllipseMode : case LineMode : case RectangleMode : reset ( ) ; p_tracking = true ; p_vertices -> push_back ( p ) ; break ; case RotatedRectangleMode : if ( p_vertices -> size ( ) == 4 ) { reset ( ) ; } if ( p_vertices -> size ( ) == 0 ) { p_vertices -> push_back ( p ) ; p_tracking = true ; } break ; case SegmentedLineMode : case PolygonMode : if ( ! p_tracking ) { reset ( ) ; p_tracking = true ; } if ( p_vertices -> size ( ) == 0 || ( * p_vertices ) [ p_vertices -> size ( ) - 1 ] != p ) { p_vertices -> push_back ( p ) ; } break ; } p_mouseDown = true ; }
If the click is not the left mouse button, this does nothing.
If the click is not the left mouse button this does nothing .