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);
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
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:58
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:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
Defines a 1D piecewise function.
a vtkContextItem that draws handles around a point of a piecewise function
vtkWeakPointer< vtkPiecewiseFunction > GetPiecewiseFunction()
virtual void SetPiecewiseFunction(vtkPiecewiseFunction *piecewiseFunc)
Set the PieceWiseFunction the handles will manipulate.
virtual void Redraw()
Redraw all the handles.
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
Mouse button down event.
int IsOverHandle(float *pos)
Returns the index of the handle if pos is over any of the handles, otherwise return -1;.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual bool Paint(vtkContext2D *painter)
Paint event for the item.
static vtkPiecewisePointHandleItem * New()
static void CallRedraw(vtkObject *sender, unsigned long event, void *receiver, void *params)
vtkWeakPointer< vtkPiecewiseFunction > PiecewiseFunction
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
virtual void SetParent(vtkAbstractContextItem *parent)
Set the parent item, which should be a vtkControlPointItem.
virtual bool Hit(const vtkContextMouseEvent &mouse)
Returns true if the supplied x, y coordinate is inside the item.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287