VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkInteractorStyleDrawPolygon.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 =========================================================================*/ 00026 #ifndef __vtkInteractorStyleDrawPolygon_h 00027 #define __vtkInteractorStyleDrawPolygon_h 00028 00029 #include "vtkInteractionStyleModule.h" // For export macro 00030 #include "vtkInteractorStyle.h" 00031 00032 #include <vector> // For returning Polygon Points 00033 #include "vtkVector.h" // For Polygon Points 00034 00035 class vtkUnsignedCharArray; 00036 00037 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleDrawPolygon : public vtkInteractorStyle 00038 { 00039 public: 00040 static vtkInteractorStyleDrawPolygon *New(); 00041 vtkTypeMacro(vtkInteractorStyleDrawPolygon, vtkInteractorStyle); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00045 00046 virtual void OnMouseMove(); 00047 virtual void OnLeftButtonDown(); 00048 virtual void OnLeftButtonUp(); 00050 00052 00053 vtkSetMacro(DrawPolygonPixels, bool); 00054 vtkGetMacro(DrawPolygonPixels, bool); 00055 vtkBooleanMacro(DrawPolygonPixels, bool); 00057 00059 std::vector<vtkVector2i> GetPolygonPoints(); 00060 00061 protected: 00062 vtkInteractorStyleDrawPolygon(); 00063 ~vtkInteractorStyleDrawPolygon(); 00064 00065 virtual void DrawPolygon(); 00066 00067 int StartPosition[2]; 00068 int EndPosition[2]; 00069 int Moving; 00070 00071 bool DrawPolygonPixels; 00072 00073 vtkUnsignedCharArray *PixelArray; 00074 00075 private: 00076 vtkInteractorStyleDrawPolygon(const vtkInteractorStyleDrawPolygon&); // Not implemented 00077 void operator=(const vtkInteractorStyleDrawPolygon&); // Not implemented 00078 00079 class vtkInternal; 00080 vtkInternal* Internal; 00081 }; 00082 00083 #endif