Merge branch 'get-cell-dimensions' into 'master'

Add GetCellDimensions to CellSetStructured

There was not an easy way to get the dimensions of cells in a structured
data set. Add a method to get that.

See merge request !323
This commit is contained in:
Kenneth Moreland 2016-01-20 14:42:42 -05:00
commit 020c31caf9
2 changed files with 15 additions and 0 deletions

@ -85,6 +85,11 @@ public:
return this->Structure.GetPointDimensions();
}
SchedulingRangeType GetCellDimensions()
{
return this->Structure.GetCellDimensions();
}
VTKM_CONT_EXPORT
vtkm::IdComponent
GetNumberOfPointsInCell(vtkm::Id vtkmNotUsed(cellIndex)=0) const

@ -64,6 +64,10 @@ TwoDimUniformTest()
"Incorrect number of points");
VTKM_TEST_ASSERT(cellSet.GetNumberOfCells() == 2,
"Incorrect number of cells");
VTKM_TEST_ASSERT(cellSet.GetPointDimensions() == vtkm::Id2(3,2),
"Incorrect point dimensions");
VTKM_TEST_ASSERT(cellSet.GetCellDimensions() == vtkm::Id2(2,1),
"Incorrect cell dimensions");
// test various field-getting methods and associations
try
@ -179,6 +183,12 @@ ThreeDimUniformTest()
VTKM_TEST_ASSERT(cellSet.GetNumberOfCells() == 4,
"Incorrect number of cells");
VTKM_TEST_ASSERT(cellSet.GetPointDimensions() == vtkm::Id3(3,2,3),
"Incorrect point dimensions");
VTKM_TEST_ASSERT(cellSet.GetCellDimensions() == vtkm::Id3(2,1,2),
"Incorrect cell dimensions");
try
{
dataSet.GetField("cellvar", vtkm::cont::Field::ASSOC_CELL_SET);