VTK
|
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 -------------------------------------------------------------------------*/ 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 vtkTypeMacro(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 00065 00066 vtkSetMacro(RenderOnMouseMove, bool); 00067 vtkGetMacro(RenderOnMouseMove, bool); 00068 vtkBooleanMacro(RenderOnMouseMove, bool); 00070 00071 //BTX 00073 00074 enum 00075 { 00076 SELECT_NORMAL = 0, 00077 SELECT_UNION = 1 00078 }; 00079 //ETX 00081 00083 00084 vtkGetMacro(Interaction, int); 00086 00087 //BTX 00088 enum 00089 { 00090 NONE, 00091 PANNING, 00092 ZOOMING, 00093 SELECTING 00094 }; 00095 //ETX 00096 00097 protected: 00098 vtkInteractorStyleRubberBand2D(); 00099 ~vtkInteractorStyleRubberBand2D(); 00100 00101 // The interaction mode 00102 int Interaction; 00103 00104 // Draws the selection rubber band 00105 void RedrawRubberBand(); 00106 00107 // The end position of the selection 00108 int StartPosition[2]; 00109 00110 // The start position of the selection 00111 int EndPosition[2]; 00112 00113 // The pixel array for the rubber band 00114 vtkUnsignedCharArray* PixelArray; 00115 00116 // Whether to render when the mouse moves 00117 bool RenderOnMouseMove; 00118 00119 private: 00120 vtkInteractorStyleRubberBand2D(const vtkInteractorStyleRubberBand2D&); // Not implemented 00121 void operator=(const vtkInteractorStyleRubberBand2D&); // Not implemented 00122 }; 00123 00124 #endif