VTK  9.3.20240318
Public Types | Public Member Functions | List of all members
vtkArrayCoordinates Class Reference

Stores coordinate into an N-way array. More...

#include <vtkArrayCoordinates.h>

Public Types

typedef vtkIdType CoordinateT
 
typedef vtkIdType DimensionT
 

Public Member Functions

 vtkArrayCoordinates ()
 Create an empty set of coordinates. More...
 
 vtkArrayCoordinates (CoordinateT i)
 Create coordinates for a one-dimensional array. More...
 
 vtkArrayCoordinates (CoordinateT i, CoordinateT j)
 Create coordinates for a two-dimensional array. More...
 
 vtkArrayCoordinates (CoordinateT i, CoordinateT j, CoordinateT k)
 Create coordinates for a three-dimensional array. More...
 
DimensionT GetDimensions () const
 Return the number of dimensions contained in the coordinates. More...
 
void SetDimensions (DimensionT dimensions)
 Set the number of dimensions. More...
 
CoordinateToperator[] (DimensionT i)
 Returns the coordinate of the i-th dimension. More...
 
const CoordinateToperator[] (DimensionT i) const
 Returns the coordinate of the i-th dimension. More...
 
CoordinateT GetCoordinate (DimensionT i) const
 Returns the coordinate of the i-th dimension. More...
 
void SetCoordinate (DimensionT i, const CoordinateT &)
 Sets the coordinate of the i-th dimension. More...
 
bool operator== (const vtkArrayCoordinates &rhs) const
 Equality comparison. More...
 
bool operator!= (const vtkArrayCoordinates &rhs) const
 Inequality comparison. More...
 
VTKCOMMONCORE_EXPORT friend ostream & operator<< (ostream &stream, const vtkArrayCoordinates &rhs)
 Inequality comparison. More...
 

Detailed Description

Stores coordinate into an N-way array.

vtkArrayCoordinates stores a collection of coordinates that can be used to access values in a vtkArray containing an arbitrary number of dimensions.

Convenience constructors are provided for working with one, two, and three dimensions. For higher dimensions, use the default constructor, SetDimensions() and operator[] to assign a coordinate value along each dimension.

See also
vtkArray, vtkArrayExtents
Thanks:
Developed by Timothy M. Shead (tshea.nosp@m.d@sa.nosp@m.ndia..nosp@m.gov) at Sandia National Laboratories.
Tests:
vtkArrayCoordinates (Tests)

Definition at line 38 of file vtkArrayCoordinates.h.

Member Typedef Documentation

◆ CoordinateT

Definition at line 41 of file vtkArrayCoordinates.h.

◆ DimensionT

Definition at line 42 of file vtkArrayCoordinates.h.

Constructor & Destructor Documentation

◆ vtkArrayCoordinates() [1/4]

vtkArrayCoordinates::vtkArrayCoordinates ( )

Create an empty set of coordinates.

Use SetDimensions() and operator[] to populate the coordinates.

◆ vtkArrayCoordinates() [2/4]

vtkArrayCoordinates::vtkArrayCoordinates ( CoordinateT  i)
explicit

Create coordinates for a one-dimensional array.

◆ vtkArrayCoordinates() [3/4]

vtkArrayCoordinates::vtkArrayCoordinates ( CoordinateT  i,
CoordinateT  j 
)

Create coordinates for a two-dimensional array.

◆ vtkArrayCoordinates() [4/4]

vtkArrayCoordinates::vtkArrayCoordinates ( CoordinateT  i,
CoordinateT  j,
CoordinateT  k 
)

Create coordinates for a three-dimensional array.

Member Function Documentation

◆ GetDimensions()

DimensionT vtkArrayCoordinates::GetDimensions ( ) const

Return the number of dimensions contained in the coordinates.

◆ SetDimensions()

void vtkArrayCoordinates::SetDimensions ( DimensionT  dimensions)

Set the number of dimensions.

Note that this method resets the coordinate along each dimension to zero, so you must set every coordinate explicitly using operator[] after calling SetDimensions().

◆ operator[]() [1/2]

CoordinateT& vtkArrayCoordinates::operator[] ( DimensionT  i)

Returns the coordinate of the i-th dimension.

◆ operator[]() [2/2]

const CoordinateT& vtkArrayCoordinates::operator[] ( DimensionT  i) const

Returns the coordinate of the i-th dimension.

◆ GetCoordinate()

CoordinateT vtkArrayCoordinates::GetCoordinate ( DimensionT  i) const

Returns the coordinate of the i-th dimension.

◆ SetCoordinate()

void vtkArrayCoordinates::SetCoordinate ( DimensionT  i,
const CoordinateT  
)

Sets the coordinate of the i-th dimension.

◆ operator==()

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

Equality comparison.

◆ operator!=()

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

Inequality comparison.

Friends And Related Function Documentation

◆ operator<<

VTKCOMMONCORE_EXPORT friend ostream& operator<< ( ostream &  stream,
const vtkArrayCoordinates rhs 
)
friend

Inequality comparison.


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