VTK
vtkPistonDataWrangling.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPistonDataWrangling.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
23 #ifndef __vtkPistonDataWrangling_h
24 #define __vtkPistonDataWrangling_h
25 
26 #define SPACE thrust::detail::default_device_space_tag
27 
28 namespace vtkpiston {
29 
31 
32 typedef struct
33 {
34  //GPU side representation of a vtkPolyData
35  //this is the sibling of vtk_image3D in piston
36  int nPoints;
37  int vertsPer;
38  thrust::device_vector<float> *points;
39  thrust::device_vector<float> *scalars;
40  thrust::device_vector<float> *normals;
41 } vtk_polydata;
42 
43 struct tuple2float3 :
44  thrust::unary_function<thrust::tuple<float, float, float>, float3>
45 {
46  __host__ __device__
47  float3 operator()(thrust::tuple<float, float, float> xyz) {
48  return make_float3((float) thrust::get<0>(xyz),
49  (float) thrust::get<1>(xyz),
50  (float) thrust::get<2>(xyz));
51  }
52 };
53 
54 struct float4tofloat3 : thrust::unary_function<float4, float3>
55 {
56  __host__ __device__
57  float3 operator()(float4 xyzw) {
58  return make_float3
59  ((float) xyzw.x,
60  (float) xyzw.y,
61  (float) xyzw.z);
62  }
63 };
64 
65 } //namespace
66 
67 #endif //__vtkPistonDataWrangling_h
68 // VTK-HeaderTest-Exclude: vtkPistonDataWrangling.h
__host__ __device__ float3 operator()(float4 xyzw)
thrust::device_vector< float > * normals
thrust::device_vector< float > * scalars
thrust::device_vector< float > * points
__host__ __device__ float3 operator()(thrust::tuple< float, float, float > xyz)
Lower level handle on GPU resident data.
void DeleteData(vtkPistonReference *)