Skip to content

Commit

Permalink
Enable read/write of std::size_t properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomFischer committed Feb 4, 2016
1 parent 63fd3a6 commit 5d4cfc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions InSituLib/VtkMappedMeshSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ int VtkMappedMeshSource::RequestData(vtkInformation *,
if (addProperty<double>(properties, *name)) continue;
if (addProperty<int>(properties, *name)) continue;
if (addProperty<unsigned>(properties, *name)) continue;
if (addProperty<std::size_t>(properties, *name)) continue;
if (addProperty<char>(properties, *name)) continue;

DBUG ("Mesh property \"%s\" with unknown data type.", *name->c_str());
Expand Down
7 changes: 7 additions & 0 deletions MeshLib/MeshGenerators/VtkMeshConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <vtkBitArray.h>
#include <vtkCharArray.h>
#include <vtkUnsignedCharArray.h>
#include <vtkUnsignedLongArray.h>
#include <vtkDoubleArray.h>
#include <vtkIntArray.h>

Expand Down Expand Up @@ -231,6 +232,12 @@ void VtkMeshConverter::convertArray(vtkDataArray &array, MeshLib::Properties &pr
return;
}

if (vtkUnsignedLongArray::SafeDownCast(&array))
{
VtkMeshConverter::convertTypedArray<unsigned long>(array, properties, type);
return;
}

if (vtkUnsignedIntArray::SafeDownCast(&array))
{
// MaterialIDs are assumed to be integers
Expand Down

0 comments on commit 5d4cfc5

Please sign in to comment.