VTK
dox/Charts/Core/vtkPiecewisePointHandleItem.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPiecewisePointHandleItem.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 
00026 #ifndef __vtkPiecewisePointHandleItem_h
00027 #define __vtkPiecewisePointHandleItem_h
00028 
00029 #include "vtkChartsCoreModule.h" // For export macro
00030 #include "vtkContextItem.h"
00031 #include "vtkWeakPointer.h" // Needed for weak pointer to the PiecewiseFunction.
00032 
00033 class vtkContext2D;
00034 class vtkPiecewiseFunction;
00035 class vtkCallbackCommand;
00036 class vtkAbstractContextItem;
00037 
00038 class VTKCHARTSCORE_EXPORT vtkPiecewisePointHandleItem : public vtkContextItem
00039 {
00040 public:
00041   vtkTypeMacro(vtkPiecewisePointHandleItem, vtkContextItem);
00042   virtual void PrintSelf(ostream &os, vtkIndent indent);
00043 
00044   static vtkPiecewisePointHandleItem *New();
00045   static void CallRedraw(vtkObject* sender, unsigned long event, void* receiver, void* params);
00046 
00048   virtual void SetParent(vtkAbstractContextItem *parent);
00049 
00051   virtual bool Paint(vtkContext2D *painter);
00052 
00054 
00055   vtkSetMacro(CurrentPointIndex, vtkIdType);
00056   vtkGetMacro(CurrentPointIndex, vtkIdType);
00058 
00060 
00061   virtual void SetPiecewiseFunction(vtkPiecewiseFunction* piecewiseFunc);
00062   vtkWeakPointer<vtkPiecewiseFunction> GetPiecewiseFunction();
00064 
00067   int IsOverHandle(float* pos);
00068 
00070   virtual bool Hit(const vtkContextMouseEvent &mouse);
00071 
00073   virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
00074 
00076   virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
00077 
00079   virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
00080 
00081 //BTX
00082 protected:
00083   vtkPiecewisePointHandleItem();
00084   ~vtkPiecewisePointHandleItem();
00085 
00087   virtual void Redraw();
00088 
00089   int MouseOverHandleIndex;
00090   vtkIdType CurrentPointIndex;
00091   float HandleRadius;
00092 
00093   vtkWeakPointer<vtkPiecewiseFunction> PiecewiseFunction;
00094   vtkCallbackCommand* Callback;
00095 
00096 private:
00097   vtkPiecewisePointHandleItem(const vtkPiecewisePointHandleItem &); // Not implemented.
00098   void operator=(const vtkPiecewisePointHandleItem &);   // Not implemented.
00099 
00100   class InternalPiecewisePointHandleInfo;
00101   InternalPiecewisePointHandleInfo* Internal;
00102 //ETX
00103 };
00104 
00105 #endif //__vtkPiecewisePointHandleItem_h