17 #ifndef vtkToDax_DataSetConverter_h
18 #define vtkToDax_DataSetConverter_h
29 #include <dax/cont/ArrayHandle.h>
30 #include <dax/cont/UniformGrid.h>
31 #include <dax/cont/UnstructuredGrid.h>
43 template<
typename CellType>
45 std::vector<dax::Id>& topo)
47 enum{NUM_POINTS_IN_CELL=CellType::NUM_POINTS};
49 topo.reserve(size*NUM_POINTS_IN_CELL);
56 std::copy(pts,pts+npts,std::back_inserter(topo));
63 template<
typename VTKDataSetType>
68 typedef typename VTKDataSetType::DaxDataSetType DataSet;
69 double origin[3];input->
GetOrigin(origin);
75 output.SetOrigin(dax::make_Vector3(origin[0],origin[1],origin[2]));
76 output.SetSpacing(dax::make_Vector3(spacing[0],spacing[1],spacing[2]));
77 output.SetExtent(dax::make_Id3(extent[0],extent[2],extent[4]),
78 dax::make_Id3(extent[1],extent[3],extent[5]));
83 template<
typename VTKDataSetType>
88 typedef typename VTKDataSetType::DaxDataSetType DataSet;
89 double origin[3];input->
GetOrigin(origin);
95 output.SetOrigin(dax::make_Vector3(origin[0],origin[1],origin[2]));
96 output.SetSpacing(dax::make_Vector3(spacing[0],spacing[1],spacing[2]));
97 output.SetExtent(dax::make_Id3(extent[0],extent[2],extent[4]),
98 dax::make_Id3(extent[1],extent[3],extent[5]));
103 template<
typename VTKDataSetType>
110 typedef typename VTKDataSetType::DaxDataSetType DataSet;
113 static const int NUM_POINTS = VTKDataSetType::CellTypeToType::NUM_POINTS;
116 dax::cont::ArrayHandle<dax::Vector3,vtkToDax::vtkPointsContainerTag>
121 dax::cont::ArrayHandle<dax::Id,vtkToDax::vtkTopologyContainerTag<CellTypeToType> >
125 return DataSet(topoHandle,pointsHandle);
130 #endif // vtkToDax_DataSetConverter_h
vtkIdType GetNumberOfPoints() override
See vtkDataSet for additional information.
void InitTraversal()
A cell traversal methods that is more efficient than vtkDataSet traversal methods.
void convertTopology(vtkUnstructuredGrid *input, std::vector< dax::Id > &topo)
virtual double * GetOrigin()
Set/Get the origin of the dataset.
topologically and geometrically regular array of data
dataset represents arbitrary combinations of all possible cell types
virtual double * GetSpacing()
Set the spacing (width,height,length) of the cubical cells that compose the data set.
virtual int * GetExtent()
Set/Get the extent.
vtkIdType GetNumberOfCells() override
Standard vtkDataSet methods; see vtkDataSet.h for documentation.
object to represent cell connectivity
int GetNextCell(vtkIdType &npts, vtkIdType *&pts)
A cell traversal methods that is more efficient than vtkDataSet traversal methods.
vtkCellArray * GetCells()
VTKDataSetType::DaxDataSetType dataSetConverter(vtkImageData *input, VTKDataSetType)
virtual vtkPoints * GetPoints()
Specify point array to define point coordinates.