In DataSet, add the ability to retrieve a cell set by name.
This commit is contained in:
parent
bafda6c348
commit
a9425ac1bb
@ -122,6 +122,20 @@ public:
|
||||
return this->CellSets[static_cast<std::size_t>(index)];
|
||||
}
|
||||
|
||||
VTKM_CONT_EXPORT
|
||||
vtkm::cont::DynamicCellSet GetCellSet(const std::string &name)
|
||||
const
|
||||
{
|
||||
for (std::size_t i=0; i < static_cast<size_t>(this->GetNumberOfCellSets()); ++i)
|
||||
{
|
||||
if (this->CellSets[i].GetCellSet().GetName() == name)
|
||||
{
|
||||
return this->CellSets[i];
|
||||
}
|
||||
}
|
||||
throw vtkm::cont::ErrorControlBadValue("No cell set with requested name");
|
||||
}
|
||||
|
||||
VTKM_CONT_EXPORT
|
||||
vtkm::IdComponent GetNumberOfCellSets() const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user