00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkInteractorStyleRubberBand2D.h,v $ 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 -------------------------------------------------------------------------*/ 00040 #ifndef __vtkInteractorStyleRubberBand2D_h 00041 #define __vtkInteractorStyleRubberBand2D_h 00042 00043 #include "vtkInteractorStyle.h" 00044 00045 class vtkUnsignedCharArray; 00046 00047 class VTK_RENDERING_EXPORT vtkInteractorStyleRubberBand2D : public vtkInteractorStyle 00048 { 00049 public: 00050 static vtkInteractorStyleRubberBand2D *New(); 00051 vtkTypeRevisionMacro(vtkInteractorStyleRubberBand2D, vtkInteractorStyle); 00052 void PrintSelf(ostream& os, vtkIndent indent); 00053 00054 virtual void OnLeftButtonDown(); 00055 virtual void OnLeftButtonUp(); 00056 virtual void OnMiddleButtonDown(); 00057 virtual void OnMiddleButtonUp(); 00058 virtual void OnRightButtonDown(); 00059 virtual void OnRightButtonUp(); 00060 virtual void OnMouseMove(); 00061 virtual void OnMouseWheelForward(); 00062 virtual void OnMouseWheelBackward(); 00063 00064 //BTX 00066 00067 enum 00068 { 00069 SELECT_NORMAL = 0, 00070 SELECT_UNION = 1 00071 }; 00072 //ETX 00074 00076 00077 vtkGetMacro(Interaction, int); 00079 00080 //BTX 00081 enum 00082 { 00083 NONE, 00084 PANNING, 00085 ZOOMING, 00086 SELECTING 00087 }; 00088 //ETX 00089 00090 protected: 00091 vtkInteractorStyleRubberBand2D(); 00092 ~vtkInteractorStyleRubberBand2D(); 00093 00094 // The interaction mode 00095 int Interaction; 00096 00097 // Draws the selection rubber band 00098 void RedrawRubberBand(); 00099 00100 // The end position of the selection 00101 int StartPosition[2]; 00102 00103 // The start position of the selection 00104 int EndPosition[2]; 00105 00106 // The pixel array for the rubber band 00107 vtkUnsignedCharArray* PixelArray; 00108 00109 private: 00110 vtkInteractorStyleRubberBand2D(const vtkInteractorStyleRubberBand2D&); // Not implemented 00111 void operator=(const vtkInteractorStyleRubberBand2D&); // Not implemented 00112 }; 00113 00114 #endif