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  virtual void PrintSelf(ostream &os, vtkIndent indent);
44 
46  static void CallRedraw(vtkObject* sender, unsigned long event, void* receiver, void* params);
47 
51  virtual void SetParent(vtkAbstractContextItem *parent);
52 
56  virtual bool Paint(vtkContext2D *painter);
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  virtual bool Hit(const vtkContextMouseEvent &mouse);
84 
88  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
89 
93  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
94 
98  virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
99 
100 protected:
103 
107  virtual void Redraw();
108 
112 
115 
116 private:
117  vtkPiecewisePointHandleItem(const vtkPiecewisePointHandleItem &) VTK_DELETE_FUNCTION;
118  void operator=(const vtkPiecewisePointHandleItem &) VTK_DELETE_FUNCTION;
119 
120  class InternalPiecewisePointHandleInfo;
121  InternalPiecewisePointHandleInfo* Internal;
122 
123 };
124 
125 #endif //vtkPiecewisePointHandleItem_h
virtual void SetParent(vtkAbstractContextItem *parent)
Set the parent item.
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:287
vtkWeakPointer< vtkPiecewiseFunction > PiecewiseFunction
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
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:39
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...