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 
30 #ifndef vtkCompositeControlPointsItem_h
31 #define vtkCompositeControlPointsItem_h
32 
33 #include "vtkChartsCoreModule.h" // For export macro
35 
38 
39 class VTKCHARTSCORE_EXPORT vtkCompositeControlPointsItem:
41 {
42 public:
44  void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE;
45 
50 
54  virtual void SetColorTransferFunction(vtkColorTransferFunction* function);
55 
57 
60  void SetOpacityFunction(vtkPiecewiseFunction* opacity);
61  vtkGetObjectMacro(OpacityFunction, vtkPiecewiseFunction);
63 
65  ColorPointsFunction = 1,
66  OpacityPointsFunction = 2,
67  ColorAndOpacityPointsFunction = 3
68  };
70 
82  vtkSetMacro(PointsFunction, int);
83  vtkGetMacro(PointsFunction, int);
85 
91  vtkIdType AddPoint(double* newPos) VTK_OVERRIDE;
92 
98  vtkIdType RemovePoint(double* pos) VTK_OVERRIDE;
99 
101 
108  vtkSetMacro(UseOpacityPointHandles, bool);
109  vtkGetMacro(UseOpacityPointHandles, bool);
111 
113 
116  bool MouseMoveEvent(const vtkContextMouseEvent &mouse) VTK_OVERRIDE;
117  bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse) VTK_OVERRIDE;
118  bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) VTK_OVERRIDE;
120 
121 protected:
123  ~vtkCompositeControlPointsItem() VTK_OVERRIDE;
124 
129  bool UsingLogScale() VTK_OVERRIDE;
130 
131  void emitEvent(unsigned long event, void* params) VTK_OVERRIDE;
132 
133  vtkMTimeType GetControlPointsMTime() VTK_OVERRIDE;
134 
135  vtkIdType GetNumberOfPoints()const VTK_OVERRIDE;
136  void DrawPoint(vtkContext2D* painter, vtkIdType index) VTK_OVERRIDE;
137  void GetControlPoint(vtkIdType index, double* pos)const VTK_OVERRIDE;
138  void SetControlPoint(vtkIdType index, double *point) VTK_OVERRIDE;
139  void EditPoint(float tX, float tY) VTK_OVERRIDE;
140  virtual void EditPointCurve(vtkIdType idx);
141 
142  void MergeTransferFunctions();
143  void SilentMergeTransferFunctions();
144 
145  int PointsFunction;
146  vtkPiecewiseFunction* OpacityFunction;
147  vtkPiecewisePointHandleItem* OpacityPointHandle;
148  bool UseOpacityPointHandles;
149 
150 private:
152  void operator=(const vtkCompositeControlPointsItem &) VTK_DELETE_FUNCTION;
153 };
154 
155 #endif
static vtkColorTransferControlPointsItem * New()
Creates a piecewise control points object.
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event.
Defines a 1D piecewise function.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
int vtkIdType
Definition: vtkType.h:345
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
a vtkContextItem that draws handles around a point of a piecewise function
bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event.
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:33
Control points for vtkCompositeFunction.
vtkIdType AddPoint(double *newPos) override
Add a point to the function.
vtkIdType RemovePoint(double *pos) override
Remove a point of the function.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Control points for vtkColorTransferFunction.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetColorTransferFunction(vtkColorTransferFunction *function)
Set the piecewise function to draw its points.
Defines a transfer function for mapping a property to an RGB color value.
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.