94 vtkInformationVector **inputVector,
95 vtkInformationVector *outputVector) {
97 vtkDataSet *input = vtkDataSet::GetData(inputVector[0]);
98 vtkDataSet *output = vtkDataSet::GetData(outputVector);
100 output->ShallowCopy(input);
102 const auto inputScalarField = this->GetInputArrayToProcess(0, input);
103 if(inputScalarField ==
nullptr) {
104 this->
printErr(
"No such input scalar field");
107 auto InputType = inputScalarField->GetDataType();
109 bool const oldUseNormalization{UseNormalization};
110 if(OutputType == SupportedType::Float or OutputType == SupportedType::Double)
111 UseNormalization =
false;
113 if(InputType == VTK_CHAR) {
114 if(OutputType == SupportedType::Double)
116 else if(OutputType == SupportedType::Float)
118 else if(OutputType == SupportedType::IdType)
120 else if(OutputType == SupportedType::Int)
122 else if(OutputType == SupportedType::Short)
124 else if(OutputType == SupportedType::UnsignedShort)
126 inputScalarField, output);
127 else if(OutputType == SupportedType::UnsignedChar)
129 inputScalarField, output);
130 }
else if(InputType == VTK_DOUBLE) {
131 if(OutputType == SupportedType::Char)
133 else if(OutputType == SupportedType::Float)
135 else if(OutputType == SupportedType::IdType)
137 else if(OutputType == SupportedType::Int)
139 else if(OutputType == SupportedType::Short)
141 else if(OutputType == SupportedType::UnsignedShort)
143 inputScalarField, output);
144 else if(OutputType == SupportedType::UnsignedChar)
146 inputScalarField, output);
147 }
else if(InputType == VTK_FLOAT) {
148 if(OutputType == SupportedType::Char)
150 else if(OutputType == SupportedType::Double)
152 else if(OutputType == SupportedType::IdType)
154 else if(OutputType == SupportedType::Int)
156 else if(OutputType == SupportedType::Short)
158 else if(OutputType == SupportedType::UnsignedShort)
160 inputScalarField, output);
161 else if(OutputType == SupportedType::UnsignedChar)
163 inputScalarField, output);
164 }
else if(InputType == VTK_INT) {
165 if(OutputType == SupportedType::Char)
167 else if(OutputType == SupportedType::Double)
169 else if(OutputType == SupportedType::Float)
171 else if(OutputType == SupportedType::IdType)
173 else if(OutputType == SupportedType::Short)
175 else if(OutputType == SupportedType::UnsignedShort)
177 inputScalarField, output);
178 else if(OutputType == SupportedType::UnsignedChar)
180 inputScalarField, output);
181 }
else if(InputType == VTK_ID_TYPE) {
182 if(OutputType == SupportedType::Char)
184 else if(OutputType == SupportedType::Double)
186 else if(OutputType == SupportedType::Float)
188 else if(OutputType == SupportedType::Short)
190 else if(OutputType == SupportedType::UnsignedShort)
192 inputScalarField, output);
193 else if(OutputType == SupportedType::UnsignedChar)
195 inputScalarField, output);
196 }
else if(InputType == VTK_LONG) {
197 if(OutputType == SupportedType::Char)
199 else if(OutputType == SupportedType::Double)
201 else if(OutputType == SupportedType::Float)
203 else if(OutputType == SupportedType::IdType)
205 inputScalarField, output);
206 else if(OutputType == SupportedType::Int)
208 else if(OutputType == SupportedType::Short)
210 else if(OutputType == SupportedType::UnsignedShort)
212 inputScalarField, output);
213 else if(OutputType == SupportedType::UnsignedChar)
215 inputScalarField, output);
216 }
else if(InputType == VTK_SHORT) {
217 if(OutputType == SupportedType::Char)
219 else if(OutputType == SupportedType::Double)
221 else if(OutputType == SupportedType::Float)
223 else if(OutputType == SupportedType::IdType)
225 else if(OutputType == SupportedType::Int)
227 else if(OutputType == SupportedType::UnsignedShort)
229 inputScalarField, output);
230 else if(OutputType == SupportedType::UnsignedChar)
232 inputScalarField, output);
233 }
else if(InputType == VTK_UNSIGNED_SHORT) {
234 if(OutputType == SupportedType::Char)
236 else if(OutputType == SupportedType::Double)
238 else if(OutputType == SupportedType::Float)
240 else if(OutputType == SupportedType::IdType)
242 inputScalarField, output);
243 else if(OutputType == SupportedType::Int)
245 else if(OutputType == SupportedType::Short)
247 else if(OutputType == SupportedType::UnsignedChar)
249 inputScalarField, output);
250 }
else if(InputType == VTK_UNSIGNED_CHAR) {
251 if(OutputType == SupportedType::Char)
253 else if(OutputType == SupportedType::Double)
255 else if(OutputType == SupportedType::Float)
257 else if(OutputType == SupportedType::IdType)
259 inputScalarField, output);
260 else if(OutputType == SupportedType::Int)
262 else if(OutputType == SupportedType::Short)
264 else if(OutputType == SupportedType::UnsignedShort)
266 inputScalarField, output);
268 this->
printErr(
"Unsupported data type");
271 UseNormalization = oldUseNormalization;