VTK
dox/Charts/vtkBlockItem.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkBlockItem.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 
00024 #ifndef __vtkBlockItem_h
00025 #define __vtkBlockItem_h
00026 
00027 #include "vtkContextItem.h"
00028 
00029 class vtkContext2D;
00030 
00031 class VTK_CHARTS_EXPORT vtkBlockItem : public vtkContextItem
00032 {
00033 public:
00034   vtkTypeMacro(vtkBlockItem, vtkContextItem);
00035   virtual void PrintSelf(ostream &os, vtkIndent indent);
00036 
00037   static vtkBlockItem *New();
00038 
00040   virtual bool Paint(vtkContext2D *painter);
00041 
00042 //BTX
00044   virtual bool Hit(const vtkContextMouseEvent &mouse);
00045 
00047   virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse);
00048 
00050   virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
00051 
00053   virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse);
00054 
00056   virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
00057 
00059   virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
00060 //ETX
00061 
00063 
00064   vtkSetStringMacro(Label);
00066 
00068 
00069   vtkGetStringMacro(Label);
00071 
00073 
00076   vtkSetVector4Macro(Dimensions, int);
00078 
00080 
00083   vtkGetVector4Macro(Dimensions, int);
00085 
00086 //BTX
00087   void SetScalarFunctor(double (*scalarFunction)(double, double));
00088 //ETX
00089 
00090 //BTX
00091 protected:
00092   vtkBlockItem();
00093   ~vtkBlockItem();
00094 
00095   int Dimensions[4];
00096 
00097   float LastPosition[2];
00098 
00099   char *Label;
00100 
00101   bool MouseOver;
00102   int MouseButtonPressed;
00103 
00104   // Some function pointers to optionally do funky things...
00105   double (*scalarFunction)(double, double);
00106 
00107 private:
00108   vtkBlockItem(const vtkBlockItem &); // Not implemented.
00109   void operator=(const vtkBlockItem &);   // Not implemented.
00110 //ETX
00111 };
00112 
00113 #endif //__vtkBlockItem_h