26#ifndef vtkStructuredExtent_h
27#define vtkStructuredExtent_h
29#include "vtkCommonDataModelModule.h"
42 static void Clamp(
int ext[6],
const int wholeExt[]);
48 static bool StrictlySmaller(
const int ext[6],
const int wholeExt[6]);
54 static bool Smaller(
const int ext[6],
const int wholeExt[6]);
59 static void Grow(
int ext[6],
int count);
65 static void Grow(
int ext[6],
int count,
int wholeExt[6]);
70 static void Transform(
int ext[6],
int wholeExt[6]);
75 static void GetDimensions(
const int ext[6],
int dims[3]);
89 ext[0] = (ext[0] < wholeExt[0]) ? wholeExt[0] : ext[0];
90 ext[1] = (ext[1] > wholeExt[1]) ? wholeExt[1] : ext[1];
92 ext[2] = (ext[2] < wholeExt[2]) ? wholeExt[2] : ext[2];
93 ext[3] = (ext[3] > wholeExt[3]) ? wholeExt[3] : ext[3];
95 ext[4] = (ext[4] < wholeExt[4]) ? wholeExt[4] : ext[4];
96 ext[5] = (ext[5] > wholeExt[5]) ? wholeExt[5] : ext[5];
102 if (ext[0] < wholeExt[0] || ext[0] > wholeExt[0 + 1] || ext[0 + 1] < wholeExt[0] ||
103 ext[0 + 1] > wholeExt[0 + 1])
108 if (ext[2] < wholeExt[2] || ext[2] > wholeExt[2 + 1] || ext[2 + 1] < wholeExt[2] ||
109 ext[2 + 1] > wholeExt[2 + 1])
114 if (ext[4] < wholeExt[4] || ext[4] > wholeExt[4 + 1] || ext[4 + 1] < wholeExt[4] ||
115 ext[4 + 1] > wholeExt[4 + 1])
131 if (ext[0] > wholeExt[0] || ext[1] < wholeExt[1] || ext[2] > wholeExt[2] ||
132 ext[3] < wholeExt[3] || ext[4] > wholeExt[4] || ext[5] < wholeExt[5])
162 ext[0] -= wholeExt[0];
163 ext[1] -= wholeExt[0];
165 ext[2] -= wholeExt[2];
166 ext[3] -= wholeExt[2];
168 ext[4] -= wholeExt[4];
169 ext[5] -= wholeExt[4];
175 dims[0] = ext[1] - ext[0] + 1;
176 dims[1] = ext[3] - ext[2] + 1;
177 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 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.
static void Clamp(int ext[6], const int wholeExt[])
Clamps ext to fit in wholeExt.