Attached Files | VTKDax.patch [^] (5,058 bytes) 2014-03-10 12:05 [Show Content] [Hide Content]diff --git a/Accelerators/Dax/vtkToDax/MarchingCubes.h b/Accelerators/Dax/vtkToDax/MarchingCubes.h
index 36ddd57..a545728 100644
--- a/Accelerators/Dax/vtkToDax/MarchingCubes.h
+++ b/Accelerators/Dax/vtkToDax/MarchingCubes.h
@@ -25,8 +25,8 @@
#include "daxToVtk/CellTypeToType.h"
#include "daxToVtk/DataSetConverters.h"
-#include <dax/cont/Scheduler.h>
-#include <dax/cont/GenerateInterpolatedCells.h>
+#include <dax/cont/DispatcherGenerateInterpolatedCells.h>
+#include <dax/cont/DispatcherMapCell.h>
#include <dax/worklet/MarchingCubes.h>
namespace
@@ -76,37 +76,19 @@ namespace vtkToDax
try
{
- //we don't want to use the custom container, so specify the default
- //container for the classification storage.
- typedef dax::cont::GenerateInterpolatedCells<
- dax::worklet::MarchingCubesGenerate> GenerateIC;
-
- // construct the scheduler that will execute all the worklets
- dax::cont::Scheduler<Adapter> scheduler;
-
- // construct the two worklets what will be used to do marching cubes
- dax::worklet::MarchingCubesClassify classifyWorklet(isoValueT);
- dax::worklet::MarchingCubesGenerate generateWorklet(isoValueT);
-
- // run the first step
- typedef typename GenerateIC::ClassifyResultType ClassifyResultType;
- ClassifyResultType classification; // array handle for the
- // first step
- // (classification)
- scheduler.Invoke(classifyWorklet,
- inGrid,
- mcHandle,
- classification);
-
- // // construct the topology generation worklet
- GenerateIC generate(classification,generateWorklet);
- generate.SetRemoveDuplicatePoints(true);
-
- // run the second step
- scheduler.Invoke(generate,
- inGrid,
- outGeom,
- mcHandle);
+ // run the first step (count)
+ dax::cont::DispatcherMapCell<dax::worklet::MarchingCubesCount>
+ countDispatcher(isoValueT);
+ dax::cont::ArrayHandle<dax::Id> countArray;
+ countDispatcher.Invoke(inGrid, mcHandle, countArray);
+
+ // run the second step (generate)
+ dax::cont::DispatcherGenerateInterpolatedCells<
+ dax::worklet::MarchingCubesGenerate> generateDispatcher(countArray,
+ isoValueT);
+ generateDispatcher.SetRemoveDuplicatePoints(true);
+
+ generateDispatcher.Invoke(inGrid, outGeom, mcHandle);
}
catch(dax::cont::ErrorControlOutOfMemory error)
{
diff --git a/Accelerators/Dax/vtkToDax/Threshold.h b/Accelerators/Dax/vtkToDax/Threshold.h
index 9becae8..b6fe379 100644
--- a/Accelerators/Dax/vtkToDax/Threshold.h
+++ b/Accelerators/Dax/vtkToDax/Threshold.h
@@ -24,8 +24,8 @@
#include "daxToVtk/CellTypeToType.h"
#include "daxToVtk/DataSetConverters.h"
-#include <dax/cont/Scheduler.h>
-#include <dax/cont/GenerateTopology.h>
+#include <dax/cont/DispatcherGenerateTopology.h>
+#include <dax/cont/DispatcherMapCell.h>
#include <dax/worklet/Threshold.h>
namespace
@@ -82,24 +82,20 @@ namespace vtkToDax
int result=1;
try
{
- //we don't want to use the custom container, so specify the default
- //container for the classification storage.
- typedef dax::cont::GenerateTopology<
- dax::worklet::ThresholdTopology> ScheduleGT;
- typedef dax::worklet::ThresholdClassify<ValueType> ThresholdClassifyType;
-
- dax::cont::Scheduler<Adapter> scheduler;
-
- typedef typename ScheduleGT::ClassifyResultType ClassifyResultType;
- ClassifyResultType classification;
-
- scheduler.Invoke(ThresholdClassifyType(thresholdMin,thresholdMax),
- inGrid, thresholdHandle, classification);
-
- ScheduleGT resolveTopology(classification);
- //remove classification resource from execution for more space
- scheduler.Invoke(resolveTopology,inGrid,outGeom);
- resolveTopology.CompactPointField(thresholdHandle,thresholdResult);
+ // run the first step (count)
+ typedef dax::worklet::ThresholdCount<ValueType> ThresholdCountType;
+ dax::cont::DispatcherMapCell<ThresholdCountType>
+ countDispatcher(ThresholdCountType(thresholdMin,thresholdMax));
+ dax::cont::ArrayHandle<dax::Id> countArray;
+ countDispatcher.Invoke(inGrid, thresholdHandle, countArray);
+
+ // run the second step (generate)
+ dax::cont::DispatcherGenerateTopology<dax::worklet::ThresholdTopology>
+ generateDispatcher(countArray);
+ generateDispatcher.Invoke(inGrid, outGeom);
+
+ // compact the point field
+ generateDispatcher.CompactPointField(thresholdHandle, thresholdResult);
}
catch(dax::cont::ErrorControlOutOfMemory error)
{
|