vtkSMTransferFunction2DProxy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
11 #ifndef vtkSMTransferFunction2DProxy_h
12 #define vtkSMTransferFunction2DProxy_h
13 
14 // ParaView includes
15 #include "vtkRemotingViewsModule.h" // needed for export macro
16 #include "vtkSMProxy.h"
17 
18 // VTK includes
19 #include <vtkImageData.h> // needed for vtkImageData
20 #include <vtkSmartPointer.h> // for ivars
21 
22 // Forward declarations
23 
25 {
26 public:
31 
33 
37  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
46  virtual bool RescaleTransferFunction(const double range[4], bool extend = false)
47  {
48  return this->RescaleTransferFunction(range[0], range[1], range[2], range[3], extend);
49  }
50  virtual bool RescaleTransferFunction(
51  double rangeXMin, double rangeXMax, double rangeYMin, double rangeYMax, bool extend = false);
52 
54 
58  static bool RescaleTransferFunction(vtkSMProxy* proxy, double rangeXMin, double rangeXMax,
59  double rangeYMin, double rangeYMax, bool extend = false);
60  static bool RescaleTransferFunction(vtkSMProxy* proxy, const double range[4], bool extend = false)
61  {
63  proxy, range[0], range[1], range[2], range[3], extend);
64  }
66 
68 
73  virtual bool RescaleTransferFunctionToDataRange(bool extend = false);
74  static bool RescaleTransferFunctionToDataRange(vtkSMProxy* proxy, bool extend = false)
75  {
77  return self ? self->RescaleTransferFunctionToDataRange(extend) : false;
78  }
80 
82 
87  virtual bool ComputeDataRange(double range[4]);
88  static bool ComputeDataRange(vtkSMProxy* proxy, double range[4])
89  {
91  return self ? self->ComputeDataRange(range) : false;
92  }
94 
96 
102  virtual vtkSmartPointer<vtkImageData> ComputeDataHistogram2D(int numberOfBins);
104  {
106  return self ? self->ComputeDataHistogram2D(numberOfBins) : nullptr;
107  }
109 
111 
115  virtual vtkImageData* GetHistogram2DCache() { return this->Histogram2DCache; }
117  {
119  return self ? self->GetHistogram2DCache() : nullptr;
120  }
122 
124 
128  virtual bool GetRange(double range[4]);
129  static bool GetRange(vtkSMProxy* proxy, double range[4])
130  {
132  return self ? self->GetRange(range) : false;
133  }
135 
140  static const int BOX_PROPERTY_SIZE = 8;
141 
142 protected:
143  vtkSMTransferFunction2DProxy() = default;
144  ~vtkSMTransferFunction2DProxy() override = default;
145 
146  // Helper members
151 
152 private:
154  void operator=(const vtkSMTransferFunction2DProxy) = delete;
155 };
156 
157 #endif // vtkSMTransferFunction2DProxy_h
static bool ComputeDataRange(vtkSMProxy *proxy, double range[4])
Helper method used by RescaleTransferFunctionToDataRange() to compute range from all visible represen...
static vtkSmartPointer< vtkImageData > ComputeDataHistogram2D(vtkSMProxy *proxy, int numberOfBins)
Helper method used to compute a 2D histogram image with provided number of bins based on the data fro...
static bool RescaleTransferFunction(vtkSMProxy *proxy, const double range[4], bool extend=false)
Safely call RescaleTransferFunction() after casting the proxy to appropriate type.
#define VTKREMOTINGVIEWS_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) override
static bool RescaleTransferFunctionToDataRange(vtkSMProxy *proxy, bool extend=false)
Locates all representations that are currently using this transfer function and then rescales the tra...
static vtkImageData * GetHistogram2DCache(vtkSMProxy *proxy)
Helper method used to recover the last histogram computed by ComputeDataHistogram2D Returns the histo...
static bool GetRange(vtkSMProxy *proxy, double range[4])
Returns current transfer function data range.
virtual bool RescaleTransferFunction(const double range[4], bool extend=false)
Rescale the control boxes for the 2D transfer function to match the new range.
vtkSMTransferFunction2DProxy is the proxy used for "TransferFunction2D".
vtkSmartPointer< vtkImageData > Histogram2DCache
Cache for the 2D histogram image.
virtual vtkImageData * GetHistogram2DCache()
Helper method used to recover the last histogram computed by ComputeDataHistogram2D Returns the histo...
static vtkSMTransferFunction2DProxy * SafeDownCast(vtkObject *o)
Standard methods for the VTK class.
static vtkSMProxy * New()
range
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
void operator=(const vtkSMProxy &)=delete