VTK
vtkBlockItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBlockItem.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
27 #ifndef __vtkBlockItem_h
28 #define __vtkBlockItem_h
29 
30 #include "vtkContextItem.h"
31 #include "vtkStdString.h" // For vtkStdString ivars
32 
33 class vtkContext2D;
34 
36 {
37 public:
38  vtkTypeMacro(vtkBlockItem, vtkContextItem);
39  virtual void PrintSelf(ostream &os, vtkIndent indent);
40 
41  static vtkBlockItem *New();
42 
44  virtual bool Paint(vtkContext2D *painter);
45 
46 //BTX
48  virtual bool Hit(const vtkContextMouseEvent &mouse);
49 
51  virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse);
52 
54  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
55 
57  virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse);
58 
60  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
61 
63 
64  virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
65 //ETX
67 
69  virtual void SetLabel(const vtkStdString &label);
70 
72  virtual vtkStdString GetLabel();
73 
75 
78  vtkSetVector4Macro(Dimensions, int);
80 
82 
85  vtkGetVector4Macro(Dimensions, int);
87 
88 //BTX
89  void SetScalarFunctor(double (*scalarFunction)(double, double));
90 //ETX
91 
92 //BTX
93 protected:
94  vtkBlockItem();
95  ~vtkBlockItem();
96 
97  int Dimensions[4];
98 
99  float LastPosition[2];
100 
102 
103  bool MouseOver;
105 
106  // Some function pointers to optionally do funky things...
107  double (*scalarFunction)(double, double);
108 
109 private:
110  vtkBlockItem(const vtkBlockItem &); // Not implemented.
111  void operator=(const vtkBlockItem &); // Not implemented.
112 //ETX
113 };
114 
115 #endif //__vtkBlockItem_h
#define VTK_CHARTS_EXPORT
Wrapper around vtkstd::string to keep symbols short.
Definition: vtkStdString.h:45
int MouseButtonPressed
Definition: vtkBlockItem.h:104
base class for items that are part of a vtkContextScene.
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
virtual bool Paint(vtkContext2D *painter)
a vtkContextItem that draws a block (optional label).
Definition: vtkBlockItem.h:35
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:54
vtkStdString Label
Definition: vtkBlockItem.h:101
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse)
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
virtual bool Hit(const vtkContextMouseEvent &mouse)
virtual void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()
virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse)