File indexing completed on 2025-12-17 09:40:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_COMPUTE_INTEROP_VTK_POINTS_HPP
0012 #define BOOST_COMPUTE_INTEROP_VTK_POINTS_HPP
0013
0014 #include <vector>
0015
0016 #include <vtkPoints.h>
0017
0018 #include <boost/compute/system.hpp>
0019 #include <boost/compute/command_queue.hpp>
0020 #include <boost/compute/algorithm/copy.hpp>
0021 #include <boost/compute/iterator/buffer_iterator.hpp>
0022
0023 namespace boost {
0024 namespace compute {
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 template<class PointType>
0035 inline void vtk_copy_points_to_buffer(const vtkPoints *points,
0036 buffer_iterator<PointType> buffer,
0037 command_queue &queue = system::default_queue())
0038 {
0039 vtkPoints *points_ = const_cast<vtkPoints *>(points);
0040
0041
0042 std::vector<PointType> tmp(points_->GetNumberOfPoints());
0043 for(vtkIdType i = 0; i < points_->GetNumberOfPoints(); i++){
0044 double *p = points_->GetPoint(i);
0045 tmp[i] = PointType(p[0], p[1], p[2], 1);
0046 }
0047
0048
0049 copy(tmp.begin(), tmp.end(), buffer, queue);
0050 }
0051
0052 }
0053 }
0054
0055 #endif