VTK
dox/Rendering/Context2D/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 "vtkRenderingContext2DModule.h" // For export macro
00031 #include "vtkContextItem.h"
00032 #include "vtkStdString.h"    // For vtkStdString ivars
00033 
00034 class vtkContext2D;
00035 
00036 class VTKRENDERINGCONTEXT2D_EXPORT vtkBlockItem : public vtkContextItem
00037 {
00038 public:
00039   vtkTypeMacro(vtkBlockItem, vtkContextItem);
00040   virtual void PrintSelf(ostream &os, vtkIndent indent);
00041 
00042   static vtkBlockItem *New();
00043 
00045   virtual bool Paint(vtkContext2D *painter);
00046 
00047 //BTX
00049   virtual bool Hit(const vtkContextMouseEvent &mouse);
00050 
00052   virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse);
00053 
00055   virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
00056 
00058   virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse);
00059 
00061   virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
00062 
00064 
00065   virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
00066 //ETX
00068 
00070   virtual void SetLabel(const vtkStdString &label);
00071 
00073   virtual vtkStdString GetLabel();
00074 
00076 
00079   vtkSetVector4Macro(Dimensions, float);
00081 
00083 
00086   vtkGetVector4Macro(Dimensions, float);
00088 
00089 //BTX
00090   void SetScalarFunctor(double (*scalarFunction)(double, double));
00091 //ETX
00092 
00093 //BTX
00094 protected:
00095   vtkBlockItem();
00096   ~vtkBlockItem();
00097 
00098   float Dimensions[4];
00099 
00100   vtkStdString Label;
00101 
00102   bool MouseOver;
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