vtkArrayExtents Class Reference

#include <vtkArrayExtents.h>

List of all members.


Detailed Description

Stores the number of dimensions and size of an N-way array.

vtkArrayExtents describes the number of dimensions and size along each dimension of an N-way collection of values. It is used to retrieve and update the extents of a vtkArray object.

Convenience constructors are provided for creating extents along one, two, and three dimensions. For higher dimensions, you can:

Use the static Uniform() factory method to create extents that have the same size along an arbitrary number of dimensions.

Use the default constructor and the Append() method to "grow" your extents to the correct number of dimensions.

Use the default constructuor, SetDimensions() and operator[] to assign a size along each dimension.

See also:
vtkArray, vtkArrayCoordinates
Thanks:
Developed by Timothy M. Shead (tshead@sandia.gov) at Sandia National Laboratories.
Tests:
vtkArrayExtents (Tests)

Definition at line 61 of file vtkArrayExtents.h.


Public Member Functions

 vtkArrayExtents ()
 vtkArrayExtents (vtkIdType i)
 vtkArrayExtents (vtkIdType i, vtkIdType j)
 vtkArrayExtents (vtkIdType i, vtkIdType j, vtkIdType k)
void Append (vtkIdType extent)
vtkIdType GetDimensions () const
vtkIdType GetSize () const
void SetDimensions (vtkIdType dimensions)
vtkIdTypeoperator[] (vtkIdType i)
const vtkIdTypeoperator[] (vtkIdType i) const
bool operator== (const vtkArrayExtents &rhs) const
bool operator!= (const vtkArrayExtents &rhs) const
bool Contains (const vtkArrayCoordinates &coordinates) const

Static Public Member Functions

static const vtkArrayExtents Uniform (vtkIdType n, vtkIdType m)

Friends

VTK_COMMON_EXPORT friend ostream & operator<< (ostream &stream, const vtkArrayExtents &rhs)

Constructor & Destructor Documentation

vtkArrayExtents::vtkArrayExtents (  ) 

Create zero-dimensional extents.

vtkArrayExtents::vtkArrayExtents ( vtkIdType  i  )  [explicit]

Create one-dimensional extents.

vtkArrayExtents::vtkArrayExtents ( vtkIdType  i,
vtkIdType  j 
)

Create two-dimensional extents.

vtkArrayExtents::vtkArrayExtents ( vtkIdType  i,
vtkIdType  j,
vtkIdType  k 
)

Create three-dimensional extents.


Member Function Documentation

static const vtkArrayExtents vtkArrayExtents::Uniform ( vtkIdType  n,
vtkIdType  m 
) [static]

Create n-dimensional extents with size m along each dimension.

void vtkArrayExtents::Append ( vtkIdType  extent  ) 

Grow the number of dimensions by one, specifying the extent of the new dimension.

vtkIdType vtkArrayExtents::GetDimensions (  )  const

Return the current number of dimensions.

vtkIdType vtkArrayExtents::GetSize (  )  const

Return the number of values that *could* be stored using the current extents. This is equal to the product of the extents along each dimension.

void vtkArrayExtents::SetDimensions ( vtkIdType  dimensions  ) 

Set the current number of dimensions. Note that this method resets the extent along each dimension to zero, so you must assign each dimension's extent explicitly using operator[] after calling SetDimensions().

vtkIdType& vtkArrayExtents::operator[] ( vtkIdType  i  ) 

Accesses the extent of the i-th dimension.

const vtkIdType& vtkArrayExtents::operator[] ( vtkIdType  i  )  const

Accesses the extent of the i-th dimension.

bool vtkArrayExtents::operator== ( const vtkArrayExtents rhs  )  const

Equality comparison

bool vtkArrayExtents::operator!= ( const vtkArrayExtents rhs  )  const

Inequality comparison

bool vtkArrayExtents::Contains ( const vtkArrayCoordinates coordinates  )  const

Returns true if the given array coordinates are completely contained by the current extents (i.e. that 0 <= coordinate and coordinate < extent along every dimension). Returns false if the array coordinates are outside the current extents, or contain a different number of dimensions.


Friends And Related Function Documentation

VTK_COMMON_EXPORT friend ostream& operator<< ( ostream &  stream,
const vtkArrayExtents rhs 
) [friend]


The documentation for this class was generated from the following file:

Generated on Wed Jun 3 18:53:33 2009 for VTK by  doxygen 1.5.6