VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Interaction/Style/vtkInteractorStyleRubberBand2D.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkInteractorStyleRubberBand2D.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00042 #ifndef vtkInteractorStyleRubberBand2D_h
00043 #define vtkInteractorStyleRubberBand2D_h
00044 
00045 #include "vtkInteractionStyleModule.h" // For export macro
00046 #include "vtkInteractorStyle.h"
00047 
00048 class vtkUnsignedCharArray;
00049 
00050 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleRubberBand2D : public vtkInteractorStyle
00051 {
00052 public:
00053   static vtkInteractorStyleRubberBand2D *New();
00054   vtkTypeMacro(vtkInteractorStyleRubberBand2D, vtkInteractorStyle);
00055   void PrintSelf(ostream& os, vtkIndent indent);
00056 
00057   virtual void OnLeftButtonDown();
00058   virtual void OnLeftButtonUp();
00059   virtual void OnMiddleButtonDown();
00060   virtual void OnMiddleButtonUp();
00061   virtual void OnRightButtonDown();
00062   virtual void OnRightButtonUp();
00063   virtual void OnMouseMove();
00064   virtual void OnMouseWheelForward();
00065   virtual void OnMouseWheelBackward();
00066 
00068 
00069   vtkSetMacro(RenderOnMouseMove, bool);
00070   vtkGetMacro(RenderOnMouseMove, bool);
00071   vtkBooleanMacro(RenderOnMouseMove, bool);
00073 
00074   //BTX
00076 
00077   enum
00078     {
00079     SELECT_NORMAL = 0,
00080     SELECT_UNION = 1
00081     };
00082   //ETX
00084 
00086 
00087   vtkGetMacro(Interaction, int);
00089 
00090   //BTX
00091   enum
00092     {
00093     NONE,
00094     PANNING,
00095     ZOOMING,
00096     SELECTING
00097     };
00098   //ETX
00099 
00101 
00105   vtkGetVector2Macro(StartPosition,int);
00106   vtkGetVector2Macro(EndPosition,int);
00108 
00109 protected:
00110   vtkInteractorStyleRubberBand2D();
00111   ~vtkInteractorStyleRubberBand2D();
00112 
00113   // The interaction mode
00114   int Interaction;
00115 
00116   // Draws the selection rubber band
00117   void RedrawRubberBand();
00118 
00119   // The end position of the selection
00120   int StartPosition[2];
00121 
00122   // The start position of the selection
00123   int EndPosition[2];
00124 
00125   // The pixel array for the rubber band
00126   vtkUnsignedCharArray* PixelArray;
00127 
00128   // Whether to render when the mouse moves
00129   bool RenderOnMouseMove;
00130 
00131 private:
00132   vtkInteractorStyleRubberBand2D(const vtkInteractorStyleRubberBand2D&); // Not implemented
00133   void operator=(const vtkInteractorStyleRubberBand2D&); // Not implemented
00134 };
00135 
00136 #endif