VTK
vtkCompositeControlPointsItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCompositeControlPointsItem.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 
32 #ifndef __vtkCompositeControlPointsItem_h
33 #define __vtkCompositeControlPointsItem_h
34 
36 
39 
42 {
43 public:
45  virtual void PrintSelf(ostream &os, vtkIndent indent);
46 
49 
51  virtual void SetColorTransferFunction(vtkColorTransferFunction* function);
52 
54 
55  void SetOpacityFunction(vtkPiecewiseFunction* opacity);
56  vtkGetObjectMacro(OpacityFunction, vtkPiecewiseFunction);
58 
60  ColorPointsFunction = 1,
61  OpacityPointsFunction = 2,
62  ColorAndOpacityPointsFunction = 3
63  };
65 
73  vtkSetMacro(PointsFunction, int);
74  vtkGetMacro(PointsFunction, int);
76 
80  virtual vtkIdType AddPoint(double* newPos);
81 
85  virtual vtkIdType RemovePoint(double* pos);
86 
88 
92  vtkSetMacro(UseOpacityPointHandles, bool);
93  vtkGetMacro(UseOpacityPointHandles, bool);
95 
97 
98  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
99  virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse);
100  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
102 
103 protected:
106 
107  virtual void emitEvent(unsigned long event, void* params);
108 
109  virtual unsigned long int GetControlPointsMTime();
110 
111  virtual vtkIdType GetNumberOfPoints()const;
112  virtual void DrawPoint(vtkContext2D* painter, vtkIdType index);
113  virtual void GetControlPoint(vtkIdType index, double* pos)const;
114  virtual void SetControlPoint(vtkIdType index, double *point);
115  virtual void EditPoint(float tX, float tY);
116  virtual void EditPointCurve(vtkIdType idx);
117 
118  void MergeTransferFunctions();
119  void SilentMergeTransferFunctions();
120 
125 
126 private:
128  void operator=(const vtkCompositeControlPointsItem &); // Not implemented.
129 };
130 
131 #endif