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 
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 
110  virtual bool UsingLogScale();
111 
112  virtual void emitEvent(unsigned long event, void* params);
113 
114  virtual unsigned long int GetControlPointsMTime();
115 
116  virtual vtkIdType GetNumberOfPoints()const;
117  virtual void DrawPoint(vtkContext2D* painter, vtkIdType index);
118  virtual void GetControlPoint(vtkIdType index, double* pos)const;
119  virtual void SetControlPoint(vtkIdType index, double *point);
120  virtual void EditPoint(float tX, float tY);
121  virtual void EditPointCurve(vtkIdType idx);
122 
123  void MergeTransferFunctions();
124  void SilentMergeTransferFunctions();
125 
130 
131 private:
133  void operator=(const vtkCompositeControlPointsItem &); // Not implemented.
134 };
135 
136 #endif
static vtkColorTransferControlPointsItem * New()
Defines a 1D piecewise function.
virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse)
virtual unsigned long int GetControlPointsMTime()
virtual void EditPoint(float tX, float tY)
int vtkIdType
Definition: vtkType.h:247
virtual vtkIdType GetNumberOfPoints() const
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
a vtkContextItem that draws handles around a point of a piecewise function
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:38
Control points for vtkCompositeFunction.
virtual void SetControlPoint(vtkIdType index, double *point)
vtkPiecewisePointHandleItem * OpacityPointHandle
virtual vtkIdType AddPoint(double *newPos)
Control points for vtkColorTransferFunction.
void SetColorTransferFunction(vtkColorTransferFunction *function)
virtual void emitEvent(unsigned long event, void *params)
virtual void GetControlPoint(vtkIdType index, double *point) const
Defines a transfer function for mapping a property to an RGB color value.
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
virtual vtkIdType RemovePoint(double *pos)
#define VTKCHARTSCORE_EXPORT
virtual void DrawPoint(vtkContext2D *painter, vtkIdType index)