Skip to content

Commit

Permalink
hide implementation details
Browse files Browse the repository at this point in the history
- but into anonymous namespace, if possible
- remove dead code
  • Loading branch information
aumuell authored and DeVasconcelos committed May 2, 2024
1 parent 41da8ce commit 9eac717
Showing 1 changed file with 4 additions and 31 deletions.
35 changes: 4 additions & 31 deletions lib/vistle/vtkm/convert.cpp
Expand Up @@ -24,37 +24,6 @@

namespace vistle {

// for testing also version that returns std::vector instead of array handle
std::vector<vtkm::UInt8> vistleTypeListToVtkmShapesVector(Index numElements, const Byte *typeList)
{
std::vector<vtkm::UInt8> shapes(numElements);
for (unsigned int i = 0; i < shapes.size(); i++) {
if (typeList[i] == cell::POINT)
shapes[i] = vtkm::CELL_SHAPE_VERTEX;
else if (typeList[i] == cell::BAR)
shapes[i] = vtkm::CELL_SHAPE_LINE;
else if (typeList[i] == cell::TRIANGLE)
shapes[i] = vtkm::CELL_SHAPE_TRIANGLE;
else if (typeList[i] == cell::POLYGON)
shapes[i] = vtkm::CELL_SHAPE_POLYGON;
else if (typeList[i] == cell::QUAD)
shapes[i] = vtkm::CELL_SHAPE_QUAD;
else if (typeList[i] == cell::TETRAHEDRON)
shapes[i] = vtkm::CELL_SHAPE_TETRA;
else if (typeList[i] == cell::HEXAHEDRON)
shapes[i] = vtkm::CELL_SHAPE_HEXAHEDRON;
else if (typeList[i] == cell::PRISM)
shapes[i] = vtkm::CELL_SHAPE_WEDGE;
else if (typeList[i] == cell::PYRAMID)
shapes[i] = vtkm::CELL_SHAPE_PYRAMID;
else {
shapes.clear();
break;
}
}
return shapes;
}

VtkmTransformStatus vtkmSetGrid(vtkm::cont::DataSet &vtkmDataset, vistle::Object::const_ptr grid)
{
if (auto coords = Coords::as(grid)) {
Expand Down Expand Up @@ -245,6 +214,7 @@ VtkmTransformStatus vtkmSetGrid(vtkm::cont::DataSet &vtkmDataset, vistle::Object
return VtkmTransformStatus::SUCCESS;
}

namespace {
struct AddField {
vtkm::cont::DataSet &dataset;
const DataBase::const_ptr &object;
Expand Down Expand Up @@ -288,6 +258,7 @@ struct AddField {
handled = true;
}
};
} // namespace


VtkmTransformStatus vtkmAddField(vtkm::cont::DataSet &vtkmDataSet, const vistle::DataBase::const_ptr &field,
Expand Down Expand Up @@ -495,6 +466,7 @@ Object::ptr vtkmGetGeometry(vtkm::cont::DataSet &dataset)
}


namespace {
template<typename C>
struct Vistle;

Expand Down Expand Up @@ -572,6 +544,7 @@ struct GetArrayContents {
}
}
};
} // namespace

vistle::DataBase::ptr vtkmGetField(const vtkm::cont::DataSet &vtkmDataSet, const std::string &name)
{
Expand Down

0 comments on commit 9eac717

Please sign in to comment.