VTK
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);
71  vtkWeakPointer<vtkPiecewiseFunction> GetPiecewiseFunction();
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:
102  ~vtkPiecewisePointHandleItem() override;
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
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:34
vtkIdType
int vtkIdType
Definition: vtkType.h:343
vtkPiecewisePointHandleItem::PiecewiseFunction
vtkWeakPointer< vtkPiecewiseFunction > PiecewiseFunction
Definition: vtkPiecewisePointHandleItem.h:113
vtkAbstractContextItem
base class for items that are part of a vtkContextScene.
Definition: vtkAbstractContextItem.h:40
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
vtkContextItem.h
vtkPiecewisePointHandleItem
a vtkContextItem that draws handles around a point of a piecewise function
Definition: vtkPiecewisePointHandleItem.h:39
vtkPiecewisePointHandleItem::CurrentPointIndex
vtkIdType CurrentPointIndex
Definition: vtkPiecewisePointHandleItem.h:110
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkAbstractContextItem::Hit
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
vtkContextItem::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWeakPointer.h
vtkAbstractContextItem::MouseMoveEvent
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
vtkPiecewiseFunction
Defines a 1D piecewise function.
Definition: vtkPiecewiseFunction.h:45
vtkAbstractContextItem::MouseButtonReleaseEvent
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
vtkContextItem
base class for items that are part of a vtkContextScene.
Definition: vtkContextItem.h:31
vtkAbstractContextItem::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
vtkAbstractContextItem::SetParent
virtual void SetParent(vtkAbstractContextItem *parent)
Set the parent item.
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:44
vtkPiecewisePointHandleItem::HandleRadius
float HandleRadius
Definition: vtkPiecewisePointHandleItem.h:111
vtkAbstractContextItem::MouseButtonPressEvent
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...
vtkPiecewisePointHandleItem::MouseOverHandleIndex
int MouseOverHandleIndex
Definition: vtkPiecewisePointHandleItem.h:109
vtkPiecewisePointHandleItem::Callback
vtkCallbackCommand * Callback
Definition: vtkPiecewisePointHandleItem.h:114
vtkWeakPointer< vtkPiecewiseFunction >