VTK  9.7.1
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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25 
26 VTK_ABI_NAMESPACE_BEGIN
28 
30  : public vtkControlPointsItem
31 {
32 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
40 
44  void SetColorTransferFunction(vtkColorTransferFunction* function);
45 
47 
50  vtkGetObjectMacro(ColorTransferFunction, vtkColorTransferFunction);
52 
56  vtkIdType GetNumberOfPoints() const override;
57 
63  void GetControlPoint(vtkIdType index, double* point) const override;
64 
70  void SetControlPoint(vtkIdType index, double* point) override;
71 
77  vtkIdType AddPoint(double* newPos) override;
78 
79  using Superclass::RemovePoint;
80 
86  vtkIdType RemovePoint(double* pos) override;
87 
89 
94  vtkSetMacro(ColorFill, bool);
95  vtkGetMacro(ColorFill, bool);
97 
98 protected:
101 
102  void emitEvent(unsigned long event, void* params) override;
103 
105 
106  void DrawPoint(vtkContext2D* painter, vtkIdType index) override;
107  void EditPoint(float tX, float tY) override;
108 
113  void ComputeBounds(double* bounds) override;
114 
115  vtkColorTransferFunction* ColorTransferFunction = nullptr;
116  bool ColorFill = false;
117 
118 private:
120  void operator=(const vtkColorTransferControlPointsItem&) = delete;
121 };
122 
123 VTK_ABI_NAMESPACE_END
124 #endif
virtual void GetControlPoint(vtkIdType index, double *point) const =0
Returns the x and y coordinates as well as the midpoint and sharpness of the control point correspond...
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
virtual vtkMTimeType GetControlPointsMTime()=0
Must be reimplemented by subclasses to calculate the points to draw.
virtual void EditPoint(float tX, float tY)
Abstract class for control points items.
int vtkIdType
Definition: vtkType.h:363
virtual void DrawPoint(vtkContext2D *painter, vtkIdType index)
Internal function that paints a collection of points and optionally excludes some.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void emitEvent(unsigned long event, void *params=nullptr)=0
Control points for vtkColorTransferFunction.
virtual vtkIdType RemovePoint(double *pos)=0
Remove a point of the function.
Defines a transfer function for mapping a property to an RGB color value.
virtual void SetControlPoint(vtkIdType index, double *point)=0
Sets the x and y coordinates as well as the midpoint and sharpness of the control point corresponding...
virtual vtkIdType AddPoint(double *newPos)=0
Add a point to the function.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkIdType GetNumberOfPoints() const =0
Returns the total number of points.