mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 18:45:43 +00:00
Add print function for generic array handles
This commit is contained in:
parent
be3a078d91
commit
001050b558
@ -162,6 +162,32 @@ inline void PrintHeader(vtkm::Id howMany, std::ostream& outStream = std::cout)
|
||||
} // PrintHeader()
|
||||
|
||||
|
||||
// base routines for reading & writing host vectors
|
||||
template <typename ARRAYTYPE>
|
||||
inline void PrintArrayHandle(std::string label,
|
||||
const ARRAYTYPE& dVec,
|
||||
vtkm::Id nValues,
|
||||
std::ostream& outStream)
|
||||
{ // PrintArrayHandle()
|
||||
// -1 means full size
|
||||
if (nValues == -1)
|
||||
{
|
||||
nValues = dVec.GetNumberOfValues();
|
||||
}
|
||||
|
||||
// print the label
|
||||
PrintLabel(label, outStream);
|
||||
|
||||
// now print the data
|
||||
auto portal = dVec.ReadPortal();
|
||||
for (vtkm::Id entry = 0; entry < nValues; entry++)
|
||||
{
|
||||
PrintDataType(portal.Get(entry), outStream);
|
||||
}
|
||||
// and an std::endl
|
||||
outStream << std::endl;
|
||||
} // PrintArrayHandle()
|
||||
|
||||
// base routines for reading & writing host vectors
|
||||
template <typename T, typename StorageType>
|
||||
inline void PrintValues(std::string label,
|
||||
|
Loading…
Reference in New Issue
Block a user