Rename CellType to CellShape.

We have been using the term "shape" in the cell set and connectivity
classes. To be consistent, use the term "shape" for the geometric
identify of the cell everywhere.
This commit is contained in:
Kenneth Moreland 2015-08-16 12:53:44 -06:00
parent a9190e79e9
commit 5b47354058
13 changed files with 53 additions and 48 deletions

@ -23,7 +23,7 @@ include_directories(${Boost_INCLUDE_DIRS})
set(headers
BinaryPredicates.h
BinaryOperators.h
CellType.h
CellShape.h
Extent.h
ListTag.h
Math.h

@ -17,37 +17,37 @@
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtk_m_CellType_h
#define vtk_m_CellType_h
#ifndef vtk_m_CellShape_h
#define vtk_m_CellShape_h
namespace vtkm {
/// CellType stores the type of each cell. Currently these are designed to
/// match up with VTK cell types.
/// CellShapeId identifies the type of each cell. Currently these are designed
/// to match up with VTK cell types.
///
enum CellType
enum CellShapeId
{
// Linear cells
VTKM_EMPTY_CELL = 0,
VTKM_VERTEX = 1,
//VTKM_POLY_VERTEX = 2,
VTKM_LINE = 3,
//VTKM_POLY_LINE = 4,
VTKM_TRIANGLE = 5,
//VTKM_TRIANGLE_STRIP = 6,
VTKM_POLYGON = 7,
VTKM_PIXEL = 8,
VTKM_QUAD = 9,
VTKM_TETRA = 10,
VTKM_VOXEL = 11,
VTKM_HEXAHEDRON = 12,
VTKM_WEDGE = 13,
VTKM_PYRAMID = 14,
CELL_SHAPE_EMPTY = 0,
CELL_SHAPE_VERTEX = 1,
//CELL_SHAPE_POLY_VERTEX = 2,
CELL_SHAPE_LINE = 3,
//CELL_SHAPE_POLY_LINE = 4,
CELL_SHAPE_TRIANGLE = 5,
//CELL_SHAPE_TRIANGLE_STRIP = 6,
CELL_SHAPE_POLYGON = 7,
CELL_SHAPE_PIXEL = 8,
CELL_SHAPE_QUAD = 9,
CELL_SHAPE_TETRA = 10,
CELL_SHAPE_VOXEL = 11,
CELL_SHAPE_HEXAHEDRON = 12,
CELL_SHAPE_WEDGE = 13,
CELL_SHAPE_PYRAMID = 14,
VTKM_NUMBER_OF_CELL_TYPES
NUMBER_OF_CELL_SHAPES
};
} // namespace vtkm
#endif //vtk_m_CellType_h
#endif //vtk_m_CellShape_h

@ -20,7 +20,6 @@
#ifndef vtk_m_cont_CellSet_h
#define vtk_m_cont_CellSet_h
#include <vtkm/CellType.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/Field.h>
#include <vtkm/cont/LogicalStructure.h>

@ -20,6 +20,7 @@
#ifndef vtk_m_cont_CellSetExplicit_h
#define vtk_m_cont_CellSetExplicit_h
#include <vtkm/CellShape.h>
#include <vtkm/TopologyElementTag.h>
#include <vtkm/cont/CellSet.h>
#include <vtkm/cont/internal/ConnectivityExplicitInternals.h>
@ -124,7 +125,7 @@ public:
template <vtkm::IdComponent ItemTupleLength>
VTKM_CONT_EXPORT
void AddCell(vtkm::CellType cellType,
void AddCell(vtkm::CellShapeId cellType,
int numVertices,
const vtkm::Vec<vtkm::Id,ItemTupleLength> &ids)
{

@ -73,7 +73,7 @@ public:
}
VTKM_CONT_EXPORT
vtkm::CellType GetCellShape() const
vtkm::CellShapeId GetCellShape() const
{
return this->Structure.GetCellShape();
}

@ -20,7 +20,6 @@
#ifndef vtk_m_cont_DataSet_h
#define vtk_m_cont_DataSet_h
#include <vtkm/CellType.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/CoordinateSystem.h>
#include <vtkm/cont/DynamicArrayHandle.h>

@ -132,8 +132,8 @@ MakeTestDataSet::Make3DExplicitDataSet0()
//Add connectivity
std::vector<vtkm::Id> shapes;
shapes.push_back(vtkm::VTKM_TRIANGLE);
shapes.push_back(vtkm::VTKM_QUAD);
shapes.push_back(vtkm::CELL_SHAPE_TRIANGLE);
shapes.push_back(vtkm::CELL_SHAPE_QUAD);
std::vector<vtkm::Id> numindices;
numindices.push_back(3);
@ -187,8 +187,8 @@ MakeTestDataSet::Make3DExplicitDataSet1()
vtkm::cont::CellSetExplicit<> cellSet("cells", 2);
cellSet.PrepareToAddCells(2, 7);
cellSet.AddCell(vtkm::VTKM_TRIANGLE, 3, make_Vec<vtkm::Id>(0,1,2));
cellSet.AddCell(vtkm::VTKM_QUAD, 4, make_Vec<vtkm::Id>(2,1,3,4));
cellSet.AddCell(vtkm::CELL_SHAPE_TRIANGLE, 3, make_Vec<vtkm::Id>(0,1,2));
cellSet.AddCell(vtkm::CELL_SHAPE_QUAD, 4, make_Vec<vtkm::Id>(2,1,3,4));
cellSet.CompleteAddingCells();
//todo this need to be a reference/shared_ptr style class
@ -256,7 +256,11 @@ MakeTestDataSet::Make3DExplicitDataSetCowNose(double *pBounds)
cellSet.PrepareToAddCells(nPointIds/3, nPointIds);
for (vtkm::Id i=0; i<nPointIds/3; i++)
{
cellSet.AddCell(vtkm::VTKM_TRIANGLE, 3, make_Vec<vtkm::Id>(pointId[i*3], pointId[i*3+1], pointId[i*3+2]));
cellSet.AddCell(vtkm::CELL_SHAPE_TRIANGLE,
3,
make_Vec<vtkm::Id>(pointId[i*3],
pointId[i*3+1],
pointId[i*3+2]));
}
cellSet.CompleteAddingCells();

@ -18,7 +18,7 @@
// this software.
//============================================================================
#include <vtkm/CellType.h>
#include <vtkm/CellShape.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/DataSet.h>
@ -95,8 +95,9 @@ TwoDimRegularTest()
{
VTKM_TEST_ASSERT(cellSet.GetNumberOfPointsInCell(cellIndex) == 4,
"Incorrect number of cell indices");
vtkm::CellType shape = cellSet.GetCellShape();
VTKM_TEST_ASSERT(shape == vtkm::VTKM_PIXEL, "Incorrect element type.");
vtkm::CellShapeId shape = cellSet.GetCellShape();
VTKM_TEST_ASSERT(shape == vtkm::CELL_SHAPE_PIXEL,
"Incorrect element type.");
}
vtkm::exec::ConnectivityStructured<
@ -202,13 +203,14 @@ ThreeDimRegularTest()
<< std::endl << " " << error.GetMessage() << std::endl;
}
vtkm::Id numCells = cellSet.GetNumberOfCells();
vtkm::Id numCells = cellSet.GetNumberOfCells();
for (vtkm::Id cellIndex = 0; cellIndex < numCells; cellIndex++)
{
VTKM_TEST_ASSERT(cellSet.GetNumberOfPointsInCell(cellIndex) == 8,
"Incorrect number of cell indices");
vtkm::CellType shape = cellSet.GetCellShape();
VTKM_TEST_ASSERT(shape == vtkm::VTKM_VOXEL, "Incorrect element type.");
vtkm::CellShapeId shape = cellSet.GetCellShape();
VTKM_TEST_ASSERT(shape == vtkm::CELL_SHAPE_VOXEL,
"Incorrect element type.");
}
//Test regular connectivity.

@ -20,7 +20,7 @@
#ifndef vtk_m_exec_ConnectivityExplicit_h
#define vtk_m_exec_ConnectivityExplicit_h
#include <vtkm/CellType.h>
#include <vtkm/CellShape.h>
#include <vtkm/Types.h>
#include <vtkm/exec/internal/VecFromPortal.h>
@ -67,10 +67,10 @@ public:
}
VTKM_EXEC_EXPORT
vtkm::CellType GetCellShape(vtkm::Id index) const
vtkm::CellShapeId GetCellShape(vtkm::Id index) const
{
// Likewise, should Shapes be vtkm::Id or something smaller?
return static_cast<vtkm::CellType>(this->Shapes.Get(index));
return static_cast<vtkm::CellShapeId>(this->Shapes.Get(index));
}
typedef vtkm::exec::internal::VecFromPortal<ConnectivityPortalType>

