Commit 0ce4534e authored by Timothy M. Shead's avatar Timothy M. Shead

ENH: Update the vtkArrayAPI to support distributed arrays / arrays with...

ENH: Update the vtkArrayAPI to support distributed arrays / arrays with non-zero-based coordinate indices.
parent 1826ff44
......@@ -410,12 +410,10 @@ IF(VTK_USE_N_WAY_ARRAYS)
SET(Kit_SRCS
${Kit_SRCS}
vtkArray.cxx
vtkArrayExtents.cxx
vtkArrayCoordinates.cxx
vtkArrayCoordinateIterator.cxx
vtkArrayExtents.cxx
vtkArrayExtentsList.cxx
vtkArrayRange.cxx
vtkArraySlice.cxx
vtkArraySlices.cxx
vtkArraySort.cxx
vtkArrayWeights.cxx
)
......@@ -426,11 +424,10 @@ IF(VTK_USE_N_WAY_ARRAYS)
)
SET_SOURCE_FILES_PROPERTIES(
vtkArrayExtents.cxx
vtkArrayCoordinates.cxx
vtkArrayExtents.cxx
vtkArrayExtentsList.cxx
vtkArrayRange.cxx
vtkArraySlice.cxx
vtkArraySlices.cxx
vtkArraySort.cxx
vtkArrayWeights.cxx
WRAP_EXCLUDE
......
......@@ -21,6 +21,7 @@ IF(PYTHON_EXECUTABLE)
vtkArrayCoordinateIterator.h
vtkArrayCoordinates.h
vtkArrayExtents.h
vtkArrayExtentsList.h
vtkArrayInterpolate.h
vtkArrayIteratorIncludes.h
vtkArrayIteratorTemplate.h
......@@ -28,8 +29,6 @@ IF(PYTHON_EXECUTABLE)
vtkArrayMapIterator.h
vtkArrayPrint.h
vtkArrayRange.h
vtkArraySlice.h
vtkArraySlices.h
vtkArraySort.h
vtkArrayWeights.h
vtkAssemblyPaths.h
......
......@@ -60,6 +60,7 @@ int ArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
// Resize the array and verify that everything adds-up ...
array->Resize(vtkArrayExtents(1, 2, 3));
array->Print(std::cout);
test_expression(array->GetDimensions() == 3);
test_expression(array->GetSize() == 6);
test_expression(array->GetNonNullSize() == 6);
......@@ -69,11 +70,11 @@ int ArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
array->Fill(0.0);
const vtkArrayExtents extents = array->GetExtents();
for(int i = 0; i != extents[0]; ++i)
for(vtkIdType i = extents[0].GetBegin(); i != extents[0].GetEnd(); ++i)
{
for(int j = 0; j != extents[1]; ++j)
for(vtkIdType j = extents[1].GetBegin(); j != extents[1].GetEnd(); ++j)
{
for(int k = 0; k != extents[2]; ++k)
for(vtkIdType k = extents[2].GetBegin(); k != extents[2].GetEnd(); ++k)
{
test_expression(array->GetValue(vtkArrayCoordinates(i, j, k)) == 0.0);
}
......@@ -85,11 +86,11 @@ int ArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
double value = 0;
const vtkArrayExtents extents = array->GetExtents();
for(int i = 0; i != extents[0]; ++i)
for(vtkIdType i = extents[0].GetBegin(); i != extents[0].GetEnd(); ++i)
{
for(int j = 0; j != extents[1]; ++j)
for(vtkIdType j = extents[1].GetBegin(); j != extents[1].GetEnd(); ++j)
{
for(int k = 0; k != extents[2]; ++k)
for(vtkIdType k = extents[2].GetBegin(); k != extents[2].GetEnd(); ++k)
{
array->SetValue(vtkArrayCoordinates(i, j, k), value++);
}
......@@ -101,11 +102,11 @@ int ArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
double value = 0;
vtkIdType index = 0;
const vtkArrayExtents extents = array->GetExtents();
for(int i = 0; i != extents[0]; ++i)
for(vtkIdType i = extents[0].GetBegin(); i != extents[0].GetEnd(); ++i)
{
for(int j = 0; j != extents[1]; ++j)
for(vtkIdType j = extents[1].GetBegin(); j != extents[1].GetEnd(); ++j)
{
for(int k = 0; k != extents[2]; ++k)
for(vtkIdType k = extents[2].GetBegin(); k != extents[2].GetEnd(); ++k)
{
test_expression(array->GetValue(vtkArrayCoordinates(i, j, k)) == value);
......@@ -123,7 +124,7 @@ int ArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
array->Fill(19700827);
// Test unordered access ...
for(int n = 0; n != array->GetNonNullSize(); ++n)
for(vtkIdType n = 0; n != array->GetNonNullSize(); ++n)
test_expression(array->GetValueN(n) == 19700827);
// Verify that deep-copy works correctly ...
......@@ -133,7 +134,7 @@ int ArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
test_expression(deep_copy->GetSize() == array->GetSize());
test_expression(deep_copy->GetNonNullSize() == array->GetNonNullSize());
test_expression(deep_copy->GetExtents() == array->GetExtents());
for(int n = 0; n != deep_copy->GetNonNullSize(); ++n)
for(vtkIdType n = 0; n != deep_copy->GetNonNullSize(); ++n)
test_expression(deep_copy->GetValueN(n) == 19700827);
// Verify that data is organized in fortran-order ...
......
......@@ -63,11 +63,11 @@ int ArrayAPISparse(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
// Verify that the array contains all zeros ...
{
const vtkArrayExtents extents = array->GetExtents();
for(int i = 0; i != extents[0]; ++i)
for(int i = extents[0].GetBegin(); i != extents[0].GetEnd(); ++i)
{
for(int j = 0; j != extents[1]; ++j)
for(int j = extents[1].GetBegin(); j != extents[1].GetEnd(); ++j)
{
for(int k = 0; k != extents[2]; ++k)
for(int k = extents[2].GetBegin(); k != extents[2].GetEnd(); ++k)
{
test_expression(array->GetValue(vtkArrayCoordinates(i, j, k)) == 0);
}
......@@ -79,11 +79,11 @@ int ArrayAPISparse(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
double value = 0;
const vtkArrayExtents extents = array->GetExtents();
for(int i = 0; i != extents[0]; ++i)
for(int i = extents[0].GetBegin(); i != extents[0].GetEnd(); ++i)
{
for(int j = 0; j != extents[1]; ++j)
for(int j = extents[1].GetBegin(); j != extents[1].GetEnd(); ++j)
{
for(int k = 0; k != extents[2]; ++k)
for(int k = extents[2].GetBegin(); k != extents[2].GetEnd(); ++k)
{
array->AddValue(vtkArrayCoordinates(i, j, k), value++);
}
......@@ -95,11 +95,11 @@ int ArrayAPISparse(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
double value = 0;
vtkIdType index = 0;
const vtkArrayExtents extents = array->GetExtents();
for(int i = 0; i != extents[0]; ++i)
for(int i = extents[0].GetBegin(); i != extents[0].GetEnd(); ++i)
{
for(int j = 0; j != extents[1]; ++j)
for(int j = extents[1].GetBegin(); j != extents[1].GetEnd(); ++j)
{
for(int k = 0; k != extents[2]; ++k)
for(int k = extents[2].GetBegin(); k != extents[2].GetEnd(); ++k)
{
test_expression(array->GetValue(vtkArrayCoordinates(i, j, k)) == value);
test_expression(array->GetValueN(index) == value);
......
/*=========================================================================
Program: Visualization Toolkit
Module: ArraySlice.cxx
Module: ArrayExtents.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
......@@ -20,7 +20,7 @@
=========================================================================*/
#include <vtkArrayCoordinates.h>
#include <vtkArraySlice.h>
#include <vtkArrayExtents.h>
#include <vtksys/ios/iostream>
#include <vtksys/ios/sstream>
......@@ -37,35 +37,35 @@
} \
}
int ArraySlice(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int ArrayExtents(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
vtkArraySlice slice(vtkArrayRange(2, 4), vtkArrayRange(6, 9));
vtkArrayExtents slice(vtkArrayRange(2, 4), vtkArrayRange(6, 9));
test_expression(slice.GetDimensions() == 2);
test_expression(slice.GetExtents()[0] == 2);
test_expression(slice.GetExtents()[1] == 3);
test_expression(slice.GetExtents().GetSize() == 6);
test_expression(slice[0].GetSize() == 2);
test_expression(slice[1].GetSize() == 3);
test_expression(slice.GetSize() == 6);
vtkArrayCoordinates coordinates;
for(vtkIdType n = 0; n != slice.GetExtents().GetSize(); ++n)
for(vtkIdType n = 0; n != slice.GetSize(); ++n)
{
slice.GetCoordinatesN(n, coordinates);
slice.GetLeftToRightCoordinatesN(n, coordinates);
cerr << coordinates << endl;
}
slice.GetCoordinatesN(0, coordinates);
slice.GetLeftToRightCoordinatesN(0, coordinates);
test_expression(coordinates == vtkArrayCoordinates(2, 6));
slice.GetCoordinatesN(1, coordinates);
slice.GetLeftToRightCoordinatesN(1, coordinates);
test_expression(coordinates == vtkArrayCoordinates(3, 6));
slice.GetCoordinatesN(2, coordinates);
slice.GetLeftToRightCoordinatesN(2, coordinates);
test_expression(coordinates == vtkArrayCoordinates(2, 7));
slice.GetCoordinatesN(3, coordinates);
slice.GetLeftToRightCoordinatesN(3, coordinates);
test_expression(coordinates == vtkArrayCoordinates(3, 7));
slice.GetCoordinatesN(4, coordinates);
slice.GetLeftToRightCoordinatesN(4, coordinates);
test_expression(coordinates == vtkArrayCoordinates(2, 8));
slice.GetCoordinatesN(5, coordinates);
slice.GetLeftToRightCoordinatesN(5, coordinates);
test_expression(coordinates == vtkArrayCoordinates(3, 8));
test_expression(slice.Contains(vtkArrayCoordinates(3, 7)));
......
......@@ -46,8 +46,8 @@ int ArrayInterpolationDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
vtkSmartPointer<vtkDenseArray<double> > b = vtkSmartPointer<vtkDenseArray<double> >::New();
b->Resize(vtkArrayExtents(2));
vtkInterpolate(a.GetPointer(), vtkArraySlices(vtkArraySlice(vtkArrayRange(0)), vtkArraySlice(vtkArrayRange(1))), vtkArrayWeights(0.5, 0.5), vtkArraySlice(vtkArrayRange(0)), b.GetPointer());
vtkInterpolate(a.GetPointer(), vtkArraySlices(vtkArraySlice(vtkArrayRange(2)), vtkArraySlice(vtkArrayRange(3))), vtkArrayWeights(0.5, 0.5), vtkArraySlice(vtkArrayRange(1)), b.GetPointer());
vtkInterpolate(a.GetPointer(), vtkArrayExtentsList(vtkArrayExtents(vtkArrayRange(0, 1)), vtkArrayExtents(vtkArrayRange(1, 2))), vtkArrayWeights(0.5, 0.5), vtkArrayExtents(vtkArrayRange(0, 1)), b.GetPointer());
vtkInterpolate(a.GetPointer(), vtkArrayExtentsList(vtkArrayExtents(vtkArrayRange(2, 3)), vtkArrayExtents(vtkArrayRange(3, 4))), vtkArrayWeights(0.5, 0.5), vtkArrayExtents(vtkArrayRange(1, 2)), b.GetPointer());
test_expression(b->GetValue(0) == 0.5, "expected 0.5");
test_expression(b->GetValue(1) == 2.5, "expected 2.5");
......@@ -66,8 +66,8 @@ int ArrayInterpolationDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
vtkSmartPointer<vtkDenseArray<double> > d = vtkSmartPointer<vtkDenseArray<double> >::New();
d->Resize(vtkArrayExtents(2, 2));
vtkInterpolate(c.GetPointer(), vtkArraySlices(vtkArraySlice(vtkArrayRange(0), vtkArrayRange(0, 2)), vtkArraySlice(vtkArrayRange(1), vtkArrayRange(0, 2))), vtkArrayWeights(0.5, 0.5), vtkArraySlice(vtkArrayRange(0), vtkArrayRange(0, 2)), d.GetPointer());
vtkInterpolate(c.GetPointer(), vtkArraySlices(vtkArraySlice(vtkArrayRange(2), vtkArrayRange(0, 2)), vtkArraySlice(vtkArrayRange(3), vtkArrayRange(0, 2))), vtkArrayWeights(0.5, 0.5), vtkArraySlice(vtkArrayRange(1), vtkArrayRange(0, 2)), d.GetPointer());
vtkInterpolate(c.GetPointer(), vtkArrayExtentsList(vtkArrayExtents(vtkArrayRange(0, 1), vtkArrayRange(0, 2)), vtkArrayExtents(vtkArrayRange(1, 2), vtkArrayRange(0, 2))), vtkArrayWeights(0.5, 0.5), vtkArrayExtents(vtkArrayRange(0, 1), vtkArrayRange(0, 2)), d.GetPointer());
vtkInterpolate(c.GetPointer(), vtkArrayExtentsList(vtkArrayExtents(vtkArrayRange(2, 3), vtkArrayRange(0, 2)), vtkArrayExtents(vtkArrayRange(3, 4), vtkArrayRange(0, 2))), vtkArrayWeights(0.5, 0.5), vtkArrayExtents(vtkArrayRange(1, 2), vtkArrayRange(0, 2)), d.GetPointer());
test_expression(d->GetValue(0, 0) == 1, "expected 1");
test_expression(d->GetValue(0, 1) == 2, "expected 2");
......
......@@ -81,7 +81,7 @@ IF(VTK_USE_N_WAY_ARRAYS)
ArrayBool.cxx
ArrayInterpolationDense.cxx
ArrayNullValues.cxx
ArraySlice.cxx
ArrayExtents.cxx
ArrayUserTypes.cxx
ArrayVariants.cxx
SparseArrayValidation.cxx
......
......@@ -30,7 +30,7 @@
// Standard functions
//
vtkCxxRevisionMacro(vtkArray, "1.5");
vtkCxxRevisionMacro(vtkArray, "1.6");
//----------------------------------------------------------------------------
......@@ -138,36 +138,42 @@ vtkArray* vtkArray::CreateArray(int StorageType, int ValueType)
return 0;
}
void vtkArray::Resize(vtkIdType i)
void vtkArray::Resize(const vtkIdType i)
{
this->Resize(vtkArrayExtents(vtkArrayRange(0, i)));
}
void vtkArray::Resize(const vtkArrayRange& i)
{
this->Resize(vtkArrayExtents(i));
}
void vtkArray::Resize(vtkIdType i, vtkIdType j)
void vtkArray::Resize(const vtkIdType i, const vtkIdType j)
{
this->Resize(vtkArrayExtents(vtkArrayRange(0, i), vtkArrayRange(0, j)));
}
void vtkArray::Resize(const vtkArrayRange& i, const vtkArrayRange& j)
{
this->Resize(vtkArrayExtents(i, j));
}
void vtkArray::Resize(vtkIdType i, vtkIdType j, vtkIdType k)
void vtkArray::Resize(const vtkIdType i, const vtkIdType j, const vtkIdType k)
{
this->Resize(vtkArrayExtents(vtkArrayRange(0, i), vtkArrayRange(0, j), vtkArrayRange(0, k)));
}
void vtkArray::Resize(const vtkArrayRange& i, const vtkArrayRange& j, const vtkArrayRange& k)
{
this->Resize(vtkArrayExtents(i, j, k));
}
void vtkArray::Resize(const vtkArrayExtents& extents)
{
for(vtkIdType i = 0; i != extents.GetDimensions(); ++i)
{
if(extents[i] < 0)
{
vtkErrorMacro(<< "cannot create dimension with extents < 0");
return;
}
}
this->InternalResize(extents);
}
vtkIdType vtkArray::GetExtent(vtkIdType dimension)
const vtkArrayRange vtkArray::GetExtent(vtkIdType dimension)
{
return this->GetExtents()[dimension];
}
......
......@@ -91,21 +91,23 @@ public:
// initialize its contents accordingly. In particular, dimension-labels will be
// undefined, dense array values will be undefined, and sparse arrays will be
// empty.
void Resize(vtkIdType i);
void Resize(vtkIdType i, vtkIdType j);
void Resize(vtkIdType i, vtkIdType j, vtkIdType k);
void Resize(const vtkIdType i);
void Resize(const vtkIdType i, const vtkIdType j);
void Resize(const vtkIdType i, const vtkIdType j, const vtkIdType k);
//BTX
void Resize(const vtkArrayRange& i);
void Resize(const vtkArrayRange& i, const vtkArrayRange& j);
void Resize(const vtkArrayRange& i, const vtkArrayRange& j, const vtkArrayRange& k);
void Resize(const vtkArrayExtents& extents);
//ETX
//BTX
// Description:
// Returns the extent (array size) along the given dimension.
vtkIdType GetExtent(vtkIdType dimension);
// Returns the extent (valid coordinate range) along the given dimension.
const vtkArrayRange GetExtent(vtkIdType dimension);
// Description:
// Returns the extents (the number of dimensions and size along each dimension) of the array.
//BTX
virtual vtkArrayExtents GetExtents() = 0;
virtual const vtkArrayExtents& GetExtents() = 0;
//ETX
// Description:
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkArrayCoordinateIterator.h
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkArrayCoordinateIterator - Iterates over array coordinates.
//
// .SECTION Description
// vtkArrayCoordinateIterator iterates over every unique set of coordinates
// that are defined by a set of vtkArrayExtents. The order in which
// coordinates are visited is undefined.
//
// Note that vtkArrayCoordinateIterator visits every permutation of
// coordinates defined by a set of array extents, *not* the array itself - if
// you are working with a sparse array, any of the coordinates that are visited
// by the iterator could be NULL within the array.
//
// vtkArrayCoordinateIterator is mainly useful if you are writing a source that
// generates arbitrary-dimension arrays from scratch. Algorithms that process
// existing arrays can almost always be written more efficiently using
// vtkArray::GetCoordinatesN() and vtkTypedArray::GetValueN(), which only visit
// non-NULL values within an array.
//
// .SECTION See Also
// vtkArray, vtkArrayExtents, vtkArrayCoordinates
//
// .SECTION Thanks
// Developed by Timothy M. Shead (tshead@sandia.gov) at Sandia National Laboratories.
#ifndef __vtkArrayCoordinateIterator_h
#define __vtkArrayCoordinateIterator_h
#include "vtkArrayExtents.h"
#include "vtkArrayCoordinates.h"
#include "vtkObject.h"
class VTK_COMMON_EXPORT vtkArrayCoordinateIterator : public vtkObject
{
public:
static vtkArrayCoordinateIterator* New();
vtkTypeRevisionMacro(vtkArrayCoordinateIterator, vtkObject);
void PrintSelf(ostream &os, vtkIndent indent);
//BTX
// Description:
// Sets the array extents to iterate over, and resets the iterator to
// the beginning of the range of unique coordinates.
void SetExtents(const vtkArrayExtents&);
//ETX
// Description:
// Returns true iff the iterator has not reached the end
// of the range of unique coordinates.
bool HasNext();
// Description:
// Returns the next set of coordinates and advances the iterator.
//BTX
vtkArrayCoordinates Next();
//ETX
protected:
vtkArrayCoordinateIterator();
~vtkArrayCoordinateIterator();
private:
vtkArrayCoordinateIterator(const vtkArrayCoordinateIterator&); // Not implemented
void operator=(const vtkArrayCoordinateIterator&); // Not implemented
vtkArrayExtents Extents;
vtkArrayCoordinates Coordinates;
vtkIdType Current;
vtkIdType End;
};
#endif
......@@ -29,20 +29,41 @@ vtkArrayExtents::vtkArrayExtents()
{
}
vtkArrayExtents::vtkArrayExtents(vtkIdType i) :
vtkArrayExtents::vtkArrayExtents(const vtkIdType i) :
Storage(1)
{
this->Storage[0] = vtkArrayRange(0, i);
}
vtkArrayExtents::vtkArrayExtents(const vtkArrayRange& i) :
Storage(1)
{
this->Storage[0] = i;
}
vtkArrayExtents::vtkArrayExtents(vtkIdType i, vtkIdType j) :
vtkArrayExtents::vtkArrayExtents(const vtkIdType i, const vtkIdType j) :
Storage(2)
{
this->Storage[0] = vtkArrayRange(0, i);
this->Storage[1] = vtkArrayRange(0, j);
}
vtkArrayExtents::vtkArrayExtents(const vtkArrayRange& i, const vtkArrayRange& j) :
Storage(2)
{
this->Storage[0] = i;
this->Storage[1] = j;
}
vtkArrayExtents::vtkArrayExtents(vtkIdType i, vtkIdType j, vtkIdType k) :
vtkArrayExtents::vtkArrayExtents(const vtkIdType i, const vtkIdType j, const vtkIdType k) :
Storage(3)
{
this->Storage[0] = vtkArrayRange(0, i);
this->Storage[1] = vtkArrayRange(0, j);
this->Storage[2] = vtkArrayRange(0, k);
}
vtkArrayExtents::vtkArrayExtents(const vtkArrayRange& i, const vtkArrayRange& j, const vtkArrayRange& k) :
Storage(3)
{
this->Storage[0] = i;
......@@ -58,15 +79,15 @@ const vtkArrayExtents vtkArrayExtents::Uniform(vtkIdType n, vtkIdType m)
// arguement constructor and initialize the values manually.
// result.Storage = vtksys_stl::vector<vtkIdType>(n, m);
result.Storage = vtksys_stl::vector<vtkIdType>(n);
for(int i = 0; i < n; i++)
result.Storage = vtksys_stl::vector<vtkArrayRange>(n);
for(vtkIdType i = 0; i < n; i++)
{
result.Storage[i] = m;
result.Storage[i] = vtkArrayRange(0, m);
}
return result;
}
void vtkArrayExtents::Append(vtkIdType extent)
void vtkArrayExtents::Append(const vtkArrayRange& extent)
{
this->Storage.push_back(extent);
}
......@@ -81,20 +102,24 @@ vtkIdType vtkArrayExtents::GetSize() const
if(this->Storage.empty())
return 0;
return vtkstd::accumulate(this->Storage.begin(), this->Storage.end(), 1, vtkstd::multiplies<vtkIdType>());
vtkIdType size = 1;
for(vtkIdType i = 0; i != this->Storage.size(); ++i)
size *= this->Storage[i].GetSize();
return size;
}
void vtkArrayExtents::SetDimensions(vtkIdType dimensions)
{
this->Storage.assign(dimensions, 0);
this->Storage.assign(dimensions, vtkArrayRange());
}
vtkIdType& vtkArrayExtents::operator[](vtkIdType i)
vtkArrayRange& vtkArrayExtents::operator[](vtkIdType i)
{
return this->Storage[i];
}
const vtkIdType& vtkArrayExtents::operator[](vtkIdType i) const
const vtkArrayRange& vtkArrayExtents::operator[](vtkIdType i) const
{
return this->Storage[i];
}
......@@ -109,6 +134,69 @@ bool vtkArrayExtents::operator!=(const vtkArrayExtents& rhs) const
return !(*this == rhs);
}
bool vtkArrayExtents::ZeroBased() const
{
for(vtkIdType i = 0; i != this->GetDimensions(); ++i)
{
if(this->Storage[i].GetBegin() != 0)
return false;
}
return true;
}
bool vtkArrayExtents::SameShape(const vtkArrayExtents& rhs) const
{
if(this->GetDimensions() != rhs.GetDimensions())
return false;
for(vtkIdType i = 0; i != this->GetDimensions(); ++i)
{
if(this->Storage[i].GetSize() != rhs.Storage[i].GetSize())
return false;
}
return true;
}
void vtkArrayExtents::GetLeftToRightCoordinatesN(vtkIdType n, vtkArrayCoordinates& coordinates) const
{
coordinates.SetDimensions(this->GetDimensions());
vtkIdType divisor = 1;
for(vtkIdType i = 0; i < this->GetDimensions(); ++i)
{
coordinates[i