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 
35 #include "vtkChartsCoreModule.h" // For export macro
37 
40 
41 class VTKCHARTSCORE_EXPORT vtkCompositeControlPointsItem:
43 {
44 public:
46  virtual void PrintSelf(ostream &os, vtkIndent indent);
47 
50 
52  virtual void SetColorTransferFunction(vtkColorTransferFunction* function);
53 
55 
56  void SetOpacityFunction(vtkPiecewiseFunction* opacity);
57  vtkGetObjectMacro(OpacityFunction, vtkPiecewiseFunction);
59 
61  ColorPointsFunction = 1,
62  OpacityPointsFunction = 2,
63  ColorAndOpacityPointsFunction = 3
64  };
66 
74  vtkSetMacro(PointsFunction, int);
75  vtkGetMacro(PointsFunction, int);
77 
81  virtual vtkIdType AddPoint(double* newPos);
82 
86  virtual vtkIdType RemovePoint(double* pos);
87 
89 
93  vtkSetMacro(UseOpacityPointHandles, bool);
94  vtkGetMacro(UseOpacityPointHandles, bool);
96 
98 
99  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
100  virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse);
101  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
103 
104 protected:
107 
108  virtual void emitEvent(unsigned long event, void* params);
109 
110  virtual unsigned long int GetControlPointsMTime();
111 
112  virtual vtkIdType GetNumberOfPoints()const;
113  virtual void DrawPoint(vtkContext2D* painter, vtkIdType index);
114  virtual void GetControlPoint(vtkIdType index, double* pos)const;
115  virtual void SetControlPoint(vtkIdType index, double *point);
116  virtual void EditPoint(float tX, float tY);
117  virtual void EditPointCurve(vtkIdType idx);
118 
119  void MergeTransferFunctions();
120  void SilentMergeTransferFunctions();
121 
126 
127 private:
129  void operator=(const vtkCompositeControlPointsItem &); // Not implemented.
130 };
131 
132 #endif