Skip to content
Snippets Groups Projects
Commit 6dfa7afa authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Merge pull request #865 from TomFischer/AddCharAndIntPropertiesToConverter

[MeL] Add char and bool properties to VtkMeshConverter.
parents 2097c9dc 664428e0
No related branches found
No related tags found
No related merge requests found
......@@ -98,6 +98,9 @@ int VtkMappedMeshSource::RequestData(vtkInformation *,
if (addProperty<unsigned>(*output, properties, *name))
continue;
if (addProperty<char>(*output, properties, *name))
continue;
DBUG ("Mesh property \"%s\" with unknown data type.", *name->c_str());
}
return 1;
......
......@@ -22,6 +22,8 @@
#include <vtkImageData.h>
#include <vtkPointData.h>
#include <vtkSmartPointer.h>
#include <vtkBitArray.h>
#include <vtkCharArray.h>
#include <vtkUnsignedCharArray.h>
#include <vtkDoubleArray.h>
#include <vtkIntArray.h>
......@@ -442,6 +444,18 @@ void VtkMeshConverter::convertArray(vtkDataArray &array, MeshLib::Properties &pr
return;
}
if (vtkBitArray::SafeDownCast(&array))
{
VtkMeshConverter::convertTypedArray<bool>(array, properties, type);
return;
}
if (vtkCharArray::SafeDownCast(&array))
{
VtkMeshConverter::convertTypedArray<char>(array, properties, type);
return;
}
if (vtkUnsignedIntArray::SafeDownCast(&array))
{
// MaterialIDs are assumed to be integers
......
......@@ -101,7 +101,7 @@ private:
(properties.createNewPropertyVector<T>(array_name, type, nComponents));
if (!vec)
{
WARN("vtkFloatArray %s could not be converted to PropertyVector.", array_name);
WARN("Array %s could not be converted to PropertyVector.", array_name);
return;
}
vec->reserve(nTuples*nComponents);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment