Merge topic 'splitsharpedges-point-count'

aa5687512 Correct the number of points in `SplitSharpEdges` filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Abhishek Yenpure <abhi.yenpure@kitware.com>
Merge-request: !2912
This commit is contained in:
Kenneth Moreland 2022-11-02 12:49:57 +00:00 committed by Kitware Robot
commit e3f74cb482
2 changed files with 15 additions and 3 deletions

@ -475,7 +475,7 @@ public:
// Create the new cellset
CellDeepCopy::Run(oldCellset, newCellset);
CellDeepCopy::Run(oldCellset, newCellset, this->NewPointsIdArray.GetNumberOfValues());
// FIXME: Since the non const get array function is not in CellSetExplict.h,
// here I just get a non-const copy of the array handle.
auto connectivityArrayHandle = newCellset.GetConnectivityArray(vtkm::TopologyElementTagCell(),

@ -67,7 +67,8 @@ struct CellDeepCopy
typename OffsetsStorage>
VTKM_CONT static void Run(
const InCellSetType& inCellSet,
vtkm::cont::CellSetExplicit<ShapeStorage, ConnectivityStorage, OffsetsStorage>& outCellSet)
vtkm::cont::CellSetExplicit<ShapeStorage, ConnectivityStorage, OffsetsStorage>& outCellSet,
vtkm::Id numberOfPoints)
{
VTKM_IS_KNOWN_OR_UNKNOWN_CELL_SET(InCellSetType);
@ -89,10 +90,21 @@ struct CellDeepCopy
inCellSet, shapes, vtkm::cont::make_ArrayHandleGroupVecVariable(connectivity, offsets));
vtkm::cont::CellSetExplicit<ShapeStorage, ConnectivityStorage, OffsetsStorage> newCellSet;
newCellSet.Fill(inCellSet.GetNumberOfPoints(), shapes, connectivity, offsets);
newCellSet.Fill(numberOfPoints, shapes, connectivity, offsets);
outCellSet = newCellSet;
}
template <typename InCellSetType,
typename ShapeStorage,
typename ConnectivityStorage,
typename OffsetsStorage>
VTKM_CONT static void Run(
const InCellSetType& inCellSet,
vtkm::cont::CellSetExplicit<ShapeStorage, ConnectivityStorage, OffsetsStorage>& outCellSet)
{
Run(inCellSet, outCellSet, inCellSet.GetNumberOfPoints());
}
template <typename InCellSetType>
VTKM_CONT static vtkm::cont::CellSetExplicit<> Run(const InCellSetType& inCellSet)
{