File indexing completed on 2025-01-18 09:30:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_COMPUTE_INTEROP_VTK_MATRIX4X4_HPP
0012 #define BOOST_COMPUTE_INTEROP_VTK_MATRIX4X4_HPP
0013
0014 #include <vtkMatrix4x4.h>
0015
0016 #include <boost/compute/types/fundamental.hpp>
0017
0018 namespace boost {
0019 namespace compute {
0020
0021
0022 inline float16_ vtk_matrix4x4_to_float16(const vtkMatrix4x4 *matrix)
0023 {
0024 float16_ result;
0025
0026 for(int i = 0; i < 4; i++){
0027 for(int j = 0; j < 4; j++){
0028 result[i*4+j] = matrix->GetElement(i, j);
0029 }
0030 }
0031
0032 return result;
0033 }
0034
0035
0036 inline double16_ vtk_matrix4x4_to_double16(const vtkMatrix4x4 *matrix)
0037 {
0038 double16_ result;
0039 std::memcpy(&result, matrix->Element, 16 * sizeof(double));
0040 return result;
0041 }
0042
0043 }
0044 }
0045
0046 #endif