VTK  9.4.20250401
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
23VTK_ABI_NAMESPACE_BEGIN
24class vtkContext2D;
28
30{
31public:
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);
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
90protected:
93
97 virtual void Redraw();
98
102
105
106private:
108 void operator=(const vtkPiecewisePointHandleItem&) = delete;
109
110 class InternalPiecewisePointHandleInfo;
111 InternalPiecewisePointHandleInfo* Internal;
112};
113
114VTK_ABI_NAMESPACE_END
115#endif // vtkPiecewisePointHandleItem_h
base class for items that are part of a vtkContextScene.
supports function callbacks
Class for drawing 2D primitives to a graphical context.
base class for items that are part of a vtkContextScene.
data structure to represent mouse events.
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Defines a 1D piecewise function.
a vtkContextItem that draws handles around a point of a piecewise function
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWeakPointer< vtkPiecewiseFunction > GetPiecewiseFunction()
Set the PieceWiseFunction the handles will manipulate.
virtual void SetPiecewiseFunction(vtkPiecewiseFunction *piecewiseFunc)
Set the PieceWiseFunction the handles will manipulate.
virtual void Redraw()
Redraw all the handles.
int IsOverHandle(float *pos)
Returns the index of the handle if pos is over any of the handles, otherwise return -1;.
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event.
static vtkPiecewisePointHandleItem * New()
static void CallRedraw(vtkObject *sender, unsigned long event, void *receiver, void *params)
vtkWeakPointer< vtkPiecewiseFunction > PiecewiseFunction
bool Paint(vtkContext2D *painter) override
Paint event for the item.
bool Hit(const vtkContextMouseEvent &mouse) override
Returns true if the supplied x, y coordinate is inside the item.
bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse) override
Mouse button release event.
void SetParent(vtkAbstractContextItem *parent) override
Set the parent item, which should be a vtkControlPointItem.
~vtkPiecewisePointHandleItem() override
a weak reference to a vtkObject.
int vtkIdType
Definition vtkType.h:332
#define VTK_MARSHALAUTO