15 #ifndef CORE_VISUALIZATION_PARAVIEW_JIT_HELPER_H_
16 #define CORE_VISUALIZATION_PARAVIEW_JIT_HELPER_H_
33 #include <vtkPointData.h>
34 #include <vtkPoints.h>
73 template <
typename T, std::
size_t N>
86 template <
typename T, std::
size_t N>
92 template <
typename T, std::
size_t N>
99 template <
typename TClass,
typename TDataMember>
101 template <
typename TTDataMember = TDataMember>
102 typename std::enable_if<!std::is_same<TTDataMember, Real3>::value>::type
103 operator()(uint64_t tid,
const std::string& dm_name, uint64_t dm_offset,
108 vtkNew<VtkArrayType> new_vtk_array;
110 new_vtk_array->Initialize(mode, dm_name, components, dm_offset);
111 auto* vtk_array = new_vtk_array.GetPointer();
112 auto* point_data = vtk_agents->
GetData(tid)->GetPointData();
113 point_data->AddArray(vtk_array);
116 template <
typename TTDataMember = TDataMember>
117 typename std::enable_if<std::is_same<TTDataMember, Real3>::value>::type
118 operator()(uint64_t tid,
const std::string& dm_name, uint64_t dm_offset,
121 vtkNew<VtkArrayType> new_vtk_array;
123 new_vtk_array->Initialize(mode, dm_name, 3, dm_offset);
124 auto* vtk_array = new_vtk_array.GetPointer();
125 if (dm_name ==
"position_") {
126 vtkNew<vtkPoints> points;
127 points->SetData(vtk_array);
128 vtk_agents->
GetData(tid)->SetPoints(points.GetPointer());
129 }
else if (dm_name ==
"mass_location_") {
132 vtkNew<vtkPoints> points;
133 points->SetData(vtk_array);
134 vtk_agents->
GetData(tid)->SetPoints(points.GetPointer());
135 vtk_agents->
GetData(tid)->GetPointData()->AddArray(vtk_array);
137 vtk_agents->
GetData(tid)->GetPointData()->AddArray(vtk_array);
144 #endif // CORE_VISUALIZATION_PARAVIEW_JIT_HELPER_H_