Commit 893fb6ed authored by David C. Lonie's avatar David C. Lonie

Refactor data array APIs.

vtkDataArray subclasses now use

ComponentValue --> TypedComponent
TupleValue --> TypedValue

for their type-specific methods.

# Conflicts:
#	Rendering/Annotation/vtkScalarBarActor.cxx
parent 9e642707
......@@ -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();
......
......@@ -203,10 +203,10 @@ private:
{
for (int compIdx = 0; compIdx < numComps; ++compIdx)
{
if (mask->GetComponentValue(tupleIdx, compIdx) != 0)
if (mask->GetTypedComponent(tupleIdx, compIdx) != 0)
{
typename ArrayT::ConstReferenceType val =
array->GetComponentValue(tupleIdx, compIdx);
typename ArrayT::ValueType val =
array->GetTypedComponent(tupleIdx, compIdx);
Result[0] = std::min(Result[0], static_cast<double>(val));
Result[1] = std::max(Result[1], static_cast<double>(val));
}
......@@ -225,8 +225,8 @@ private:
{
for (int compIdx = 0; compIdx < numComps; ++compIdx)
{
typename ArrayT::ConstReferenceType val =
array->GetComponentValue(tupleIdx, compIdx);
typename ArrayT::ValueType val =
array->GetTypedComponent(tupleIdx, compIdx);
Result[0] = std::min(Result[0], static_cast<double>(val));
Result[1] = std::max(Result[1], static_cast<double>(val));
}
......
......@@ -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]);
}
//-----------------------------------------------------------------------------
......
......@@ -43,9 +43,9 @@ int TestAngularPeriodicDataArray(int, char * [])
angularPeriodicDataArray2->SetAxis(VTK_PERIODIC_ARRAY_AXIS_Y);
double pTmp[3];
angularPeriodicDataArray->GetTupleValue(0, pTmp);
angularPeriodicDataArray->GetTypedTuple(0, pTmp);
float pTmp2[3];
angularPeriodicDataArray2->GetTupleValue(0, pTmp2);
angularPeriodicDataArray2->GetTypedTuple(0, pTmp2);
double dEpsilon = std::numeric_limits<double>::epsilon() * 20.0;
float fEpsilon = std::numeric_limits<float>::epsilon() * 20.f;
......@@ -85,7 +85,7 @@ int TestAngularPeriodicDataArray(int, char * [])
tmp[1] = 1.;
tmp[2] = 1.;
angularPeriodicDataArray2->SetCenter(tmp);
angularPeriodicDataArray2->GetTupleValue(0, pTmp2);
angularPeriodicDataArray2->GetTypedTuple(0, pTmp2);
if (std::abs(pTmp2[0] - 4.7902297) >= fEpsilon ||
std::abs(pTmp2[1] - 12.3) >= fEpsilon ||
......@@ -122,7 +122,7 @@ int TestAngularPeriodicDataArray(int, char * [])
tensorPArray->SetCenter(tmp);
double pTmp3[9];
tensorPArray->GetTupleValue(0, pTmp3);
tensorPArray->GetTypedTuple(0, pTmp3);
if (std::abs(pTmp3[0] - 2.0096597239047708783) >= dEpsilon ||
std::abs(pTmp3[1] - 13.555918489185591724) >= dEpsilon ||
std::abs(pTmp3[2] - -8.6693107531410973365) >= dEpsilon ||
......
......@@ -479,8 +479,8 @@ int Test_void_SetTuple_i_j_source()
std::vector<ScalarT> destTuple(comps);
for (vtkIdType i = 0; i < tuples; ++i)
{
source->GetTupleValue(i, &srcTuple[0]);
dest->GetTupleValue(tupleMap[i], &destTuple[0]);
source->GetTypedTuple(i, &srcTuple[0]);
dest->GetTypedTuple(tupleMap[i], &destTuple[0]);
if (!std::equal(srcTuple.begin(), srcTuple.end(), destTuple.begin()))
{
std::ostringstream srcTupleStr;
......@@ -549,8 +549,8 @@ int Test_void_InsertTuple_i_j_source()
std::vector<ScalarT> destTuple(comps);
for (vtkIdType i = 0; i < tuples; ++i)
{
source->GetTupleValue(i, &srcTuple[0]);
dest->GetTupleValue(tupleMap[i], &destTuple[0]);
source->GetTypedTuple(i, &srcTuple[0]);
dest->GetTypedTuple(tupleMap[i], &destTuple[0]);
if (!std::equal(srcTuple.begin(), srcTuple.end(), destTuple.begin()))
{
std::ostringstream srcTupleStr;
......@@ -625,8 +625,8 @@ int Test_void_InsertTuples_dstIds_srcIds_source()
{
vtkIdType srcTupleId = srcIds->GetId(t);
vtkIdType dstTupleId = dstIds->GetId(t);
src->GetTupleValue(srcTupleId, &srcTuple[0]);
dst->GetTupleValue(dstTupleId, &dstTuple[0]);
src->GetTypedTuple(srcTupleId, &srcTuple[0]);
dst->GetTypedTuple(dstTupleId, &dstTuple[0]);
DataArrayAPIAssert(std::equal(srcTuple.begin(), srcTuple.end(),
dstTuple.begin()),
"Copied tuple does not match input.");
......@@ -674,8 +674,8 @@ int Test_void_InsertTuples_dstStart_n_srcStart_source()
{
vtkIdType srcTupleId = srcStart + t;
vtkIdType dstTupleId = dstStart + t;
src->GetTupleValue(srcTupleId, &srcTuple[0]);
dst->GetTupleValue(dstTupleId, &dstTuple[0]);
src->GetTypedTuple(srcTupleId, &srcTuple[0]);
dst->GetTypedTuple(dstTupleId, &dstTuple[0]);
DataArrayAPIAssert(std::equal(srcTuple.begin(), srcTuple.end(),
dstTuple.begin()),
"Copied tuple does not match input.");
......@@ -738,8 +738,8 @@ int Test_vtkIdType_InsertNextTuple_j_source()
std::vector<ScalarT> destTuple(comps);
for (vtkIdType i = 0; i < tuples; ++i)
{
source->GetTupleValue(tupleMap[i], &srcTuple[0]);
dest->GetTupleValue(i, &destTuple[0]);
source->GetTypedTuple(tupleMap[i], &srcTuple[0]);
dest->GetTypedTuple(i, &destTuple[0]);
if (!std::equal(srcTuple.begin(), srcTuple.end(), destTuple.begin()))
{
std::ostringstream srcTupleStr;
......@@ -799,8 +799,8 @@ int Test_void_GetTuples_ptIds_output()
for (vtkIdType i = 0; i < ids->GetNumberOfIds(); ++i)
{
vtkIdType tupleIdx = ids->GetId(i);
source->GetTupleValue(tupleIdx, &srcTuple[0]);
output->GetTupleValue(i, &outTuple[0]);
source->GetTypedTuple(tupleIdx, &srcTuple[0]);
output->GetTypedTuple(i, &outTuple[0]);
if (!std::equal(srcTuple.begin(), srcTuple.end(), outTuple.begin()))
{
std::ostringstream srcTupleStr;
......@@ -860,8 +860,8 @@ int Test_void_GetTuples_p1_p2_output()
for (vtkIdType i = p1; i < outTupleCount; ++i)
{
vtkIdType tupleIdx = p1 + i;
source->GetTupleValue(tupleIdx, &srcTuple[0]);
output->GetTupleValue(i, &outTuple[0]);
source->GetTypedTuple(tupleIdx, &srcTuple[0]);
output->GetTypedTuple(i, &outTuple[0]);
if (!std::equal(srcTuple.begin(), srcTuple.end(), outTuple.begin()))
{
std::ostringstream srcTupleStr;
......@@ -901,7 +901,7 @@ int Test_voidPtr_GetVoidPointer()
{
tuple.push_back(static_cast<ScalarT>(((t * comps) + c) % 17));
}
source->SetTupleValue(t, &tuple[0]);
source->SetTypedTuple(t, &tuple[0]);
}
// Verify:
......@@ -1238,7 +1238,7 @@ int Test_int_Resize_numTuples()
{
for (int c = 0; c < comps; ++c)
{
array->SetComponentValue(t, c,
array->SetTypedComponent(t, c,
static_cast<ScalarT>((t * comps + c) % 17));
}
}
......@@ -1260,7 +1260,7 @@ int Test_int_Resize_numTuples()
for (int c = 0; c < comps; ++c)
{
ScalarT ref = static_cast<ScalarT>((t * comps + c) % 17);
ScalarT test = array->GetComponentValue(t, c);
ScalarT test = array->GetTypedComponent(t, c);
DataArrayAPIAssert(ref == test,
"Data changed after resize for tuple " << t
<< " component " << c << ": Expected " << ref
......@@ -1284,7 +1284,7 @@ int Test_int_Resize_numTuples()
for (int c = 0; c < comps; ++c)
{
ScalarT ref = static_cast<ScalarT>((t * comps + c) % 17);
ScalarT test = array->GetComponentValue(t, c);
ScalarT test = array->GetTypedComponent(t, c);
DataArrayAPIAssert(ref == test,
"Data changed after resize for tuple " << t
<< " component " << c << ": Expected " << ref
......@@ -1359,7 +1359,7 @@ int Test_void_ExportToVoidPointer_voidPtr()
{
tuple.push_back(static_cast<ScalarT>(((t * comps) + c) % 17));
}
source->SetTupleValue(t, &tuple[0]);
source->SetTypedTuple(t, &tuple[0]);
}
std::vector<ScalarT> buffer(comps * tuples);
......
......@@ -190,12 +190,12 @@ vtkSmartPointer<vtkDataArray> CreateDataArray()
//------------------Unit Test Implementations-----------------------------------
//------------------------------------------------------------------------------
// const ReferenceType GetValue(vtkIdType valueIdx) const
// ValueType GetValue(vtkIdType valueIdx) const
// No range checking/allocation.
template <typename ScalarT, typename ArrayT>
int Test_constRefT_GetValue_valueIdx_const()
int Test_valT_GetValue_valueIdx_const()
{
DataArrayAPIInit("const ReferenceType GetValue(vtkIdType valueIdx) const");
DataArrayAPIInit("ValueType GetValue(vtkIdType valueIdx) const");
DataArrayAPICreateTestArray(array);
vtkIdType comps = 9;
......@@ -212,7 +212,7 @@ int Test_constRefT_GetValue_valueIdx_const()
// Verify:
for (vtkIdType i = 0; i < comps * tuples; ++i)
{
typename ArrayT::ConstReferenceType test = array->GetValue(i);
ScalarT test = array->GetValue(i);
ScalarT ref = static_cast<ScalarT>(i % 16);
if (test != ref)
{
......@@ -224,11 +224,11 @@ int Test_constRefT_GetValue_valueIdx_const()
DataArrayAPIFinish();
}
//void GetTupleValue(vtkIdType tupleIdx, ValueType* tuple) const
//void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const
template <typename ScalarT, typename ArrayT>
int Test_void_GetTupleValue_tupleIdx_tuple()
int Test_void_GetTypedTuple_tupleIdx_tuple()
{
DataArrayAPIInit("void GetTupleValue(vtkIdType tupleIdx, ValueType *tuple)");
DataArrayAPIInit("void GetTypedTuple(vtkIdType tupleIdx, ValueType *tuple)");
DataArrayAPICreateTestArray(source);
......@@ -247,7 +247,7 @@ int Test_void_GetTupleValue_tupleIdx_tuple()
std::vector<ScalarT> tuple(comps);
for (vtkIdType tupleIdx = 0; tupleIdx < tuples; ++tupleIdx)
{
source->GetTupleValue(tupleIdx, &tuple[0]);
source->GetTypedTuple(tupleIdx, &tuple[0]);
for (int compIdx = 0; compIdx < comps; ++compIdx)
{
if (tuple[compIdx] != static_cast<ScalarT>(refValue))
......@@ -264,11 +264,11 @@ int Test_void_GetTupleValue_tupleIdx_tuple()
DataArrayAPIFinish();
}
//const ReferenceType GetComponentValue(vtkIdType tupleIdx, int comp) const
// ValueType GetTypedComponent(vtkIdType tupleIdx, int comp) const
template <typename ScalarT, typename ArrayT>
int Test_constRefT_GetComponentValue_tupleIdx_comp_const()
int Test_valT_GetTypedComponent_tupleIdx_comp_const()
{
DataArrayAPIInit("const ReferenceType GetComponentValue("
DataArrayAPIInit("ValueType GetTypedComponent("
"vtkIdType tupleIdx, int comp) const");
DataArrayAPICreateTestArray(source);
......@@ -289,11 +289,11 @@ int Test_constRefT_GetComponentValue_tupleIdx_comp_const()
{
for (int j = 0; j < comps; ++j)
{
if (source->GetComponentValue(i, j) != static_cast<ScalarT>(refValue))
if (source->GetTypedComponent(i, j) != static_cast<ScalarT>(refValue))
{
DataArrayAPIError("Data mismatch at tuple " << i << ", "
"component " << j << ": Expected '" << refValue
<< "', got '" << source->GetComponentValue(i, j)
<< "', got '" << source->GetTypedComponent(i, j)
<< "'.");
}
++refValue;
......@@ -337,11 +337,11 @@ int Test_void_SetValue_valueIdx_value()
DataArrayAPIFinish();
}
// void SetTupleValue(vtkIdType tupleIdx, const ValueType* tuple)
// void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple)
template <typename ScalarT, typename ArrayT>
int Test_void_SetTupleValue_tupleIdx_tuple()
int Test_void_SetTypedTuple_tupleIdx_tuple()
{
DataArrayAPIInit("void SetTupleValue(vtkIdType tupleIdx, "
DataArrayAPIInit("void SetTypedTuple(vtkIdType tupleIdx, "
"const ValueType* tuple)");
DataArrayAPICreateTestArray(source);
......@@ -358,7 +358,7 @@ int Test_void_SetTupleValue_tupleIdx_tuple()
{
tuple.push_back(static_cast<ScalarT>(((t * comps) + c) % 17));
}
source->SetTupleValue(t, &tuple[0]);
source->SetTypedTuple(t, &tuple[0]);
}
// Verify:
......@@ -367,8 +367,7 @@ int Test_void_SetTupleValue_tupleIdx_tuple()
for (int c = 0; c < comps; ++c)
{
ScalarT ref = static_cast<ScalarT>(((t * comps) + c) % 17);
typename ArrayT::ConstReferenceType test =
source->GetComponentValue(t, c);
ScalarT test = source->GetTypedComponent(t, c);
if (ref != test)
{
DataArrayAPIError("Data mismatch at tuple " << t << " component " << c
......@@ -380,11 +379,11 @@ int Test_void_SetTupleValue_tupleIdx_tuple()
DataArrayAPIFinish();
}
// void SetComponentValue(vtkIdType tupleIdx, int comp, ValueType value)
// void SetTypedComponent(vtkIdType tupleIdx, int comp, ValueType value)
template <typename ScalarT, typename ArrayT>
int Test_void_SetComponentValue_tupleIdx_comp_value()
int Test_void_SetTypedComponent_tupleIdx_comp_value()
{
DataArrayAPIInit("void SetComponentValue(vtkIdType tupleIdx, int comp, "
DataArrayAPIInit("void SetTypedComponent(vtkIdType tupleIdx, int comp, "
"ValueType value)");
DataArrayAPICreateTestArray(source);
......@@ -398,7 +397,7 @@ int Test_void_SetComponentValue_tupleIdx_comp_value()
{
for (int j = 0; j < comps; ++j)
{
source->SetComponentValue(i, j,
source->SetTypedComponent(i, j,
static_cast<ScalarT>(((i + 1) * (j + 1)) % 17));
}
}
......@@ -407,7 +406,7 @@ int Test_void_SetComponentValue_tupleIdx_comp_value()
std::vector<ScalarT> tuple(comps);
for (vtkIdType i = 0; i < tuples; ++i)
{
source->GetTupleValue(i, &tuple[0]);
source->GetTypedTuple(i, &tuple[0]);
for (int j = 0; j < comps; ++j)
{
ScalarT test = tuple[j];
......@@ -520,39 +519,6 @@ int Test_LookupTypedValue_allSigs()
DataArrayAPIFinish();
}
// ReferenceType GetValueReference(vtkIdType idx)
template <typename ScalarT, typename ArrayT>
int Test_RefT_GetValueReference_valueIdx()
{
DataArrayAPIInit("ReferenceType GetValueReference(vtkIdType valueIdx)");
DataArrayAPICreateTestArray(array);
vtkIdType comps = 9;
vtkIdType tuples = 5;
array->SetNumberOfComponents(comps);
array->SetNumberOfTuples(tuples);
// Initialize:
for (vtkIdType i = 0; i < comps * tuples; ++i)
{
array->SetValue(i, static_cast<ScalarT>(i % 16));
}
// Verify:
for (vtkIdType i = 0; i < comps * tuples; ++i)
{
typename ArrayT::ConstReferenceType test = array->GetValueReference(i);
ScalarT ref = static_cast<ScalarT>(i % 16);
if (test != ref)
{
DataArrayAPIError("Data mismatch at value index '" << i << "'. Expected '"
<< ref << "', got '" << test << "'.");
}
}
DataArrayAPIFinish();
}
// vtkIdType InsertNextValue(ValueType v)
template <typename ScalarT, typename ArrayT>
int Test_vtkIdType_InsertNextValue_v()
......@@ -643,11 +609,11 @@ int Test_void_InsertValue_idx_v()
DataArrayAPIFinish();
}
// void InsertTupleValue(vtkIdType idx, const ValueType *t)
// void InsertTypedTuple(vtkIdType idx, const ValueType *t)
template <typename ScalarT, typename ArrayT>
int Test_void_InsertTupleValue_idx_t()
int Test_void_InsertTypedTuple_idx_t()
{
DataArrayAPIInit("void InsertTupleValue(vtkIdType idx, const ValueType *t)");
DataArrayAPIInit("void InsertTypedTuple(vtkIdType idx, const ValueType *t)");
DataArrayAPICreateTestArray(source);
......@@ -662,7 +628,7 @@ int Test_void_InsertTupleValue_idx_t()
{
tuple.push_back(static_cast<ScalarT>(((t * comps) + c) % 17));
}
source->InsertTupleValue(t, &tuple[0]);
source->InsertTypedTuple(t, &tuple[0]);
if (source->GetSize() < ((t + 1) * comps))
{
DataArrayAPIError("Size should be at least " << ((t + 1) * comps)
......@@ -680,13 +646,13 @@ int Test_void_InsertTupleValue_idx_t()
{
for (int c = 0; c < comps; ++c)
{
if (source->GetComponentValue(t, c) !=
if (source->GetTypedComponent(t, c) !=
static_cast<ScalarT>(((t * comps) + c) % 17))
{
DataArrayAPIError("Data mismatch at tuple " << t << " component " << c
<< ": Expected "
<< static_cast<ScalarT>(((t * comps) + c) % 17)
<< ", got " << source->GetComponentValue(t, c)
<< ", got " << source->GetTypedComponent(t, c)
<< ".");
}
}
......@@ -695,11 +661,11 @@ int Test_void_InsertTupleValue_idx_t()
DataArrayAPIFinish();
}
// vtkIdType InsertNextTupleValue(const ValueType *t)
// vtkIdType InsertNextTypedTuple(const ValueType *t)
template <typename ScalarT, typename ArrayT>
int Test_vtkIdType_InsertNextTupleValue_t()
int Test_vtkIdType_InsertNextTypedTuple_t()
{
DataArrayAPIInit("vtkIdType InsertNextTupleValue(const ValueType *t)");
DataArrayAPIInit("vtkIdType InsertNextTypedTuple(const ValueType *t)");
DataArrayAPICreateTestArray(source);
......@@ -714,7 +680,7 @@ int Test_vtkIdType_InsertNextTupleValue_t()
{
tuple.push_back(static_cast<ScalarT>(((t * comps) + c) % 17));
}
vtkIdType insertLoc = source->InsertNextTupleValue(&tuple[0]);
vtkIdType insertLoc = source->InsertNextTypedTuple(&tuple[0]);
if (insertLoc != t)
{
DataArrayAPIError("Returned location incorrect. Expected '" << t
......@@ -737,13 +703,13 @@ int Test_vtkIdType_InsertNextTupleValue_t()
{
for (int c = 0; c < comps; ++c)
{
if (source->GetComponentValue(t, c) !=
if (source->GetTypedComponent(t, c) !=
static_cast<ScalarT>(((t * comps) + c) % 17))
{
DataArrayAPIError("Data mismatch at tuple " << t << " component " << c
<< ": Expected "
<< static_cast<ScalarT>(((t * comps) + c) % 17)
<< ", got " << source->GetComponentValue(t, c)
<< ", got " << source->GetTypedComponent(t, c)
<< ".");
}
}
......@@ -756,7 +722,7 @@ int Test_vtkIdType_InsertNextTupleValue_t()
template <typename ScalarT, typename ArrayT>
int Test_vtkIdType_GetNumberOfValues()
{
DataArrayAPIInit("vtkIdType InsertNextTupleValue(const ValueType *t)");
DataArrayAPIInit("vtkIdType InsertNextTypedTuple(const ValueType *t)");
DataArrayAPICreateTestArray(source);
......@@ -864,28 +830,23 @@ int Test_GetValueRange_all_overloads()
//------------------------------------------------------------------------------
//-----------Unit Test Function Caller------------------------------------------
//------------------------------------------------------------------------------
struct CanDispatch // Dummy for testing if we can dispatch an array type.
{
template <typename ArrayT> void operator()(ArrayT *) {}
};
template <typename ScalarT, typename ArrayT>
int ExerciseGenericDataArray()
{
int errors = 0;
errors += Test_constRefT_GetValue_valueIdx_const<ScalarT, ArrayT>();
errors += Test_void_GetTupleValue_tupleIdx_tuple<ScalarT, ArrayT>();
errors += Test_constRefT_GetComponentValue_tupleIdx_comp_const<ScalarT, ArrayT>();
errors += Test_valT_GetValue_valueIdx_const<ScalarT, ArrayT>();
errors += Test_void_GetTypedTuple_tupleIdx_tuple<ScalarT, ArrayT>();
errors += Test_valT_GetTypedComponent_tupleIdx_comp_const<ScalarT, ArrayT>();
errors += Test_void_SetValue_valueIdx_value<ScalarT, ArrayT>();
errors += Test_void_SetTupleValue_tupleIdx_tuple<ScalarT, ArrayT>();
errors += Test_void_SetComponentValue_tupleIdx_comp_value<ScalarT, ArrayT>();
errors += Test_void_SetTypedTuple_tupleIdx_tuple<ScalarT, ArrayT>();
errors += Test_void_SetTypedComponent_tupleIdx_comp_value<ScalarT, ArrayT>();
errors += Test_LookupTypedValue_allSigs<ScalarT, ArrayT>();
errors += Test_RefT_GetValueReference_valueIdx<ScalarT, ArrayT>();
errors += Test_vtkIdType_InsertNextValue_v<ScalarT, ArrayT>();
errors += Test_void_InsertValue_idx_v<ScalarT, ArrayT>();
errors += Test_void_InsertTupleValue_idx_t<ScalarT, ArrayT>();
errors += Test_vtkIdType_InsertNextTupleValue_t<ScalarT, ArrayT>();
errors += Test_void_InsertTypedTuple_idx_t<ScalarT, ArrayT>();
errors += Test_vtkIdType_InsertNextTypedTuple_t<ScalarT, ArrayT>();
errors += Test_vtkIdType_GetNumberOfValues<ScalarT, ArrayT>();
errors += Test_GetValueRange_all_overloads<ScalarT, ArrayT>();
......
......@@ -34,8 +34,8 @@ class TestArrayArguments(Testing.vtkTest):
a.SetNumberOfTuples(1)
ti = [0, a.GetDataTypeValueMin(), a.GetDataTypeValueMax()]
to = [0, 0, 0]
a.SetTupleValue(0, ti)
a.GetTupleValue(0, to);
a.SetTypedTuple(0, ti)
a.GetTypedTuple(0, to);
self.assertEqual(ti, to)
d1 = a.GetTuple(0)
d2 = [float(x) for x in ti]
......@@ -50,8 +50,8 @@ class TestArrayArguments(Testing.vtkTest):
a.SetNumberOfTuples(1)
ti = [0, a.GetDataTypeValueMin(), a.GetDataTypeValueMax()]
to = [0, 0, 0]
a.SetTupleValue(0, ti)
a.GetTupleValue(0, to);
a.SetTypedTuple(0, ti)
a.GetTypedTuple(0, to);
self.assertEqual(ti, to)
d1 = a.GetTuple(0)
d2 = [float(x) for x in ti]
......@@ -64,10 +64,10 @@ class TestArrayArguments(Testing.vtkTest):
a.SetNumberOfComponents(3)
a.SetNumberOfTuples(1)
ti = "opn"
a.SetTupleValue(0, ti)
a.SetTypedTuple(0, ti)
# python strings are immutable, so this should NOT work
#to = "***"
#a.GetTupleValue(0, to);
#a.GetTypedTuple(0, to);
d1 = list(a.GetTuple(0))
d2 = [ord(x) for x in ti]
self.assertEqual(d1, d2)
......
......@@ -85,8 +85,8 @@ class TestBuffer(Testing.vtkTest):
# bit array is actually stored as a byte array
a = vtk.vtkCharArray()
a.SetNumberOfComponents(5)
a.InsertNextTupleValue("hello")
a.InsertNextTupleValue("world")
a.InsertNextTypedTuple("hello")
a.InsertNextTypedTuple("world")
m = memoryview(a)
self.assertEqual(m.format, 'c')
self.assertEqual(m.itemsize, 1)
......
......@@ -36,8 +36,6 @@ public:
typedef vtkAOSDataArrayTemplate<ValueTypeT> SelfType;
vtkTemplateTypeMacro(SelfType, GenericDataArrayType)
typedef typename Superclass::ValueType ValueType;
typedef typename Superclass::ReferenceType ReferenceType;
typedef typename Superclass::ConstReferenceType ConstReferenceType;
// Description:
// Legacy support for array-of-structs value iteration.
......@@ -52,18 +50,18 @@ public:
// Methods that are needed to be implemented by every vtkGenericDataArray
// subclass.
// **************************************************************************
inline ConstReferenceType GetValue(vtkIdType valueIdx) const
inline ValueType GetValue(vtkIdType valueIdx) const
{