00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageItem.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 00025 #ifndef __vtkImageItem_h 00026 #define __vtkImageItem_h 00027 00028 #include "vtkContextItem.h" 00029 00030 class vtkContext2D; 00031 class vtkImageData; 00032 00033 class VTK_CHARTS_EXPORT vtkImageItem : public vtkContextItem 00034 { 00035 public: 00036 vtkTypeMacro(vtkImageItem, vtkContextItem); 00037 virtual void PrintSelf(ostream &os, vtkIndent indent); 00038 00039 static vtkImageItem *New(); 00040 00042 virtual bool Paint(vtkContext2D *painter); 00043 00044 //BTX 00046 virtual bool Hit(const vtkContextMouseEvent &mouse); 00047 00049 virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse); 00050 00052 virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse); 00053 00055 virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse); 00056 00058 virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse); 00059 00061 virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse); 00062 //ETX 00063 00065 00066 vtkSetStringMacro(Label); 00068 00070 00071 vtkGetStringMacro(Label); 00073 00075 void SetImage(vtkImageData *image); 00076 00078 00079 vtkGetObjectMacro(Image, vtkImageData); 00081 00083 00084 vtkSetVector4Macro(Dimensions, int); 00086 00088 00089 vtkGetVector4Macro(Dimensions, int); 00091 00092 //BTX 00093 void SetScalarFunctor(double (*scalarFunction)(double, double)); 00094 //ETX 00095 00096 //BTX 00097 protected: 00098 vtkImageItem(); 00099 ~vtkImageItem(); 00100 00101 int Dimensions[4]; 00102 00103 int LastPosition[2]; 00104 00105 char *Label; 00106 vtkImageData *Image; 00107 00108 bool MouseOver; 00109 int MouseButtonPressed; 00110 00111 // Some function pointers to optionally do funky things... 00112 double (*ScalarFunction)(double, double); 00113 00114 private: 00115 vtkImageItem(const vtkImageItem &); // Not implemented. 00116 void operator=(const vtkImageItem &); // Not implemented. 00117 //ETX 00118 }; 00119 00120 #endif //__vtkImageItem_h