From 893fb6ed2ffc94b4fd61c5adc4b40e3692daa474 Mon Sep 17 00:00:00 2001 From: "David C. Lonie" <david.lonie@kitware.com> Date: Mon, 29 Feb 2016 09:50:22 -0500 Subject: [PATCH] Refactor data array APIs. vtkDataArray subclasses now use ComponentValue --> TypedComponent TupleValue --> TypedValue for their type-specific methods. # Conflicts: # Rendering/Annotation/vtkScalarBarActor.cxx --- Charts/Core/vtkPlot3D.cxx | 6 +- Charts/Core/vtkPlotArea.cxx | 10 +- Charts/Core/vtkPlotParallelCoordinates.cxx | 6 +- Charts/Core/vtkPlotSurface.cxx | 6 +- .../Cxx/TestAngularPeriodicDataArray.cxx | 8 +- .../Core/Testing/Cxx/TestDataArrayAPI.cxx.in | 38 +++--- .../Testing/Cxx/TestGenericDataArrayAPI.cxx | 125 ++++++------------ .../Core/Testing/Python/TestArrayArguments.py | 12 +- Common/Core/Testing/Python/TestBuffer.py | 4 +- Common/Core/vtkAOSDataArrayTemplate.h | 20 ++- Common/Core/vtkAbstractArray.h | 10 ++ Common/Core/vtkDataArray.cxx | 30 ++--- Common/Core/vtkDataArrayPrivate.txx | 10 +- Common/Core/vtkGenericDataArray.h | 57 +++----- Common/Core/vtkGenericDataArray.txx | 6 +- Common/Core/vtkMappedDataArray.h | 2 - Common/Core/vtkPeriodicDataArray.h | 21 ++- Common/Core/vtkPeriodicDataArray.txx | 20 +-- Common/Core/vtkSOADataArrayTemplate.h | 17 +-- Common/Core/vtkSOADataArrayTemplate.txx | 2 +- Common/Core/vtkTypedDataArray.h | 18 ++- Common/Core/vtkTypedDataArray.txx | 6 +- .../Testing/Cxx/TestPolyDataRemoveCell.cxx | 4 +- Common/DataModel/vtkDataSetAttributes.cxx | 4 +- Common/DataModel/vtkHyperOctree.cxx | 2 +- Common/DataModel/vtkHyperTreeGrid.cxx | 2 +- Common/DataModel/vtkPolyhedron.cxx | 4 +- .../Chemistry/vtkBlueObeliskDataParser.cxx | 2 +- Domains/Chemistry/vtkPeriodicTable.cxx | 6 +- .../Core/Testing/Cxx/TestNamedComponents.cxx | 2 +- .../Testing/Cxx/TestStructuredGridAppend.cxx | 4 +- Filters/Core/vtkAppendPolyData.cxx | 4 +- .../Testing/Cxx/TestGradientAndVorticity.cxx | 4 +- .../Cxx/TestTableSplitColumnComponents.cxx | 2 +- .../vtkBooleanOperationPolyDataFilter.cxx | 4 +- Filters/General/vtkClipClosedSurface.cxx | 34 ++--- Filters/General/vtkWarpVector.cxx | 6 +- .../Cxx/TestDataSetSurfaceFieldData.cxx | 4 +- .../Cxx/TestGeometryFilterCellData.cxx | 4 +- Filters/Geometry/vtkDataSetSurfaceFilter.cxx | 6 +- .../ReebGraph/Testing/Cxx/TestReebGraph.cxx | 12 +- .../vtkReebGraphSurfaceSkeletonFilter.cxx | 6 +- .../vtkReebGraphVolumeSkeletonFilter.cxx | 6 +- Filters/SMP/Testing/Cxx/TestSMPWarp.cxx | 4 +- Filters/Statistics/vtkPCAStatistics.cxx | 6 +- GUISupport/Qt/vtkQtTableModelAdapter.cxx | 2 +- GUISupport/Qt/vtkQtTreeModelAdapter.cxx | 2 +- Geovis/Core/Testing/Cxx/TestGlobeSource.cxx | 2 +- Geovis/Core/vtkCompassRepresentation.cxx | 12 +- .../vtkCPExodusIINodalCoordinatesTemplate.h | 14 +- .../vtkCPExodusIINodalCoordinatesTemplate.txx | 12 +- IO/Exodus/vtkCPExodusIIResultsArrayTemplate.h | 14 +- .../vtkCPExodusIIResultsArrayTemplate.txx | 12 +- IO/Exodus/vtkExodusIIReader.cxx | 8 +- IO/Export/vtkX3DExporter.cxx | 10 +- IO/Geometry/vtkOpenFOAMReader.cxx | 4 +- IO/Geometry/vtkPDBReader.cxx | 8 +- IO/Legacy/vtkCompositeDataReader.cxx | 2 +- IO/Legacy/vtkCompositeDataWriter.cxx | 2 +- IO/MINC/vtkMNIObjectWriter.cxx | 2 +- IO/NetCDF/vtkSLACReader.cxx | 4 +- IO/Parallel/vtkPSLACReader.cxx | 8 +- Infovis/Layout/vtkAreaLayout.cxx | 2 +- Infovis/Layout/vtkCirclePackLayout.cxx | 6 +- .../Layout/vtkStackedTreeLayoutStrategy.cxx | 8 +- Infovis/Layout/vtkTreeMapLayout.cxx | 6 +- Infovis/Layout/vtkTreeMapLayoutStrategy.cxx | 4 +- .../Cxx/vtkPolyLineRepresentationTest1.cxx | 4 +- .../Cxx/vtkSplineRepresentationTest1.cxx | 4 +- .../vtkBezierContourLineInterpolator.cxx | 2 +- .../vtkCenteredSliderRepresentation.cxx | 28 ++-- .../Widgets/vtkContourLineInterpolator.cxx | 2 +- .../Widgets/vtkContourRepresentation.cxx | 2 +- .../vtkGraphAnnotationLayersFilter.cxx | 2 +- Rendering/Annotation/vtkScalarBarActor.cxx | 6 +- .../Testing/Cxx/TestBareScalarsToColors.cxx | 2 +- .../TestColorTransferFunctionStringArray.cxx | 2 +- .../Testing/Cxx/TestDirectScalarsToColors.cxx | 2 +- ...izableColorTransferFunctionStringArray.cxx | 2 +- .../Testing/Cxx/TestMapVectorsAsRGBColors.cxx | 2 +- .../Testing/Cxx/TestMapVectorsToColors.cxx | 2 +- .../Core/Testing/Cxx/TestPolygonSelection.cxx | 2 +- .../Label/vtkLabeledTreeMapDataMapper.cxx | 2 +- Rendering/OpenGL/vtkOpenGLGlyph3DMapper.cxx | 2 +- .../OpenGL/vtkScalarsToColorsPainter.cxx | 4 +- Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx | 2 +- .../Volume/vtkProjectedTetrahedraMapper.cxx | 14 +- ...tkUnstructuredGridBunykRayCastFunction.cxx | 16 +-- Rendering/Volume/vtkVolumeOutlineSource.cxx | 6 +- Views/Infovis/vtkApplyColors.cxx | 16 +-- Wrapping/Tools/vtkWrap.c | 10 +- 91 files changed, 390 insertions(+), 456 deletions(-) diff --git a/Charts/Core/vtkPlot3D.cxx b/Charts/Core/vtkPlot3D.cxx index e0b513104f..80b4f9bbfa 100644 --- a/Charts/Core/vtkPlot3D.cxx +++ b/Charts/Core/vtkPlot3D.cxx @@ -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(); diff --git a/Charts/Core/vtkPlotArea.cxx b/Charts/Core/vtkPlotArea.cxx index eb2cc69a70..c2197327f8 100644 --- a/Charts/Core/vtkPlotArea.cxx +++ b/Charts/Core/vtkPlotArea.cxx @@ -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)); } diff --git a/Charts/Core/vtkPlotParallelCoordinates.cxx b/Charts/Core/vtkPlotParallelCoordinates.cxx index 569c14d836..5ceea69660 100644 --- a/Charts/Core/vtkPlotParallelCoordinates.cxx +++ b/Charts/Core/vtkPlotParallelCoordinates.cxx @@ -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 diff --git a/Charts/Core/vtkPlotSurface.cxx b/Charts/Core/vtkPlotSurface.cxx index 4da14cb7bb..003e2dc2d0 100644 --- a/Charts/Core/vtkPlotSurface.cxx +++ b/Charts/Core/vtkPlotSurface.cxx @@ -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]); } //----------------------------------------------------------------------------- diff --git a/Common/Core/Testing/Cxx/TestAngularPeriodicDataArray.cxx b/Common/Core/Testing/Cxx/TestAngularPeriodicDataArray.cxx index 33786350ff..706f281bd2 100644 --- a/Common/Core/Testing/Cxx/TestAngularPeriodicDataArray.cxx +++ b/Common/Core/Testing/Cxx/TestAngularPeriodicDataArray.cxx @@ -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 || diff --git a/Common/Core/Testing/Cxx/TestDataArrayAPI.cxx.in b/Common/Core/Testing/Cxx/TestDataArrayAPI.cxx.in index f433b69957..9d6bd9a5e4 100644 --- a/Common/Core/Testing/Cxx/TestDataArrayAPI.cxx.in +++ b/Common/Core/Testing/Cxx/TestDataArrayAPI.cxx.in @@ -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); diff --git a/Common/Core/Testing/Cxx/TestGenericDataArrayAPI.cxx b/Common/Core/Testing/Cxx/TestGenericDataArrayAPI.cxx index a3099918c8..fd18bd94ae 100644 --- a/Common/Core/Testing/Cxx/TestGenericDataArrayAPI.cxx +++ b/Common/Core/Testing/Cxx/TestGenericDataArrayAPI.cxx @@ -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>(); diff --git a/Common/Core/Testing/Python/TestArrayArguments.py b/Common/Core/Testing/Python/TestArrayArguments.py index a614f686e7..a6d4fdb40c 100644 --- a/Common/Core/Testing/Python/TestArrayArguments.py +++ b/Common/Core/Testing/Python/TestArrayArguments.py @@ -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) diff --git a/Common/Core/Testing/Python/TestBuffer.py b/Common/Core/Testing/Python/TestBuffer.py index 2417574846..a6ee478caf 100644 --- a/Common/Core/Testing/Python/TestBuffer.py +++ b/Common/Core/Testing/Python/TestBuffer.py @@ -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) diff --git a/Common/Core/vtkAOSDataArrayTemplate.h b/Common/Core/vtkAOSDataArrayTemplate.h index 2e96fc1155..87b6e813da 100644 --- a/Common/Core/vtkAOSDataArrayTemplate.h +++ b/Common/Core/vtkAOSDataArrayTemplate.h @@ -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 { return this->Buffer.GetBuffer()[valueIdx]; } - inline void GetTupleValue(vtkIdType tupleIdx, ValueType* tuple) const + inline void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const { const vtkIdType valueIdx = tupleIdx * this->NumberOfComponents; std::copy(this->Buffer.GetBuffer() + valueIdx, this->Buffer.GetBuffer() + valueIdx + this->NumberOfComponents, tuple); } - inline ConstReferenceType GetComponentValue(vtkIdType index, int comp) const + inline ValueType GetTypedComponent(vtkIdType index, int comp) const { return this->Buffer.GetBuffer()[this->NumberOfComponents*index + comp]; } @@ -71,13 +69,13 @@ public: { this->Buffer.GetBuffer()[valueIdx] = value; } - inline void SetTupleValue(vtkIdType tupleIdx, const ValueType* tuple) + inline void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple) { const vtkIdType valueIdx = tupleIdx * this->NumberOfComponents; std::copy(tuple, tuple + this->NumberOfComponents, this->Buffer.GetBuffer() + valueIdx); } - inline void SetComponentValue(vtkIdType tupleIdx, int comp, ValueType value) + inline void SetTypedComponent(vtkIdType tupleIdx, int comp, ValueType value) { const vtkIdType valueIdx = tupleIdx * this->NumberOfComponents + comp; this->SetValue(valueIdx, value); @@ -208,10 +206,10 @@ vtkArrayDownCast_TemplateFastCastMacro(vtkAOSDataArrayTemplate) // can see them. The wrappers ignore vtkAOSDataArrayTemplate. #define vtkCreateWrappedArrayInterface(T) \ int GetDataType(); \ - void GetTupleValue(vtkIdType i, T* tuple); \ - void SetTupleValue(vtkIdType i, const T* tuple); \ - void InsertTupleValue(vtkIdType i, const T* tuple); \ - vtkIdType InsertNextTupleValue(const T* tuple); \ + void GetTypedTuple(vtkIdType i, T* tuple); \ + void SetTypedTuple(vtkIdType i, const T* tuple); \ + void InsertTypedTuple(vtkIdType i, const T* tuple); \ + vtkIdType InsertNextTypedTuple(const T* tuple); \ T GetValue(vtkIdType id); \ void SetValue(vtkIdType id, T value); \ void SetNumberOfValues(vtkIdType number); \ diff --git a/Common/Core/vtkAbstractArray.h b/Common/Core/vtkAbstractArray.h index 49f6716b36..163f39067f 100644 --- a/Common/Core/vtkAbstractArray.h +++ b/Common/Core/vtkAbstractArray.h @@ -138,6 +138,16 @@ public: vtkIdType GetNumberOfTuples() {return (this->MaxId + 1)/this->NumberOfComponents;} + // Description: + // Get the total number of values in the array. This is typically equivalent + // to (numTuples * numComponents). The exception is during incremental array + // construction for subclasses that support component insertion, which may + // result in an incomplete trailing tuple. + inline vtkIdType GetNumberOfValues() const + { + return (this->MaxId + 1); + } + // Description: // Set the tuple at the ith location using the jth tuple in the source array. // This method assumes that the two arrays have the same type diff --git a/Common/Core/vtkDataArray.cxx b/Common/Core/vtkDataArray.cxx index 082ea9bfbf..fe9d7a2dcf 100644 --- a/Common/Core/vtkDataArray.cxx +++ b/Common/Core/vtkDataArray.cxx @@ -83,9 +83,9 @@ struct DeepCopyWorker { for (int c = 0; c < comps; ++c) { - dst->SetComponentValue( + dst->SetTypedComponent( t, c, static_cast<typename Array2T::ValueType>( - src->GetComponentValue(t, c))); + src->GetTypedComponent(t, c))); } } } @@ -141,11 +141,11 @@ struct InterpolateMultiTupleWorker { vtkIdType t = this->TupleIds[tupleId]; double weight = this->Weights[tupleId]; - val += weight * static_cast<double>(src->GetComponentValue(t, c)); + val += weight * static_cast<double>(src->GetTypedComponent(t, c)); } typename Array2T::ValueType valT; vtkDataArrayRoundIfNecessary(val, &valT); - dst->InsertComponentValue(this->DestTuple, c, valT); + dst->InsertTypedComponent(this->DestTuple, c, valT); } } }; @@ -172,10 +172,10 @@ struct InterpolateTupleWorker typename Array3T::ValueType valT; for (int c = 0; c < numComps; ++c) { - val = src1->GetComponentValue(this->SrcTuple1, c) * oneMinusT + - src2->GetComponentValue(this->SrcTuple2, c) * this->Weight; + val = src1->GetTypedComponent(this->SrcTuple1, c) * oneMinusT + + src2->GetTypedComponent(this->SrcTuple2, c) * this->Weight; vtkDataArrayRoundIfNecessary(val, &valT); - dst->InsertComponentValue(this->DstTuple, c, valT); + dst->InsertTypedComponent(this->DstTuple, c, valT); } } }; @@ -198,9 +198,9 @@ struct GetTuplesFromListWorker { for (int c = 0; c < numComps; ++c) { - dst->SetComponentValue(dstTuple, c, + dst->SetTypedComponent(dstTuple, c, static_cast<typename Array2T::ValueType>( - src->GetComponentValue(*srcTuple, c))); + src->GetTypedComponent(*srcTuple, c))); } ++srcTuple; ++dstTuple; @@ -245,9 +245,9 @@ struct GetTuplesRangeWorker { for (int c = 0; c < numComps; ++c) { - dst->SetComponentValue(dstT, c, + dst->SetTypedComponent(dstT, c, static_cast<typename Array2T::ValueType>( - src->GetComponentValue(srcT, c))); + src->GetTypedComponent(srcT, c))); } } } @@ -283,8 +283,8 @@ struct SetTupleArrayWorker int numComps = src->GetNumberOfComponents(); for (int c = 0; c < numComps; ++c) { - dst->SetComponentValue(this->DstTuple, c, - src->GetComponentValue(this->SrcTuple, c)); + dst->SetTypedComponent(this->DstTuple, c, + src->GetTypedComponent(this->SrcTuple, c)); } } @@ -320,7 +320,7 @@ struct SetTuplesIdListWorker vtkIdType dstT = this->DstTuples->GetId(t); for (int c = 0; c < numComps; ++c) { - dst->SetComponentValue(dstT, c, src->GetComponentValue(srcT, c)); + dst->SetTypedComponent(dstT, c, src->GetTypedComponent(srcT, c)); } } } @@ -369,7 +369,7 @@ struct SetTuplesRangeWorker { for (int c = 0; c < numComps; ++c) { - dst->SetComponentValue(dstT, c, src->GetComponentValue(srcT, c)); + dst->SetTypedComponent(dstT, c, src->GetTypedComponent(srcT, c)); } } ++srcT; diff --git a/Common/Core/vtkDataArrayPrivate.txx b/Common/Core/vtkDataArrayPrivate.txx index 72d68c6336..37fc22eb44 100644 --- a/Common/Core/vtkDataArrayPrivate.txx +++ b/Common/Core/vtkDataArrayPrivate.txx @@ -80,9 +80,9 @@ struct ComputeScalarRange for(int compIdx = 0, j = 0; compIdx < NumComps; ++compIdx, j+=2) { tempRange[j] = detail::min(tempRange[j], - array->GetComponentValue(tupleIdx, compIdx)); + array->GetTypedComponent(tupleIdx, compIdx)); tempRange[j+1] = detail::max(tempRange[j+1], - array->GetComponentValue(tupleIdx, compIdx)); + array->GetTypedComponent(tupleIdx, compIdx)); } } @@ -171,9 +171,9 @@ bool DoComputeScalarRange(ArrayT *array, double *ranges) for(int compIdx = 0, j = 0; compIdx < numComp; ++compIdx, j+=2) { tempRange[j] = detail::min(tempRange[j], - array->GetComponentValue(tupleIdx, compIdx)); + array->GetTypedComponent(tupleIdx, compIdx)); tempRange[j+1] = detail::max(tempRange[j+1], - array->GetComponentValue(tupleIdx, compIdx)); + array->GetTypedComponent(tupleIdx, compIdx)); } } @@ -247,7 +247,7 @@ bool DoComputeVectorRange(ArrayT *array, double range[2]) for (int compIdx = 0; compIdx < numComps; ++compIdx) { const double t = - static_cast<double>(array->GetComponentValue(tupleIdx, compIdx)); + static_cast<double>(array->GetTypedComponent(tupleIdx, compIdx)); squaredSum += t * t; } range[0] = detail::min(range[0], squaredSum); diff --git a/Common/Core/vtkGenericDataArray.h b/Common/Core/vtkGenericDataArray.h index f6c761598e..d38c40ac02 100644 --- a/Common/Core/vtkGenericDataArray.h +++ b/Common/Core/vtkGenericDataArray.h @@ -34,40 +34,34 @@ class vtkGenericDataArray : public vtkDataArray public: vtkTemplateTypeMacro(SelfType, vtkDataArray) typedef ValueTypeT ValueType; - typedef ValueTypeT& ReferenceType; - typedef const ValueTypeT& ConstReferenceType; //---------------------------------------------------------------------------- // Methods that must be defined by the subclasses. // Let's call these GenericDataArray concept methods. - inline ConstReferenceType GetValue(vtkIdType valueIdx) const + inline ValueType GetValue(vtkIdType valueIdx) const { - // TODO this method shadows a non-const method in vtkDataArrayTemplate - // that returns a value. Prolly won't matter for most cases, but we should - // note it somewhere. return static_cast<const DerivedT*>(this)->GetValue(valueIdx); } - inline void GetTupleValue(vtkIdType tupleIdx, ValueType* tuple) const + inline void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const { - static_cast<const DerivedT*>(this)->GetTupleValue(tupleIdx, tuple); + static_cast<const DerivedT*>(this)->GetTypedTuple(tupleIdx, tuple); } - inline ConstReferenceType GetComponentValue(vtkIdType tupleIdx, - int comp) const + inline ValueType GetTypedComponent(vtkIdType tupleIdx, int comp) const { - return static_cast<const DerivedT*>(this)->GetComponentValue(tupleIdx, + return static_cast<const DerivedT*>(this)->GetTypedComponent(tupleIdx, comp); } inline void SetValue(vtkIdType valueIdx, ValueType value) { static_cast<DerivedT*>(this)->SetValue(valueIdx, value); } - inline void SetTupleValue(vtkIdType tupleIdx, const ValueType* tuple) + inline void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple) { - static_cast<DerivedT*>(this)->SetTupleValue(tupleIdx, tuple); + static_cast<DerivedT*>(this)->SetTypedTuple(tupleIdx, tuple); } - inline void SetComponentValue(vtkIdType tupleIdx, int comp, ValueType value) + inline void SetTypedComponent(vtkIdType tupleIdx, int comp, ValueType value) { - static_cast<DerivedT*>(this)->SetComponentValue(tupleIdx, comp, value); + static_cast<DerivedT*>(this)->SetTypedComponent(tupleIdx, comp, value); } // Provide implementations for pure virtual methods in vtkDataArray. @@ -263,7 +257,7 @@ public: virtual void SetComponent(vtkIdType i, int j, double c) { // Reimplemented for efficiency (base impl allocates heap memory) - this->SetComponentValue(i, j, static_cast<ValueType>(c)); + this->SetTypedComponent(i, j, static_cast<ValueType>(c)); } //---------------------------------------------------------------------------- @@ -271,7 +265,7 @@ public: virtual double GetComponent(vtkIdType i, int j) { // Reimplemented for efficiency (base impl allocates heap memory) - return static_cast<double>(this->GetComponentValue(i, j)); + return static_cast<double>(this->GetTypedComponent(i, j)); } //---------------------------------------------------------------------------- @@ -328,15 +322,6 @@ public: // to be virtual. They are no longer virtual and the vtkGenericDataArray // concept methods defined above. - // Description: - // Get a reference to the scalar value at a particular index. - // Index is value/component index assuming - // traditional VTK memory layout (array-of-structures). - ReferenceType GetValueReference(vtkIdType idx) - { - return const_cast<ReferenceType>(this->GetValue(idx)); - } - // Description: // Insert data at the end of the array. Return its location in the array. vtkIdType InsertNextValue(ValueType v) @@ -381,27 +366,27 @@ public: // Description: // Insert (memory allocation performed) the tuple into the ith location // in the array. - void InsertTupleValue(vtkIdType tupleIdx, const ValueType *t) + void InsertTypedTuple(vtkIdType tupleIdx, const ValueType *t) { if (this->EnsureAccessToTuple(tupleIdx)) { - this->SetTupleValue(tupleIdx, t); + this->SetTypedTuple(tupleIdx, t); } } // Description: // Insert (memory allocation performed) the tuple onto the end of the array. - vtkIdType InsertNextTupleValue(const ValueType *t) + vtkIdType InsertNextTypedTuple(const ValueType *t) { vtkIdType nextTuple = this->GetNumberOfTuples(); - this->InsertTupleValue(nextTuple, t); + this->InsertTypedTuple(nextTuple, t); return nextTuple; } // Description: // Insert (memory allocation performed) the value at the specified tuple and // component location. - void InsertComponentValue(vtkIdType tupleIdx, int compIdx, ValueType val) + void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val) { // Update MaxId to the inserted component (not the complete tuple) for // compatibility with InsertNextValue. @@ -413,17 +398,9 @@ public: this->EnsureAccessToTuple(tupleIdx); assert("Sufficient space allocated." && this->MaxId >= newMaxId); this->MaxId = newMaxId; - this->SetComponentValue(tupleIdx, compIdx, val); + this->SetTypedComponent(tupleIdx, compIdx, val); } - // Description: - // Returns the number of values i.e. - // (this->NumberOfComponents*this->NumberOfTuples) - // TODO this can go in vtkAbstractArray. - inline vtkIdType GetNumberOfValues() - { - return (this->MaxId + 1); - } // Description: // Get the range of array values for the given component in the diff --git a/Common/Core/vtkGenericDataArray.txx b/Common/Core/vtkGenericDataArray.txx index 8862b06f6f..d523809b1a 100644 --- a/Common/Core/vtkGenericDataArray.txx +++ b/Common/Core/vtkGenericDataArray.txx @@ -38,7 +38,7 @@ vtkGenericDataArrayT(void)::GetTuple(vtkIdType i, double *tuple) { for (int c = 0; c < this->NumberOfComponents; ++c) { - tuple[c] = static_cast<double>(this->GetComponentValue(i, c)); + tuple[c] = static_cast<double>(this->GetTypedComponent(i, c)); } } @@ -69,8 +69,8 @@ vtkGenericDataArrayT(void)::RemoveTuple(vtkIdType id) { for (int comp=0; comp < numComps; ++comp) { - this->SetComponentValue(toTuple, comp, - this->GetComponentValue(fromTuple, comp)); + this->SetTypedComponent(toTuple, comp, + this->GetTypedComponent(fromTuple, comp)); } } this->SetNumberOfTuples(this->GetNumberOfTuples() - 1); diff --git a/Common/Core/vtkMappedDataArray.h b/Common/Core/vtkMappedDataArray.h index ca4bff8c81..218afcea8f 100644 --- a/Common/Core/vtkMappedDataArray.h +++ b/Common/Core/vtkMappedDataArray.h @@ -40,8 +40,6 @@ class vtkMappedDataArray : public vtkTypedDataArray<Scalar> public: vtkTemplateTypeMacro(vtkMappedDataArray<Scalar>, vtkTypedDataArray<Scalar>) typedef typename Superclass::ValueType ValueType; - typedef typename Superclass::ReferenceType ReferenceType; - typedef typename Superclass::ConstReferenceType ConstReferenceType; // Description: // Perform a fast, safe cast from a vtkAbstractArray to a vtkMappedDataArray. diff --git a/Common/Core/vtkPeriodicDataArray.h b/Common/Core/vtkPeriodicDataArray.h index 036914e18d..8924110513 100644 --- a/Common/Core/vtkPeriodicDataArray.h +++ b/Common/Core/vtkPeriodicDataArray.h @@ -35,8 +35,7 @@ class vtkPeriodicDataArray: public vtkMappedDataArray<Scalar> public: vtkTemplateTypeMacro(vtkPeriodicDataArray<Scalar>, vtkMappedDataArray<Scalar>) typedef typename Superclass::ValueType ValueType; - typedef typename Superclass::ReferenceType ReferenceType; - typedef typename Superclass::ConstReferenceType ConstReferenceType; + virtual void PrintSelf(ostream &os, vtkIndent indent); // Description: @@ -98,19 +97,19 @@ public: // Description: // Get value at index idx. - // Warning, it internally call GetTupleValue, + // Warning, it internally call GetTypedTuple, // so it is an inneficcient way if reading all data - ConstReferenceType GetValue(vtkIdType idx) const; + ValueType GetValue(vtkIdType idx) const; // Description: // Get value at index idx as reference. - // Warning, it internally call GetTupleValue, + // Warning, it internally call GetTypedTuple, // so it is an inneficcient way if reading all data - ReferenceType GetValueReference(vtkIdType idx); + ValueType& GetValueReference(vtkIdType idx); // Description: // Copy tuple value at location idx into provided array - void GetTupleValue(vtkIdType idx, Scalar *t) const; + void GetTypedTuple(vtkIdType idx, Scalar *t) const; // Description: // Return the memory in kilobytes consumed by this data array. @@ -214,15 +213,15 @@ public: // Description: // Read only container, not supported. - void SetTupleValue(vtkIdType i, const Scalar *t); + void SetTypedTuple(vtkIdType i, const Scalar *t); // Description: // Read only container, not supported. - void InsertTupleValue(vtkIdType i, const Scalar *t); + void InsertTypedTuple(vtkIdType i, const Scalar *t); // Description: // Read only container, not supported. - vtkIdType InsertNextTupleValue(const Scalar *t); + vtkIdType InsertNextTypedTuple(const Scalar *t); // Description: // Read only container, not supported. @@ -271,7 +270,7 @@ private: vtkPeriodicDataArray(const vtkPeriodicDataArray &); // Not implemented. void operator=(const vtkPeriodicDataArray &); // Not implemented. - Scalar* TempScalarArray; // Temporary array used by GetTupleValue methods + Scalar* TempScalarArray; // Temporary array used by GetTypedTuple methods double* TempDoubleArray; // Temporary array used by GetTuple vethods vtkIdType TempTupleIdx; // Location of currently stored Temp Tuple to use as cache vtkAOSDataArrayTemplate<Scalar>* Data; // Original data diff --git a/Common/Core/vtkPeriodicDataArray.txx b/Common/Core/vtkPeriodicDataArray.txx index 5f292dcd70..5fd5e5530d 100644 --- a/Common/Core/vtkPeriodicDataArray.txx +++ b/Common/Core/vtkPeriodicDataArray.txx @@ -303,7 +303,7 @@ template <class Scalar> double* vtkPeriodicDataArray<Scalar> { if (this->TempTupleIdx != i) { - this->GetTupleValue(i, this->TempScalarArray); + this->GetTypedTuple(i, this->TempScalarArray); this->TempTupleIdx = i; } for (int j = 0; j < this->NumberOfComponents; j++) @@ -319,7 +319,7 @@ template <class Scalar> void vtkPeriodicDataArray<Scalar> { if (this->TempTupleIdx != i) { - this->GetTupleValue(i, this->TempScalarArray); + this->GetTypedTuple(i, this->TempScalarArray); this->TempTupleIdx = i; } for (int j = 0; j < this->NumberOfComponents; j++) @@ -345,7 +345,7 @@ template <class Scalar> void vtkPeriodicDataArray<Scalar> //------------------------------------------------------------------------------ template <class Scalar> -typename vtkPeriodicDataArray<Scalar>::ConstReferenceType +typename vtkPeriodicDataArray<Scalar>::ValueType vtkPeriodicDataArray<Scalar>::GetValue(vtkIdType idx) const { return const_cast<vtkPeriodicDataArray<Scalar>*>(this)->GetValueReference(idx); @@ -353,13 +353,13 @@ vtkPeriodicDataArray<Scalar>::GetValue(vtkIdType idx) const //------------------------------------------------------------------------------ template <class Scalar> -typename vtkPeriodicDataArray<Scalar>::ReferenceType +typename vtkPeriodicDataArray<Scalar>::ValueType& vtkPeriodicDataArray<Scalar>::GetValueReference(vtkIdType idx) { vtkIdType tupleIdx = idx / this->NumberOfComponents; if (tupleIdx != this->TempTupleIdx) { - this->GetTupleValue(tupleIdx, this->TempScalarArray); + this->GetTypedTuple(tupleIdx, this->TempScalarArray); this->TempTupleIdx = tupleIdx; } return this->TempScalarArray[idx % this->NumberOfComponents]; @@ -367,9 +367,9 @@ vtkPeriodicDataArray<Scalar>::GetValueReference(vtkIdType idx) //------------------------------------------------------------------------------ template <class Scalar> void vtkPeriodicDataArray<Scalar> -::GetTupleValue(vtkIdType tupleId, Scalar *tuple) const +::GetTypedTuple(vtkIdType tupleId, Scalar *tuple) const { - this->Data->GetTupleValue(tupleId, tuple); + this->Data->GetTypedTuple(tupleId, tuple); this->Transform(tuple); } @@ -551,21 +551,21 @@ template <class Scalar> void vtkPeriodicDataArray<Scalar> //------------------------------------------------------------------------------ template <class Scalar> void vtkPeriodicDataArray<Scalar> -::SetTupleValue(vtkIdType, const Scalar*) +::SetTypedTuple(vtkIdType, const Scalar*) { vtkErrorMacro("Read only container."); } //------------------------------------------------------------------------------ template <class Scalar> void vtkPeriodicDataArray<Scalar> -::InsertTupleValue(vtkIdType, const Scalar*) +::InsertTypedTuple(vtkIdType, const Scalar*) { vtkErrorMacro("Read only container."); } //------------------------------------------------------------------------------ template <class Scalar> vtkIdType vtkPeriodicDataArray<Scalar> -::InsertNextTupleValue(const Scalar *) +::InsertNextTypedTuple(const Scalar *) { vtkErrorMacro("Read only container."); return -1; diff --git a/Common/Core/vtkSOADataArrayTemplate.h b/Common/Core/vtkSOADataArrayTemplate.h index 90ba099ee8..c5eb527f72 100644 --- a/Common/Core/vtkSOADataArrayTemplate.h +++ b/Common/Core/vtkSOADataArrayTemplate.h @@ -33,8 +33,6 @@ public: typedef vtkSOADataArrayTemplate<ValueTypeT> SelfType; vtkTemplateTypeMacro(SelfType, GenericDataArrayType) typedef typename Superclass::ValueType ValueType; - typedef typename Superclass::ReferenceType ReferenceType; - typedef typename Superclass::ConstReferenceType ConstReferenceType; static vtkSOADataArrayTemplate* New(); @@ -42,22 +40,21 @@ public: // Methods that are needed to be implemented by every vtkGenericDataArray // subclass. // ************************************************************************** - inline ConstReferenceType GetValue(vtkIdType valueIdx) const + inline ValueType GetValue(vtkIdType valueIdx) const { vtkIdType tupleIdx; int comp; this->GetTupleIndexFromValueIndex(valueIdx, tupleIdx, comp); - return this->GetComponentValue(tupleIdx, comp); + return this->GetTypedComponent(tupleIdx, comp); } - inline void GetTupleValue(vtkIdType tupleIdx, ValueType* tuple) const + inline void GetTypedTuple(vtkIdType tupleIdx, ValueType* tuple) const { for (size_t cc=0; cc < this->Data.size(); cc++) { tuple[cc] = this->Data[cc].GetBuffer()[tupleIdx]; } } - inline ConstReferenceType GetComponentValue(vtkIdType tupleIdx, - int comp) const + inline ValueType GetTypedComponent(vtkIdType tupleIdx, int comp) const { return this->Data[comp].GetBuffer()[tupleIdx]; } @@ -66,16 +63,16 @@ public: vtkIdType tupleIdx; int comp; this->GetTupleIndexFromValueIndex(valueIdx, tupleIdx, comp); - this->SetComponentValue(tupleIdx, comp, value); + this->SetTypedComponent(tupleIdx, comp, value); } - inline void SetTupleValue(vtkIdType tupleIdx, const ValueType* tuple) + inline void SetTypedTuple(vtkIdType tupleIdx, const ValueType* tuple) { for (size_t cc=0; cc < this->Data.size(); ++cc) { this->Data[cc].GetBuffer()[tupleIdx] = tuple[cc]; } } - inline void SetComponentValue(vtkIdType tupleIdx, int comp, ValueType value) + inline void SetTypedComponent(vtkIdType tupleIdx, int comp, ValueType value) { this->Data[comp].GetBuffer()[tupleIdx] = value; } diff --git a/Common/Core/vtkSOADataArrayTemplate.txx b/Common/Core/vtkSOADataArrayTemplate.txx index 3419d35484..acc1214ac2 100644 --- a/Common/Core/vtkSOADataArrayTemplate.txx +++ b/Common/Core/vtkSOADataArrayTemplate.txx @@ -192,7 +192,7 @@ void *vtkSOADataArrayTemplate<ValueType>::GetVoidPointer(vtkIdType id) "this warning."); } - size_t numValues = this->NumberOfComponents * this->GetNumberOfTuples(); + size_t numValues = this->GetNumberOfValues(); if (!this->AoSCopy.Allocate(numValues)) { diff --git a/Common/Core/vtkTypedDataArray.h b/Common/Core/vtkTypedDataArray.h index 2021c901dd..70e6b80456 100644 --- a/Common/Core/vtkTypedDataArray.h +++ b/Common/Core/vtkTypedDataArray.h @@ -44,8 +44,6 @@ class vtkTypedDataArray : public: vtkTemplateTypeMacro(vtkTypedDataArray<Scalar>, GenericDataArrayType) typedef typename Superclass::ValueType ValueType; - typedef typename Superclass::ReferenceType ReferenceType; - typedef typename Superclass::ConstReferenceType ConstReferenceType; // Description: // Typedef to a suitable iterator class. @@ -94,16 +92,16 @@ public: // Description: // Set the tuple value at the ith location in the array. - virtual void SetTupleValue(vtkIdType i, const ValueType *t) = 0; + virtual void SetTypedTuple(vtkIdType i, const ValueType *t) = 0; // Description: // Insert (memory allocation performed) the tuple into the ith location // in the array. - virtual void InsertTupleValue(vtkIdType i, const ValueType *t) = 0; + virtual void InsertTypedTuple(vtkIdType i, const ValueType *t) = 0; // Description: // Insert (memory allocation performed) the tuple onto the end of the array. - virtual vtkIdType InsertNextTupleValue(const ValueType *t) = 0; + virtual vtkIdType InsertNextTypedTuple(const ValueType *t) = 0; // Description: // Return the indices where a specific value appears. @@ -112,11 +110,11 @@ public: // Description: // Get the data at a particular index. - virtual ConstReferenceType GetValue(vtkIdType idx) const = 0; + virtual ValueType GetValue(vtkIdType idx) const = 0; // Description: // Get a reference to the scalar value at a particular index. - virtual ReferenceType GetValueReference(vtkIdType idx) = 0; + virtual ValueType& GetValueReference(vtkIdType idx) = 0; // Description: // Set the data at a particular index. Does not do range checking. Make sure @@ -125,7 +123,7 @@ public: // Description: // Copy the tuple value into a user-provided array. - virtual void GetTupleValue(vtkIdType idx, ValueType *t) const = 0; + virtual void GetTypedTuple(vtkIdType idx, ValueType *t) const = 0; // Description: // Insert data at the end of the array. Return its location in the array. @@ -135,8 +133,8 @@ public: // Insert data at a specified position in the array. virtual void InsertValue(vtkIdType idx, ValueType v) = 0; - virtual ConstReferenceType GetComponentValue(vtkIdType tupleIdx, int comp) const; - virtual void SetComponentValue(vtkIdType tupleIdx, int comp, ValueType v); + virtual ValueType GetTypedComponent(vtkIdType tupleIdx, int comp) const; + virtual void SetTypedComponent(vtkIdType tupleIdx, int comp, ValueType v); // Description: // Method for type-checking in FastDownCast implementations. diff --git a/Common/Core/vtkTypedDataArray.txx b/Common/Core/vtkTypedDataArray.txx index 38c242509b..931367d620 100644 --- a/Common/Core/vtkTypedDataArray.txx +++ b/Common/Core/vtkTypedDataArray.txx @@ -77,15 +77,15 @@ void vtkTypedDataArray<Scalar>::SetNumberOfValues(vtkIdType number) //------------------------------------------------------------------------------ template <typename Scalar> inline -typename vtkTypedDataArray<Scalar>::ConstReferenceType -vtkTypedDataArray<Scalar>::GetComponentValue(vtkIdType tupleIdx, int comp) const +typename vtkTypedDataArray<Scalar>::ValueType +vtkTypedDataArray<Scalar>::GetTypedComponent(vtkIdType tupleIdx, int comp) const { return this->GetValue(tupleIdx * this->NumberOfComponents + comp); } //------------------------------------------------------------------------------ template <typename Scalar> inline -void vtkTypedDataArray<Scalar>::SetComponentValue(vtkIdType tupleIdx, int comp, +void vtkTypedDataArray<Scalar>::SetTypedComponent(vtkIdType tupleIdx, int comp, ValueType v) { this->SetValue(tupleIdx * this->NumberOfComponents + comp, v); diff --git a/Common/DataModel/Testing/Cxx/TestPolyDataRemoveCell.cxx b/Common/DataModel/Testing/Cxx/TestPolyDataRemoveCell.cxx index 3e3f81dcb7..0c6b438606 100644 --- a/Common/DataModel/Testing/Cxx/TestPolyDataRemoveCell.cxx +++ b/Common/DataModel/Testing/Cxx/TestPolyDataRemoveCell.cxx @@ -93,7 +93,7 @@ int TestPolyDataRemoveCell(int , char *[]) { data[j+1] = pts[j]; } - cellPoints->SetTupleValue(i, data); + cellPoints->SetTypedTuple(i, data); } poly->GetCellData()->AddArray(cellPoints); cellPoints->Delete(); @@ -133,7 +133,7 @@ int TestPolyDataRemoveCell(int , char *[]) vtkIdType npts, *pts; poly->GetCellPoints(i, npts, pts); vtkIdType data[4]; - cellPoints->GetTupleValue(i, data); + cellPoints->GetTypedTuple(i, data); if(data[0] != npts) { cout << "Problem with the number of points for cell " << i << endl; diff --git a/Common/DataModel/vtkDataSetAttributes.cxx b/Common/DataModel/vtkDataSetAttributes.cxx index 028cdd50cd..3b6f2cfd83 100644 --- a/Common/DataModel/vtkDataSetAttributes.cxx +++ b/Common/DataModel/vtkDataSetAttributes.cxx @@ -477,8 +477,8 @@ struct CopyStructuredDataWorker for (int comp = 0, max = dest->GetNumberOfComponents(); comp < max; ++comp) { - dest->SetComponentValue(outTupleIdx, comp, - src->GetComponentValue(inTupleIdx, comp)); + dest->SetTypedComponent(outTupleIdx, comp, + src->GetTypedComponent(inTupleIdx, comp)); } outTupleIdx++; } diff --git a/Common/DataModel/vtkHyperOctree.cxx b/Common/DataModel/vtkHyperOctree.cxx index b93d8caf8f..e07e664515 100644 --- a/Common/DataModel/vtkHyperOctree.cxx +++ b/Common/DataModel/vtkHyperOctree.cxx @@ -3656,7 +3656,7 @@ void vtkHyperOctree::EvaluateDualCorner( leaves[corner] = neighborhood[corner].GetLeafIndex(); } - this->CornerLeafIds->InsertNextTupleValue(leaves); + this->CornerLeafIds->InsertNextTypedTuple(leaves); } //---------------------------------------------------------------------------- diff --git a/Common/DataModel/vtkHyperTreeGrid.cxx b/Common/DataModel/vtkHyperTreeGrid.cxx index d24ef66dd1..da55535f42 100644 --- a/Common/DataModel/vtkHyperTreeGrid.cxx +++ b/Common/DataModel/vtkHyperTreeGrid.cxx @@ -1754,7 +1754,7 @@ void vtkHyperTreeGrid::TraverseDualLeaf( vtkHyperTreeGridSuperCursor* superCurso if ( owner ) { - this->Connectivity->InsertNextTupleValue( leaves ); + this->Connectivity->InsertNextTypedTuple( leaves ); } } // cornerIdx } diff --git a/Common/DataModel/vtkPolyhedron.cxx b/Common/DataModel/vtkPolyhedron.cxx index 96d8c9d231..3f9df6c8e2 100644 --- a/Common/DataModel/vtkPolyhedron.cxx +++ b/Common/DataModel/vtkPolyhedron.cxx @@ -1563,7 +1563,7 @@ vtkCell *vtkPolyhedron::GetEdge(int edgeId) // Return the requested edge vtkIdType edge[2]; - this->Edges->GetTupleValue(edgeId,edge); + this->Edges->GetTypedTuple(edgeId,edge); // Recall that edge tuples are stored in canonical numbering for (int i=0; i<2; i++) @@ -1607,7 +1607,7 @@ int vtkPolyhedron::GenerateEdges() if ( this->EdgeTable->IsEdge(edge[0],edge[1]) == (-1) ) { this->EdgeTable->InsertEdge(edge[0],edge[1]); - this->Edges->InsertNextTupleValue(edge); + this->Edges->InsertNextTypedTuple(edge); } } face += face[0] + 1; diff --git a/Domains/Chemistry/vtkBlueObeliskDataParser.cxx b/Domains/Chemistry/vtkBlueObeliskDataParser.cxx index 9b0e0e92ad..4ba87f1512 100644 --- a/Domains/Chemistry/vtkBlueObeliskDataParser.cxx +++ b/Domains/Chemistry/vtkBlueObeliskDataParser.cxx @@ -273,7 +273,7 @@ void vtkBlueObeliskDataParser::NewAtomFinished() // Tuple handled differently this->ResizeArrayIfNeeded(this->Target->DefaultColors.GetPointer(), index); - this->Target->DefaultColors->SetTupleValue(index, + this->Target->DefaultColors->SetTypedTuple(index, this->CurrentDefaultColor); this->ResizeAndSetValue(this->CurrentBoilingPoint, this->Target->BoilingPoints.GetPointer(), diff --git a/Domains/Chemistry/vtkPeriodicTable.cxx b/Domains/Chemistry/vtkPeriodicTable.cxx index 23e20c7caa..e4ee854727 100644 --- a/Domains/Chemistry/vtkPeriodicTable.cxx +++ b/Domains/Chemistry/vtkPeriodicTable.cxx @@ -184,7 +184,7 @@ void vtkPeriodicTable::GetDefaultLUT(vtkLookupTable * lut) float rgb[3]; for (vtkIdType i = 0; static_cast<unsigned int>(i) < numColors; ++i) { - colors->GetTupleValue(i, rgb); + colors->GetTypedTuple(i, rgb); lut->SetTableValue(i, rgb[0], rgb[1], rgb[2]); } } @@ -193,14 +193,14 @@ void vtkPeriodicTable::GetDefaultLUT(vtkLookupTable * lut) void vtkPeriodicTable::GetDefaultRGBTuple(unsigned short atomicNum, float rgb[3]) { - this->BlueObeliskData->GetDefaultColors()->GetTupleValue(atomicNum, rgb); + this->BlueObeliskData->GetDefaultColors()->GetTypedTuple(atomicNum, rgb); } //---------------------------------------------------------------------------- vtkColor3f vtkPeriodicTable::GetDefaultRGBTuple(unsigned short atomicNum) { vtkColor3f result; - this->BlueObeliskData->GetDefaultColors()->GetTupleValue(atomicNum, + this->BlueObeliskData->GetDefaultColors()->GetTypedTuple(atomicNum, result.GetData()); return result; } diff --git a/Filters/Core/Testing/Cxx/TestNamedComponents.cxx b/Filters/Core/Testing/Cxx/TestNamedComponents.cxx index 07cb17ab2a..d0fabcdba9 100644 --- a/Filters/Core/Testing/Cxx/TestNamedComponents.cxx +++ b/Filters/Core/Testing/Cxx/TestNamedComponents.cxx @@ -115,7 +115,7 @@ int TestNamedComponents(int , char *[]) { data[j+1] = pts[j]; } - cellPoints->SetTupleValue(i, data); + cellPoints->SetTypedTuple(i, data); } poly->GetCellData()->AddArray(cellPoints); diff --git a/Filters/Core/Testing/Cxx/TestStructuredGridAppend.cxx b/Filters/Core/Testing/Cxx/TestStructuredGridAppend.cxx index 68a0ef9c9b..527c8a0005 100644 --- a/Filters/Core/Testing/Cxx/TestStructuredGridAppend.cxx +++ b/Filters/Core/Testing/Cxx/TestStructuredGridAppend.cxx @@ -69,7 +69,7 @@ namespace for(int i=extent[0];i<extent[1];i++) { ijk[0] = i; - cellArray->InsertNextTupleValue(ijk); + cellArray->InsertNextTypedTuple(ijk); } } } @@ -140,7 +140,7 @@ namespace for(int i=extent[0];i<extent[1];i++) { int values[3]; - cellArray->GetTupleValue(counter, values); + cellArray->GetTypedTuple(counter, values); if(values[0] != i || values[1] != j || values[2] != k) { vtkGenericWarningMacro("ERROR: Bad cell array tuple value [" diff --git a/Filters/Core/vtkAppendPolyData.cxx b/Filters/Core/vtkAppendPolyData.cxx index fa65068dd1..afcea5c846 100644 --- a/Filters/Core/vtkAppendPolyData.cxx +++ b/Filters/Core/vtkAppendPolyData.cxx @@ -730,8 +730,8 @@ struct AppendDataWorker { for (int c = 0; c < numComps; ++c) { - dest->SetComponentValue(t + this->Offset, c, - src->GetComponentValue(t, c)); + dest->SetTypedComponent(t + this->Offset, c, + src->GetTypedComponent(t, c)); } } } diff --git a/Filters/General/Testing/Cxx/TestGradientAndVorticity.cxx b/Filters/General/Testing/Cxx/TestGradientAndVorticity.cxx index 28e5e61323..aeacae96e0 100644 --- a/Filters/General/Testing/Cxx/TestGradientAndVorticity.cxx +++ b/Filters/General/Testing/Cxx/TestGradientAndVorticity.cxx @@ -84,7 +84,7 @@ namespace {// +offset makes the curl/vorticity nonzero tupleValues[j] = point[(j+offset)%3]; } - array->SetTupleValue(i, &tupleValues[0]); + array->SetTypedTuple(i, &tupleValues[0]); } array->SetName(arrayName); grid->GetCellData()->AddArray(array); @@ -107,7 +107,7 @@ namespace {// +offset makes the curl/vorticity nonzero tupleValues[j] = point[(j+offset)%3]; } - array->SetTupleValue(i, &tupleValues[0]); + array->SetTypedTuple(i, &tupleValues[0]); } array->SetName(arrayName); grid->GetPointData()->AddArray(array); diff --git a/Filters/General/Testing/Cxx/TestTableSplitColumnComponents.cxx b/Filters/General/Testing/Cxx/TestTableSplitColumnComponents.cxx index a869b18cc7..9d1939f4e7 100644 --- a/Filters/General/Testing/Cxx/TestTableSplitColumnComponents.cxx +++ b/Filters/General/Testing/Cxx/TestTableSplitColumnComponents.cxx @@ -38,7 +38,7 @@ int TestTableSplitColumnComponents(int, char*[]) { single->InsertValue(i, i); int ints[] = { i+1, 2 * (i+1), 3 * (i+1) }; - multi->InsertTupleValue(i, ints); + multi->InsertTypedTuple(i, ints); } VTK_CREATE(vtkTable, table); diff --git a/Filters/General/vtkBooleanOperationPolyDataFilter.cxx b/Filters/General/vtkBooleanOperationPolyDataFilter.cxx index 34d5b07410..aea1cfe68d 100644 --- a/Filters/General/vtkBooleanOperationPolyDataFilter.cxx +++ b/Filters/General/vtkBooleanOperationPolyDataFilter.cxx @@ -336,11 +336,11 @@ void vtkBooleanOperationPolyDataFilter if ( reverseCells && outNormals ) { float normal[3]; - outNormals->GetTupleValue( newId, normal ); + outNormals->GetTypedTuple( newId, normal ); normal[0] *= -1.0; normal[1] *= -1.0; normal[2] *= -1.0; - outNormals->SetTupleValue( newId, normal ); + outNormals->SetTypedTuple( newId, normal ); } } diff --git a/Filters/General/vtkClipClosedSurface.cxx b/Filters/General/vtkClipClosedSurface.cxx index 79376afd14..49681f28da 100644 --- a/Filters/General/vtkClipClosedSurface.cxx +++ b/Filters/General/vtkClipClosedSurface.cxx @@ -598,13 +598,13 @@ int vtkClipClosedSurface::RequestData( for (vtkIdType lineId = numClipLines; lineId < numLines; lineId++) { unsigned char oldColor[3]; - scalars->GetTupleValue(lineId, oldColor); + scalars->GetTypedTuple(lineId, oldColor); if (numberOfScalarComponents != 3 || oldColor[0] != activeColor[0] || oldColor[1] != activeColor[1] || oldColor[2] != activeColor[2]) { - scalars->SetTupleValue(lineId, color); + scalars->SetTypedTuple(lineId, color); } } } @@ -633,10 +633,10 @@ int vtkClipClosedSurface::RequestData( if (numCells > cellId) { // The insert allocates space up to numCells-1 - scalars->InsertTupleValue(numCells-1, color); + scalars->InsertTypedTuple(numCells-1, color); for (;cellId < numCells; cellId++) { - scalars->SetTupleValue(cellId, color); + scalars->SetTypedTuple(cellId, color); } } } @@ -653,11 +653,11 @@ int vtkClipClosedSurface::RequestData( if (numCells > numClipAndContourLines) { // The insert allocates space up to numCells-1 - scalars->InsertTupleValue(numCells-1, color); + scalars->InsertTypedTuple(numCells-1, color); for (vtkIdType lineCellId = numClipAndContourLines; lineCellId < numCells; lineCellId++) { - scalars->SetTupleValue(lineCellId, color); + scalars->SetTypedTuple(lineCellId, color); } } } @@ -729,13 +729,13 @@ int vtkClipClosedSurface::RequestData( color[0] = color[1] = color[2] = 0; // This is just to expand the array - scalars->InsertTupleValue(n+m-1, color); + scalars->InsertTypedTuple(n+m-1, color); // Fill in the poly scalars for (vtkIdType i = 0; i < n; i++) { - pScalars->GetTupleValue(i, color); - scalars->SetTupleValue(i+m, color); + pScalars->GetTypedTuple(i, color); + scalars->SetTypedTuple(i+m, color); } } } @@ -1188,7 +1188,7 @@ void vtkClipClosedSurface::BreakPolylines( { if (inputScalars) { - inputScalars->GetTupleValue(firstLineScalar + cellId++, cellColor); + inputScalars->GetTypedTuple(firstLineScalar + cellId++, cellColor); } for (vtkIdType i = 1; i < npts; i++) @@ -1199,7 +1199,7 @@ void vtkClipClosedSurface::BreakPolylines( if (scalars) { - scalars->InsertNextTupleValue(cellColor); + scalars->InsertNextTypedTuple(cellColor); } } } @@ -1232,15 +1232,15 @@ void vtkClipClosedSurface::CopyPolygons( { for (vtkIdType i = 0; i < n; i++) { - inputScalars->GetTupleValue(i + firstPolyScalar, scalarValue); - polyScalars->SetTupleValue(i, scalarValue); + inputScalars->GetTypedTuple(i + firstPolyScalar, scalarValue); + polyScalars->SetTypedTuple(i, scalarValue); } } else { for (vtkIdType i = 0; i < n; i++) { - polyScalars->SetTupleValue(i, scalarValue); + polyScalars->SetTypedTuple(i, scalarValue); } } } @@ -1278,7 +1278,7 @@ void vtkClipClosedSurface::BreakTriangleStrips( if (inputScalars) { // If there are input scalars, use them instead of "color" - inputScalars->GetTupleValue(cellId, scalarValue); + inputScalars->GetTypedTuple(cellId, scalarValue); } vtkIdType n = npts - 3; @@ -1286,11 +1286,11 @@ void vtkClipClosedSurface::BreakTriangleStrips( if (n >= 0) { // First insert is just to allocate space - polyScalars->InsertTupleValue(m+n, scalarValue); + polyScalars->InsertTypedTuple(m+n, scalarValue); for (vtkIdType i = 0; i < n; i++) { - polyScalars->SetTupleValue(m+i, scalarValue); + polyScalars->SetTypedTuple(m+i, scalarValue); } } } diff --git a/Filters/General/vtkWarpVector.cxx b/Filters/General/vtkWarpVector.cxx index f897ca1740..ba87af1c8f 100644 --- a/Filters/General/vtkWarpVector.cxx +++ b/Filters/General/vtkWarpVector.cxx @@ -125,9 +125,9 @@ struct WarpVectorDispatch2Points for (int c = 0; c < 3; ++c) { - PointValueT val = inPtArray->GetComponentValue(t, c) + - scaleFactor * this->Vectors->GetComponentValue(t, c); - outPtArray->SetComponentValue(t, c, val); + PointValueT val = inPtArray->GetTypedComponent(t, c) + + scaleFactor * this->Vectors->GetTypedComponent(t, c); + outPtArray->SetTypedComponent(t, c, val); } } } diff --git a/Filters/Geometry/Testing/Cxx/TestDataSetSurfaceFieldData.cxx b/Filters/Geometry/Testing/Cxx/TestDataSetSurfaceFieldData.cxx index 516934de27..b1f6051038 100644 --- a/Filters/Geometry/Testing/Cxx/TestDataSetSurfaceFieldData.cxx +++ b/Filters/Geometry/Testing/Cxx/TestDataSetSurfaceFieldData.cxx @@ -69,7 +69,7 @@ int TestDataSet(vtkDataSet* ds, int expectedValue) else { int value = 0; - array->GetTupleValue(0, &value); + array->GetTypedTuple(0, &value); std::cout << "Block value " << value << "\n"; if (value != expectedValue) @@ -92,7 +92,7 @@ void AddFieldData(vtkDataSet* ds, int id) array->SetName("ID"); array->SetNumberOfComponents(1); array->SetNumberOfTuples(1); - array->SetTupleValue(0, &id); + array->SetTypedTuple(0, &id); ds->GetFieldData()->AddArray(array.GetPointer()); } diff --git a/Filters/Geometry/Testing/Cxx/TestGeometryFilterCellData.cxx b/Filters/Geometry/Testing/Cxx/TestGeometryFilterCellData.cxx index 1fedbd5d56..6970ea4937 100644 --- a/Filters/Geometry/Testing/Cxx/TestGeometryFilterCellData.cxx +++ b/Filters/Geometry/Testing/Cxx/TestGeometryFilterCellData.cxx @@ -142,7 +142,7 @@ vtkUnstructuredGrid* GridFactory::Get() for ( int i = 0; i < num; ++i ) { vtkIdType value = i+100; - pointDataArray->InsertNextTupleValue( &value ); + pointDataArray->InsertNextTypedTuple( &value ); } this->Grid->GetPointData()->AddArray( pointDataArray ); @@ -156,7 +156,7 @@ vtkUnstructuredGrid* GridFactory::Get() for ( int i = 0; i < num; ++i ) { vtkIdType value = i+200; - cellDataArray->InsertNextTupleValue( &value ); + cellDataArray->InsertNextTypedTuple( &value ); } this->Grid->GetCellData()->AddArray( cellDataArray ); diff --git a/Filters/Geometry/vtkDataSetSurfaceFilter.cxx b/Filters/Geometry/vtkDataSetSurfaceFilter.cxx index c5547df924..b0d2c2e02c 100644 --- a/Filters/Geometry/vtkDataSetSurfaceFilter.cxx +++ b/Filters/Geometry/vtkDataSetSurfaceFilter.cxx @@ -1851,7 +1851,7 @@ int vtkDataSetSurfaceFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput, for (cellPtId = 0; cell->GetPointId(cellPtId) != ptId; cellPtId++) { } - parametricCoords->InsertNextTupleValue(pc + 3*cellPtId); + parametricCoords->InsertNextTypedTuple(pc + 3*cellPtId); } // Subdivide these triangles as many more times as necessary. Remember // that we have already done the first subdivision. @@ -1873,7 +1873,7 @@ int vtkDataSetSurfaceFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput, for (k = 0; k < 3; k++) { inPts[k] = outPts->GetId(i+k); - parametricCoords->GetTupleValue(i+k, inParamCoords[k]); + parametricCoords->GetTypedTuple(i+k, inParamCoords[k]); } for (k = 3; k < 6; k++) { @@ -1900,7 +1900,7 @@ int vtkDataSetSurfaceFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput, { int localId = subtriangles[k]; outPts2->InsertNextId(inPts[localId]); - parametricCoords2->InsertNextTupleValue(inParamCoords[localId]); + parametricCoords2->InsertNextTypedTuple(inParamCoords[localId]); } } // Iterate over triangles // Now that we have recorded the subdivided triangles in outPts2 and diff --git a/Filters/ReebGraph/Testing/Cxx/TestReebGraph.cxx b/Filters/ReebGraph/Testing/Cxx/TestReebGraph.cxx index 0f099a5a37..c24e1b7d26 100644 --- a/Filters/ReebGraph/Testing/Cxx/TestReebGraph.cxx +++ b/Filters/ReebGraph/Testing/Cxx/TestReebGraph.cxx @@ -4402,14 +4402,14 @@ int DisplaySurfaceSkeleton(vtkPolyData *surfaceMesh, vtkTable *skeleton) vtkDoubleArray *arc = vtkDoubleArray::SafeDownCast(skeleton->GetColumn(i)); // critical point at the origin of the arc - arc->GetTupleValue(0, point); + arc->GetTypedTuple(0, point); nodeActors[2*i] = vtkActor::New(); nodeActors[2*i]->SetMapper(sphereMapper); nodeActors[2*i]->GetProperty()->SetColor(0, 0, 1); nodeActors[2*i]->SetPosition(point); renderer->AddActor(nodeActors[2*i]); - arc->GetTupleValue(arc->GetNumberOfTuples() - 1, point); + arc->GetTypedTuple(arc->GetNumberOfTuples() - 1, point); nodeActors[2*i + 1] = vtkActor::New(); nodeActors[2*i + 1]->SetMapper(sphereMapper); nodeActors[2*i + 1]->GetProperty()->SetColor(0, 0, 1); @@ -4420,7 +4420,7 @@ int DisplaySurfaceSkeleton(vtkPolyData *surfaceMesh, vtkTable *skeleton) int initialSampleId = sampleId; for(int j = 0; j < arc->GetNumberOfTuples(); j++) { - arc->GetTupleValue(j, point); + arc->GetTypedTuple(j, point); skeletonSamples->SetPoint(sampleId, point); sampleId++; } @@ -4525,14 +4525,14 @@ int DisplayVolumeSkeleton(vtkUnstructuredGrid* vtkNotUsed(volumeMesh), vtkTable vtkDoubleArray *arc = vtkDoubleArray::SafeDownCast(skeleton->GetColumn(i)); // critical point at the origin of the arc - arc->GetTupleValue(0, point); + arc->GetTypedTuple(0, point); nodeActors[2*i] = vtkActor::New(); nodeActors[2*i]->SetMapper(sphereMapper); nodeActors[2*i]->GetProperty()->SetColor(0, 0, 1); nodeActors[2*i]->SetPosition(point); renderer->AddActor(nodeActors[2*i]); - arc->GetTupleValue(arc->GetNumberOfTuples() - 1, point); + arc->GetTypedTuple(arc->GetNumberOfTuples() - 1, point); nodeActors[2*i + 1] = vtkActor::New(); nodeActors[2*i + 1]->SetMapper(sphereMapper); nodeActors[2*i + 1]->GetProperty()->SetColor(0, 0, 1); @@ -4543,7 +4543,7 @@ int DisplayVolumeSkeleton(vtkUnstructuredGrid* vtkNotUsed(volumeMesh), vtkTable int initialSampleId = sampleId; for(int j = 0; j < arc->GetNumberOfTuples(); j++) { - arc->GetTupleValue(j, point); + arc->GetTypedTuple(j, point); skeletonSamples->SetPoint(sampleId, point); sampleId++; } diff --git a/Filters/ReebGraph/vtkReebGraphSurfaceSkeletonFilter.cxx b/Filters/ReebGraph/vtkReebGraphSurfaceSkeletonFilter.cxx index 6e69d3287c..7e16053385 100644 --- a/Filters/ReebGraph/vtkReebGraphSurfaceSkeletonFilter.cxx +++ b/Filters/ReebGraph/vtkReebGraphSurfaceSkeletonFilter.cxx @@ -198,10 +198,10 @@ int vtkReebGraphSurfaceSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(re points[k] = (double *) malloc(sizeof(double)*3); inputMesh->GetPoint(vertices[k], points[k]); meshToSubMeshMap[vertices[k]] = - subCoordinates->InsertNextTupleValue(points[k]); + subCoordinates->InsertNextTypedTuple(points[k]); double scalarFieldValue = scalarField->GetComponent(vertices[k], 0); - subField->InsertNextTupleValue(&scalarFieldValue); + subField->InsertNextTypedTuple(&scalarFieldValue); visitedVertices[vertices[k]] = true; free(points[k]); } @@ -371,7 +371,7 @@ int vtkReebGraphSurfaceSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(re double *point = (double *) malloc(sizeof(double)*3); for(int k = 0; k < 3; k++) point[k] = skeleton[i][j][k]; - outputArc->InsertNextTupleValue(point); + outputArc->InsertNextTypedTuple(point); free(point); } output->AddColumn(outputArc); diff --git a/Filters/ReebGraph/vtkReebGraphVolumeSkeletonFilter.cxx b/Filters/ReebGraph/vtkReebGraphVolumeSkeletonFilter.cxx index 9d0a4a7811..e43ca95577 100644 --- a/Filters/ReebGraph/vtkReebGraphVolumeSkeletonFilter.cxx +++ b/Filters/ReebGraph/vtkReebGraphVolumeSkeletonFilter.cxx @@ -205,10 +205,10 @@ int vtkReebGraphVolumeSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(req // add also its scalar value to the subField inputMesh->GetPoint(vertexId, point); meshToSubMeshMap[vertexId] = - subCoordinates->InsertNextTupleValue(point); + subCoordinates->InsertNextTypedTuple(point); double scalarFieldValue = scalarField->GetComponent(vertexId, 0); - subField->InsertNextTupleValue(&scalarFieldValue); + subField->InsertNextTypedTuple(&scalarFieldValue); visitedVertices[vertexId] = true; } } @@ -368,7 +368,7 @@ int vtkReebGraphVolumeSkeletonFilter::RequestData(vtkInformation* vtkNotUsed(req { for(int k = 0; k < 3; k++) point[k] = skeleton[i][j][k]; - outputArc->InsertNextTupleValue(point); + outputArc->InsertNextTypedTuple(point); } output->AddColumn(outputArc); outputArc->Delete(); diff --git a/Filters/SMP/Testing/Cxx/TestSMPWarp.cxx b/Filters/SMP/Testing/Cxx/TestSMPWarp.cxx index e703cf85b2..d54dd28425 100644 --- a/Filters/SMP/Testing/Cxx/TestSMPWarp.cxx +++ b/Filters/SMP/Testing/Cxx/TestSMPWarp.cxx @@ -119,7 +119,7 @@ public: float* fptr = pts->GetPointer(3*begin); for (vtkIdType i=begin; i<end; i++) { - //pts->GetTupleValue(i, x); + //pts->GetTypedTuple(i, x); x = fptr; lbounds[0] = x[0] < lbounds[0] ? x[0] : lbounds[0]; lbounds[1] = x[0] > lbounds[1] ? x[0] : lbounds[1]; @@ -152,7 +152,7 @@ public: #if 0 pts->SetTuple(counter++, pt); #else - pts->SetTupleValue(counter++, pt); + pts->SetTypedTuple(counter++, pt); // pts->SetValue(counter++, i*spacing); // pts->SetValue(counter++, j*spacing); // pts->SetValue(counter++, k*spacing); diff --git a/Filters/Statistics/vtkPCAStatistics.cxx b/Filters/Statistics/vtkPCAStatistics.cxx index 699cec7c55..a5023e4ca6 100644 --- a/Filters/Statistics/vtkPCAStatistics.cxx +++ b/Filters/Statistics/vtkPCAStatistics.cxx @@ -156,7 +156,7 @@ void vtkPCAStatistics::GetEigenvectors(int request, vtkDoubleArray* eigenvectors eigenvector.push_back(currentCol->GetValue(i)); } - eigenvectors->InsertNextTupleValue(&eigenvector.front()); + eigenvectors->InsertNextTypedTuple(&eigenvector.front()); eval++; } } @@ -177,12 +177,12 @@ void vtkPCAStatistics::GetEigenvector(int request, int i, vtkDoubleArray* eigenv this->GetEigenvectors(request, eigenvectors); double* evec = new double[eigenvectors->GetNumberOfComponents()]; - eigenvectors->GetTupleValue(i, evec); + eigenvectors->GetTypedTuple(i, evec); eigenvector->Reset(); eigenvector->Squeeze(); eigenvector->SetNumberOfComponents(eigenvectors->GetNumberOfComponents()); - eigenvector->InsertNextTupleValue(evec); + eigenvector->InsertNextTypedTuple(evec); delete[] evec; } diff --git a/GUISupport/Qt/vtkQtTableModelAdapter.cxx b/GUISupport/Qt/vtkQtTableModelAdapter.cxx index 4ae63a22d1..1613ccc95f 100644 --- a/GUISupport/Qt/vtkQtTableModelAdapter.cxx +++ b/GUISupport/Qt/vtkQtTableModelAdapter.cxx @@ -816,7 +816,7 @@ QVariant vtkQtTableModelAdapter::getColorIcon(int row) const if(nComponents >= 3) { unsigned char rgba[4]; - colors->GetTupleValue(row, rgba); + colors->GetTypedTuple(row, rgba); int rgb[3]; rgb[0] = static_cast<int>(0x0ff & rgba[0]); rgb[1] = static_cast<int>(0x0ff & rgba[1]); diff --git a/GUISupport/Qt/vtkQtTreeModelAdapter.cxx b/GUISupport/Qt/vtkQtTreeModelAdapter.cxx index 45ac497284..b1563b70f9 100644 --- a/GUISupport/Qt/vtkQtTreeModelAdapter.cxx +++ b/GUISupport/Qt/vtkQtTreeModelAdapter.cxx @@ -328,7 +328,7 @@ QVariant vtkQtTreeModelAdapter::data(const QModelIndex &idx, int role) const } unsigned char rgba[4]; - colors->GetTupleValue(vertex, rgba); + colors->GetTypedTuple(vertex, rgba); int rgb[3]; rgb[0] = static_cast<int>(0x0ff & rgba[0]); rgb[1] = static_cast<int>(0x0ff & rgba[1]); diff --git a/Geovis/Core/Testing/Cxx/TestGlobeSource.cxx b/Geovis/Core/Testing/Cxx/TestGlobeSource.cxx index ff129f0eae..ba688269cf 100644 --- a/Geovis/Core/Testing/Cxx/TestGlobeSource.cxx +++ b/Geovis/Core/Testing/Cxx/TestGlobeSource.cxx @@ -82,7 +82,7 @@ int TestGlobeSource(int argc, char* argv[]) for(int i=0; i < array->GetNumberOfTuples(); ++i) { - array->GetTupleValue(i, val); + array->GetTypedTuple(i, val); // Get the texture coordinates in [0,1] range. newVal[1] = (latRange[0] - val[0]) / range[0]; diff --git a/Geovis/Core/vtkCompassRepresentation.cxx b/Geovis/Core/vtkCompassRepresentation.cxx index c21ac60521..d706601b1f 100644 --- a/Geovis/Core/vtkCompassRepresentation.cxx +++ b/Geovis/Core/vtkCompassRepresentation.cxx @@ -172,11 +172,11 @@ void vtkCompassRepresentation::BuildBackdrop() color[1] = 0; color[2] = 0; color[3] = 0; - colors->SetTupleValue(0,color); - colors->SetTupleValue(3,color); + colors->SetTypedTuple(0,color); + colors->SetTypedTuple(3,color); color[3] = 80; - colors->SetTupleValue(1,color); - colors->SetTupleValue(2,color); + colors->SetTypedTuple(1,color); + colors->SetTypedTuple(2,color); backdropPolyData->GetPointData()->SetScalars(colors); this->BackdropMapper = vtkPolyDataMapper2D::New(); @@ -480,14 +480,14 @@ void vtkCompassRepresentation::BuildRepresentation() pts->SetPoint( 0, center[0] - rsize * 5.0, center[1] - rsize * 1.1, 0 ); pts->SetPoint( 3, center[0] - rsize * 5.0, renSize[1], 0 ); color[3] = 80; - colors->SetTupleValue(1,color); + colors->SetTypedTuple(1,color); } else { pts->SetPoint( 0, center[0] - rsize * 3.0, center[1] - rsize * 1.1, 0 ); pts->SetPoint( 3, center[0] - rsize * 3.0, renSize[1], 0 ); color[3] = 0; - colors->SetTupleValue( 1, color ); + colors->SetTypedTuple( 1, color ); } pts->Modified(); colors->Modified(); diff --git a/IO/Exodus/vtkCPExodusIINodalCoordinatesTemplate.h b/IO/Exodus/vtkCPExodusIINodalCoordinatesTemplate.h index a35b561882..b388f56fa5 100644 --- a/IO/Exodus/vtkCPExodusIINodalCoordinatesTemplate.h +++ b/IO/Exodus/vtkCPExodusIINodalCoordinatesTemplate.h @@ -41,8 +41,6 @@ public: virtual void PrintSelf(ostream &os, vtkIndent indent); typedef typename Superclass::ValueType ValueType; - typedef typename Superclass::ReferenceType ReferenceType; - typedef typename Superclass::ConstReferenceType ConstReferenceType; // Description: // Set the raw scalar arrays for the coordinate set. This class takes @@ -64,9 +62,9 @@ public: void GetTuple(vtkIdType i, double *tuple); vtkIdType LookupTypedValue(Scalar value); void LookupTypedValue(Scalar value, vtkIdList *ids); - ConstReferenceType GetValue(vtkIdType idx) const; - ReferenceType GetValueReference(vtkIdType idx); - void GetTupleValue(vtkIdType idx, Scalar *t) const; + ValueType GetValue(vtkIdType idx) const; + ValueType& GetValueReference(vtkIdType idx); + void GetTypedTuple(vtkIdType idx, Scalar *t) const; // Description: // This container is read only -- this method does nothing but print a @@ -98,9 +96,9 @@ public: void RemoveTuple(vtkIdType id); void RemoveFirstTuple(); void RemoveLastTuple(); - void SetTupleValue(vtkIdType i, const Scalar *t); - void InsertTupleValue(vtkIdType i, const Scalar *t); - vtkIdType InsertNextTupleValue(const Scalar *t); + void SetTypedTuple(vtkIdType i, const Scalar *t); + void InsertTypedTuple(vtkIdType i, const Scalar *t); + vtkIdType InsertNextTypedTuple(const Scalar *t); void SetValue(vtkIdType idx, Scalar value); vtkIdType InsertNextValue(Scalar v); void InsertValue(vtkIdType idx, Scalar v); diff --git a/IO/Exodus/vtkCPExodusIINodalCoordinatesTemplate.txx b/IO/Exodus/vtkCPExodusIINodalCoordinatesTemplate.txx index 9f0de1b7d9..42b7d8d113 100644 --- a/IO/Exodus/vtkCPExodusIINodalCoordinatesTemplate.txx +++ b/IO/Exodus/vtkCPExodusIINodalCoordinatesTemplate.txx @@ -203,7 +203,7 @@ template <class Scalar> void vtkCPExodusIINodalCoordinatesTemplate<Scalar> //------------------------------------------------------------------------------ template <class Scalar> -typename vtkCPExodusIINodalCoordinatesTemplate<Scalar>::ConstReferenceType +typename vtkCPExodusIINodalCoordinatesTemplate<Scalar>::ValueType vtkCPExodusIINodalCoordinatesTemplate<Scalar>::GetValue(vtkIdType idx) const { return const_cast<vtkCPExodusIINodalCoordinatesTemplate<Scalar>*>( @@ -212,7 +212,7 @@ vtkCPExodusIINodalCoordinatesTemplate<Scalar>::GetValue(vtkIdType idx) const //------------------------------------------------------------------------------ template <class Scalar> -typename vtkCPExodusIINodalCoordinatesTemplate<Scalar>::ReferenceType +typename vtkCPExodusIINodalCoordinatesTemplate<Scalar>::ValueType& vtkCPExodusIINodalCoordinatesTemplate<Scalar>::GetValueReference(vtkIdType idx) { const vtkIdType tuple = idx / this->NumberOfComponents; @@ -234,7 +234,7 @@ vtkCPExodusIINodalCoordinatesTemplate<Scalar>::GetValueReference(vtkIdType idx) //------------------------------------------------------------------------------ template <class Scalar> void vtkCPExodusIINodalCoordinatesTemplate<Scalar> -::GetTupleValue(vtkIdType tupleId, Scalar *tuple) const +::GetTypedTuple(vtkIdType tupleId, Scalar *tuple) const { tuple[0] = this->XArray[tupleId]; tuple[1] = this->YArray[tupleId]; @@ -432,7 +432,7 @@ template <class Scalar> void vtkCPExodusIINodalCoordinatesTemplate<Scalar> //------------------------------------------------------------------------------ template <class Scalar> void vtkCPExodusIINodalCoordinatesTemplate<Scalar> -::SetTupleValue(vtkIdType, const Scalar*) +::SetTypedTuple(vtkIdType, const Scalar*) { vtkErrorMacro("Read only container.") return; @@ -440,7 +440,7 @@ template <class Scalar> void vtkCPExodusIINodalCoordinatesTemplate<Scalar> //------------------------------------------------------------------------------ template <class Scalar> void vtkCPExodusIINodalCoordinatesTemplate<Scalar> -::InsertTupleValue(vtkIdType, const Scalar*) +::InsertTypedTuple(vtkIdType, const Scalar*) { vtkErrorMacro("Read only container.") return; @@ -448,7 +448,7 @@ template <class Scalar> void vtkCPExodusIINodalCoordinatesTemplate<Scalar> //------------------------------------------------------------------------------ template <class Scalar> vtkIdType vtkCPExodusIINodalCoordinatesTemplate<Scalar> -::InsertNextTupleValue(const Scalar *) +::InsertNextTypedTuple(const Scalar *) { vtkErrorMacro("Read only container.") return -1; diff --git a/IO/Exodus/vtkCPExodusIIResultsArrayTemplate.h b/IO/Exodus/vtkCPExodusIIResultsArrayTemplate.h index bba20c839e..f789dc7521 100644 --- a/IO/Exodus/vtkCPExodusIIResultsArrayTemplate.h +++ b/IO/Exodus/vtkCPExodusIIResultsArrayTemplate.h @@ -39,8 +39,6 @@ public: virtual void PrintSelf(ostream &os, vtkIndent indent); typedef typename Superclass::ValueType ValueType; - typedef typename Superclass::ReferenceType ReferenceType; - typedef typename Superclass::ConstReferenceType ConstReferenceType; // Description: // Set the arrays to be used and the number of tuples in each array. @@ -64,9 +62,9 @@ public: void GetTuple(vtkIdType i, double *tuple); vtkIdType LookupTypedValue(Scalar value); void LookupTypedValue(Scalar value, vtkIdList *ids); - ConstReferenceType GetValue(vtkIdType idx) const; - ReferenceType GetValueReference(vtkIdType idx); - void GetTupleValue(vtkIdType idx, Scalar *t) const; + ValueType GetValue(vtkIdType idx) const; + ValueType& GetValueReference(vtkIdType idx); + void GetTypedTuple(vtkIdType idx, Scalar *t) const; // Description: // This container is read only -- this method does nothing but print a @@ -98,9 +96,9 @@ public: void RemoveTuple(vtkIdType id); void RemoveFirstTuple(); void RemoveLastTuple(); - void SetTupleValue(vtkIdType i, const Scalar *t); - void InsertTupleValue(vtkIdType i, const Scalar *t); - vtkIdType InsertNextTupleValue(const Scalar *t); + void SetTypedTuple(vtkIdType i, const Scalar *t); + void InsertTypedTuple(vtkIdType i, const Scalar *t); + vtkIdType InsertNextTypedTuple(const Scalar *t); void SetValue(vtkIdType idx, Scalar value); vtkIdType InsertNextValue(Scalar v); void InsertValue(vtkIdType idx, Scalar v); diff --git a/IO/Exodus/vtkCPExodusIIResultsArrayTemplate.txx b/IO/Exodus/vtkCPExodusIIResultsArrayTemplate.txx index 72f2d67138..3725ecc02e 100644 --- a/IO/Exodus/vtkCPExodusIIResultsArrayTemplate.txx +++ b/IO/Exodus/vtkCPExodusIIResultsArrayTemplate.txx @@ -239,7 +239,7 @@ template <class Scalar> void vtkCPExodusIIResultsArrayTemplate<Scalar> //------------------------------------------------------------------------------ template <class Scalar> -typename vtkCPExodusIIResultsArrayTemplate<Scalar>::ConstReferenceType +typename vtkCPExodusIIResultsArrayTemplate<Scalar>::ValueType vtkCPExodusIIResultsArrayTemplate<Scalar>::GetValue(vtkIdType idx) const { return const_cast<vtkCPExodusIIResultsArrayTemplate<Scalar>*>( @@ -248,7 +248,7 @@ vtkCPExodusIIResultsArrayTemplate<Scalar>::GetValue(vtkIdType idx) const //------------------------------------------------------------------------------ template <class Scalar> -typename vtkCPExodusIIResultsArrayTemplate<Scalar>::ReferenceType +typename vtkCPExodusIIResultsArrayTemplate<Scalar>::ValueType& vtkCPExodusIIResultsArrayTemplate<Scalar>::GetValueReference(vtkIdType idx) { const vtkIdType tuple = idx / this->NumberOfComponents; @@ -258,7 +258,7 @@ vtkCPExodusIIResultsArrayTemplate<Scalar>::GetValueReference(vtkIdType idx) //------------------------------------------------------------------------------ template <class Scalar> void vtkCPExodusIIResultsArrayTemplate<Scalar> -::GetTupleValue(vtkIdType tupleId, Scalar *tuple) const +::GetTypedTuple(vtkIdType tupleId, Scalar *tuple) const { for (size_t comp = 0; comp < this->Arrays.size(); ++comp) { @@ -454,7 +454,7 @@ template <class Scalar> void vtkCPExodusIIResultsArrayTemplate<Scalar> //------------------------------------------------------------------------------ template <class Scalar> void vtkCPExodusIIResultsArrayTemplate<Scalar> -::SetTupleValue(vtkIdType, const Scalar*) +::SetTypedTuple(vtkIdType, const Scalar*) { vtkErrorMacro("Read only container.") return; @@ -462,7 +462,7 @@ template <class Scalar> void vtkCPExodusIIResultsArrayTemplate<Scalar> //------------------------------------------------------------------------------ template <class Scalar> void vtkCPExodusIIResultsArrayTemplate<Scalar> -::InsertTupleValue(vtkIdType, const Scalar*) +::InsertTypedTuple(vtkIdType, const Scalar*) { vtkErrorMacro("Read only container.") return; @@ -470,7 +470,7 @@ template <class Scalar> void vtkCPExodusIIResultsArrayTemplate<Scalar> //------------------------------------------------------------------------------ template <class Scalar> vtkIdType vtkCPExodusIIResultsArrayTemplate<Scalar> -::InsertNextTupleValue(const Scalar *) +::InsertNextTypedTuple(const Scalar *) { vtkErrorMacro("Read only container.") return -1; diff --git a/IO/Exodus/vtkExodusIIReader.cxx b/IO/Exodus/vtkExodusIIReader.cxx index a57598e3ff..0c3c24a935 100644 --- a/IO/Exodus/vtkExodusIIReader.cxx +++ b/IO/Exodus/vtkExodusIIReader.cxx @@ -817,7 +817,7 @@ int vtkExodusIIReaderPrivate::AssembleOutputProceduralArrays( vtkIdType values[2]; for(vtkIdType i=0;i<idarray->GetNumberOfTuples();i++) { - idarray->GetTupleValue(i, values); + idarray->GetTypedTuple(i, values); elementid->SetValue(i, values[0]-1); // switch to 0-based indexing // now we have to worry about mapping from exodus canonical side // ordering to vtk canonical side ordering for wedges and hexes. @@ -2626,7 +2626,7 @@ vtkDataArray* vtkExodusIIReaderPrivate::GetCacheOrRead( vtkExodusIICacheKey key { // we'll have to fix up the side indexing later // because Exodus and VTK have different canonical orderings for wedges and hexes. vtkIdType info[2] = {side_set_elem_list[i], side_set_side_list[i]}; - iarr->SetTupleValue(i, info); + iarr->SetTypedTuple(i, info); } arr = iarr; } @@ -2854,7 +2854,7 @@ vtkDataArray* vtkExodusIIReaderPrivate::GetCacheOrRead( vtkExodusIICacheKey key { for ( i = 0; i < num_info; ++i ) { - carr->InsertTupleValue( i, info[i] ); + carr->InsertTypedTuple( i, info[i] ); } arr = carr; } @@ -2917,7 +2917,7 @@ vtkDataArray* vtkExodusIIReaderPrivate::GetCacheOrRead( vtkExodusIICacheKey key { for ( j = 0; j < 4 ; ++j ) { - carr->InsertTupleValue( ( i * 4 ) + j, qa_record[i][j] ); + carr->InsertTypedTuple( ( i * 4 ) + j, qa_record[i][j] ); } } arr = carr; diff --git a/IO/Export/vtkX3DExporter.cxx b/IO/Export/vtkX3DExporter.cxx index 50dbbf6261..cee8919566 100644 --- a/IO/Export/vtkX3DExporter.cxx +++ b/IO/Export/vtkX3DExporter.cxx @@ -1058,7 +1058,7 @@ static void vtkX3DExporterWriteData(vtkPoints *points, unsigned char c[4]; for (int i = 0; i < colors->GetNumberOfTuples(); i++) { - colors->GetTupleValue(i,c); + colors->GetTypedTuple(i,c); colorVec.push_back(c[0]/255.0); colorVec.push_back(c[1]/255.0); colorVec.push_back(c[2]/255.0); @@ -1124,11 +1124,11 @@ static bool vtkX3DExporterWriterRenderVerts( unsigned char color[4]; if (cell_colors) { - colors->GetTupleValue(cellId, color); + colors->GetTypedTuple(cellId, color); } else { - colors->GetTupleValue(indx[cc], color); + colors->GetTypedTuple(indx[cc], color); } colorVector.push_back(color[0]/255.0); @@ -1185,7 +1185,7 @@ static bool vtkX3DExporterWriterRenderPoints( // Get the color for this cell. unsigned char color[4]; - colors->GetTupleValue(cid, color); + colors->GetTypedTuple(cid, color); double dcolor[3]; dcolor[0] = color[0]/255.0; dcolor[1] = color[1]/255.0; @@ -1220,7 +1220,7 @@ static bool vtkX3DExporterWriterRenderPoints( if (colors) { unsigned char color[4]; - colors->GetTupleValue(pid, color); + colors->GetTypedTuple(pid, color); colorVec.push_back(color[0]/255.0); colorVec.push_back(color[1]/255.0); colorVec.push_back(color[2]/255.0); diff --git a/IO/Geometry/vtkOpenFOAMReader.cxx b/IO/Geometry/vtkOpenFOAMReader.cxx index 2134fd7f28..ae20b7b37f 100644 --- a/IO/Geometry/vtkOpenFOAMReader.cxx +++ b/IO/Geometry/vtkOpenFOAMReader.cxx @@ -5603,7 +5603,7 @@ void vtkOpenFOAMReaderPrivate::InsertCellsToGrid( else { nAdditionalCells++; - additionalCells->InsertNextTupleValue(cellPoints->GetPointer(0)); + additionalCells->InsertNextTypedTuple(cellPoints->GetPointer(0)); } } @@ -5633,7 +5633,7 @@ void vtkOpenFOAMReaderPrivate::InsertCellsToGrid( // set the 5th vertex number to -1 to distinguish a tetra cell cellPoints->SetId(4, -1); nAdditionalCells++; - additionalCells->InsertNextTupleValue(cellPoints->GetPointer(0)); + additionalCells->InsertNextTypedTuple(cellPoints->GetPointer(0)); } } } diff --git a/IO/Geometry/vtkPDBReader.cxx b/IO/Geometry/vtkPDBReader.cxx index 7995a09970..3367020676 100644 --- a/IO/Geometry/vtkPDBReader.cxx +++ b/IO/Geometry/vtkPDBReader.cxx @@ -103,7 +103,7 @@ void vtkPDBReader::ReadSpecificMolecule(FILE* fp) sscanf(&linebuf[32], "%c", &endChain); sscanf(&linebuf[33], "%d", &endResi); int tuple[4] = { startChain, startResi, endChain, endResi }; - Sheets->InsertNextTupleValue(tuple); + Sheets->InsertNextTypedTuple(tuple); } else if (command == "HELIX") { @@ -112,7 +112,7 @@ void vtkPDBReader::ReadSpecificMolecule(FILE* fp) sscanf(&linebuf[31], "%c", &endChain); sscanf(&linebuf[33], "%d", &endResi); int tuple[4] = { startChain, startResi, endChain, endResi }; - Helix->InsertNextTupleValue(tuple); + Helix->InsertNextTypedTuple(tuple); } } @@ -136,7 +136,7 @@ void vtkPDBReader::ReadSpecificMolecule(FILE* fp) for (j = 0; j < Sheets->GetNumberOfTuples(); j++) { int sheet[4]; - Sheets->GetTupleValue(j, sheet); + Sheets->GetTypedTuple(j, sheet); if (this->Chain->GetValue(i) != sheet[0]) continue; if (resi < sheet[1]) continue; if (resi > sheet[3]) continue; @@ -148,7 +148,7 @@ void vtkPDBReader::ReadSpecificMolecule(FILE* fp) for (j = 0; j < Helix->GetNumberOfTuples(); j++) { int helix[4]; - Helix->GetTupleValue(j, helix); + Helix->GetTypedTuple(j, helix); if (this->Chain->GetValue(i) != helix[0]) continue; if (resi < helix[1]) continue; if (resi > helix[3]) continue; diff --git a/IO/Legacy/vtkCompositeDataReader.cxx b/IO/Legacy/vtkCompositeDataReader.cxx index 6482910a43..33a4e6bb41 100644 --- a/IO/Legacy/vtkCompositeDataReader.cxx +++ b/IO/Legacy/vtkCompositeDataReader.cxx @@ -431,7 +431,7 @@ bool vtkCompositeDataReader::ReadCompositeData(vtkOverlappingAMR* oamr) for (unsigned int index=0; index < num_datasets; index++, metadata_index++) { int tuple[6]; - idata->GetTupleValue(metadata_index, tuple); + idata->GetTypedTuple(metadata_index, tuple); vtkAMRBox box; box.SetDimensions(&tuple[0], &tuple[3], description); diff --git a/IO/Legacy/vtkCompositeDataWriter.cxx b/IO/Legacy/vtkCompositeDataWriter.cxx index 14adab842c..94937cb17e 100644 --- a/IO/Legacy/vtkCompositeDataWriter.cxx +++ b/IO/Legacy/vtkCompositeDataWriter.cxx @@ -263,7 +263,7 @@ bool vtkCompositeDataWriter::WriteCompositeData( const vtkAMRBox& box = oamr->GetAMRBox(level,index); int tuple[6]; box.Serialize(tuple); - idata->SetTupleValue(metadata_index, tuple); + idata->SetTypedTuple(metadata_index, tuple); } } *fp << "AMRBOXES " diff --git a/IO/MINC/vtkMNIObjectWriter.cxx b/IO/MINC/vtkMNIObjectWriter.cxx index 6a2ce476ef..096f1fdde3 100644 --- a/IO/MINC/vtkMNIObjectWriter.cxx +++ b/IO/MINC/vtkMNIObjectWriter.cxx @@ -647,7 +647,7 @@ int vtkMNIObjectWriter::WriteColors( rgba[3] = 255; } - newScalars->SetTupleValue(0, rgba); + newScalars->SetTypedTuple(0, rgba); scalars = newScalars; } diff --git a/IO/NetCDF/vtkSLACReader.cxx b/IO/NetCDF/vtkSLACReader.cxx index 70992b9ed4..f01bf6aac0 100644 --- a/IO/NetCDF/vtkSLACReader.cxx +++ b/IO/NetCDF/vtkSLACReader.cxx @@ -1280,7 +1280,7 @@ int vtkSLACReader::ReadConnectivity(int meshFD, // winding, but it should be consistent through the mesh. The invertTets // flag set earlier indicates whether we need to invert the tetrahedra. vtkIdType tetInfo[NumPerTetInt]; - connectivity->GetTupleValue(i, tetInfo); + connectivity->GetTypedTuple(i, tetInfo); if (invertTets) std::swap(tetInfo[1], tetInfo[2]); vtkUnstructuredGrid *ugrid = AllocateGetBlock(volumeOutput, tetInfo[0], IS_INTERNAL_VOLUME()); @@ -1300,7 +1300,7 @@ int vtkSLACReader::ReadConnectivity(int meshFD, // when the face is internal. Other flags separate faces in a multiblock // data set. vtkIdType tetInfo[NumPerTetExt]; - connectivity->GetTupleValue(i, tetInfo); + connectivity->GetTypedTuple(i, tetInfo); if (invertTets) { std::swap(tetInfo[1], tetInfo[2]); // Invert point indices diff --git a/IO/Parallel/vtkPSLACReader.cxx b/IO/Parallel/vtkPSLACReader.cxx index 490b20b82d..be7df8897a 100644 --- a/IO/Parallel/vtkPSLACReader.cxx +++ b/IO/Parallel/vtkPSLACReader.cxx @@ -763,7 +763,7 @@ int vtkPSLACReader::ReadConnectivity(int meshFD, vtkIdType ids[2]; ids[0] = edgesNeeded[i].GetMinEndPoint(); ids[1] = edgesNeeded[i].GetMaxEndPoint(); - edgeLists[process]->InsertNextTupleValue(static_cast<vtkIdType*>(ids)); + edgeLists[process]->InsertNextTypedTuple(static_cast<vtkIdType*>(ids)); } for (int process = 0; process < this->NumberOfPieces; process ++) { @@ -1080,7 +1080,7 @@ int vtkPSLACReader::ReadMidpointCoordinates ( { MidpointsAvailableType::const_iterator iter; vtkIdType e[2]; - this->Internal->EdgesToSendToProcesses->GetTupleValue(i, e); + this->Internal->EdgesToSendToProcesses->GetTypedTuple(i, e); iter = MidpointsAvailable.find(EdgeEndpoints(e[0], e[1])); if (iter != MidpointsAvailable.end ()) { @@ -1121,7 +1121,7 @@ int vtkPSLACReader::ReadMidpointCoordinates ( vtkIdType index; if (iter == localMap.end()) { - index = this->Internal->LocalToGlobalIds->InsertNextTupleValue( + index = this->Internal->LocalToGlobalIds->InsertNextTypedTuple( &topIter->globalId); localMap[topIter->globalId] = index; } @@ -1160,7 +1160,7 @@ int vtkPSLACReader::ReadMidpointData(int meshFD, vtkMultiBlockDataSet *output, vtkIdType end = start + pointsAdded; for (vtkIdType i = start; i < end; i ++) { - this->Internal->LocalToGlobalIds->InsertNextTupleValue (&i); + this->Internal->LocalToGlobalIds->InsertNextTypedTuple (&i); } return 1; diff --git a/Infovis/Layout/vtkAreaLayout.cxx b/Infovis/Layout/vtkAreaLayout.cxx index 868f759c6b..ba027268af 100644 --- a/Infovis/Layout/vtkAreaLayout.cxx +++ b/Infovis/Layout/vtkAreaLayout.cxx @@ -185,7 +185,7 @@ void vtkAreaLayout::GetBoundingArea(vtkIdType id, float *sinfo) } vtkFloatArray *sectorInfo = vtkFloatArray::SafeDownCast(array); - sectorInfo->GetTupleValue(id, sinfo); + sectorInfo->GetTypedTuple(id, sinfo); } unsigned long vtkAreaLayout::GetMTime() diff --git a/Infovis/Layout/vtkCirclePackLayout.cxx b/Infovis/Layout/vtkCirclePackLayout.cxx index 6c59603c0c..88bc00b199 100644 --- a/Infovis/Layout/vtkCirclePackLayout.cxx +++ b/Infovis/Layout/vtkCirclePackLayout.cxx @@ -194,7 +194,7 @@ vtkIdType vtkCirclePackLayout::FindVertex(double pnt[2], double *cinfo) vtkIdType vertex = otree->GetRoot(); vtkDoubleArray *circleInfo = vtkDoubleArray::SafeDownCast(array); // Now try to find the vertex that contains the point - circleInfo->GetTupleValue(vertex, climits); // Get the extents of the root + circleInfo->GetTypedTuple(vertex, climits); // Get the extents of the root if (pow((pnt[0]- climits[0]),2) + pow((pnt[1] - climits[1]),2) > pow(climits[2],2)) { // Point is not in the tree at all @@ -216,7 +216,7 @@ vtkIdType vtkCirclePackLayout::FindVertex(double pnt[2], double *cinfo) while (it->HasNext()) { child = it->Next(); - circleInfo->GetTupleValue(child, climits); // Get the extents of the child + circleInfo->GetTypedTuple(child, climits); // Get the extents of the child if (pow((pnt[0]- climits[0]),2) + pow((pnt[1] - climits[1]),2) > pow(climits[2],2)) { continue; @@ -263,7 +263,7 @@ void vtkCirclePackLayout::GetBoundingCircle(vtkIdType id, double *cinfo) } vtkDoubleArray *boxInfo = vtkDoubleArray::SafeDownCast(array); - boxInfo->GetTupleValue(id, cinfo); + boxInfo->GetTypedTuple(id, cinfo); } unsigned long vtkCirclePackLayout::GetMTime() diff --git a/Infovis/Layout/vtkStackedTreeLayoutStrategy.cxx b/Infovis/Layout/vtkStackedTreeLayoutStrategy.cxx index 1d3172553a..c565932e5f 100644 --- a/Infovis/Layout/vtkStackedTreeLayoutStrategy.cxx +++ b/Infovis/Layout/vtkStackedTreeLayoutStrategy.cxx @@ -485,7 +485,7 @@ vtkIdType vtkStackedTreeLayoutStrategy::FindVertex( vtkFloatArray *boundsInfo = vtkFloatArray::SafeDownCast(array); // Now try to find the vertex that contains the point - boundsInfo->GetTupleValue(vertex, blimits); // Get the extents of the root + boundsInfo->GetTypedTuple(vertex, blimits); // Get the extents of the root if( ((pnt[1] > blimits[2]) && (pnt[1] < blimits[3])) && ((pnt[0] > blimits[0]) && (pnt[0] < blimits[1])) ) { @@ -503,7 +503,7 @@ vtkIdType vtkStackedTreeLayoutStrategy::FindVertex( while (it->HasNext()) { child = it->Next(); - boundsInfo->GetTupleValue(child, blimits); // Get the extents of the child + boundsInfo->GetTypedTuple(child, blimits); // Get the extents of the child bool beyond_radial_bounds = false; bool beyond_angle_bounds = false; if( (pnt[1] < blimits[2]) || (pnt[1] > blimits[3])) @@ -537,7 +537,7 @@ vtkIdType vtkStackedTreeLayoutStrategy::FindVertex( vtkFloatArray *boundsInfo = vtkFloatArray::SafeDownCast(array); // Now try to find the vertex that contains the point - boundsInfo->GetTupleValue(vertex, blimits); // Get the extents of the root + boundsInfo->GetTypedTuple(vertex, blimits); // Get the extents of the root if( ((polar_location[0] > blimits[2]) && (polar_location[0] < blimits[3])) && ((polar_location[1] > blimits[0]) && (polar_location[1] < blimits[1])) ) { @@ -564,7 +564,7 @@ vtkIdType vtkStackedTreeLayoutStrategy::FindVertex( { continue; } - boundsInfo->GetTupleValue(child, blimits); // Get the extents of the child + boundsInfo->GetTypedTuple(child, blimits); // Get the extents of the child // the range checking below doesn't work if either or both of blimits > 360 if ((blimits[0] > 360.0) && (blimits[1] > 360.0)) diff --git a/Infovis/Layout/vtkTreeMapLayout.cxx b/Infovis/Layout/vtkTreeMapLayout.cxx index bba5246f22..6715637abc 100644 --- a/Infovis/Layout/vtkTreeMapLayout.cxx +++ b/Infovis/Layout/vtkTreeMapLayout.cxx @@ -141,7 +141,7 @@ vtkIdType vtkTreeMapLayout::FindVertex(float pnt[2], float *binfo) vtkIdType vertex = otree->GetRoot(); vtkFloatArray *boxInfo = vtkFloatArray::SafeDownCast(array); // Now try to find the vertex that contains the point - boxInfo->GetTupleValue(vertex, blimits); // Get the extents of the root + boxInfo->GetTypedTuple(vertex, blimits); // Get the extents of the root if ((pnt[0] < blimits[0]) || (pnt[0] > blimits[1]) || (pnt[1] < blimits[2]) || (pnt[1] > blimits[3])) { @@ -165,7 +165,7 @@ vtkIdType vtkTreeMapLayout::FindVertex(float pnt[2], float *binfo) while (it->HasNext()) { child = it->Next(); - boxInfo->GetTupleValue(child, blimits); // Get the extents of the child + boxInfo->GetTypedTuple(child, blimits); // Get the extents of the child if ((pnt[0] < blimits[0]) || (pnt[0] > blimits[1]) || (pnt[1] < blimits[2]) || (pnt[1] > blimits[3])) { @@ -201,7 +201,7 @@ void vtkTreeMapLayout::GetBoundingBox(vtkIdType id, float *binfo) } vtkFloatArray *boxInfo = vtkFloatArray::SafeDownCast(array); - boxInfo->GetTupleValue(id, binfo); + boxInfo->GetTypedTuple(id, binfo); } unsigned long vtkTreeMapLayout::GetMTime() diff --git a/Infovis/Layout/vtkTreeMapLayoutStrategy.cxx b/Infovis/Layout/vtkTreeMapLayoutStrategy.cxx index 6fe772f9c2..9e3b501c3b 100644 --- a/Infovis/Layout/vtkTreeMapLayoutStrategy.cxx +++ b/Infovis/Layout/vtkTreeMapLayoutStrategy.cxx @@ -58,7 +58,7 @@ vtkIdType vtkTreeMapLayoutStrategy::FindVertex( vtkIdType vertex = otree->GetRoot(); vtkFloatArray *boxInfo = vtkFloatArray::SafeDownCast(array); // Now try to find the vertex that contains the point - boxInfo->GetTupleValue(vertex, blimits); // Get the extents of the root + boxInfo->GetTypedTuple(vertex, blimits); // Get the extents of the root if ((pnt[0] < blimits[0]) || (pnt[0] > blimits[1]) || (pnt[1] < blimits[2]) || (pnt[1] > blimits[3])) { @@ -84,7 +84,7 @@ vtkIdType vtkTreeMapLayoutStrategy::FindVertex( while (it->HasNext()) { child = it->Next(); - boxInfo->GetTupleValue(child, blimits); // Get the extents of the child + boxInfo->GetTypedTuple(child, blimits); // Get the extents of the child if ((pnt[0] < blimits[0]) || (pnt[0] > blimits[1]) || (pnt[1] < blimits[2]) || (pnt[1] > blimits[3])) { diff --git a/Interaction/Widgets/Testing/Cxx/vtkPolyLineRepresentationTest1.cxx b/Interaction/Widgets/Testing/Cxx/vtkPolyLineRepresentationTest1.cxx index 6bbbdf640e..18a1fd1abd 100644 --- a/Interaction/Widgets/Testing/Cxx/vtkPolyLineRepresentationTest1.cxx +++ b/Interaction/Widgets/Testing/Cxx/vtkPolyLineRepresentationTest1.cxx @@ -177,7 +177,7 @@ int vtkPolyLineRepresentationTest1(int , char * [] ) for (vtkIdType i = 0; i < da->GetNumberOfTuples(); i++) { double val[3]; - da->GetTupleValue(i, val); + da->GetTypedTuple(i, val); std::cout << i << " = " << val[0] << ", " << val[1] << ", " << val[2] << std::endl; } } @@ -204,7 +204,7 @@ int vtkPolyLineRepresentationTest1(int , char * [] ) for (vtkIdType i = 0; i < da->GetNumberOfTuples(); i++) { double val[3]; - da->GetTupleValue(i, val); + da->GetTypedTuple(i, val); std::cout << i << " = " << val[0] << ", " << val[1] << ", " << val[2] << std::endl; } } diff --git a/Interaction/Widgets/Testing/Cxx/vtkSplineRepresentationTest1.cxx b/Interaction/Widgets/Testing/Cxx/vtkSplineRepresentationTest1.cxx index 06d06d7f91..42badc66cf 100644 --- a/Interaction/Widgets/Testing/Cxx/vtkSplineRepresentationTest1.cxx +++ b/Interaction/Widgets/Testing/Cxx/vtkSplineRepresentationTest1.cxx @@ -180,7 +180,7 @@ int vtkSplineRepresentationTest1(int , char * [] ) for (vtkIdType i = 0; i < da->GetNumberOfTuples(); i++) { double val[3]; - da->GetTupleValue(i, val); + da->GetTypedTuple(i, val); std::cout << i << " = " << val[0] << ", " << val[1] << ", " << val[2] << std::endl; } } @@ -207,7 +207,7 @@ int vtkSplineRepresentationTest1(int , char * [] ) for (vtkIdType i = 0; i < da->GetNumberOfTuples(); i++) { double val[3]; - da->GetTupleValue(i, val); + da->GetTypedTuple(i, val); std::cout << i << " = " << val[0] << ", " << val[1] << ", " << val[2] << std::endl; } } diff --git a/Interaction/Widgets/vtkBezierContourLineInterpolator.cxx b/Interaction/Widgets/vtkBezierContourLineInterpolator.cxx index 1fe2c47f86..600dee4cd4 100644 --- a/Interaction/Widgets/vtkBezierContourLineInterpolator.cxx +++ b/Interaction/Widgets/vtkBezierContourLineInterpolator.cxx @@ -213,7 +213,7 @@ void vtkBezierContourLineInterpolator::GetSpan( int nodeIndex, if ( index[0] >= 0 && index[0] < rep->GetNumberOfNodes() && index[1] >= 0 && index[1] < rep->GetNumberOfNodes() ) { - nodeIndices->InsertNextTupleValue( index ); + nodeIndices->InsertNextTypedTuple( index ); } } } diff --git a/Interaction/Widgets/vtkCenteredSliderRepresentation.cxx b/Interaction/Widgets/vtkCenteredSliderRepresentation.cxx index 64231f87fb..bb3ed4ad30 100644 --- a/Interaction/Widgets/vtkCenteredSliderRepresentation.cxx +++ b/Interaction/Widgets/vtkCenteredSliderRepresentation.cxx @@ -189,19 +189,19 @@ void vtkCenteredSliderRepresentation::BuildTube() this->Points->SetPoint(1, 0.0, this->ArcEnd, 0.0); this->Points->SetPoint(this->ArcCount+2, 0.0, this->ArcStart, 0.0); this->Points->SetPoint(this->ArcCount+3, 0.0, 1.0 - this->TubeSize, 0.0); - colors->SetTupleValue(0,col); - colors->SetTupleValue(1,col); - colors->SetTupleValue(this->ArcCount+2,col); - colors->SetTupleValue(this->ArcCount+3,col); + colors->SetTypedTuple(0,col); + colors->SetTypedTuple(1,col); + colors->SetTypedTuple(this->ArcCount+2,col); + colors->SetTypedTuple(this->ArcCount+3,col); this->Points->SetPoint(this->ArcCount+4, 1.0,1.0, 0.0); this->Points->SetPoint(this->ArcCount+5, 1.0, this->ArcEnd, 0.0); this->Points->SetPoint(2*this->ArcCount+6, 1.0, this->ArcStart, 0.0); this->Points->SetPoint(2*this->ArcCount+7, 1.0, 1.0 - this->TubeSize, 0.0); - colors->SetTupleValue(this->ArcCount+4,col); - colors->SetTupleValue(this->ArcCount+5,col); - colors->SetTupleValue(2*this->ArcCount+6,col); - colors->SetTupleValue(2*this->ArcCount+7,col); + colors->SetTypedTuple(this->ArcCount+4,col); + colors->SetTypedTuple(this->ArcCount+5,col); + colors->SetTypedTuple(2*this->ArcCount+6,col); + colors->SetTypedTuple(2*this->ArcCount+7,col); // and the arc double midPoint = this->ArcCount/2.0; @@ -222,8 +222,8 @@ void vtkCenteredSliderRepresentation::BuildTube() (i + this->ArcCount + 6, 0.7, (1.0 - this->TubeSize/2.0) - halfArcLength*factor*sign, 0.0); col[3] = static_cast<unsigned char>(255*factor); - colors->SetTupleValue(i+2,col); - colors->SetTupleValue(i+this->ArcCount+6,col); + colors->SetTypedTuple(i+2,col); + colors->SetTypedTuple(i+this->ArcCount+6,col); } // last four points are the slider @@ -236,10 +236,10 @@ void vtkCenteredSliderRepresentation::BuildTube() this->Points->SetPoint(this->ArcCount*2+11, 1.0, (this->ArcStart + this->ArcEnd)/2.0 + 0.025, 0.0); col[0] = 255; col[1] = 255; col[2] = 255; col[3] = 255; - colors->SetTupleValue(this->ArcCount*2+8,col); - colors->SetTupleValue(this->ArcCount*2+9,col); - colors->SetTupleValue(this->ArcCount*2+10,col); - colors->SetTupleValue(this->ArcCount*2+11,col); + colors->SetTypedTuple(this->ArcCount*2+8,col); + colors->SetTypedTuple(this->ArcCount*2+9,col); + colors->SetTypedTuple(this->ArcCount*2+10,col); + colors->SetTypedTuple(this->ArcCount*2+11,col); } //---------------------------------------------------------------------- diff --git a/Interaction/Widgets/vtkContourLineInterpolator.cxx b/Interaction/Widgets/vtkContourLineInterpolator.cxx index 7f5182e891..e5a335d06f 100644 --- a/Interaction/Widgets/vtkContourLineInterpolator.cxx +++ b/Interaction/Widgets/vtkContourLineInterpolator.cxx @@ -78,7 +78,7 @@ void vtkContourLineInterpolator::GetSpan( int nodeIndex, if ( index[0] >= 0 && index[0] < rep->GetNumberOfNodes() && index[1] >= 0 && index[1] < rep->GetNumberOfNodes() ) { - nodeIndices->InsertNextTupleValue( index ); + nodeIndices->InsertNextTypedTuple( index ); } } } diff --git a/Interaction/Widgets/vtkContourRepresentation.cxx b/Interaction/Widgets/vtkContourRepresentation.cxx index ab479cc9b5..dbc9d37dfc 100644 --- a/Interaction/Widgets/vtkContourRepresentation.cxx +++ b/Interaction/Widgets/vtkContourRepresentation.cxx @@ -997,7 +997,7 @@ void vtkContourRepresentation::UpdateLines( int index ) int nNodes = arr->GetNumberOfTuples(); for (int i = 0; i < nNodes; i++) { - arr->GetTupleValue( i, indices ); + arr->GetTypedTuple( i, indices ); this->UpdateLine( indices[0], indices[1] ); } arr->Delete(); diff --git a/Rendering/Annotation/vtkGraphAnnotationLayersFilter.cxx b/Rendering/Annotation/vtkGraphAnnotationLayersFilter.cxx index 54b3a6984a..43d26e410a 100644 --- a/Rendering/Annotation/vtkGraphAnnotationLayersFilter.cxx +++ b/Rendering/Annotation/vtkGraphAnnotationLayersFilter.cxx @@ -226,7 +226,7 @@ int vtkGraphAnnotationLayersFilter::RequestData(vtkInformation *vtkNotUsed(reque static_cast<unsigned char>(opacity * 255) }; for (vtkIdType i = 0; i < numberOfCells; ++i) { - outColors->InsertNextTupleValue(outColor); + outColors->InsertNextTypedTuple(outColor); } hullPolyData->GetCellData()->AddArray(outColors); outColors->Delete(); diff --git a/Rendering/Annotation/vtkScalarBarActor.cxx b/Rendering/Annotation/vtkScalarBarActor.cxx index 0b5bd41f9a..b2fb358c60 100644 --- a/Rendering/Annotation/vtkScalarBarActor.cxx +++ b/Rendering/Annotation/vtkScalarBarActor.cxx @@ -2295,7 +2295,7 @@ int vtkScalarBarActor::PlaceAnnotationsVertically( ctr); \ ll[1] = lpts->InsertNextPoint(xl1, ctr, 0.); \ llines->InsertNextCell(2, ll); \ - llcolors->InsertNextTupleValue(this->P->AnnotationColors[j].GetData()); \ + llcolors->InsertNextTypedTuple(this->P->AnnotationColors[j].GetData()); \ if (upCum < ctr + hh) upCum = ctr + hh; \ if (dnCum > ctr - hh) dnCum = ctr - hh; @@ -2541,7 +2541,7 @@ struct vtkScalarBarHLabelPlacer pt = pts->InsertNextPoint(label.Anchor[0], other.Y[0], 0.); lines->InsertCellPoint(pt); lines->InsertNextCell(2); - colors->InsertNextTupleValue(color.GetData()); + colors->InsertNextTypedTuple(color.GetData()); curY = other.Y[1]; pt = pts->InsertNextPoint(label.Anchor[0], curY, 0.); lines->InsertCellPoint(pt); @@ -2558,7 +2558,7 @@ struct vtkScalarBarHLabelPlacer // I. Insert first vertex near swatch: lines->InsertNextCell(2); - colors->InsertNextTupleValue(color.GetData()); + colors->InsertNextTypedTuple(color.GetData()); double curY = this->Y0 + this->Dir * this->Pad / 2.; pt = pts->InsertNextPoint(label.Anchor[0], curY, 0.); lines->InsertCellPoint(pt); diff --git a/Rendering/Core/Testing/Cxx/TestBareScalarsToColors.cxx b/Rendering/Core/Testing/Cxx/TestBareScalarsToColors.cxx index 9e63fc8b66..18a990e0f7 100644 --- a/Rendering/Core/Testing/Cxx/TestBareScalarsToColors.cxx +++ b/Rendering/Core/Testing/Cxx/TestBareScalarsToColors.cxx @@ -72,7 +72,7 @@ int TestBareScalarsToColors(int argc, char *argv[]) cval[1] = (ncomp > 2 ? cval[1] : cval[3]); for (int kk = 0; kk < 5; kk++) { - arr->SetTupleValue(i++, cval); + arr->SetTypedTuple(i++, cval); } } } diff --git a/Rendering/Core/Testing/Cxx/TestColorTransferFunctionStringArray.cxx b/Rendering/Core/Testing/Cxx/TestColorTransferFunctionStringArray.cxx index 75b70d23a2..ba096877b2 100644 --- a/Rendering/Core/Testing/Cxx/TestColorTransferFunctionStringArray.cxx +++ b/Rendering/Core/Testing/Cxx/TestColorTransferFunctionStringArray.cxx @@ -66,7 +66,7 @@ int TestColorTransferFunctionStringArray(int vtkNotUsed(argc), char* vtkNotUsed( for (int i = 0; i < sArray->GetNumberOfValues(); ++i) { unsigned char color[4]; - colors->GetTupleValue(i, color); + colors->GetTypedTuple(i, color); if (expectedColors[i][0] != color[0] || expectedColors[i][1] != color[1] || expectedColors[i][2] != color[2] || diff --git a/Rendering/Core/Testing/Cxx/TestDirectScalarsToColors.cxx b/Rendering/Core/Testing/Cxx/TestDirectScalarsToColors.cxx index 5bdb031670..c768ff6f1c 100644 --- a/Rendering/Core/Testing/Cxx/TestDirectScalarsToColors.cxx +++ b/Rendering/Core/Testing/Cxx/TestDirectScalarsToColors.cxx @@ -104,7 +104,7 @@ void addViews (vtkRenderWindow* renWin, int typeIndex) } for (int kk = 0; kk < 5; kk++) { - arr->SetTupleValue(i++, cval); + arr->SetTypedTuple(i++, cval); } } } diff --git a/Rendering/Core/Testing/Cxx/TestDiscretizableColorTransferFunctionStringArray.cxx b/Rendering/Core/Testing/Cxx/TestDiscretizableColorTransferFunctionStringArray.cxx index 7250b099d9..8b1b202561 100644 --- a/Rendering/Core/Testing/Cxx/TestDiscretizableColorTransferFunctionStringArray.cxx +++ b/Rendering/Core/Testing/Cxx/TestDiscretizableColorTransferFunctionStringArray.cxx @@ -65,7 +65,7 @@ int TestDiscretizableColorTransferFunctionStringArray(int vtkNotUsed(argc), char for (int i = 0; i < sArray->GetNumberOfValues(); ++i) { unsigned char color[4]; - colors->GetTupleValue(i, color); + colors->GetTypedTuple(i, color); if (expectedColors[i][0] != color[0] || expectedColors[i][1] != color[1] || expectedColors[i][2] != color[2] || diff --git a/Rendering/Core/Testing/Cxx/TestMapVectorsAsRGBColors.cxx b/Rendering/Core/Testing/Cxx/TestMapVectorsAsRGBColors.cxx index 2dd30f1dbb..e14853890e 100644 --- a/Rendering/Core/Testing/Cxx/TestMapVectorsAsRGBColors.cxx +++ b/Rendering/Core/Testing/Cxx/TestMapVectorsAsRGBColors.cxx @@ -71,7 +71,7 @@ int TestMapVectorsAsRGBColors(int argc, char *argv[]) cval[1] = (ncomp > 2 ? cval[1] : cval[3]); for (int kk = 0; kk < 5; kk++) { - arr->SetTupleValue(i++, cval); + arr->SetTypedTuple(i++, cval); } } } diff --git a/Rendering/Core/Testing/Cxx/TestMapVectorsToColors.cxx b/Rendering/Core/Testing/Cxx/TestMapVectorsToColors.cxx index cdd8670951..42da2e614d 100644 --- a/Rendering/Core/Testing/Cxx/TestMapVectorsToColors.cxx +++ b/Rendering/Core/Testing/Cxx/TestMapVectorsToColors.cxx @@ -63,7 +63,7 @@ int TestMapVectorsToColors(int argc, char *argv[]) cval[3] = (j & 3)*f; for (int kk = 0; kk < 5; kk++) { - arr->SetTupleValue(i++, cval); + arr->SetTypedTuple(i++, cval); } } } diff --git a/Rendering/Core/Testing/Cxx/TestPolygonSelection.cxx b/Rendering/Core/Testing/Cxx/TestPolygonSelection.cxx index cba0452874..b441e07243 100644 --- a/Rendering/Core/Testing/Cxx/TestPolygonSelection.cxx +++ b/Rendering/Core/Testing/Cxx/TestPolygonSelection.cxx @@ -125,7 +125,7 @@ int TestPolygonSelection( int argc, char* argv[] ) { const vtkVector2i &v = points[j]; int pos[2] = {v[0], v[1]}; - polygonPointsArray->SetTupleValue(j, pos); + polygonPointsArray->SetTypedTuple(j, pos); } vtkNew<vtkHardwareSelector> hardSel; diff --git a/Rendering/Label/vtkLabeledTreeMapDataMapper.cxx b/Rendering/Label/vtkLabeledTreeMapDataMapper.cxx index 531ef415db..faccc211ac 100644 --- a/Rendering/Label/vtkLabeledTreeMapDataMapper.cxx +++ b/Rendering/Label/vtkLabeledTreeMapDataMapper.cxx @@ -515,7 +515,7 @@ void vtkLabeledTreeMapDataMapper::LabelTree(vtkTree *tree, if (level >= this->StartLevel && (this->EndLevel == -1 || level <= this->EndLevel)) { - boxInfo->GetTupleValue(vertex, blimits); // Get the extents of the vertex + boxInfo->GetTypedTuple(vertex, blimits); // Get the extents of the vertex if (this->ConvertToDC(blimits, blimitsDC)) { continue; diff --git a/Rendering/OpenGL/vtkOpenGLGlyph3DMapper.cxx b/Rendering/OpenGL/vtkOpenGLGlyph3DMapper.cxx index 0c2c0ae44a..0c8c3ffefa 100644 --- a/Rendering/OpenGL/vtkOpenGLGlyph3DMapper.cxx +++ b/Rendering/OpenGL/vtkOpenGLGlyph3DMapper.cxx @@ -588,7 +588,7 @@ void vtkOpenGLGlyph3DMapper::Render( else if (colors) { unsigned char rgba[4]; - colors->GetTupleValue(inPtId, rgba); + colors->GetTypedTuple(inPtId, rgba); glColor4ub(rgba[0], rgba[1], rgba[2], rgba[3]); } //glFinish(); // for debug diff --git a/Rendering/OpenGL/vtkScalarsToColorsPainter.cxx b/Rendering/OpenGL/vtkScalarsToColorsPainter.cxx index c56c90a054..c94b2a4e78 100644 --- a/Rendering/OpenGL/vtkScalarsToColorsPainter.cxx +++ b/Rendering/OpenGL/vtkScalarsToColorsPainter.cxx @@ -678,7 +678,7 @@ void vtkScalarsToColorsPainter::MapScalars(vtkDataSet* output, { // Use only the requested tuple's color unsigned char color[4]; - scalarColors->GetTupleValue(this->FieldDataTupleId, color); + scalarColors->GetTypedTuple(this->FieldDataTupleId, color); vtkUnsignedCharArray* newColors = vtkUnsignedCharArray::New(); newColors->SetNumberOfComponents(4); @@ -686,7 +686,7 @@ void vtkScalarsToColorsPainter::MapScalars(vtkDataSet* output, newColors->SetName("Color"); for (vtkIdType i = 0; i < input->GetNumberOfCells(); ++i) { - newColors->SetTupleValue(i, color); + newColors->SetTypedTuple(i, color); } opfd->AddArray(newColors); diff --git a/Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx b/Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx index 494edc4c62..6ff373f9a7 100644 --- a/Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx +++ b/Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx @@ -664,7 +664,7 @@ void vtkOpenGLGlyph3DMapper::RebuildStructures( if (colors) { - colors->GetTupleValue(inPtId, &(entry->Colors[entry->NumberOfPoints*4])); + colors->GetTypedTuple(inPtId, &(entry->Colors[entry->NumberOfPoints*4])); } // scale data if appropriate diff --git a/Rendering/Volume/vtkProjectedTetrahedraMapper.cxx b/Rendering/Volume/vtkProjectedTetrahedraMapper.cxx index 0b6871462d..0bc125abd1 100644 --- a/Rendering/Volume/vtkProjectedTetrahedraMapper.cxx +++ b/Rendering/Volume/vtkProjectedTetrahedraMapper.cxx @@ -119,7 +119,7 @@ struct TransformPointsWorker // Transform all points. for (i = 0, out_p = this->OutPoints; i < num_points; i++, out_p += 3) { - in_points->GetTupleValue(i, in_p); + in_points->GetTypedTuple(i, in_p); for (row = 0; row < 3; row++) { out_p[row] = ( mat[0*4+row] * in_p[0] + mat[1*4+row] * in_p[1] @@ -133,7 +133,7 @@ struct TransformPointsWorker { for (i = 0, out_p = this->OutPoints; i < num_points; i++, out_p += 3) { - in_points->GetTupleValue(i, in_p); + in_points->GetTypedTuple(i, in_p); float w = ( mat[0*4+3]*in_p[0] + mat[1*4+3]*in_p[1] + mat[2*4+3]*in_p[2] + mat[3*4+3]); if (w > 0.0) @@ -320,10 +320,10 @@ namespace vtkProjectedTetrahedraMapperNamespace for (i = 0; i < num_scalars; i++) { - ScalarType s = scalars->GetComponentValue(i, 0); + ScalarType s = scalars->GetTypedComponent(i, 0); c[0] = c[1] = c[2] = static_cast<ColorType>(gray->GetValue(s)); c[3] = static_cast<ColorType>(alpha->GetValue(s)); - colors->SetTupleValue(i, c); + colors->SetTypedTuple(i, c); } } else @@ -333,14 +333,14 @@ namespace vtkProjectedTetrahedraMapperNamespace for (i = 0; i < num_scalars; i++) { - ScalarType s = scalars->GetComponentValue(i, 0); + ScalarType s = scalars->GetTypedComponent(i, 0); double trgb[3]; rgb->GetColor(s, trgb); c[0] = static_cast<ColorType>(trgb[0]); c[1] = static_cast<ColorType>(trgb[1]); c[2] = static_cast<ColorType>(trgb[2]); c[3] = static_cast<ColorType>(alpha->GetValue(s)); - colors->SetTupleValue(i, c); + colors->SetTypedTuple(i, c); } } } @@ -358,7 +358,7 @@ namespace vtkProjectedTetrahedraMapperNamespace for (vtkIdType i = 0; i < num_scalars; i++) { - scalars->GetTupleValue(i, scalar); + scalars->GetTypedTuple(i, scalar); rgb->GetColor(scalar[0], rgbColor); rgbColor[3] = alpha->GetValue(scalar[1]); colors->SetTuple(i, rgbColor); diff --git a/Rendering/Volume/vtkUnstructuredGridBunykRayCastFunction.cxx b/Rendering/Volume/vtkUnstructuredGridBunykRayCastFunction.cxx index 7b3206fd92..e5a8d95d46 100644 --- a/Rendering/Volume/vtkUnstructuredGridBunykRayCastFunction.cxx +++ b/Rendering/Volume/vtkUnstructuredGridBunykRayCastFunction.cxx @@ -278,10 +278,10 @@ struct TemplateCastRayWorker for (int c = 0; c < this->NumComponents; c++) { ValueType A, B, C; - A = scalarArray->GetComponentValue(this->CurrentTriangle->PointIndex[0], c); - B = scalarArray->GetComponentValue(this->CurrentTriangle->PointIndex[1], c); - C = scalarArray->GetComponentValue(this->CurrentTriangle->PointIndex[2], c); - nearIntersectionArray->SetComponentValue( + A = scalarArray->GetTypedComponent(this->CurrentTriangle->PointIndex[0], c); + B = scalarArray->GetTypedComponent(this->CurrentTriangle->PointIndex[1], c); + C = scalarArray->GetTypedComponent(this->CurrentTriangle->PointIndex[2], c); + nearIntersectionArray->SetTypedComponent( this->NumIntersections, c, static_cast<ValueType>(a1 * A + b1 * B + c1 * C)); } @@ -292,10 +292,10 @@ struct TemplateCastRayWorker for (int c = 0; c < this->NumComponents; c++) { ValueType A, B, C; - A = scalarArray->GetComponentValue(nextTriangle->PointIndex[0], c); - B = scalarArray->GetComponentValue(nextTriangle->PointIndex[1], c); - C = scalarArray->GetComponentValue(nextTriangle->PointIndex[2], c); - farIntersectionArray->SetComponentValue( + A = scalarArray->GetTypedComponent(nextTriangle->PointIndex[0], c); + B = scalarArray->GetTypedComponent(nextTriangle->PointIndex[1], c); + C = scalarArray->GetTypedComponent(nextTriangle->PointIndex[2], c); + farIntersectionArray->SetTypedComponent( this->NumIntersections, c, static_cast<ValueType>(a2 * A + b2 * B + c2 * C)); } diff --git a/Rendering/Volume/vtkVolumeOutlineSource.cxx b/Rendering/Volume/vtkVolumeOutlineSource.cxx index cc47250dbd..f6ddc46f91 100644 --- a/Rendering/Volume/vtkVolumeOutlineSource.cxx +++ b/Rendering/Volume/vtkVolumeOutlineSource.cxx @@ -490,7 +490,7 @@ void vtkVolumeOutlineSource::GeneratePolys( // Color the face if (scalars) { - scalars->InsertNextTupleValue(colors[active]); + scalars->InsertNextTypedTuple(colors[active]); } } @@ -615,7 +615,7 @@ void vtkVolumeOutlineSource::GenerateLines( // Change color if current segment is on active plane if (scalars && active) { - scalars->SetTupleValue(cellId, colors[active]); + scalars->SetTypedTuple(cellId, colors[active]); } foundDuplicate = 1; break; @@ -632,7 +632,7 @@ void vtkVolumeOutlineSource::GenerateLines( // Color the line segment if (scalars) { - scalars->InsertNextTupleValue(colors[active]); + scalars->InsertNextTypedTuple(colors[active]); } } } diff --git a/Views/Infovis/vtkApplyColors.cxx b/Views/Infovis/vtkApplyColors.cxx index d31a5a3f5a..46dda9b09d 100644 --- a/Views/Infovis/vtkApplyColors.cxx +++ b/Views/Infovis/vtkApplyColors.cxx @@ -257,7 +257,7 @@ int vtkApplyColors::RequestData( { continue; } - colorArr1->GetTupleValue(list1->GetValue(i), prev); + colorArr1->GetTypedTuple(list1->GetValue(i), prev); if (hasColor) { curColor[0] = annColor[0]; @@ -279,7 +279,7 @@ int vtkApplyColors::RequestData( { curColor[3] = prev[3]; } - colorArr1->SetTupleValue(list1->GetValue(i), curColor); + colorArr1->SetTypedTuple(list1->GetValue(i), curColor); } numIds = list2->GetNumberOfTuples(); for (vtkIdType i = 0; i < numIds; ++i) @@ -288,7 +288,7 @@ int vtkApplyColors::RequestData( { continue; } - colorArr2->GetTupleValue(list2->GetValue(i), prev); + colorArr2->GetTypedTuple(list2->GetValue(i), prev); if (hasColor) { curColor[0] = annColor[0]; @@ -310,7 +310,7 @@ int vtkApplyColors::RequestData( { curColor[3] = prev[3]; } - colorArr2->SetTupleValue(list2->GetValue(i), curColor); + colorArr2->SetTypedTuple(list2->GetValue(i), curColor); } } if (vtkAnnotation* ann = layers->GetCurrentAnnotation()) @@ -371,7 +371,7 @@ int vtkApplyColors::RequestData( { continue; } - colorArr1->SetTupleValue(list1->GetValue(i), color1); + colorArr1->SetTypedTuple(list1->GetValue(i), color1); } numIds = list2->GetNumberOfTuples(); for (vtkIdType i = 0; i < numIds; ++i) @@ -380,7 +380,7 @@ int vtkApplyColors::RequestData( { continue; } - colorArr2->SetTupleValue(list2->GetValue(i), color2); + colorArr2->SetTypedTuple(list2->GetValue(i), color2); } } } // end if (layers) @@ -438,7 +438,7 @@ void vtkApplyColors::ProcessColorArray( // Combine the opacity of the lookup table with the // default color opacity. myColor[3] = static_cast<unsigned char>((color[3]/255.0)*mappedColor[3]); - colorArr->SetTupleValue(i, myColor); + colorArr->SetTypedTuple(i, myColor); } } else @@ -446,7 +446,7 @@ void vtkApplyColors::ProcessColorArray( // If no lookup table, use default color. for (vtkIdType i = 0; i < colorArr->GetNumberOfTuples(); ++i) { - colorArr->SetTupleValue(i, color); + colorArr->SetTypedTuple(i, color); } } } diff --git a/Wrapping/Tools/vtkWrap.c b/Wrapping/Tools/vtkWrap.c index bc49119ff1..cca9a42551 100644 --- a/Wrapping/Tools/vtkWrap.c +++ b/Wrapping/Tools/vtkWrap.c @@ -666,7 +666,7 @@ void vtkWrap_FindCountHints( theFunc = data->Functions[i]; if ((strcmp(theFunc->Name, "GetTuple") == 0 || - strcmp(theFunc->Name, "GetTupleValue") == 0) && + strcmp(theFunc->Name, "GetTypedTuple") == 0) && theFunc->ReturnValue && theFunc->ReturnValue->Count == 0 && theFunc->NumberOfParameters == 1 && theFunc->Parameters[0]->Type == VTK_PARSE_ID_TYPE) @@ -674,11 +674,11 @@ void vtkWrap_FindCountHints( theFunc->ReturnValue->CountHint = countMethod; } else if ((strcmp(theFunc->Name, "SetTuple") == 0 || - strcmp(theFunc->Name, "SetTupleValue") == 0 || + strcmp(theFunc->Name, "SetTypedTuple") == 0 || strcmp(theFunc->Name, "GetTuple") == 0 || - strcmp(theFunc->Name, "GetTupleValue") == 0 || + strcmp(theFunc->Name, "GetTypedTuple") == 0 || strcmp(theFunc->Name, "InsertTuple") == 0 || - strcmp(theFunc->Name, "InsertTupleValue") == 0) && + strcmp(theFunc->Name, "InsertTypedTuple") == 0) && theFunc->NumberOfParameters == 2 && theFunc->Parameters[0]->Type == VTK_PARSE_ID_TYPE && theFunc->Parameters[1]->Count == 0) @@ -686,7 +686,7 @@ void vtkWrap_FindCountHints( theFunc->Parameters[1]->CountHint = countMethod; } else if ((strcmp(theFunc->Name, "InsertNextTuple") == 0 || - strcmp(theFunc->Name, "InsertNextTupleValue") == 0) && + strcmp(theFunc->Name, "InsertNextTypedTuple") == 0) && theFunc->NumberOfParameters == 1 && theFunc->Parameters[0]->Count == 0) { -- GitLab