12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #ifndef BOOST_COMPUTE_INTEROP_VTK_MATRIX4X4_HPP
- #define BOOST_COMPUTE_INTEROP_VTK_MATRIX4X4_HPP
- #include <vtkMatrix4x4.h>
- #include <boost/compute/types/fundamental.hpp>
- namespace boost {
- namespace compute {
- inline float16_ vtk_matrix4x4_to_float16(const vtkMatrix4x4 *matrix)
- {
- float16_ result;
- for(int i = 0; i < 4; i++){
- for(int j = 0; j < 4; j++){
- result[i*4+j] = matrix->GetElement(i, j);
- }
- }
- return result;
- }
- inline double16_ vtk_matrix4x4_to_double16(const vtkMatrix4x4 *matrix)
- {
- double16_ result;
- std::memcpy(&result, matrix->Element, 16 * sizeof(double));
- return result;
- }
- }
- }
- #endif
|