1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #ifndef BOOST_COMPUTE_INTEROP_VTK_MATRIX4X4_HPP
12 #define BOOST_COMPUTE_INTEROP_VTK_MATRIX4X4_HPP
14 #include <vtkMatrix4x4.h>
16 #include <boost/compute/types/fundamental.hpp>
21 /// Converts a \c vtkMatrix4x4 to a \c float16_.
22 inline float16_ vtk_matrix4x4_to_float16(const vtkMatrix4x4 *matrix)
26 for(int i = 0; i < 4; i++){
27 for(int j = 0; j < 4; j++){
28 result[i*4+j] = matrix->GetElement(i, j);
35 /// Converts a \c vtkMatrix4x4 to a \c double16_;
36 inline double16_ vtk_matrix4x4_to_double16(const vtkMatrix4x4 *matrix)
39 std::memcpy(&result, matrix->Element, 16 * sizeof(double));
43 } // end compute namespace
44 } // end boost namespace
46 #endif // BOOST_COMPUTE_INTEROP_VTK_MATRIX4X4_HPP