Commit 89b46e95 authored by Kenneth Moreland's avatar Kenneth Moreland Committed by Kitware Robot
Browse files

Merge topic 'multiblock-const-correctness'

117ce0be

 Add const correctness to MultiBlock method arguments
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1115
parents 6ad53c7b 117ce0be
......@@ -169,20 +169,20 @@ const std::vector<vtkm::cont::DataSet>& MultiBlock::GetBlocks() const
}
VTKM_CONT
void MultiBlock::AddBlock(vtkm::cont::DataSet& ds)
void MultiBlock::AddBlock(const vtkm::cont::DataSet& ds)
{
this->Blocks.insert(this->Blocks.end(), ds);
return;
}
void MultiBlock::AddBlocks(std::vector<vtkm::cont::DataSet>& mblocks)
void MultiBlock::AddBlocks(const std::vector<vtkm::cont::DataSet>& mblocks)
{
this->Blocks.insert(this->Blocks.end(), mblocks.begin(), mblocks.end());
return;
}
VTKM_CONT
void MultiBlock::InsertBlock(vtkm::Id index, vtkm::cont::DataSet& ds)
void MultiBlock::InsertBlock(vtkm::Id index, const vtkm::cont::DataSet& ds)
{
if (index <= static_cast<vtkm::Id>(this->Blocks.size()))
this->Blocks.insert(this->Blocks.begin() + index, ds);
......@@ -194,7 +194,7 @@ void MultiBlock::InsertBlock(vtkm::Id index, vtkm::cont::DataSet& ds)
}
VTKM_CONT
void MultiBlock::ReplaceBlock(vtkm::Id index, vtkm::cont::DataSet& ds)
void MultiBlock::ReplaceBlock(vtkm::Id index, const vtkm::cont::DataSet& ds)
{
if (index < static_cast<vtkm::Id>(this->Blocks.size()))
this->Blocks.at(static_cast<std::size_t>(index)) = ds;
......
......@@ -78,16 +78,16 @@ public:
const std::vector<vtkm::cont::DataSet>& GetBlocks() const;
/// add DataSet "ds" to the end of the contained DataSet vector
VTKM_CONT
void AddBlock(vtkm::cont::DataSet& ds);
void AddBlock(const vtkm::cont::DataSet& ds);
/// add DataSet "ds" to position "index" of the contained DataSet vector
VTKM_CONT
void InsertBlock(vtkm::Id index, vtkm::cont::DataSet& ds);
void InsertBlock(vtkm::Id index, const vtkm::cont::DataSet& ds);
/// replace the "index" positioned element of the contained DataSet vector with "ds"
VTKM_CONT
void ReplaceBlock(vtkm::Id index, vtkm::cont::DataSet& ds);
void ReplaceBlock(vtkm::Id index, const vtkm::cont::DataSet& ds);
/// append the DataSet vector "mblocks" to the end of the contained one
VTKM_CONT
void AddBlocks(std::vector<vtkm::cont::DataSet>& mblocks);
void AddBlocks(const std::vector<vtkm::cont::DataSet>& mblocks);
/// get the unified bounds of the same indexed coordinate system within all contained DataSet
VTKM_CONT
vtkm::Bounds GetBounds(vtkm::Id coordinate_system_index = 0) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment