VTK  9.3.20240329
vtkColorTransferControlPointsItem.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
19 #ifndef vtkColorTransferControlPointsItem_h
20 #define vtkColorTransferControlPointsItem_h
21 
22 #include "vtkChartsCoreModule.h" // For export macro
23 #include "vtkControlPointsItem.h"
24 
25 VTK_ABI_NAMESPACE_BEGIN
27 
28 class VTKCHARTSCORE_EXPORT vtkColorTransferControlPointsItem : public vtkControlPointsItem
29 {
30 public:
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
38 
43 
45 
48  vtkGetObjectMacro(ColorTransferFunction, vtkColorTransferFunction);
50 
54  vtkIdType GetNumberOfPoints() const override;
55 
61  void GetControlPoint(vtkIdType index, double* point) const override;
62 
68  void SetControlPoint(vtkIdType index, double* point) override;
69 
75  vtkIdType AddPoint(double* newPos) override;
76 
77  using Superclass::RemovePoint;
78 
84  vtkIdType RemovePoint(double* pos) override;
85 
87 
92  vtkSetMacro(ColorFill, bool);
93  vtkGetMacro(ColorFill, bool);
95 
96 protected:
99 
100  void emitEvent(unsigned long event, void* params) override;
101 
103 
104  void DrawPoint(vtkContext2D* painter, vtkIdType index) override;
105  void EditPoint(float tX, float tY) override;
106 
111  void ComputeBounds(double* bounds) override;
112 
113  vtkColorTransferFunction* ColorTransferFunction = nullptr;
114  bool ColorFill = false;
115 
116 private:
118  void operator=(const vtkColorTransferControlPointsItem&) = delete;
119 };
120 
121 VTK_ABI_NAMESPACE_END
122 #endif
Control points for vtkColorTransferFunction.
void SetControlPoint(vtkIdType index, double *point) override
Sets the x and y coordinates as well as the midpoint and sharpness of the control point corresponding...
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) const override
Returns the x and y coordinates as well as the midpoint and sharpness of the control point correspond...
vtkIdType GetNumberOfPoints() const override
Return the number of points in the color transfer function.
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.
void ComputeBounds(double *bounds) override
Compute the bounds for this item.
void EditPoint(float tX, float tY) override
void SetColorTransferFunction(vtkColorTransferFunction *function)
Set the piecewise function to draw its points.
void emitEvent(unsigned long event, void *params) override
static vtkColorTransferControlPointsItem * New()
Creates a piecewise control points object.
vtkIdType RemovePoint(double *pos) override
Remove a point of the function.
vtkMTimeType GetControlPointsMTime() override
Must be reimplemented by subclasses to calculate the points to draw.
Defines a transfer function for mapping a property to an RGB color value.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:69
Abstract class for control points items.
a simple class to control print indentation
Definition: vtkIndent.h:108
@ point
Definition: vtkX3D.h:236
@ index
Definition: vtkX3D.h:246
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270