17 #ifndef vtkToDax_CompactPointField_h
18 #define vtkToDax_CompactPointField_h
30 template<
typename DispatcherType>
38 : Dispatcher(&dispatcher), Output(output) { }
40 template<
typename InputVTKArrayType>
43 switch(inputFieldVTKArray.GetNumberOfComponents())
45 case 1:
return this->DoCompact<1>(inputFieldVTKArray);
46 case 2:
return this->DoCompact<2>(inputFieldVTKArray);
47 case 3:
return this->DoCompact<3>(inputFieldVTKArray);
48 case 4:
return this->DoCompact<4>(inputFieldVTKArray);
50 vtkGenericWarningMacro(
51 <<
"Cannot compact point array " << inputFieldVTKArray.GetName()
52 <<
" with " << inputFieldVTKArray.GetNumberOfComponents()
58 template<
int NumComponents,
typename InputVTKArrayType>
59 int DoCompact(InputVTKArrayType &inputFieldVTKArray)
63 ::DaxValueType DaxValueType;
64 typedef dax::cont::ArrayHandle<DaxValueType, ContainerTag>
66 typedef typename FieldHandleType::PortalConstControl PortalType;
68 if (inputFieldVTKArray.GetNumberOfComponents() != NumComponents)
72 vtkGenericWarningMacro(
73 <<
"vtkToDax::CompactPointField in unexpected function call.");
77 FieldHandleType daxInputField =
78 FieldHandleType(PortalType(&inputFieldVTKArray,
79 inputFieldVTKArray.GetNumberOfTuples()));
81 FieldHandleType daxOutputField;
83 this->Dispatcher->CompactPointField(daxInputField, daxOutputField);
87 inputFieldVTKArray.GetName());
95 #endif //vtkToDax_CompactPointField_h
abstract class to specify dataset behavior
CompactPointField(DispatcherType &dispatcher, vtkDataSet *output)
int operator()(InputVTKArrayType &inputFieldVTKArray)
void addPointData(vtkDataSet *output, FieldType &outputArray, const std::string &name)
DispatcherType * Dispatcher
int DoCompact(InputVTKArrayType &inputFieldVTKArray)