@ -71,7 +71,7 @@ public:
// This needs some thought. What does cell shape mean when the to topology
// is not a cell?
VTKM_EXEC_EXPORT
vtkm::CellType GetCellShape(vtkm::Id=0) const {
vtkm::CellShapeId GetCellShape(vtkm::Id=0) const {
return Internals.GetCellShape();
}

@ -21,7 +21,7 @@
#ifndef vtk_m_internal_ConnectivityStructuredInternals_h
#define vtk_m_internal_ConnectivityStructuredInternals_h
#include <vtkm/CellType.h>
#include <vtkm/CellShape.h>
#include <vtkm/TopologyElementTag.h>
#include <vtkm/Types.h>
@ -83,7 +83,7 @@ public:
VTKM_EXEC_CONT_EXPORT
vtkm::IdComponent GetNumberOfPointsInCell() const {return NUM_POINTS_IN_CELL;}
VTKM_EXEC_CONT_EXPORT
vtkm::CellType GetCellShape() const {return VTKM_LINE;}
vtkm::CellShapeId GetCellShape() const {return CELL_SHAPE_LINE;}
VTKM_EXEC_CONT_EXPORT
vtkm::Vec<vtkm::Id,NUM_POINTS_IN_CELL> GetPointsOfCell(vtkm::Id index) const
@ -182,7 +182,7 @@ public:
VTKM_EXEC_CONT_EXPORT
vtkm::IdComponent GetNumberOfPointsInCell() const {return NUM_POINTS_IN_CELL;}
VTKM_EXEC_CONT_EXPORT
vtkm::CellType GetCellShape() const { return VTKM_PIXEL; }
vtkm::CellShapeId GetCellShape() const { return CELL_SHAPE_PIXEL; }
VTKM_EXEC_CONT_EXPORT
vtkm::Vec<vtkm::Id,NUM_POINTS_IN_CELL> GetPointsOfCell(vtkm::Id index) const
@ -319,7 +319,7 @@ public:
VTKM_EXEC_CONT_EXPORT
vtkm::IdComponent GetNumberOfPointsInCell() const {return NUM_POINTS_IN_CELL;}
VTKM_EXEC_CONT_EXPORT
vtkm::CellType GetCellShape() const { return VTKM_VOXEL; }
vtkm::CellShapeId GetCellShape() const { return CELL_SHAPE_VOXEL; }
VTKM_EXEC_CONT_EXPORT
vtkm::Vec<vtkm::Id,NUM_POINTS_IN_CELL> GetPointsOfCell(vtkm::Id index) const

@ -59,7 +59,7 @@ vtkm::cont::DataSet MakePointElevationTestDataSet()
{
for (vtkm::Id i = 0; i < dim - 1; ++i)
{
cellSet.AddCell(vtkm::VTKM_QUAD,
cellSet.AddCell(vtkm::CELL_SHAPE_QUAD,
4,
vtkm::make_Vec<vtkm::Id>(j * dim + i,
j * dim + i + 1,

@ -91,7 +91,7 @@ vtkm::cont::DataSet RunVertexClustering(vtkm::cont::DataSet &dataSet,
vtkm::cont::CellSetExplicit<> newCellSet("cells", 0);
newCellSet.Fill(
copyFromImplicit(vtkm::cont::make_ArrayHandleConstant<vtkm::Id>(vtkm::VTKM_TRIANGLE, cells)),
copyFromImplicit(vtkm::cont::make_ArrayHandleConstant<vtkm::Id>(vtkm::CELL_SHAPE_TRIANGLE, cells)),
copyFromImplicit(vtkm::cont::make_ArrayHandleConstant<vtkm::Id>(3, cells)),
copyFromVec(output_pointId3Array)
);