VTK  9.7.1
vtkPiecewisePointHandleItem.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 
15 #ifndef vtkPiecewisePointHandleItem_h
16 #define vtkPiecewisePointHandleItem_h
17 
18 #include "vtkChartsCoreModule.h" // For export macro
19 #include "vtkContextItem.h"
20 #include "vtkWeakPointer.h" // Needed for weak pointer to the PiecewiseFunction.
21 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkContext2D;
26 class vtkCallbackCommand;
28 
29 class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkPiecewisePointHandleItem : public vtkContextItem
30 {
31 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
36  static void CallRedraw(vtkObject* sender, unsigned long event, void* receiver, void* params);
37 
41  void SetParent(vtkAbstractContextItem* parent) override;
42 
46  bool Paint(vtkContext2D* painter) override;
47 
49 
52  vtkSetMacro(CurrentPointIndex, vtkIdType);
53  vtkGetMacro(CurrentPointIndex, vtkIdType);
55 
57 
60  virtual void SetPiecewiseFunction(vtkPiecewiseFunction* piecewiseFunc);
61  vtkWeakPointer<vtkPiecewiseFunction> GetPiecewiseFunction();
63 
68  int IsOverHandle(float* pos);
69 
73  bool Hit(const vtkContextMouseEvent& mouse) override;
74 
78  bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
79 
83  bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
84 
88  bool MouseButtonReleaseEvent(const vtkContextMouseEvent& mouse) override;
89 
90 protected:
92  ~vtkPiecewisePointHandleItem() override;
93 
97  virtual void Redraw();
98 
102 
105 
106 private:
108  void operator=(const vtkPiecewisePointHandleItem&) = delete;
109 
110  class InternalPiecewisePointHandleInfo;
111  InternalPiecewisePointHandleInfo* Internal;
112 };
113 
114 VTK_ABI_NAMESPACE_END
115 #endif // vtkPiecewisePointHandleItem_h
virtual void SetParent(vtkAbstractContextItem *parent)
Set the parent item.
abstract base class for most VTK objects
Definition: vtkObject.h:52
Defines a 1D piecewise function.
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.
int vtkIdType
Definition: vtkType.h:363
vtkWeakPointer< vtkPiecewiseFunction > PiecewiseFunction
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
supports function callbacks
a vtkContextItem that draws handles around a point of a piecewise function
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.
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
base class for items that are part of a vtkContextScene.
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...