VTK  9.2.6
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 
33 #ifndef vtkCompositeControlPointsItem_h
34 #define vtkCompositeControlPointsItem_h
35 
36 #include "vtkChartsCoreModule.h" // For export macro
38 
41 
43 {
44 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
52 
57 
59 
63  vtkGetObjectMacro(OpacityFunction, vtkPiecewiseFunction);
65 
67  {
68  ColorPointsFunction = 1,
69  OpacityPointsFunction = 2,
70  ColorAndOpacityPointsFunction = 3
71  };
72 
74 
86  vtkSetMacro(PointsFunction, int);
87  vtkGetMacro(PointsFunction, int);
89 
95  vtkIdType AddPoint(double* newPos) override;
96 
103  vtkIdType RemovePoint(double* pos) override;
104 
106 
113  vtkSetMacro(UseOpacityPointHandles, bool);
114  vtkGetMacro(UseOpacityPointHandles, bool);
116 
118 
121  bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
122  bool MouseDoubleClickEvent(const vtkContextMouseEvent& mouse) override;
123  bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
125 
131  vtkIdType GetNumberOfPoints() const override;
132 
139  void GetControlPoint(vtkIdType index, double point[4]) const override;
140 
147  void SetControlPoint(vtkIdType index, double* point) override;
148 
149 protected:
152 
153  void emitEvent(unsigned long event, void* params) override;
154 
156 
157  void DrawPoint(vtkContext2D* painter, vtkIdType index) override;
158  void EditPoint(float tX, float tY) override;
159  virtual void EditPointCurve(vtkIdType idx);
160 
163 
165  vtkPiecewiseFunction* OpacityFunction = nullptr;
166  vtkPiecewisePointHandleItem* OpacityPointHandle = nullptr;
167  bool UseOpacityPointHandles = false;
168 
169 private:
171  void operator=(const vtkCompositeControlPointsItem&) = delete;
172 };
173 
174 #endif
Control points for vtkColorTransferFunction.
Defines a transfer function for mapping a property to an RGB color value.
Control points for vtkCompositeFunction.
vtkMTimeType GetControlPointsMTime() override
Must be reimplemented by subclasses to calculate the points to draw.
vtkIdType RemovePoint(double *pos) override
Remove a point of the function.
~vtkCompositeControlPointsItem() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType AddPoint(double *newPos) override
Add a point to the function.
virtual void EditPointCurve(vtkIdType idx)
virtual void SetColorTransferFunction(vtkColorTransferFunction *function)
Set the color transfer function to draw its points.
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
void EditPoint(float tX, float tY) override
void SetOpacityFunction(vtkPiecewiseFunction *opacity)
Utility function that calls SetPiecewiseFunction()
void emitEvent(unsigned long event, void *params) override
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
static vtkCompositeControlPointsItem * New()
Creates a piecewise control points object.
void SetControlPoint(vtkIdType index, double *point) override
Sets the x and y coordinates as well as the midpoint and sharpness, of the control point correspondin...
vtkIdType GetNumberOfPoints() const override
Returns the total number of points, either from using the superclass implementation or the opacity fu...
bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
void DrawPoint(vtkContext2D *painter, vtkIdType index) override
Internal function that paints a collection of points and optionally excludes some.
void GetControlPoint(vtkIdType index, double point[4]) const override
Returns the x and y coordinates as well as the midpoint and sharpness of the control point correspond...
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:77
data structure to represent mouse events.
virtual vtkIdType RemovePoint(double *pos)=0
Remove a point of the function.
a simple class to control print indentation
Definition: vtkIndent.h:119
Defines a 1D piecewise function.
a vtkContextItem that draws handles around a point of a piecewise function
@ point
Definition: vtkX3D.h:242
@ index
Definition: vtkX3D.h:252
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287