VTK  9.3.0
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 
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 
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 
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
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Map values in an input array to different values in an output array of (possibly) different type.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
int GetMapSize()
Get the size of the internal map.
void ClearMap()
Clear the internal map.
void AddToMap(const char *from, int to)
Add to the internal STL map.
void AddToMap(const char *from, const char *to)
Add to the internal STL map.
void AddToMap(int from, const char *to)
Add to the internal STL map.
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
void AddToMap(vtkVariant from, vtkVariant to)
Add to the internal STL map.
~vtkMapArrayValues() override
void AddToMap(int from, int to)
Add to the internal STL map.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkMapArrayValues * New()
Superclass for algorithms that produce output of the same type as input.
A type representing the union of many types.
Definition: vtkVariant.h:53
int vtkTypeBool
Definition: vtkABI.h:64