VTK  9.0.3
vtkPiecewisePointHandleItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPiecewisePointHandleItem.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 vtkPiecewisePointHandleItem_h
28 #define vtkPiecewisePointHandleItem_h
29 
30 #include "vtkChartsCoreModule.h" // For export macro
31 #include "vtkContextItem.h"
32 #include "vtkWeakPointer.h" // Needed for weak pointer to the PiecewiseFunction.
33 
34 class vtkContext2D;
36 class vtkCallbackCommand;
38 
39 class VTKCHARTSCORE_EXPORT vtkPiecewisePointHandleItem : public vtkContextItem
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46  static void CallRedraw(vtkObject* sender, unsigned long event, void* receiver, void* params);
47 
51  void SetParent(vtkAbstractContextItem* parent) override;
52 
56  bool Paint(vtkContext2D* painter) override;
57 
59 
62  vtkSetMacro(CurrentPointIndex, vtkIdType);
63  vtkGetMacro(CurrentPointIndex, vtkIdType);
65 
67 
70  virtual void SetPiecewiseFunction(vtkPiecewiseFunction* piecewiseFunc);
73 
78  int IsOverHandle(float* pos);
79 
83  bool Hit(const vtkContextMouseEvent& mouse) override;
84 
88  bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
89 
93  bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
94 
98  bool MouseButtonReleaseEvent(const vtkContextMouseEvent& mouse) override;
99 
100 protected:
103 
107  virtual void Redraw();
108 
112 
115 
116 private:
118  void operator=(const vtkPiecewisePointHandleItem&) = delete;
119 
120  class InternalPiecewisePointHandleInfo;
121  InternalPiecewisePointHandleInfo* Internal;
122 };
123 
124 #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.
Definition: vtkContext2D.h:53
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:34
abstract base class for most VTK objects
Definition: vtkObject.h:63
Defines a 1D piecewise function.
a vtkContextItem that draws handles around a point of a piecewise function
vtkWeakPointer< vtkPiecewiseFunction > GetPiecewiseFunction()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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
int vtkIdType
Definition: vtkType.h:338