VTK  9.3.1
vtkMapArrayValues.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
27 #ifndef vtkMapArrayValues_h
28 #define vtkMapArrayValues_h
29 
31 #include "vtkRenderingCoreModule.h" // For export macro
32 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkMapType;
35 class vtkVariant;
36 
37 class VTKRENDERINGCORE_EXPORT vtkMapArrayValues : public vtkPassInputTypeAlgorithm
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
43  static vtkMapArrayValues* New();
44 
46 
51  vtkSetMacro(FieldType, int);
52  vtkGetMacro(FieldType, int);
54 
56 
61  vtkSetMacro(PassArray, vtkTypeBool);
62  vtkGetMacro(PassArray, vtkTypeBool);
63  vtkBooleanMacro(PassArray, vtkTypeBool);
65 
67 
72  vtkSetMacro(FillValue, double);
73  vtkGetMacro(FillValue, double);
75 
77 
80  vtkSetStringMacro(InputArrayName);
81  vtkGetStringMacro(InputArrayName);
83 
85 
88  vtkSetStringMacro(OutputArrayName);
89  vtkGetStringMacro(OutputArrayName);
91 
93 
97  vtkGetMacro(OutputArrayType, int);
98  vtkSetMacro(OutputArrayType, int);
100 
102 
106  void AddToMap(vtkVariant from, vtkVariant to);
107  void AddToMap(int from, int to);
108  void AddToMap(int from, const char* to);
109  void AddToMap(const char* from, int to);
110  void AddToMap(const char* from, const char* to);
112 
116  void ClearMap();
117 
121  int GetMapSize();
122 
123  // Always keep NUM_ATTRIBUTE_LOCS as the last entry
125  {
126  POINT_DATA = 0,
127  CELL_DATA = 1,
128  VERTEX_DATA = 2,
129  EDGE_DATA = 3,
130  ROW_DATA = 4,
131  NUM_ATTRIBUTE_LOCS
132  };
133 
134 protected:
136  ~vtkMapArrayValues() override;
137 
139  int FillInputPortInformation(int, vtkInformation*) override;
140 
145  int MapType;
147  double FillValue;
148 
149  // PIMPL idiom to hide map implementation.
150  vtkMapType* Map;
151 
152 private:
153  vtkMapArrayValues(const vtkMapArrayValues&) = delete;
154  void operator=(const vtkMapArrayValues&) = delete;
155 };
156 
157 VTK_ABI_NAMESPACE_END
158 #endif
Map values in an input array to different values in an output array of (possibly) different type...
Superclass for algorithms that produce output of the same type as input.
Store vtkAlgorithm input/output information.
A type representing the union of many types.
Definition: vtkVariant.h:52
int vtkTypeBool
Definition: vtkABI.h:64
a simple class to control print indentation
Definition: vtkIndent.h:28
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store zero or more vtkInformation instances.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
static vtkPassInputTypeAlgorithm * New()