VTK
9.1.0
|
Representation of a cartesian pixel plane and common operations on it. More...
#include <vtkPixelExtent.h>
Public Member Functions | |
vtkPixelExtent () | |
template<typename T > | |
vtkPixelExtent (const T *ext) | |
template<typename T > | |
vtkPixelExtent (T ilo, T ihi, T jlo, T jhi) | |
template<typename T > | |
vtkPixelExtent (T width, T height) | |
vtkPixelExtent (const vtkPixelExtent &other) | |
vtkPixelExtent & | operator= (const vtkPixelExtent &other) |
int & | operator[] (int i) |
Element access. More... | |
const int & | operator[] (int i) const |
void | SetData (const vtkPixelExtent &ext) |
Set the extent. More... | |
template<typename T > | |
void | SetData (const T *ext) |
template<typename T > | |
void | SetData (T ilo, T ihi, T jlo, T jhi) |
void | Clear () |
int * | GetData () |
Direct access to internal data. More... | |
const int * | GetData () const |
template<typename T > | |
void | GetData (T data[4]) const |
unsigned int * | GetDataU () |
const unsigned int * | GetDataU () const |
int | Empty () const |
Return true if empty. More... | |
bool | operator== (const vtkPixelExtent &other) const |
Test for equivalence. More... | |
int | Disjoint (vtkPixelExtent other) const |
Return non-zero if the extent is disjoint from the other. More... | |
template<typename T > | |
void | Size (T nCells[2]) const |
Get the number in each direction. More... | |
size_t | Size () const |
Get the total number. More... | |
void | operator&= (const vtkPixelExtent &other) |
In place intersection. More... | |
void | operator|= (const vtkPixelExtent &other) |
In place union. More... | |
void | Shift () |
Shifts by low corner of this, moving to the origin. More... | |
void | Shift (const vtkPixelExtent &ext) |
Shift by low corner of the given extent. More... | |
void | Shift (int *n) |
Shift by the given amount. More... | |
void | Shift (int q, int n) |
Shift by the given amount in the given direction. More... | |
vtkPixelExtent | Split (int dir) |
Divide the extent in half in the given direction. More... | |
void | GetStartIndex (int first[2]) const |
Get the start/end index. More... | |
void | GetStartIndex (int first[2], const int origin[2]) const |
Get the start/end index. More... | |
void | GetEndIndex (int last[2]) const |
Get the start/end index. More... | |
int | Contains (const vtkPixelExtent &other) const |
Return non-zero if this extent contains the other. More... | |
int | Contains (int i, int j) const |
Return non-zero if this extent contains the other. More... | |
void | Grow (int n) |
Expand the extents by n. More... | |
void | Grow (int q, int n) |
Expand the extents by n. More... | |
void | GrowLow (int q, int n) |
Expand the extents by n. More... | |
void | GrowHigh (int q, int n) |
Expand the extents by n. More... | |
void | Shrink (int n) |
Shrink the extent by n. More... | |
void | Shrink (int q, int n) |
Shrink the extent by n. More... | |
void | CellToNode () |
In-place conversion from cell based to node based extent, and vise-versa. More... | |
void | NodeToCell () |
In-place conversion from cell based to node based extent, and vise-versa. More... | |
Static Public Member Functions | |
template<typename T > | |
static void | Size (const vtkPixelExtent &ext, T nCells[2]) |
Get the number in each direction. More... | |
static size_t | Size (const vtkPixelExtent &ext) |
Get the total number. More... | |
static vtkPixelExtent | Grow (const vtkPixelExtent &inputExt, int n) |
Add or remove ghost cells. More... | |
static vtkPixelExtent | Grow (const vtkPixelExtent &inputExt, const vtkPixelExtent &problemDomain, int n) |
static vtkPixelExtent | GrowLow (const vtkPixelExtent &ext, int q, int n) |
static vtkPixelExtent | GrowHigh (const vtkPixelExtent &ext, int q, int n) |
static vtkPixelExtent | Shrink (const vtkPixelExtent &inputExt, const vtkPixelExtent &problemDomain, int n) |
Remove ghost cells. More... | |
static vtkPixelExtent | Shrink (const vtkPixelExtent &inputExt, int n) |
static vtkPixelExtent | NodeToCell (const vtkPixelExtent &inputExt) |
Convert from point extent to cell extent while respecting the dimensionality of the data. More... | |
static vtkPixelExtent | CellToNode (const vtkPixelExtent &inputExt) |
Convert from cell extent to point extent while respecting the dimensionality of the data. More... | |
static void | Split (int i, int j, const vtkPixelExtent &ext, std::deque< vtkPixelExtent > &newExts) |
Split ext at i,j, resulting extents (up to 4) are appended to newExts. More... | |
static void | Subtract (const vtkPixelExtent &A, const vtkPixelExtent &B, std::deque< vtkPixelExtent > &C) |
A - B = C C is a set of disjoint extents such that the intersection of B and C is empty and the intersection of A and C is C. More... | |
static void | Merge (std::deque< vtkPixelExtent > &exts) |
Merge compatible extents in the list. More... | |
static void | Shift (int *ij, int n) |
Shift by the given amount while respecting mode. More... | |
static void | Shift (int *ij, int *n) |
Shift by the given amount while respecting mode. More... | |
Representation of a cartesian pixel plane and common operations on it.
The implementation is intended to be fast and light so that it may be used in place of int[4] with little or no performance penalty.
NOTE in most cases operation on an empty object produces incorrect results. If it an issue query Empty() first.
Definition at line 38 of file vtkPixelExtent.h.
|
inline |
Definition at line 325 of file vtkPixelExtent.h.
vtkPixelExtent::vtkPixelExtent | ( | const T * | ext | ) |
Definition at line 332 of file vtkPixelExtent.h.
vtkPixelExtent::vtkPixelExtent | ( | T | ilo, |
T | ihi, | ||
T | jlo, | ||
T | jhi | ||
) |
Definition at line 339 of file vtkPixelExtent.h.
|
inline |
Definition at line 50 of file vtkPixelExtent.h.
|
inline |
Definition at line 358 of file vtkPixelExtent.h.
|
inline |
Definition at line 345 of file vtkPixelExtent.h.
|
inline |
Element access.
Definition at line 62 of file vtkPixelExtent.h.
|
inline |
Definition at line 63 of file vtkPixelExtent.h.
|
inline |
Set the extent.
Definition at line 303 of file vtkPixelExtent.h.
void vtkPixelExtent::SetData | ( | const T * | ext | ) |
Definition at line 286 of file vtkPixelExtent.h.
void vtkPixelExtent::SetData | ( | T | ilo, |
T | ihi, | ||
T | jlo, | ||
T | jhi | ||
) |
Definition at line 296 of file vtkPixelExtent.h.
|
inline |
Definition at line 319 of file vtkPixelExtent.h.
|
inline |
Direct access to internal data.
Definition at line 80 of file vtkPixelExtent.h.
|
inline |
Definition at line 81 of file vtkPixelExtent.h.
void vtkPixelExtent::GetData | ( | T | data[4] | ) | const |
Definition at line 310 of file vtkPixelExtent.h.
|
inline |
Definition at line 86 of file vtkPixelExtent.h.
|
inline |
Definition at line 88 of file vtkPixelExtent.h.
|
inline |
Get the start/end index.
Definition at line 391 of file vtkPixelExtent.h.
|
inline |
Get the start/end index.
Definition at line 398 of file vtkPixelExtent.h.
|
inline |
Get the start/end index.
Definition at line 405 of file vtkPixelExtent.h.
|
inline |
Return true if empty.
Definition at line 412 of file vtkPixelExtent.h.
|
inline |
Test for equivalence.
Definition at line 422 of file vtkPixelExtent.h.
|
inline |
Return non-zero if this extent contains the other.
Definition at line 433 of file vtkPixelExtent.h.
|
inline |
Return non-zero if this extent contains the other.
Definition at line 444 of file vtkPixelExtent.h.
|
inline |
Return non-zero if the extent is disjoint from the other.
Definition at line 499 of file vtkPixelExtent.h.
void vtkPixelExtent::Size | ( | T | nCells[2] | ) | const |
Get the number in each direction.
Definition at line 379 of file vtkPixelExtent.h.
|
inline |
Get the total number.
Definition at line 385 of file vtkPixelExtent.h.
|
inline |
In place intersection.
Definition at line 454 of file vtkPixelExtent.h.
|
inline |
In place union.
Definition at line 479 of file vtkPixelExtent.h.
|
inline |
Expand the extents by n.
Definition at line 506 of file vtkPixelExtent.h.
|
inline |
Expand the extents by n.
Definition at line 515 of file vtkPixelExtent.h.
|
inline |
Expand the extents by n.
Definition at line 524 of file vtkPixelExtent.h.
|
inline |
Expand the extents by n.
Definition at line 530 of file vtkPixelExtent.h.
|
inline |
Shrink the extent by n.
Definition at line 536 of file vtkPixelExtent.h.
|
inline |
Shrink the extent by n.
Definition at line 545 of file vtkPixelExtent.h.
|
inline |
Shifts by low corner of this, moving to the origin.
Definition at line 583 of file vtkPixelExtent.h.
|
inline |
Shift by low corner of the given extent.
Definition at line 570 of file vtkPixelExtent.h.
|
inline |
Shift by the given amount.
Definition at line 553 of file vtkPixelExtent.h.
|
inline |
Shift by the given amount in the given direction.
Definition at line 562 of file vtkPixelExtent.h.
|
inline |
Divide the extent in half in the given direction.
The operation is done in-place the other half of the split extent is returned. The return will be empty if the split could not be made.
Definition at line 596 of file vtkPixelExtent.h.
|
inline |
In-place conversion from cell based to node based extent, and vise-versa.
Definition at line 616 of file vtkPixelExtent.h.
|
inline |
In-place conversion from cell based to node based extent, and vise-versa.
Definition at line 623 of file vtkPixelExtent.h.
|
static |
Get the number in each direction.
Definition at line 365 of file vtkPixelExtent.h.
|
inlinestatic |
Get the total number.
Definition at line 372 of file vtkPixelExtent.h.
|
static |
Add or remove ghost cells.
If a problem domain is provided then the result is clipled to be within the problem domain.
|
static |
|
static |
|
static |
|
static |
Remove ghost cells.
If a problem domain is provided the input is pinned at the domain.
|
static |
|
static |
Convert from point extent to cell extent while respecting the dimensionality of the data.
|
static |
Convert from cell extent to point extent while respecting the dimensionality of the data.
|
static |
Shift by the given amount while respecting mode.
|
static |
Shift by the given amount while respecting mode.
|
static |
Split ext at i,j, resulting extents (up to 4) are appended to newExts.
If i,j is outside ext, ext is passed through unmodified.
|
static |
A - B = C C is a set of disjoint extents such that the intersection of B and C is empty and the intersection of A and C is C.
|
static |
Merge compatible extents in the list.
Extents are compatible if they are directly adjacent nad have the same extent along the adjacent edge.