Commit 448cf636 authored by David Lonie's avatar David Lonie Committed by Kitware Robot

Merge topic 'generic_arrays'

adf0fff8 Use custom min/max in DataArray::GetRange on MSVC 2015.
1dabc5ce Documentation updates.
c9b41f8a Restore vtkAOSDataArrayTemplate deprecated API for compat.
133816b7 Install and document the vtkBuffer header.
5bc5cc75 Move vtkPeriodicDataArray to inherit vtkGenericDataArray.
ea2e02e2 Only use vtkArrayIterators for non-vtkDataArrays in vtkDSA.
74bd55b4 Update documentation for array classes, clean up template classes.
a025c550 Add vtkDataArray::ShallowCopy(vtkDataArray*).
...
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !776
parents 1fa83aaf adf0fff8
# This file contains macros that are used by VTK to generate the list of
# default arrays used by the vtkArrayDispatch system.
#
# There are a number of CMake variables that control the final array list. At
# the high level, the following options enable/disable predefined categories of
# arrays:
#
# - VTK_DISPATCH_AOS_ARRAYS (default: ON)
# Include vtkAOSDataArrayTemplate<ValueType> for the basic types supported
# by VTK. This should probably not be turned off.
# - VTK_DISPATCH_SOA_ARRAYS (default: OFF)
# Include vtkSOADataArrayTemplate<ValueType> for the basic types supported
# by VTK.
# - VTK_DISPATCH_TYPED_ARRAYS (default: OFF)
# Include vtkTypedDataArray<ValueType> for the basic types supported
# by VTK. This enables the old-style in-situ vtkMappedDataArray subclasses
# to be used.
#
# At a lower level, specific arrays can be added to the list individually in
# two ways:
#
# For templated classes, set the following variables:
# - vtkArrayDispatch_containers:
# List of template class names.
# - vtkArrayDispatch_[template class name]_types:
# For the specified template class, add an entry to the array list that
# instantiates the container for each type listed here.
# - vtkArrayDispatch_[template class name]_header
# Specifies the header file to include for the specified template class.
#
# Both templated and non-templated arrays can be added using these variables:
# - vtkArrayDispatch_extra_arrays:
# List of arrays to add to the list.
# - vtkArrayDispatch_extra_headers:
# List of headers to include.
#
################################ Example #######################################
#
# The cmake call below instantiates the array list that follows:
#
# cmake [path to VTK source]
# -DvtkArrayDispatch_containers="MyCustomArray1;MyCustomArray2"
# -DvtkArrayDispatch_MyCustomArray1_header="MyCustomArray1.h"
# -DvtkArrayDispatch_MyCustomArray1_types="float;double"
# -DvtkArrayDispatch_MyCustomArray2_header="MyCustomArray2.h"
# -DvtkArrayDispatch_MyCustomArray2_types="int;unsigned char"
# -DvtkArrayDispatch_extra_headers="ExtraHeader1.h;ExtraHeader2.h"
# -DvtkArrayDispatch_extra_arrays="ExtraArray1;ExtraArray2<float>;ExtraArray2<char>"
#
# Generated header:
#
# #ifndef vtkArrayDispatchArrayList_h
# #define vtkArrayDispatchArrayList_h
#
# #include "vtkTypeList.h"
# #include "MyCustomArray1.h"
# #include "MyCustomArray2.h"
# #include "vtkAOSDataArrayTemplate.h"
# #include "ExtraHeader1.h"
# #include "ExtraHeader2.h"
#
# namespace vtkArrayDispatch {
#
# typedef vtkTypeList::Unique<
# vtkTypeList_Create_21(
# MyCustomArray1<float>,
# MyCustomArray1<double>,
# MyCustomArray2<int>,
# MyCustomArray2<unsigned char>,
# vtkAOSDataArrayTemplate<char>,
# vtkAOSDataArrayTemplate<double>,
# vtkAOSDataArrayTemplate<float>,
# vtkAOSDataArrayTemplate<int>,
# vtkAOSDataArrayTemplate<long>,
# vtkAOSDataArrayTemplate<short>,
# vtkAOSDataArrayTemplate<signed char>,
# vtkAOSDataArrayTemplate<unsigned char>,
# vtkAOSDataArrayTemplate<unsigned int>,
# vtkAOSDataArrayTemplate<unsigned long>,
# vtkAOSDataArrayTemplate<unsigned short>,
# vtkAOSDataArrayTemplate<vtkIdType>,
# vtkAOSDataArrayTemplate<long long>,
# vtkAOSDataArrayTemplate<unsigned long long>,
# ExtraArray1,
# ExtraArray2<float>,
# ExtraArray2<char>
# )
# >::Result Arrays;
#
# } // end namespace vtkArrayDispatch
#
# #endif // vtkArrayDispatchArrayList_h
#
# Populate the environment so that vtk_array_dispatch_generate_array_header will
# create the array TypeList with all known array types.
macro(vtkArrayDispatch_default_array_setup)
# The default set of scalar types:
set(vtkArrayDispatch_all_types
"char"
"double"
"float"
"int"
"long"
"long long"
"short"
"signed char"
"unsigned char"
"unsigned int"
"unsigned long"
"unsigned long long"
"unsigned short"
"vtkIdType"
)
# For each container, define a header and a list of types:
if (VTK_DISPATCH_AOS_ARRAYS)
list(APPEND vtkArrayDispatch_containers vtkAOSDataArrayTemplate)
set(vtkArrayDispatch_vtkAOSDataArrayTemplate_header vtkAOSDataArrayTemplate.h)
set(vtkArrayDispatch_vtkAOSDataArrayTemplate_types
${vtkArrayDispatch_all_types}
)
endif()
if (VTK_DISPATCH_SOA_ARRAYS)
list(APPEND vtkArrayDispatch_containers vtkSOADataArrayTemplate)
set(vtkArrayDispatch_vtkSOADataArrayTemplate_header vtkSOADataArrayTemplate.h)
set(vtkArrayDispatch_vtkSOADataArrayTemplate_types
${vtkArrayDispatch_all_types}
)
endif()
if (VTK_DISPATCH_TYPED_ARRAYS)
list(APPEND vtkArrayDispatch_containers vtkTypedDataArray)
set(vtkArrayDispatch_vtkTypedDataArray_header vtkTypedDataArray.h)
set(vtkArrayDispatch_vtkTypedDataArray_types
${vtkArrayDispatch_all_types}
)
endif()
endmacro()
# Concatenates a list of strings into a single string, since string(CONCAT ...)
# is not currently available for VTK's cmake version.
# Internal method.
function(CollapseString input output)
set(temp "")
foreach(line ${input})
set(temp ${temp}${line})
endforeach()
set(${output} "${temp}" PARENT_SCOPE)
endfunction()
# Create a header that declares the vtkArrayDispatch::Arrays TypeList.
macro(vtkArrayDispatch_generate_array_header result)
set(vtkAD_headers vtkTypeList.h)
set(vtkAD_arrays)
foreach(container ${vtkArrayDispatch_containers})
list(APPEND vtkAD_headers ${vtkArrayDispatch_${container}_header})
foreach(value_type ${vtkArrayDispatch_${container}_types})
list(APPEND vtkAD_arrays "${container}<${value_type}>")
endforeach()
endforeach()
# Include externally specified headers/arrays:
list(APPEND vtkAD_headers ${vtkArrayDispatch_extra_headers})
list(APPEND vtkAD_arrays ${vtkArrayDispatch_extra_arrays})
set(temp
"// This file is autogenerated by vtkCreateArrayDispatchArrayList.cmake.\n"
"// Do not edit this file. Your changes will not be saved.\n"
"\n"
"#ifndef vtkArrayDispatchArrayList_h\n"
"#define vtkArrayDispatchArrayList_h\n"
"\n"
)
foreach(header ${vtkAD_headers})
list(APPEND temp "#include \"${header}\"\n")
endforeach()
list(LENGTH vtkAD_arrays vtkAD_numArrays)
list(APPEND temp
"\n"
"namespace vtkArrayDispatch {\n"
"\n"
"typedef vtkTypeList::Unique<\n"
" vtkTypeList_Create_${vtkAD_numArrays}(\n"
)
foreach(array ${vtkAD_arrays})
list(APPEND temp " ${array},\n")
endforeach()
# Remove the final comma from the array list:
CollapseString("${temp}" temp)
string(REGEX REPLACE ",\n$" "\n" temp "${temp}")
list(APPEND temp
" )\n"
">::Result Arrays\;\n"
"\n"
"} // end namespace vtkArrayDispatch\n"
"\n"
"#endif // vtkArrayDispatchArrayList_h\n"
)
CollapseString("${temp}" ${result})
endmacro()
# This file contains functions used to generate a list of macros that are used
# to create fixed-size typelists. See vtkTypeList for details.
# Concatenates a list of strings into a single string, since string(CONCAT ...)
# is not currently available for VTK's cmake version.
# Internal method.
function(CollapseString input output)
set(temp "")
foreach(line ${input})
set(temp ${temp}${line})
endforeach()
set(${output} "${temp}" PARENT_SCOPE)
endfunction()
# Create list of numbers, start to end _inclusive_, storing the list in result.
# Internal method
function(CreateTypeListMacros_range start end result)
set(temp)
set(i ${start})
while(i LESS end OR i EQUAL end)
list(APPEND temp ${i})
math(EXPR i "${i} + 1")
endwhile()
set(${result} ${temp} PARENT_SCOPE)
endfunction()
# Creates a macro for case n = 1
# Internal method
function(CreateTypeListMacros_create_macro_1 macroPrefix typeList nullType result)
set(temp
"#define ${macroPrefix}_1(t1) \\\n"
" ${typeList}<t1, ${nullType} >\n"
)
CollapseString("${temp}" temp)
set(${result} ${temp} PARENT_SCOPE)
endfunction()
# Creates a macro for case ${num}, where ${num} > 1
# Internal method
function(CreateTypeListMacros_create_macro num macroPrefix typeList nullType result)
set(nums)
CreateTypeListMacros_range(2 ${num} nums)
math(EXPR lastNum "${num} - 1")
set(decl "#define ${macroPrefix}_${num}")
set(macroArgs "t1")
set(lastMacroArgs "")
set(delim "")
foreach(i ${nums})
set(macroArgs "${macroArgs}, t${i}")
set(lastMacroArgs "${lastMacroArgs}${delim}t${i}")
set(delim ", ")
endforeach()
set(temp
"${decl}(${macroArgs}) \\\n"
" ${typeList}<t1, \\\n"
" ${macroPrefix}_${lastNum}(${lastMacroArgs}) >\n"
)
CollapseString("${temp}" temp)
set(${result} ${temp} PARENT_SCOPE)
endfunction()
# This function generates a header file that generates TypeList creator macros.
#
# Usage:
# HEADER = output string variable that will contain the complete header.
# MAX_SIZE = largest typelist macro to create.
# MACRO_PREFIX = prefix to use for macro names
# TYPELIST_T = type for TypeList implementation
# NULLTYPE_T = type for NullType implementation
#
# The output is generated to look like:
#
# #define ${MACRO_PREFIX}_1(t1) \
# ${TYPELIST_T}<t1, ${NULLTYPE_T} >
# #define ${MACRO_PREFIX}_2(t1, t2) \
# ${TYPELIST_T}<t1, \
# ${MACRO_PREFIX}_1(t2)
# #define ${MACRO_PREFIX}_3(t1, t2, t3) \
# ${TYPELIST_T}<t1, \
# ${MACRO_PREFIX}_2(t2, t3)
# And so on, up to ${MACRO_PREFIX}_${MAX_SIZE}.
function(CreateTypeListMacros HEADER MAX_SIZE MACRO_PREFIX TYPELIST_T
NULLTYPE_T)
set(temp "")
set(result
"// This file is autogenerated by vtkCreateTypeListMacros.cmake.\n"
"// Do not edit this file, your changes will not be saved.\n"
"\n"
"#ifndef vtkTypeListMacros_h\n"
"#define vtkTypeListMacros_h\n"
"\n"
"#include \"vtkTypeList.h\"\n"
"\n"
)
set(nums "")
CreateTypeListMacros_range(2 ${MAX_SIZE} nums)
CreateTypeListMacros_create_macro_1(
"${MACRO_PREFIX}"
"${TYPELIST_T}"
"${NULLTYPE_T}"
temp
)
list(APPEND result ${temp})
foreach(num ${nums})
CreateTypeListMacros_create_macro(
"${num}"
"${MACRO_PREFIX}"
"${TYPELIST_T}"
"${NULLTYPE_T}"
temp
)
list(APPEND result ${temp})
endforeach()
list(APPEND result "\n#endif // vtkTypeListMacros_h")
CollapseString("${result}" result)
set(${HEADER} "${result}" PARENT_SCOPE)
endfunction()
......@@ -230,9 +230,9 @@ void vtkPlot3D::SetColors(vtkDataArray *colorArr)
double value = colorArr->GetComponent(i, 0);
unsigned char *rgb = lookupTable->MapValue(value);
const unsigned char constRGB[3] = { rgb[0], rgb[1], rgb[2] };
this->Colors->InsertNextTupleValue(&constRGB[0]);
this->Colors->InsertNextTupleValue(&constRGB[1]);
this->Colors->InsertNextTupleValue(&constRGB[2]);
this->Colors->InsertNextTypedTuple(&constRGB[0]);
this->Colors->InsertNextTypedTuple(&constRGB[1]);
this->Colors->InsertNextTypedTuple(&constRGB[2]);
}
this->Modified();
......
This diff is collapsed.
......@@ -144,7 +144,7 @@ bool vtkPlotParallelCoordinates::Paint(vtkContext2D *painter)
selectionSize = this->Selection->GetNumberOfTuples();
if (selectionSize)
{
this->Selection->GetTupleValue(selection, &id);
this->Selection->GetTypedTuple(selection, &id);
}
}
......@@ -187,7 +187,7 @@ bool vtkPlotParallelCoordinates::Paint(vtkContext2D *painter)
{
for (size_t j = 0; j < cols; ++j)
{
this->Selection->GetTupleValue(i, &id);
this->Selection->GetTypedTuple(i, &id);
line[j].Set(this->Storage->AxisPos[j], (*this->Storage)[j][id]);
}
painter->DrawPoly(line[0].GetData(), static_cast<int>(cols));
......@@ -233,7 +233,7 @@ bool vtkPlotParallelCoordinates::SetSelectionRange(int axis, float low,
for (vtkIdType i = 0; i < this->Selection->GetNumberOfTuples(); ++i)
{
vtkIdType id = 0;
this->Selection->GetTupleValue(i, &id);
this->Selection->GetTypedTuple(i, &id);
if (col[id] >= low && col[id] <= high)
{
// Remove this point - no longer selected
......
......@@ -237,9 +237,9 @@ void vtkPlotSurface::InsertSurfaceVertex(float *data, float value, int i,
unsigned char *rgb = this->LookupTable->MapValue(data[pos-1]);
const unsigned char constRGB[3] = { rgb[0], rgb[1], rgb[2] };
this->Colors->InsertNextTupleValue(&constRGB[0]);
this->Colors->InsertNextTupleValue(&constRGB[1]);
this->Colors->InsertNextTupleValue(&constRGB[2]);
this->Colors->InsertNextTypedTuple(&constRGB[0]);
this->Colors->InsertNextTypedTuple(&constRGB[1]);
this->Colors->InsertNextTypedTuple(&constRGB[2]);
}
//-----------------------------------------------------------------------------
......
......@@ -98,14 +98,51 @@ endforeach()
list(APPEND VTK_SMP_HEADERS vtkSMPTools.h vtkSMPThreadLocalObject.h)
#-------------------------------------------------------------------------------
# Generate the vtkTypeList_Create macros:
include(vtkCreateTypeListMacros)
CreateTypeListMacros(
VTK_TYPELISTMACRO_HEADER_CONTENTS
99
vtkTypeList_Create
"vtkTypeList::TypeList"
"vtkTypeList::NullType"
)
configure_file(vtkTypeListMacros.h.in vtkTypeListMacros.h)
#-------------------------------------------------------------------------------
# And the ArrayDispatch array list header:
option(VTK_DISPATCH_AOS_ARRAYS
"Include array-of-structs vtkDataArray subclasses in dispatcher."
ON
)
option(VTK_DISPATCH_SOA_ARRAYS
"Include struct-of-arrays vtkDataArray subclasses in dispatcher."
OFF
)
option(VTK_DISPATCH_TYPED_ARRAYS
"Include vtkTypedDataArray subclasses (e.g. old mapped arrays) in dispatcher."
OFF
)
include(vtkCreateArrayDispatchArrayList)
vtkArrayDispatch_default_array_setup()
vtkArrayDispatch_generate_array_header(VTK_ARRAYDISPATCH_ARRAY_LIST)
configure_file(vtkArrayDispatchArrayList.h.in vtkArrayDispatchArrayList.h)
option(VTK_WARN_ON_DISPATCH_FAILURE
"If enabled, vtkArrayDispatch will print a warning when a dispatch fails."
OFF
)
#-----------------------------------------------------------------------------
include_directories(${VTK_SOURCE_DIR}/ThirdParty/utf8/source)
SET(Module_SRCS
vtkAbstractArray.cxx
vtkAnimationCue.cxx
vtkAngularPeriodicDataArray.txx
vtkAnimationCue.cxx
vtkAOSDataArrayTemplate.txx
vtkArrayCoordinates.cxx
vtkArray.cxx
vtkArrayExtents.cxx
......@@ -200,6 +237,8 @@ SET(Module_SRCS
vtkSignedCharArray.cxx
vtkSimpleCriticalSection.cxx
vtkSmartPointerBase.cxx
vtkSOADataArrayTemplate.txx
vtkSOADataArrayTemplateInstantiate.cxx
vtkSortDataArray.cxx
vtkStdString.cxx
vtkStringArray.cxx
......@@ -221,8 +260,6 @@ SET(Module_SRCS
vtkWeakPointerBase.cxx
vtkWindow.cxx
vtkXMLFileOutputWindow.cxx
vtkDataArrayTemplate.txx
vtkDataArrayTemplateHelper.cxx
vtkDenseArray.txx
vtkSparseArray.txx
vtkTypedArray.txx
......@@ -239,19 +276,27 @@ SET(Module_SRCS
set(${vtk-module}_HDRS
vtkABI.h
vtkAngularPeriodicDataArray.h
vtkArrayDispatch.h
vtkArrayDispatch.txx
vtkArrayInterpolate.h
vtkArrayInterpolate.txx
vtkArrayIteratorIncludes.h
vtkArrayIteratorTemplate.h
vtkArrayIteratorTemplate.txx
vtkArrayIteratorTemplateImplicit.txx
vtkArrayIteratorTemplate.txx
vtkArrayPrint.h
vtkArrayPrint.txx
vtkAssume.h
vtkAtomicTypeConcepts.h
vtkAtomicTypes.h
vtkAutoInit.h
vtkBuffer.h
vtkDataArrayAccessor.h
vtkDataArrayIteratorMacro.h
vtkDataArrayTemplateImplicit.txx
vtkDataArrayTemplate.h
vtkGenericDataArray.h
vtkGenericDataArrayLookupHelper.h
vtkGenericDataArray.txx
vtkIOStream.h
vtkIOStreamFwd.h
vtkInformationInternals.h
......@@ -261,7 +306,11 @@ set(${vtk-module}_HDRS
vtkPeriodicDataArray.h
vtkSetGet.h
vtkSmartPointer.h
vtkSOADataArrayTemplate.h
vtkSOADataArrayTemplate.txx
vtkTemplateAliasMacro.h
vtkTypeList.h
vtkTypeList.txx
vtkTypeTraits.h
vtkTypedDataArray.h
vtkTypedDataArrayIterator.h
......@@ -272,7 +321,9 @@ set(${vtk-module}_HDRS
vtkWeakPointer.h
vtkWin32Header.h
vtkWindows.h
${CMAKE_CURRENT_BINARY_DIR}/vtkArrayDispatchArrayList.h
${CMAKE_CURRENT_BINARY_DIR}/vtkToolkits.h
${CMAKE_CURRENT_BINARY_DIR}/vtkTypeListMacros.h
)
if(vtkCommonDataModel_ENABLED)
......@@ -488,9 +539,9 @@ configure_file(
set_source_files_properties(
# vtkObjectBase is marked ABSTRACT so that instantiators are happy.
vtkAbstractArray
vtkArray
vtkArrayIterator
vtkArrayIteratorTemplate
vtkArray
vtkCallbackCommand
vtkCommand
vtkCommonInformationKeyManager
......@@ -528,6 +579,8 @@ set_source_files_properties(
)
set_source_files_properties(
vtkAOSDataArrayTemplate.h
vtkAOSDataArrayTemplate.txx
vtkArrayCoordinates.cxx
vtkArrayExtents.cxx
vtkArrayExtentsList.cxx
......@@ -535,6 +588,7 @@ set_source_files_properties(
vtkArrayRange.cxx
vtkArraySort.cxx
vtkArrayWeights.cxx
vtkBuffer.h
vtkBoundingBox.cxx
vtkBreakPoint.cxx
vtkCallbackCommand.cxx
......@@ -550,12 +604,14 @@ set_source_files_properties(
vtkOldStyleCallbackCommand.cxx
vtkSimpleCriticalSection.cxx
vtkSmartPointerBase.cxx
vtkSOADataArrayTemplate.h
vtkSOADataArrayTemplate.txx
vtkSOADataArrayTemplateInstantiate.cxx # Has no API
vtkStdString.cxx
vtkTimeStamp.cxx
vtkVariant.cxx
vtkWeakPointerBase.cxx
vtkUnicodeString.cxx
vtkDataArrayTemplate.h
vtkDataArrayPrivate.txx
vtkABI.h
......@@ -564,20 +620,19 @@ set_source_files_properties(
vtkArrayInterpolate.txx
vtkArrayIteratorIncludes.h
vtkArrayIteratorTemplate.h
vtkArrayIteratorTemplate.txx
vtkArrayIteratorTemplateImplicit.txx
vtkArrayIteratorTemplate.txx
vtkArrayPrint.h
vtkArrayPrint.txx
vtkAtomicTypeConcepts.h
vtkAtomicTypes.h
vtkAutoInit.h
vtkDataArrayTemplate.txx
vtkDataArrayTemplateHelper.cxx
vtkDataArrayTemplateImplicit.txx
vtkDenseArray.txx
vtkGenericDataArrayHelpers.h
vtkInformationInternals.h
vtkIOStream.h
vtkIOStreamFwd.h
vtkInformationInternals.h
vtkIOStreamFwd.h
vtkMathUtilities.h
vtkMappedDataArray.txx
vtkNew.h
......@@ -605,6 +660,7 @@ set_source_files_properties(
vtkTypeTemplate.h
${VTK_SMP_SOURCES}
${VTK_SMP_HEADERS}
"${VTK_TYPELISTMACROS_HEADER}"
WRAP_EXCLUDE
)
......@@ -612,12 +668,10 @@ set_source_files_properties(
# python uses WRAP_EXCLUDE_PYTHON and ignores WRAP_EXCLUDE
set_source_files_properties(
vtkABI.h
vtkAOSDataArrayTemplate.txx
vtkAtomic.h
vtkAutoInit.h
vtkDataArrayTemplate.txx
vtkDataArrayTemplateHelper.cxx
vtkDataArrayTemplateImplicit.txx
vtkIOStream.h
vtkIOStream.cxx
vtkIOStreamFwd.h
vtkLargeInteger.cxx
vtkOldStyleCallbackCommand.cxx
......@@ -627,6 +681,8 @@ set_source_files_properties(
vtkSetGet.h
vtkSmartPointer.h
vtkSmartPointerBase.h
vtkSOADataArrayTemplate.txx
vtkSOADataArrayTemplateInstantiate.cxx # Has no API
vtkStdString.cxx
vtkUnicodeString.cxx
vtkWeakPointer.h
......@@ -641,9 +697,15 @@ set_source_files_properties(
vtkSparseArray.h
vtkTypedArray.h
vtkTypeTemplate.h
"${VTK_TYPELISTMACROS_HEADER}"
HEADER_FILE_ONLY
)
set_source_files_properties(
vtkSOADataArrayTemplateInstantiate.cxx # Has no header
PROPERTIES SKIP_HEADER_INSTALL 1
)
# Need nsl to resolve gethostbyname on SunOS-5.8
# and socket also
if(CMAKE_SYSTEM MATCHES "SunOS.*")
......
# Add the vtkDataArrayAPI tests. These are split up to separately test each
# array class, as testing all in a single translation unit led to heavy
# memory consumption and excessively long compile times.
set(data_array_tests)
function(add_data_array_test test_name array_header array_valuetype array_type)
set(VTK_TESTDATAARRAYAPI_HEADER "${array_header}")
set(VTK_TESTDATAARRAYAPI_VALUETYPE "${array_valuetype}")
set(VTK_TESTDATAARRAYAPI_ARRAYTYPE "${array_type}")
set(VTK_TESTDATAARRAYAPI_TESTNAME "TestDataArrayAPI_${test_name}")
set(test_source "${VTK_TESTDATAARRAYAPI_TESTNAME}.cxx")
configure_file(TestDataArrayAPI.cxx.in "${test_source}")
set(data_array_tests ${data_array_tests} "${test_source}.cxx" PARENT_SCOPE)
endfunction()
# Legacy -- test that the vtkDataArrayTemplate interface still works:
if(NOT VTK_LEGACY_REMOVE)
add_data_array_test(
vtkDataArrayTemplate_LEGACY
vtkDataArrayTemplate.h
float
vtkDataArrayTemplate<float>
)
endif()
# Non-templated classes:
add_data_array_test(vtkCharArray vtkCharArray.h "char" vtkCharArray)
add_data_array_test(vtkDoubleArray vtkDoubleArray.h "double" vtkDoubleArray)
add_data_array_test(vtkFloatArray vtkFloatArray.h "float" vtkFloatArray)
add_data_array_test(vtkIntArray vtkIntArray.h "int" vtkIntArray)
add_data_array_test(vtkLongArray vtkLongArray.h "long" vtkLongArray)
add_data_array_test(vtkLongLongArray vtkLongLongArray.h "long long" vtkLongLongArray)
add_data_array_test(vtkShortArray vtkShortArray.h "short" vtkShortArray)
add_data_array_test(vtkSignedCharArray vtkSignedCharArray.h "signed char" vtkSignedCharArray)
add_data_array_test(vtkUnsignedCharArray vtkUnsignedCharArray.h "unsigned char" vtkUnsignedCharArray)
add_data_array_test(vtkUnsignedIntArray vtkUnsignedIntArray.h "unsigned int" vtkUnsignedIntArray)
add_data_array_test(vtkUnsignedLongArray vtkUnsignedLongArray.h "unsigned long" vtkUnsignedLongArray)
add_data_array_test(vtkUnsignedLongLongArray vtkUnsignedLongLongArray.h "unsigned long long" vtkUnsignedLongLongArray)
add_data_array_test(vtkUnsignedShortArray vtkUnsignedShortArray.h "unsigned short" vtkUnsignedShortArray)