...
 
Commits (165)
......@@ -48,6 +48,8 @@ set(headers
vtkmProbe.h
vtkmThreshold.h
vtkmTriangleMeshPointNormals.h
vtkmWarpScalar.h
vtkmWarpVector.h
)
#implementation of the algorithms for cpu accelerators
......@@ -71,6 +73,8 @@ set(cpu_accelerator_srcs
vtkmProbe.cxx
vtkmThreshold.cxx
vtkmTriangleMeshPointNormals.cxx
vtkmWarpScalar.cxx
vtkmWarpVector.cxx
vtkmlib/Portals.cxx
vtkmlib/ImplicitFunctionConverter.cxx
)
......@@ -96,6 +100,8 @@ set(cuda_accelerator_srcs
vtkmProbe.cu
vtkmThreshold.cu
vtkmTriangleMeshPointNormals.cu
vtkmWarpScalar.cu
vtkmWarpVector.cu
vtkmlib/Portals.cu
vtkmlib/ImplicitFunctionConverter.cu
)
......
......@@ -17,6 +17,8 @@ vtk_add_test_cxx(vtkAcceleratorsVtkmCxxTests tests
TestVTKMThreshold.cxx
TestVTKMThreshold2.cxx
TestVTKMTriangleMeshPointNormals.cxx
TestVTKMWarpScalar.cxx
TestVTKMWarpVector.cxx
)
vtk_test_cxx_executable(vtkAcceleratorsVtkmCxxTests tests
RENDERING_FACTORY
......
//=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2012 Sandia Corporation.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmWarpScalar.h"
#include "vtkActor.h"
#include "vtkCamera.h"
#include "vtkCellData.h"
#include "vtkDataSet.h"
#include "vtkDataSetMapper.h"
#include "vtkDataArray.h"
#include "vtkFloatArray.h"
#include "vtkImageData.h"
#include "vtkNew.h"
#include "vtkPointData.h"
#include "vtkPointSet.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRegressionTestImage.h"
#include "vtkRTAnalyticSource.h"
#include "vtkSphereSource.h"
int TestVTKMWarpScalar(int argc, char* argv[])
{
vtkNew<vtkRenderer> xyplaneRen, dataNormalRen, customNormalRen;
vtkNew<vtkRenderWindow> renWin;
renWin->SetSize(900, 300);
vtkNew<vtkRenderWindowInteractor> iren;
iren->SetRenderWindow(renWin);
// Define viewport ranges
// (xmin, ymin, xmax, ymax)
double leftViewport[4] = {0.0, 0.0, 0.33, 1.0};
double centerViewport[4] = {0.33, 0.0, .66, 1.0};
double rightViewport[4] = {0.66, 0.0, 1.0, 1.0};
/// First window - xy plane
vtkSmartPointer<vtkRTAnalyticSource> xySource =
vtkSmartPointer<vtkRTAnalyticSource>::New();
xySource->SetWholeExtent(-100, 100, -100, 100, 1, 1);
xySource->SetCenter(0, 0, 0);
xySource->SetMaximum(255);
xySource->SetStandardDeviation(.5);
xySource->SetXFreq(60);
xySource->SetYFreq(30);
xySource->SetZFreq(40);
xySource->SetXMag(10);
xySource->SetYMag(18);
xySource->SetZMag(5);
xySource->SetSubsampleRate(1);
vtkNew<vtkmWarpScalar> xyWarpScalar;
xyWarpScalar->SetScaleFactor(2);
xyWarpScalar->XYPlaneOn();
xyWarpScalar->SetNormal(1, 0, 0); // should be igored
xyWarpScalar->SetInputConnection(xySource->GetOutputPort());
xyWarpScalar->Update();
vtkPointSet* points = xyWarpScalar->GetOutput();
for (vtkIdType i = 0; i < points->GetNumberOfPoints(); i++)
{
assert (points->GetPoint(i)[2] == 3.0);
if (points->GetPoint(i)[2] != 3.0)
{
std::cout << "XYPlane result is wrong at i=" << i <<std::endl;
}
}
vtkNew<vtkDataSetMapper> xyplaneMapper;
xyplaneMapper->SetInputConnection(xyWarpScalar->GetOutputPort());
vtkNew<vtkActor> xyplaneActor;
xyplaneActor->SetMapper(xyplaneMapper);
renWin->AddRenderer(xyplaneRen);
xyplaneRen->SetViewport(leftViewport);
xyplaneRen->SetBackground(0.5, 0.4, 0.3);
xyplaneRen->AddActor(xyplaneActor);
/// Second window - data normal
vtkSmartPointer<vtkSphereSource> dataNormalSource =
vtkSmartPointer<vtkSphereSource>::New();
dataNormalSource->SetRadius(100);
dataNormalSource->SetThetaResolution(20);
dataNormalSource->SetPhiResolution(20);
dataNormalSource->Update();
// Create a scalar array
auto dataNormalSourceOutput = dataNormalSource->GetOutput();
vtkNew<vtkFloatArray> scalarArray;
scalarArray->SetName("scalarfactor");
scalarArray->SetNumberOfValues(dataNormalSourceOutput->GetNumberOfPoints());
for (vtkIdType i = 0; i < dataNormalSourceOutput->GetNumberOfPoints(); i++)
{
scalarArray->SetValue(i, 2);
}
dataNormalSourceOutput->GetPointData()->AddArray(scalarArray);
vtkNew<vtkmWarpScalar> dataNormalWarpScalar;
dataNormalWarpScalar->SetScaleFactor(2);
dataNormalWarpScalar->SetInputData(dataNormalSource->GetOutput());
dataNormalWarpScalar->SetInputArrayToProcess(0,0,0,
vtkDataObject::FIELD_ASSOCIATION_POINTS, "scalarfactor");
vtkNew<vtkDataSetMapper> dataNormalMapper;
dataNormalMapper->SetInputConnection(dataNormalWarpScalar->GetOutputPort());
vtkNew<vtkActor> dataNormalActor;
dataNormalActor->SetMapper(dataNormalMapper);
renWin->AddRenderer(dataNormalRen);
dataNormalRen->SetViewport(centerViewport);
dataNormalRen->SetBackground(0.0, 0.7, 0.2);
dataNormalRen->AddActor(dataNormalActor);
/// Third window - custom normal
vtkSmartPointer<vtkRTAnalyticSource> customNormalSource =
vtkSmartPointer<vtkRTAnalyticSource>::New();
customNormalSource->SetWholeExtent(-100, 100, -100, 100, 1, 1);
customNormalSource->SetCenter(0, 0, 0);
customNormalSource->SetMaximum(255);
customNormalSource->SetStandardDeviation(.5);
customNormalSource->SetXFreq(60);
customNormalSource->SetYFreq(30);
customNormalSource->SetZFreq(40);
customNormalSource->SetXMag(10);
customNormalSource->SetYMag(18);
customNormalSource->SetZMag(5);
customNormalSource->SetSubsampleRate(1);
vtkNew<vtkmWarpScalar> customNormalWarpScalar;
customNormalWarpScalar->SetScaleFactor(2);
customNormalWarpScalar->SetNormal(0.333, 0.333, 0.333);
customNormalWarpScalar->SetInputConnection(customNormalSource->GetOutputPort());
vtkNew<vtkDataSetMapper> customNormalMapper;
customNormalMapper->SetInputConnection(customNormalWarpScalar->GetOutputPort());
vtkNew<vtkActor> customNormalActor;
customNormalActor->SetMapper(customNormalMapper);
renWin->AddRenderer(customNormalRen);
customNormalRen->SetViewport(rightViewport);
customNormalRen->SetBackground(0.3, 0.2, 0.5);
customNormalRen->AddActor(customNormalActor);
xyplaneRen->ResetCamera();
dataNormalRen->ResetCamera();
customNormalRen->ResetCamera();
renWin->Render();
int retVal = vtkRegressionTestImage(renWin);
if(retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
retVal = vtkRegressionTester::PASSED;
}
return (!retVal);
}
//=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2012 Sandia Corporation.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmWarpVector.h"
#include "vtkActor.h"
#include "vtkCamera.h"
#include "vtkCellData.h"
#include "vtkDataSet.h"
#include "vtkDataSetMapper.h"
#include "vtkDataArray.h"
#include "vtkFloatArray.h"
#include "vtkImageData.h"
#include "vtkNew.h"
#include "vtkPointData.h"
#include "vtkPointSet.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRegressionTestImage.h"
#include "vtkRTAnalyticSource.h"
#include "vtkSphereSource.h"
int TestVTKMWarpVector(int argc, char* argv[])
{
vtkNew<vtkRenderer> xyplaneRen, dataNormalRen;
vtkNew<vtkRenderWindow> renWin;
renWin->SetSize(600, 300);
vtkNew<vtkRenderWindowInteractor> iren;
iren->SetRenderWindow(renWin);
// Define viewport ranges
// (xmin, ymin, xmax, ymax)
double leftViewport[4] = {0.0, 0.0, 0.5, 1.0};
double centerViewport[4] = {0.5, 0.0, 1.0, 1.0};
/// First window - xy plane
vtkSmartPointer<vtkRTAnalyticSource> xySource =
vtkSmartPointer<vtkRTAnalyticSource>::New();
xySource->SetWholeExtent(-100, 100, -100, 100, 1, 1);
xySource->SetCenter(0, 0, 0);
xySource->SetMaximum(255);
xySource->SetStandardDeviation(.5);
xySource->SetXFreq(60);
xySource->SetYFreq(30);
xySource->SetZFreq(40);
xySource->SetXMag(10);
xySource->SetYMag(18);
xySource->SetZMag(10);
xySource->SetSubsampleRate(1);
xySource->Update();
vtkNew<vtkFloatArray> xyVector;
xyVector->SetNumberOfComponents(3);
xyVector->SetName("scalarVector");
xyVector->SetNumberOfTuples(xySource->GetOutput()->GetNumberOfPoints());
for(vtkIdType i = 0; i < xySource->GetOutput()->GetNumberOfPoints(); i++)
{
xyVector->SetTuple3(i, 0.0, 0.0, 1.0);
}
xySource->GetOutput()->GetPointData()->AddArray(xyVector);
vtkNew<vtkmWarpVector> xyWarpVector;
xyWarpVector->SetScaleFactor(2);
xyWarpVector->SetInputConnection(xySource->GetOutputPort());
// Create a scalarVector array
xyWarpVector->SetInputArrayToProcess(0,0,0, vtkDataObject::FIELD_ASSOCIATION_POINTS,
"scalarVector");
xyWarpVector->Update();
vtkNew<vtkDataSetMapper> xyplaneMapper;
xyplaneMapper->SetInputConnection(xyWarpVector->GetOutputPort());
vtkNew<vtkActor> xyplaneActor;
xyplaneActor->SetMapper(xyplaneMapper);
renWin->AddRenderer(xyplaneRen);
xyplaneRen->SetViewport(leftViewport);
xyplaneRen->SetBackground(0.5, 0.4, 0.3);
xyplaneRen->AddActor(xyplaneActor);
/// Second window - data normal
vtkSmartPointer<vtkSphereSource> dataNormalSource =
vtkSmartPointer<vtkSphereSource>::New();
dataNormalSource->SetRadius(100);
dataNormalSource->SetThetaResolution(20);
dataNormalSource->SetPhiResolution(20);
dataNormalSource->Update();
auto dataNormalSourceOutput = dataNormalSource->GetOutput();
vtkNew<vtkmWarpVector> dataNormalWarpVector;
dataNormalWarpVector->SetScaleFactor(5);
dataNormalWarpVector->SetInputData(dataNormalSource->GetOutput());
dataNormalWarpVector->SetInputArrayToProcess(0,0,0,
vtkDataObject::POINT, dataNormalSourceOutput->GetPointData()->GetNormals()->GetName());
vtkNew<vtkDataSetMapper> dataNormalMapper;
dataNormalMapper->SetInputConnection(dataNormalWarpVector->GetOutputPort());
vtkNew<vtkActor> dataNormalActor;
dataNormalActor->SetMapper(dataNormalMapper);
renWin->AddRenderer(dataNormalRen);
dataNormalRen->SetViewport(centerViewport);
dataNormalRen->SetBackground(0.0, 0.7, 0.2);
dataNormalRen->AddActor(dataNormalActor);
xyplaneRen->ResetCamera();
dataNormalRen->ResetCamera();
renWin->Render();
int retVal = vtkRegressionTestImage(renWin);
if(retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
retVal = vtkRegressionTester::PASSED;
}
return (!retVal);
}
6ff8298127c1dc7d83aebd8def970ffb0f33ab684357c80e4bdd0f276493c30f63d9f39c97eff7c34d96ddb6444f64fc51e1aca7517c9774febadce7810fd4ee
3e366533603d32a147baca023a6b98a6ceb92f9b4a01fe28e3cb1f1a537c6bf9dd524680b5c433563da259a36fe787791a29b56b0ebbc2b21b72d495b4f01f76
......@@ -12,19 +12,68 @@ import vtk
from vtk.numpy_interface import dataset_adapter as dsa
from vtk.numpy_interface import algorithms as algs
rt = vtk.vtkRTAnalyticSource()
def test_dataset(ds):
p2c = vtk.vtkPointDataToCellData()
p2c.SetInputData(ds)
p2c.Update()
p2c = vtk.vtkPointDataToCellData()
p2c.SetInputConnection(rt.GetOutputPort())
p2c.Update()
d1 = dsa.WrapDataObject(p2c.GetOutput())
d1 = dsa.WrapDataObject(p2c.GetOutput())
vtkm_p2c = vtk.vtkmAverageToCells()
vtkm_p2c.SetInputData(ds)
vtkm_p2c.SetInputArrayToProcess(0, 0, 0, vtk.vtkDataObject.FIELD_ASSOCIATION_POINTS, "RTData")
vtkm_p2c.Update()
vtkm_p2c = vtk.vtkmAverageToCells()
vtkm_p2c.SetInputData(rt.GetOutput())
vtkm_p2c.SetInputArrayToProcess(0, 0, 0, vtk.vtkDataObject.FIELD_ASSOCIATION_POINTS, "RTData")
vtkm_p2c.Update()
d2 = dsa.WrapDataObject(vtkm_p2c.GetOutput())
d2 = dsa.WrapDataObject(vtkm_p2c.GetOutput())
rtD1 = d1.PointData['RTData']
rtD2 = d2.PointData['RTData']
assert (algs.max(algs.abs(d1.CellData['RTData'] - d2.CellData['RTData'])) < 10E-4)
assert (algs.max(algs.abs(rtD1 - rtD2)) < 10E-4)
print("Testing simple debugging grid...")
# This dataset matches the example values in vtkmCellSetExplicit:
dbg = vtk.vtkUnstructuredGrid()
dbg.SetPoints(vtk.vtkPoints())
dbg.GetPoints().SetNumberOfPoints(7)
dbg.InsertNextCell(vtk.VTK_TRIANGLE, 3, [0, 1, 2])
dbg.InsertNextCell(vtk.VTK_QUAD, 4, [0, 1, 3, 4])
dbg.InsertNextCell(vtk.VTK_TRIANGLE, 3, [1, 3, 5])
dbg.InsertNextCell(vtk.VTK_LINE, 2, [5, 6])
dbgRt = vtk.vtkDoubleArray()
dbgRt.SetNumberOfTuples(7)
dbgRt.SetName('RTData')
dbgRt.SetValue(0, 17.40)
dbgRt.SetValue(1, 123.0)
dbgRt.SetValue(2, 28.60)
dbgRt.SetValue(3, 19.47)
dbgRt.SetValue(4, 3.350)
dbgRt.SetValue(5, 0.212)
dbgRt.SetValue(6, 1023.)
dbg.GetPointData().AddArray(dbgRt)
test_dataset(dbg)
print("Success!")
print("Testing homogeneous image data...")
source = vtk.vtkRTAnalyticSource()
source.Update()
imgData = source.GetOutput()
test_dataset(imgData)
print("Success!")
d = dsa.WrapDataObject(imgData)
rtData = d.PointData['RTData']
rtMin = algs.min(rtData)
rtMax = algs.max(rtData)
clipScalar = 0.5 * (rtMin + rtMax)
print("Testing non-homogenous unstructured grid...")
clip = vtk.vtkClipDataSet()
clip.SetInputData(imgData)
clip.SetValue(clipScalar)
clip.Update()
ugrid = clip.GetOutput()
test_dataset(ugrid)
print("Success!")
......@@ -12,23 +12,72 @@ import vtk
from vtk.numpy_interface import dataset_adapter as dsa
from vtk.numpy_interface import algorithms as algs
rt = vtk.vtkRTAnalyticSource()
def test_dataset(ds):
p2c = vtk.vtkPointDataToCellData()
p2c.SetInputData(ds)
p2c.Update()
p2c = vtk.vtkPointDataToCellData()
p2c.SetInputConnection(rt.GetOutputPort())
p2c.Update()
c2p = vtk.vtkCellDataToPointData()
c2p.SetInputConnection(p2c.GetOutputPort())
c2p.Update()
c2p = vtk.vtkCellDataToPointData()
c2p.SetInputConnection(p2c.GetOutputPort())
c2p.Update()
d1 = dsa.WrapDataObject(c2p.GetOutput())
d1 = dsa.WrapDataObject(c2p.GetOutput())
c2p = vtk.vtkmAverageToPoints()
c2p.SetInputData(p2c.GetOutput())
c2p.SetInputArrayToProcess(0, 0, 0, vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS, "RTData")
c2p.Update()
c2p = vtk.vtkmAverageToPoints()
c2p.SetInputData(p2c.GetOutput())
c2p.SetInputArrayToProcess(0, 0, 0, vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS, "RTData")
c2p.Update()
d2 = dsa.WrapDataObject(c2p.GetOutput())
d2 = dsa.WrapDataObject(c2p.GetOutput())
rtD1 = d1.PointData['RTData']
rtD2 = d2.PointData['RTData']
assert (algs.max(algs.abs(d1.PointData['RTData'] - d2.PointData['RTData'])) < 10E-4)
assert (algs.max(algs.abs(rtD1 - rtD2)) < 10E-4)
print("Testing simple debugging grid...")
# This dataset matches the example values in vtkmCellSetExplicit:
dbg = vtk.vtkUnstructuredGrid()
dbg.SetPoints(vtk.vtkPoints())
dbg.GetPoints().SetNumberOfPoints(7)
dbg.InsertNextCell(vtk.VTK_TRIANGLE, 3, [0, 1, 2])
dbg.InsertNextCell(vtk.VTK_QUAD, 4, [0, 1, 3, 4])
dbg.InsertNextCell(vtk.VTK_TRIANGLE, 3, [1, 3, 5])
dbg.InsertNextCell(vtk.VTK_LINE, 2, [5, 6])
dbgRt = vtk.vtkDoubleArray()
dbgRt.SetNumberOfTuples(7)
dbgRt.SetName('RTData')
dbgRt.SetValue(0, 17.40)
dbgRt.SetValue(1, 123.0)
dbgRt.SetValue(2, 28.60)
dbgRt.SetValue(3, 19.47)
dbgRt.SetValue(4, 3.350)
dbgRt.SetValue(5, 0.212)
dbgRt.SetValue(6, 1023.)
dbg.GetPointData().AddArray(dbgRt)
test_dataset(dbg)
print("Success!")
print("Testing homogeneous image data...")
source = vtk.vtkRTAnalyticSource()
source.Update()
imgData = source.GetOutput()
test_dataset(imgData)
print("Success!")
d = dsa.WrapDataObject(imgData)
rtData = d.PointData['RTData']
rtMin = algs.min(rtData)
rtMax = algs.max(rtData)
clipScalar = 0.5 * (rtMin + rtMax)
print("Testing non-homogenous unstructured grid...")
clip = vtk.vtkClipDataSet()
clip.SetInputData(imgData)
clip.SetValue(clipScalar)
clip.Update()
ugrid = clip.GetOutput()
test_dataset(ugrid)
print("Success!")
This diff is collapsed.
......@@ -225,6 +225,18 @@ extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
#endif
#ifdef VTKM_ENABLE_OPENMP
extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
vtkm::exec::ConnectivityVTKAOS<vtkm::cont::DeviceAdapterTagOpenMP>
vtkmCellSetExplicitAOS::PrepareForInput(vtkm::cont::DeviceAdapterTagOpenMP,
vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const;
extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
vtkm::exec::ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagOpenMP>
vtkmCellSetExplicitAOS::PrepareForInput(vtkm::cont::DeviceAdapterTagOpenMP,
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
#endif
#if defined(VTKM_ENABLE_CUDA) && defined(VTKM_CUDA)
extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
vtkm::exec::ConnectivityVTKAOS<vtkm::cont::DeviceAdapterTagCuda>
......
......@@ -21,49 +21,38 @@
#include "vtkmCellSetSingleType.h"
#include "vtkmConnectivityExec.h"
#include <vtkm/cont/ArrayHandleCast.h>
#include <vtkm/cont/ArrayHandleCounting.h>
#include <vtkm/cont/ArrayHandleConstant.h>
#include <vtkm/cont/internal/ReverseConnectivityBuilder.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/DispatcherMapField.h>
namespace
{
namespace {
class ComputeSingleTypeReverseMapping : public vtkm::worklet::WorkletMapField
// Converts [0, rconnSize) to [0, connSize), skipping cell length entries.
struct SingleTypeRConnToConn
{
vtkm::Id NumberOfPointsPerCell;
public:
ComputeSingleTypeReverseMapping(vtkm::Id numberOfPointsPerCell):
NumberOfPointsPerCell(numberOfPointsPerCell)
{
vtkm::Id PointsPerCell;
VTKM_EXEC
vtkm::Id operator()(vtkm::Id rconnIdx) const
{
return rconnIdx + 1 + (rconnIdx / this->PointsPerCell);
}
typedef void ControlSignature(FieldIn<IdType> cellIndex,
WholeArrayIn<IdType> connectivity,
WholeArrayOut<IdType> pointIds,
WholeArrayOut<IdType> cellIds);
typedef void ExecutionSignature(_1, _2, _3, _4);
typedef _1 InputDomain;
VTKM_SUPPRESS_EXEC_WARNINGS
template <typename ConnPortalType, typename PortalType>
VTKM_EXEC void operator()(const vtkm::Id& cellId,
const ConnPortalType& connectivity,
const PortalType& pointIdKey,
const PortalType& pointIdValue) const
};
// Converts a connectivity index to a cell id:
struct SingleTypeCellIdCalc
{
vtkm::Id EncodedCellSize;
VTKM_EXEC
vtkm::Id operator()(vtkm::Id connIdx) const
{
const vtkm::Id read_offset = (NumberOfPointsPerCell+1) * cellId;
const vtkm::Id write_offset = NumberOfPointsPerCell * cellId;
const vtkm::Id numIndices = connectivity.Get(read_offset);
for (vtkm::Id i = 0; i < numIndices; i++)
{
pointIdKey.Set(write_offset + i, connectivity.Get(read_offset + i + 1) );
pointIdValue.Set(write_offset + i, cellId);
}
return connIdx / this->EncodedCellSize;
}
};
} //namespace
} // end anon namespace
namespace vtkm {
namespace cont {
......@@ -124,43 +113,29 @@ typename vtkm::exec::ReverseConnectivityVTK<Device>
{
if(!this->ReverseConnectivityBuilt)
{
const vtkm::Id numberOfPoints = this->GetNumberOfPoints();
const vtkm::Id numberOfCells = this->GetNumberOfCells();
const vtkm::Id numberOfPointsPerCell = this->DetermineNumberOfPoints();
const vtkm::Id rconnSize = numberOfCells*numberOfPointsPerCell;
// create a mapping of where each key is the point id and the value
// is the cell id.
using Algorithm = vtkm::cont::DeviceAdapterAlgorithm<Device>;
vtkm::cont::ArrayHandle<vtkm::Id> pointIdKey;
// We need to allocate pointIdKey and RConn to correct length.
// which for this is equal to numberOfCells * numberOfPointsPerCell
// as the connectivity has the vtk padding per cell
pointIdKey.Allocate(rconnSize);
this->RConn.Allocate(rconnSize);
vtkm::worklet::DispatcherMapField<ComputeSingleTypeReverseMapping, Device>
dispatcher(
ComputeSingleTypeReverseMapping(this->DetermineNumberOfPoints()));
dispatcher.Invoke(vtkm::cont::make_ArrayHandleCounting<vtkm::Id>(0, 1, numberOfCells),
this->Connectivity, pointIdKey, this->RConn);
Algorithm::SortByKey(pointIdKey, this->RConn);
// now we can compute the NumIndices
vtkm::cont::ArrayHandle<vtkm::Id> reducedKeys;
Algorithm::ReduceByKey(pointIdKey,
vtkm::cont::make_ArrayHandleConstant(vtkm::IdComponent(1), rconnSize),
reducedKeys, this->RNumIndices, vtkm::Add());
// than a scan exclusive will give us the index offsets
using CastedNumIndices = vtkm::cont::ArrayHandleCast<vtkm::Id,
vtkm::cont::ArrayHandle<vtkm::IdComponent>>;
Algorithm::ScanExclusive(
CastedNumIndices(this->RNumIndices), this->RIndexOffsets);
this->NumberOfPoints = reducedKeys.GetNumberOfValues();
const SingleTypeRConnToConn rconnToConnCalc{numberOfPointsPerCell};
const SingleTypeCellIdCalc cellIdCalc{numberOfPointsPerCell + 1}; // +1 for cell length entries
vtkm::cont::internal::ReverseConnectivityBuilder builder;
builder.Run(this->Connectivity,
this->RConn,
this->RNumIndices,
this->RIndexOffsets,
rconnToConnCalc,
cellIdCalc,
numberOfPoints,
rconnSize,
Device{});
this->NumberOfPoints = this->RIndexOffsets.GetNumberOfValues();
this->ReverseConnectivityBuilt = true;
}
} // End if !RConnBuilt
//no need to have a reverse shapes array, as everything has the shape type
//of vertex
......@@ -202,5 +177,17 @@ template VTKACCELERATORSVTKM_EXPORT
vtkmCellSetSingleType::PrepareForInput(vtkm::cont::DeviceAdapterTagTBB,
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
#endif
#ifdef VTKM_ENABLE_OPENMP
template VTKACCELERATORSVTKM_EXPORT
vtkm::exec::ConnectivityVTKSingleType<vtkm::cont::DeviceAdapterTagOpenMP>
vtkmCellSetSingleType::PrepareForInput(vtkm::cont::DeviceAdapterTagOpenMP,
vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const;
template VTKACCELERATORSVTKM_EXPORT
vtkm::exec::ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagOpenMP>
vtkmCellSetSingleType::PrepareForInput(vtkm::cont::DeviceAdapterTagOpenMP,
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
#endif
}
}
......@@ -226,6 +226,18 @@ extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
#endif
#ifdef VTKM_ENABLE_OPENMP
extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
vtkm::exec::ConnectivityVTKSingleType<vtkm::cont::DeviceAdapterTagOpenMP>
vtkmCellSetSingleType::PrepareForInput(vtkm::cont::DeviceAdapterTagOpenMP,
vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const;
extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
vtkm::exec::ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagTBB>
vtkmCellSetSingleType::PrepareForInput(vtkm::cont::DeviceAdapterTagTBB,
vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const;
#endif
#if defined(VTKM_ENABLE_CUDA) && defined(VTKM_CUDA)
extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
vtkm::exec::ConnectivityVTKSingleType<vtkm::cont::DeviceAdapterTagCuda>
......
......@@ -165,5 +165,11 @@ template class ConnectivityVTKSingleType<vtkm::cont::DeviceAdapterTagTBB>;
template class ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagTBB>;
#endif
#ifdef VTKM_ENABLE_OPENMP
template class ConnectivityVTKAOS<vtkm::cont::DeviceAdapterTagOpenMP>;
template class ConnectivityVTKSingleType<vtkm::cont::DeviceAdapterTagOpenMP>;
template class ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagOpenMP>;
#endif
}
}
......@@ -31,6 +31,7 @@
#include <vtkm/cont/serial/DeviceAdapterSerial.h>
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
#include <vtkm/cont/openmp/DeviceAdapterOpenMP.h>
#include <vtkm/cont/tbb/DeviceAdapterTBB.h>
namespace vtkm {
......@@ -199,6 +200,12 @@ extern template class VTKACCELERATORSVTKM_TEMPLATE_EXPORT ConnectivityVTKSingleT
extern template class VTKACCELERATORSVTKM_TEMPLATE_EXPORT ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagTBB>;
#endif
#ifdef VTKM_ENABLE_OPENMP
extern template class VTKACCELERATORSVTKM_TEMPLATE_EXPORT ConnectivityVTKAOS<vtkm::cont::DeviceAdapterTagOpenMP>;
extern template class VTKACCELERATORSVTKM_TEMPLATE_EXPORT ConnectivityVTKSingleType<vtkm::cont::DeviceAdapterTagOpenMP>;
extern template class VTKACCELERATORSVTKM_TEMPLATE_EXPORT ReverseConnectivityVTK<vtkm::cont::DeviceAdapterTagOpenMP>;
#endif
//only when cuda is enabled, and the compiler is cuda
#if defined(VTKM_ENABLE_CUDA) && defined(VTKM_CUDA)
extern template class VTKACCELERATORSVTKM_TEMPLATE_EXPORT ConnectivityVTKAOS<vtkm::cont::DeviceAdapterTagCuda>;
......
......@@ -43,9 +43,8 @@
#ifndef vtkmProbe_h
#define vtkmProbe_h
#include <algorithm>
#include <utility>
#include <vector>
#include <string> // for std::string
#include "vtkAcceleratorsVTKmModule.h" //required for export
#include "vtkDataSetAlgorithm.h"
......
//=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2012 Sandia Corporation.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmWarpScalar.cxx"
//=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2012 Sandia Corporation.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmWarpScalar.h"
#include "vtkmConfig.h"
#include "vtkCellData.h"
#include "vtkDataSet.h"
#include "vtkImageData.h"
#include "vtkImageDataToPointSet.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkPointData.h"
#include "vtkRectilinearGrid.h"
#include "vtkRectilinearGridToPointSet.h"
#include "vtkUnstructuredGrid.h"
#include "vtkmlib/ArrayConverters.h"
#include "vtkmlib/DataSetConverters.h"
#include "vtkmlib/Storage.h"
#include "vtkmFilterPolicy.h"
#include "vtkm/cont/DataSetFieldAdd.h"
#include <vtkm/filter/WarpScalar.h>
vtkStandardNewMacro(vtkmWarpScalar)
namespace {
// This class is pretty similar to vtkmInputFilterPolicy except that it adds
// the support for ArrayHandle and ArrayHandleConstant
class vtkmWarpScalarFilterPolicy : public
vtkm::filter::PolicyBase<vtkmWarpScalarFilterPolicy>
{
public:
using FieldTypeList = tovtkm::FieldTypeInVTK;
using vecType = vtkm::Vec<vtkm::FloatDefault, 3>;
struct TypeListVTKMWarpScalarTags : vtkm::ListTagBase<
vtkm::cont::ArrayHandle<vtkm::FloatDefault>::StorageTag,
vtkm::cont::ArrayHandleConstant<vecType>::StorageTag,
vtkm::cont::ArrayHandleConstant<vtkm::FloatDefault>::StorageTag,
#if defined(VTKM_FILTER_INCLUDE_AOS)
tovtkm::vtkAOSArrayContainerTag
#endif
#if defined(VTKM_FILTER_INCLUDE_SOA)
,tovtkm::vtkSOAArrayContainerTag
#endif
>
{
};
using FieldStorageList = TypeListVTKMWarpScalarTags;
using StructuredCellSetList = tovtkm::CellListStructuredInVTK;
using UnstructuredCellSetList = tovtkm::CellListUnstructuredInVTK;
using AllCellSetList = tovtkm::CellListAllInVTK;
using CoordinateTypeList = vtkm::TypeListTagFieldVec3;
using CoordinateStorageList = tovtkm::PointListInVTK;
using DeviceAdapterList = vtkm::filter::PolicyDefault::DeviceAdapterList;
};
}
//------------------------------------------------------------------------------
vtkmWarpScalar::vtkmWarpScalar() : vtkWarpScalar()
{
}
//------------------------------------------------------------------------------
vtkmWarpScalar::~vtkmWarpScalar()
{
}
//------------------------------------------------------------------------------
int vtkmWarpScalar::RequestData(vtkInformation* vtkNotUsed(request),
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
vtkSmartPointer<vtkPointSet> input = vtkPointSet::GetData(inputVector[0]);
vtkSmartPointer<vtkPointSet> output = vtkPointSet::GetData(outputVector);
if (!input)
{
// Try converting image data.
vtkImageData *inImage = vtkImageData::GetData(inputVector[0]);
if (inImage)
{
vtkNew<vtkImageDataToPointSet> image2points;
image2points->SetInputData(inImage);
image2points->Update();
input = image2points->GetOutput();
}
}
if (!input)
{
// Try converting rectilinear grid.
vtkRectilinearGrid *inRect = vtkRectilinearGrid::GetData(inputVector[0]);
if (inRect)
{
vtkNew<vtkRectilinearGridToPointSet> rect2points;
rect2points->SetInputData(inRect);
rect2points->Update();
input = rect2points->GetOutput();
}
}
if (!input)
{
vtkErrorMacro(<< "Invalid or missing input");
return 0;
}
output->CopyStructure(input);
// Get the scalar field info
vtkDataArray* inScalars = this->GetInputArrayToProcess(0, inputVector);
int inScalarsAssociation = this->GetInputArrayAssociation(0, inputVector);
// Get the normal field info
vtkDataArray* inNormals = input->GetPointData()->GetNormals();
vtkPoints* inPts = input->GetPoints();
// InScalars is not used when XYPlane is on
if (!inPts || (!inScalars && !this->XYPlane))
{
vtkDebugMacro( << "No data to warp");
return 1;
}
try
{
vtkm::cont::DataSet in = tovtkm::Convert(input, tovtkm::FieldsFlag::PointsAndCells);
if (inScalars)
{
auto scalarFactor = tovtkm::Convert(inScalars, inScalarsAssociation);
in.AddField(scalarFactor);
}
vtkm::Id numberOfPoints = in.GetCoordinateSystem().GetData().GetNumberOfValues();
// ScaleFactor in vtk is the scalarAmount in vtk-m.
vtkm::filter::WarpScalar warpScalar(this->ScaleFactor);
warpScalar.SetUseCoordinateSystemAsField(true);
// Get/generate the normal field
if (inNormals && !this->UseNormal)
{ // DataNormal
auto inNormalsField = tovtkm::Convert(inNormals,
vtkDataObject::FIELD_ASSOCIATION_POINTS);
in.AddField(inNormalsField);
warpScalar.SetNormalField(inNormals->GetName());
}
else if (this->XYPlane)
{
using vecType = vtkm::Vec<vtkm::FloatDefault, 3>;
vecType normal = vtkm::make_Vec<vtkm::FloatDefault>(0.0, 0.0, 1.0);
vtkm::cont::ArrayHandleConstant<vecType> vectorAH =
vtkm::cont::make_ArrayHandleConstant(normal,
numberOfPoints);
vtkm::cont::DataSetFieldAdd::AddPointField(in, "zNormal", vectorAH);
warpScalar.SetNormalField("zNormal");
}
else
{
using vecType = vtkm::Vec<vtkm::FloatDefault, 3>;
vecType normal = vtkm::make_Vec<vtkm::FloatDefault>(this->Normal[0],
this->Normal[1], this->Normal[2]);
vtkm::cont::ArrayHandleConstant<vecType> vectorAH =
vtkm::cont::make_ArrayHandleConstant(normal,
numberOfPoints);
vtkm::cont::DataSetFieldAdd::AddPointField(in, "instanceNormal", vectorAH);
warpScalar.SetNormalField("instanceNormal");
}
if (this->XYPlane)
{ // Just use the z value to warp the surface. Ignore the input scalars.
std::vector<vtkm::FloatDefault> zValues;
zValues.reserve(static_cast<size_t>(input->GetNumberOfPoints()));
for (vtkIdType i = 0; i < input->GetNumberOfPoints(); i++)
{
zValues.push_back(input->GetPoints()->GetPoint(i)[2]);
}
vtkm::cont::DataSetFieldAdd::AddPointField(in, "scalarfactor", zValues);
warpScalar.SetScalarFactorField("scalarfactor");
}
else
{
warpScalar.SetScalarFactorField(std::string(inScalars->GetName()));
}
vtkmWarpScalarFilterPolicy policy;
auto result = warpScalar.Execute(in, policy);
vtkDataArray* warpScalarResult = fromvtkm::Convert(result.GetField("warpscalar",
vtkm::cont::Field::Association::POINTS));
vtkPoints* newPts = vtkPoints::New();
// Update points
newPts->SetNumberOfPoints(warpScalarResult->GetNumberOfTuples());
newPts->SetData(warpScalarResult);
output->SetPoints(newPts);
newPts->Delete();
warpScalarResult->FastDelete();
}
catch (const vtkm::cont::Error& e)
{
vtkErrorMacro(<< "VTK-m error: " << e.GetMessage());
return 0;
}
// Update ourselves and release memory
output->GetPointData()->CopyNormalsOff(); // distorted geometry
output->GetPointData()->PassData(input->GetPointData());
output->GetCellData()->CopyNormalsOff(); // distorted geometry
output->GetCellData()->PassData(input->GetCellData());
return 1;
}
//------------------------------------------------------------------------------
void vtkmWarpScalar::PrintSelf(std::ostream &os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
//=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2012 Sandia Corporation.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
/**
* @class vtkmWarpScalar
* @brief deform geometry with scalar data
*
* vtkmWarpScalar is a filter that modifies point coordinates by moving points
* along point normals by the scalar amount times the scalar factor with vtkm
* as its backend.
* Useful for creating carpet or x-y-z plots.
*
* If normals are not present in data, the Normal instance variable will
* be used as the direction along which to warp the geometry. If normals are
* present but you would like to use the Normal instance variable, set the
* UseNormal boolean to true.
*
* If XYPlane boolean is set true, then the z-value is considered to be
* a scalar value (still scaled by scale factor), and the displacement is
* along the z-axis. If scalars are also present, these are copied through
* and can be used to color the surface.
*
* Note that the filter passes both its point data and cell data to
* its output, except for normals, since these are distorted by the
* warping.
*/
#ifndef vtkmWarpScalar_h
#define vtkmWarpScalar_h
#include "vtkWarpScalar.h"
#include "vtkAcceleratorsVTKmModule.h" // required for correct export
class VTKACCELERATORSVTKM_EXPORT vtkmWarpScalar : public vtkWarpScalar
{
public:
vtkTypeMacro(vtkmWarpScalar, vtkWarpScalar)
void PrintSelf(ostream& os, vtkIndent indent) override;
static vtkmWarpScalar* New();
protected:
vtkmWarpScalar();
~vtkmWarpScalar();
int RequestData(vtkInformation* , vtkInformationVector**,
vtkInformationVector*) override;
private:
vtkmWarpScalar(const vtkmWarpScalar&) = delete;
void operator=(const vtkmWarpScalar&) = delete;
};
#endif // vtkmWarpScalar_h
// VTK-HeaderTest-Exclude: vtkmWarpScalar.h
//=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2012 Sandia Corporation.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmWarpVector.cxx"
//=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2012 Sandia Corporation.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "vtkmWarpVector.h"
#include "vtkmConfig.h"
#include "vtkCellData.h"
#include "vtkDataSet.h"
#include "vtkImageData.h"
#include "vtkImageDataToPointSet.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkPointData.h"
#include "vtkRectilinearGrid.h"
#include "vtkRectilinearGridToPointSet.h"
#include "vtkUnstructuredGrid.h"
#include "vtkmlib/ArrayConverters.h"
#include "vtkmlib/DataSetConverters.h"
#include "vtkmlib/Storage.h"
#include "vtkmFilterPolicy.h"
#include "vtkm/cont/DataSetFieldAdd.h"
#include <vtkm/filter/WarpVector.h>
vtkStandardNewMacro(vtkmWarpVector)
//------------------------------------------------------------------------------
vtkmWarpVector::vtkmWarpVector() : vtkWarpVector()
{
}
//------------------------------------------------------------------------------
vtkmWarpVector::~vtkmWarpVector()
{
}
//------------------------------------------------------------------------------
int vtkmWarpVector::RequestData(vtkInformation* vtkNotUsed(request),
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
vtkSmartPointer<vtkPointSet> input = vtkPointSet::GetData(inputVector[0]);
vtkSmartPointer<vtkPointSet> output = vtkPointSet::GetData(outputVector);
if (!input)
{
// Try converting image data.
vtkImageData *inImage = vtkImageData::GetData(inputVector[0]);
if (inImage)
{
vtkNew<vtkImageDataToPointSet> image2points;
image2points->SetInputData(inImage);
image2points->Update();
input = image2points->GetOutput();
}
}
if (!input)
{
// Try converting rectilinear grid.
vtkRectilinearGrid *inRect = vtkRectilinearGrid::GetData(inputVector[0]);
if (inRect)
{
vtkNew<vtkRectilinearGridToPointSet> rect2points;
rect2points->SetInputData(inRect);
rect2points->Update();
input = rect2points->GetOutput();
}
}
if (!input)
{
vtkErrorMacro(<< "Invalid or missing input");
return 0;
}
vtkIdType numPts = input->GetPoints()->GetNumberOfPoints();
vtkDataArray* vectors = this->GetInputArrayToProcess(0, inputVector);
int vectorsAssociation = this->GetInputArrayAssociation(0, inputVector);
if (!vectors || !numPts)
{
vtkDebugMacro(<< "no input data");
return 1;
}
output->CopyStructure(input);
try
{
vtkm::cont::DataSet in = tovtkm::Convert(input, tovtkm::FieldsFlag::PointsAndCells);
vtkm::cont::Field vectorField = tovtkm::Convert(vectors,
vectorsAssociation);
in.AddField(vectorField);
vtkmInputFilterPolicy policy;
vtkm::filter::WarpVector warpVector(this->ScaleFactor);
warpVector.SetUseCoordinateSystemAsPrimaryField("true");
warpVector.SetVectorField(vectorField.GetName(), vectorField.GetAssociation());
auto result = warpVector.Execute(in, policy);
vtkDataArray* warpVectorResult = fromvtkm::Convert(
result.GetField("warpvector",vtkm::cont::Field::Association::POINTS));
vtkNew<vtkPoints> newPts;
newPts->SetNumberOfPoints(warpVectorResult->GetNumberOfTuples());
newPts->SetData(warpVectorResult);
output->SetPoints(newPts);
warpVectorResult->FastDelete();
}
catch (const vtkm::cont::Error& e)
{
vtkErrorMacro(<< "VTK-m error: " << e.GetMessage());
return 0;
}
// Update ourselves and release memory
output->GetPointData()->CopyNormalsOff(); // distorted geometry
output->GetPointData()->PassData(input->GetPointData());
output->GetCellData()->CopyNormalsOff(); // distorted geometry
output->GetCellData()->PassData(input->GetCellData());
return 1;
}
//------------------------------------------------------------------------------
void vtkmWarpVector::PrintSelf(std::ostream &os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
//=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2012 Sandia Corporation.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
/**
* @class vtkmWarpVector
* @brief deform geometry with vector data
*
* vtkWarpVector is a filter that modifies point coordinates by moving
* points along vector times the scale factor. Useful for showing flow
* profiles or mechanical deformation.
*
* The filter passes both its point data and cell data to its output.
*/