vtkPVTransferFunction2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
11 #ifndef vtkPVTransferFunction2D_h
12 #define vtkPVTransferFunction2D_h
13 
14 // VTK includes
15 #include <vtkObject.h>
16 
17 #include "vtkPVTransferFunction2DBox.h" // needed for ivar
18 #include "vtkRemotingViewsModule.h" // needed for export macro
19 
20 #include <memory> // for unique_ptr
21 #include <vector> // needed for ivar
22 
23 // Forward declarations
24 class vtkImageData;
25 class vtkPVTransferFunction2DInternals;
26 
28 {
29 public:
33  static vtkPVTransferFunction2D* New();
34 
36 
40  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  virtual void Build();
47 
49 
53  vtkSetVector2Macro(OutputDimensions, int);
54  vtkGetVector2Macro(OutputDimensions, int);
56 
58 
65  int AddControlBox(
66  double x, double y, double width, double height, double r, double g, double b, double a);
67  int AddControlBox(double x, double y, double width, double height, double* color);
68  int AddControlBox(vtkRectd& box, double* color);
69  int AddControlBox(vtkSmartPointer<vtkPVTransferFunction2DBox> box);
70  int SetControlBox(int id, vtkSmartPointer<vtkPVTransferFunction2DBox> box);
71  int RemoveControlBox(int id);
72  int RemoveControlBox(vtkSmartPointer<vtkPVTransferFunction2DBox> box);
74 
78  std::vector<vtkSmartPointer<vtkPVTransferFunction2DBox>> GetBoxes();
79 
83  void RemoveAllBoxes();
84 
86 
90  vtkSetVector4Macro(Range, double);
91  vtkGetVector4Macro(Range, double);
93 
97  vtkImageData* GetFunction();
98 
99 protected:
101  ~vtkPVTransferFunction2D() override;
102 
103  // Helper members
108  double Range[4] = { 0, 0, 0, 0 };
109 
113  int OutputDimensions[2] = { 10, 10 };
114 
120  bool UpdateRange();
121 
122 private:
123  // Helper members
124  std::unique_ptr<vtkPVTransferFunction2DInternals> Internals;
125 
127  void operator=(const vtkPVTransferFunction2D) = delete;
128 };
129 
130 #endif // vtkPVTransferFunction2D_h
#define VTKREMOTINGVIEWS_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
Defines a 2D transfer function for mapping to RGBA values for volume rendering.
static vtkObject * New()
void operator=(const vtkObjectBase &)