VTK
dox/Charts/vtkCompositeControlPointsItem.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCompositeControlPointsItem.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 
00032 #ifndef __vtkCompositeControlPointsItem_h
00033 #define __vtkCompositeControlPointsItem_h
00034 
00035 #include "vtkColorTransferControlPointsItem.h"
00036 
00037 class vtkPiecewiseFunction;
00038 class vtkPiecewisePointHandleItem;
00039 
00040 class VTK_CHARTS_EXPORT vtkCompositeControlPointsItem:
00041   public vtkColorTransferControlPointsItem
00042 {
00043 public:
00044   vtkTypeMacro(vtkCompositeControlPointsItem, vtkColorTransferControlPointsItem);
00045   virtual void PrintSelf(ostream &os, vtkIndent indent);
00046 
00048   static vtkCompositeControlPointsItem* New();
00049 
00051   virtual void SetColorTransferFunction(vtkColorTransferFunction* function);
00052 
00054 
00055   void SetOpacityFunction(vtkPiecewiseFunction* opacity);
00056   vtkGetObjectMacro(OpacityFunction, vtkPiecewiseFunction);
00058 
00059   enum PointsFunctionType{
00060     ColorPointsFunction = 1,
00061     OpacityPointsFunction = 2,
00062     ColorAndOpacityPointsFunction = 3
00063   };
00065 
00073   vtkSetMacro(PointsFunction, int);
00074   vtkGetMacro(PointsFunction, int);
00076 
00080   virtual vtkIdType AddPoint(double* newPos);
00081 
00085   virtual vtkIdType RemovePoint(double* pos);
00086 
00088 
00092   vtkSetMacro(UseOpacityPointHandles, bool);
00093   vtkGetMacro(UseOpacityPointHandles, bool);
00095 
00097 
00098   virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
00099   virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse);
00100   virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
00102 
00103 protected:
00104   vtkCompositeControlPointsItem();
00105   virtual ~vtkCompositeControlPointsItem();
00106 
00107   virtual void emitEvent(unsigned long event, void* params);
00108 
00109   virtual unsigned long int GetControlPointsMTime();
00110 
00111   virtual vtkIdType GetNumberOfPoints()const;
00112   virtual void DrawPoint(vtkContext2D* painter, vtkIdType index);
00113   virtual void GetControlPoint(vtkIdType index, double* pos)const;
00114   virtual void SetControlPoint(vtkIdType index, double *point);
00115   virtual void EditPoint(float tX, float tY);
00116   virtual void EditPointCurve(vtkIdType idx);
00117 
00118   void MergeTransferFunctions();
00119   void SilentMergeTransferFunctions();
00120 
00121   int                   PointsFunction;
00122   vtkPiecewiseFunction* OpacityFunction;
00123   vtkPiecewisePointHandleItem* OpacityPointHandle;
00124   bool UseOpacityPointHandles;
00125 
00126 private:
00127   vtkCompositeControlPointsItem(const vtkCompositeControlPointsItem &); // Not implemented.
00128   void operator=(const vtkCompositeControlPointsItem &);   // Not implemented.
00129 };
00130 
00131 #endif