17#ifndef vtkStructuredExtent_h
18#define vtkStructuredExtent_h
20#include "vtkCommonDataModelModule.h"
23VTK_ABI_NAMESPACE_BEGIN
34 static void Clamp(
int ext[6],
const int wholeExt[6]);
40 static bool StrictlySmaller(
const int ext[6],
const int wholeExt[6]);
46 static bool Smaller(
const int ext[6],
const int wholeExt[6]);
51 static void Grow(
int ext[6],
int count);
57 static void Grow(
int ext[6],
int count,
int wholeExt[6]);
62 static void Transform(
int ext[6],
int wholeExt[6]);
67 static void GetDimensions(
const int ext[6],
int dims[3]);
81 ext[0] = (ext[0] < wholeExt[0]) ? wholeExt[0] : ext[0];
82 ext[1] = (ext[1] > wholeExt[1]) ? wholeExt[1] : ext[1];
84 ext[2] = (ext[2] < wholeExt[2]) ? wholeExt[2] : ext[2];
85 ext[3] = (ext[3] > wholeExt[3]) ? wholeExt[3] : ext[3];
87 ext[4] = (ext[4] < wholeExt[4]) ? wholeExt[4] : ext[4];
88 ext[5] = (ext[5] > wholeExt[5]) ? wholeExt[5] : ext[5];
94 if (ext[0] < wholeExt[0] || ext[0] > wholeExt[0 + 1] || ext[0 + 1] < wholeExt[0] ||
95 ext[0 + 1] > wholeExt[0 + 1])
100 if (ext[2] < wholeExt[2] || ext[2] > wholeExt[2 + 1] || ext[2 + 1] < wholeExt[2] ||
101 ext[2 + 1] > wholeExt[2 + 1])
106 if (ext[4] < wholeExt[4] || ext[4] > wholeExt[4 + 1] || ext[4 + 1] < wholeExt[4] ||
107 ext[4 + 1] > wholeExt[4 + 1])
123 if (ext[0] > wholeExt[0] || ext[1] < wholeExt[1] || ext[2] > wholeExt[2] ||
124 ext[3] < wholeExt[3] || ext[4] > wholeExt[4] || ext[5] < wholeExt[5])
154 ext[0] -= wholeExt[0];
155 ext[1] -= wholeExt[0];
157 ext[2] -= wholeExt[2];
158 ext[3] -= wholeExt[2];
160 ext[4] -= wholeExt[4];
161 ext[5] -= wholeExt[4];
167 dims[0] = ext[1] - ext[0] + 1;
168 dims[1] = ext[3] - ext[2] + 1;
169 dims[2] = ext[5] - ext[4] + 1;
a simple class to control print indentation
abstract base class for most VTK objects
helper class to aid working with structured extents.
static vtkStructuredExtent * New()
static void Grow(int ext[6], int count)
Grows the ext on each side by the given count.
~vtkStructuredExtent() override
static bool StrictlySmaller(const int ext[6], const int wholeExt[6])
Returns true if ext is fits within wholeExt with at least 1 dimension smaller than the wholeExt.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static void Clamp(int ext[6], const int wholeExt[6])
Clamps ext to fit in wholeExt.
static bool Smaller(const int ext[6], const int wholeExt[6])
Returns if ext fits within wholeExt.
static void Transform(int ext[6], int wholeExt[6])
Makes ext relative to wholeExt.
static void GetDimensions(const int ext[6], int dims[3])
Given the extents, computes the dimensions.