ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkDiscretizableColorTransferFunctionCustom.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "qPCL.h"
11 #include "vtkDiscretizableColorTransferFunction.h"
12 
13 class vtkAbstractArray;
14 class vtkDoubleArray;
15 class vtkVariantArray;
16 
18  : public vtkDiscretizableColorTransferFunction {
19 public:
22  vtkDiscretizableColorTransferFunction);
23  void PrintSelf(ostream& os, vtkIndent indent) override;
24 
26 
30  virtual void SetAnnotationsInFullSet(vtkAbstractArray* values,
31  vtkStringArray* annotations);
32  vtkGetObjectMacro(AnnotatedValuesInFullSet, vtkAbstractArray);
33  vtkGetObjectMacro(AnnotationsInFullSet, vtkStringArray);
34  virtual vtkIdType SetAnnotationInFullSet(vtkVariant value,
35  std::string annotation);
36  virtual vtkIdType SetAnnotationInFullSet(std::string value,
37  std::string annotation);
38  virtual void ResetAnnotationsInFullSet();
40 
48  void SetIndexedColorRGB(unsigned int index, const double rgb[3]) {
49  this->SetIndexedColor(index, rgb[0], rgb[1], rgb[2]);
50  }
51  void SetIndexedColorRGBA(unsigned int index, const double rgba[4]) {
52  this->SetIndexedColor(index, rgba[0], rgba[1], rgba[2]);
53  }
54 
55  void ResetActiveAnnotatedValues();
56  void SetActiveAnnotatedValue(std::string value);
57 
58  void SetNumberOfIndexedColorsInFullSet(int n);
59  int GetNumberOfIndexedColorsInFullSet();
60  void SetIndexedColorInFullSet(unsigned int index,
61  double r,
62  double g,
63  double b);
64  void GetIndexedColorInFullSet(unsigned int index, double rgb[3]);
65 
66  void SetNumberOfIndexedOpacitiesInFullSet(int n);
67  int GetNumberOfIndexedOpacitiesInFullSet();
68  void SetIndexedOpacityInFullSet(unsigned int index, double alpha);
69  void GetIndexedOpacityInFullSet(unsigned int index, double* alpha);
70 
72 
76  vtkSetMacro(UseActiveValues, bool);
77  vtkGetMacro(UseActiveValues, bool);
78  vtkBooleanMacro(UseActiveValues, bool);
80 
84  void Build() override;
85 
86 protected:
89 
90 private:
93  void operator=(const vtkDiscretizableColorTransferFunctionCustom&) = delete;
94 
96 
99  vtkAbstractArray* AnnotatedValuesInFullSet;
100  vtkStringArray* AnnotationsInFullSet;
102 
103  vtkDoubleArray* IndexedColorsInFullSet;
104  vtkDoubleArray* IndexedOpacitiesInFullSet;
105 
109  vtkVariantArray* ActiveAnnotatedValues;
110 
115  bool UseActiveValues;
116 
120  vtkTimeStamp BuildTime;
121 };
vtkGetObjectMacro(AnnotationsInFullSet, vtkStringArray)
vtkGetObjectMacro(AnnotatedValuesInFullSet, vtkAbstractArray)
static vtkDiscretizableColorTransferFunctionCustom * New()
void SetIndexedColorRGB(unsigned int index, const double rgb[3])
vtkTypeMacro(vtkDiscretizableColorTransferFunctionCustom, vtkDiscretizableColorTransferFunction)
void SetIndexedColorRGBA(unsigned int index, const double rgba[4])
normal_z rgb
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15