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 
00027 #ifndef __vtkBlockItem_h
00028 #define __vtkBlockItem_h
00029 
00030 #include "vtkContextItem.h"
00031 #include "vtkStdString.h"    // For vtkStdString ivars
00032 
00033 class vtkContext2D;
00034 
00035 class VTK_CHARTS_EXPORT vtkBlockItem : public vtkContextItem
00036 {
00037 public:
00038   vtkTypeMacro(vtkBlockItem, vtkContextItem);
00039   virtual void PrintSelf(ostream &os, vtkIndent indent);
00040 
00041   static vtkBlockItem *New();
00042 
00044   virtual bool Paint(vtkContext2D *painter);
00045 
00046 //BTX
00048   virtual bool Hit(const vtkContextMouseEvent &mouse);
00049 
00051   virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse);
00052 
00054   virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
00055 
00057   virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse);
00058 
00060   virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
00061 
00063 
00064   virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
00065 //ETX
00067 
00069   virtual void SetLabel(const vtkStdString &label);
00070 
00072   virtual vtkStdString GetLabel();
00073 
00075 
00078   vtkSetVector4Macro(Dimensions, float);
00080 
00082 
00085   vtkGetVector4Macro(Dimensions, float);
00087 
00088 //BTX
00089   void SetScalarFunctor(double (*scalarFunction)(double, double));
00090 //ETX
00091 
00092 //BTX
00093 protected:
00094   vtkBlockItem();
00095   ~vtkBlockItem();
00096 
00097   float Dimensions[4];
00098 
00099   vtkStdString Label;
00100 
00101   bool MouseOver;
00102 
00103   // Some function pointers to optionally do funky things...
00104   double (*scalarFunction)(double, double);
00105 
00106 private:
00107   vtkBlockItem(const vtkBlockItem &); // Not implemented.
00108   void operator=(const vtkBlockItem &);   // Not implemented.
00109 //ETX
00110 };
00111 
00112 #endif //__vtkBlockItem_h