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 -------------------------------------------------------------------------*/ 00042 #ifndef __vtkInteractorStyleRubberBand2D_h 00043 #define __vtkInteractorStyleRubberBand2D_h 00044 00045 #include "vtkInteractorStyle.h" 00046 00047 class vtkUnsignedCharArray; 00048 00049 class VTK_RENDERING_EXPORT vtkInteractorStyleRubberBand2D : public vtkInteractorStyle 00050 { 00051 public: 00052 static vtkInteractorStyleRubberBand2D *New(); 00053 vtkTypeMacro(vtkInteractorStyleRubberBand2D, vtkInteractorStyle); 00054 void PrintSelf(ostream& os, vtkIndent indent); 00055 00056 virtual void OnLeftButtonDown(); 00057 virtual void OnLeftButtonUp(); 00058 virtual void OnMiddleButtonDown(); 00059 virtual void OnMiddleButtonUp(); 00060 virtual void OnRightButtonDown(); 00061 virtual void OnRightButtonUp(); 00062 virtual void OnMouseMove(); 00063 virtual void OnMouseWheelForward(); 00064 virtual void OnMouseWheelBackward(); 00065 00067 00068 vtkSetMacro(RenderOnMouseMove, bool); 00069 vtkGetMacro(RenderOnMouseMove, bool); 00070 vtkBooleanMacro(RenderOnMouseMove, bool); 00072 00073 //BTX 00075 00076 enum 00077 { 00078 SELECT_NORMAL = 0, 00079 SELECT_UNION = 1 00080 }; 00081 //ETX 00083 00085 00086 vtkGetMacro(Interaction, int); 00088 00089 //BTX 00090 enum 00091 { 00092 NONE, 00093 PANNING, 00094 ZOOMING, 00095 SELECTING 00096 }; 00097 //ETX 00098 00100 00104 vtkGetVector2Macro(StartPosition,int); 00105 vtkGetVector2Macro(EndPosition,int); 00107 00108 protected: 00109 vtkInteractorStyleRubberBand2D(); 00110 ~vtkInteractorStyleRubberBand2D(); 00111 00112 // The interaction mode 00113 int Interaction; 00114 00115 // Draws the selection rubber band 00116 void RedrawRubberBand(); 00117 00118 // The end position of the selection 00119 int StartPosition[2]; 00120 00121 // The start position of the selection 00122 int EndPosition[2]; 00123 00124 // The pixel array for the rubber band 00125 vtkUnsignedCharArray* PixelArray; 00126 00127 // Whether to render when the mouse moves 00128 bool RenderOnMouseMove; 00129 00130 private: 00131 vtkInteractorStyleRubberBand2D(const vtkInteractorStyleRubberBand2D&); // Not implemented 00132 void operator=(const vtkInteractorStyleRubberBand2D&); // Not implemented 00133 }; 00134 00135 #endif