VTK  9.3.1
vtkEqualizerContextItem.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef vtkEqualizerContextItem_h
4 #define vtkEqualizerContextItem_h
5 
6 #include "vtkContextItem.h"
7 #include "vtkInteractionWidgetsModule.h" // For export macro
8 #include "vtkNew.h" // For vtkNew
9 
10 #include <string> // for std::string
11 
12 VTK_ABI_NAMESPACE_BEGIN
13 class vtkBrush;
14 class vtkPen;
16 
36 class VTKINTERACTIONWIDGETS_EXPORT vtkEqualizerContextItem : public vtkContextItem
37 {
38 public:
39  static vtkEqualizerContextItem* New();
40 
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  bool Paint(vtkContext2D* painter) override;
48 
52  bool Hit(const vtkContextMouseEvent& mouse) override;
53 
59  bool MouseEnterEvent(const vtkContextMouseEvent& mouse) override;
60 
66  bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
67 
73  bool MouseLeaveEvent(const vtkContextMouseEvent& mouse) override;
74 
80  bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
81 
87  bool MouseButtonReleaseEvent(const vtkContextMouseEvent& mouse) override;
88 
90 
97  void SetPoints(const std::string& points);
98  std::string GetPoints() const;
100 
101 protected:
103  {
104  NO_BUTTON = 0,
105  LEFT_BUTTON_PRESSED = 1,
106  RIGHT_BUTTON_PRESSED = 2
107  };
108 
110  ~vtkEqualizerContextItem() override;
111 
112  MouseStates MouseState = NO_BUTTON;
115 
116 private:
118  void operator=(const vtkEqualizerContextItem&) = delete;
119 
120  class vtkInternal;
121  vtkInternal* Internal;
122 };
123 
124 VTK_ABI_NAMESPACE_END
125 #endif
base class for items that are part of a vtkContextScene.
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
Mouse button down event Return true if the item holds the event, false if the event can be propagated...
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
all children of this item are transformed by the vtkTransform2D of this item.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:29
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:28
virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse)
Mouse enter event.
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse)
Mouse leave event.
draws a interactive polyline