LSSTApplications  12.1-5-gbdcc3ab+2,15.0+13,15.0+26,15.0-1-g19261fa+17,15.0-1-g60afb23+26,15.0-1-g615e0bb+18,15.0-1-g788a293+26,15.0-1-ga91101e+26,15.0-1-gae1598d+12,15.0-1-gd076f1f+24,15.0-1-gdf18595+5,15.0-1-gf4f1c34+12,15.0-11-g7db6e543+4,15.0-12-g3681e7a+4,15.0-15-gc15de322,15.0-16-g83b84f4,15.0-2-g100d730+19,15.0-2-g1f9c9cf+4,15.0-2-g8aea5f4+1,15.0-2-gf38729e+21,15.0-29-ga12a2b06e,15.0-3-g11fe1a0+14,15.0-3-g707930d+3,15.0-3-g9103c06+12,15.0-3-gd3cbb57+3,15.0-4-g2d82b59,15.0-4-g535e784+10,15.0-4-g92ca6c3+4,15.0-4-gf906033+2,15.0-5-g23e394c+14,15.0-5-g4be42a9,15.0-6-g69628aa,15.0-6-g86e3f3d+1,15.0-6-gfa9b38f+4,15.0-7-g949993c+3,15.0-8-g67a62d3+1,15.0-8-gcf05001+1,15.0-9-g1e7c341+1,w.2018.21
LSSTDataManagementBasePackage
Public Types | Public Member Functions | List of all members
lsst::afw::geom::Box2I Class Reference

An integer coordinate rectangle. More...

#include <Box.h>

Public Types

enum  EdgeHandlingEnum { EXPAND, SHRINK }
 
typedef Point2I Point
 
typedef Extent2I Extent
 
typedef int Element
 

Public Member Functions

 Box2I ()
 Construct an empty box. More...
 
 Box2I (Point2I const &minimum, Point2I const &maximum, bool invert=true)
 Construct a box from its minimum and maximum points. More...
 
 Box2I (Point2I const &minimum, Extent2I const &dimensions, bool invert=true)
 Construct a box from its minimum point and dimensions. More...
 
 Box2I (Box2D const &other, EdgeHandlingEnum edgeHandling=EXPAND)
 Construct an integer box from a floating-point box. More...
 
 Box2I (Box2I const &)=default
 Standard copy constructor. More...
 
 Box2I (Box2I &&)=default
 
 ~Box2I ()=default
 
void swap (Box2I &other)
 
Box2Ioperator= (Box2I const &)=default
 Standard assignment operator. More...
 
Box2Ioperator= (Box2I &&)=default
 
ndarray::View< boost::fusion::vector2< ndarray::index::Range, ndarray::index::Range > > getSlices () const
 Return slices to extract the box's region from an ndarray::Array. More...
 
bool isEmpty () const
 Return true if the box contains no points. More...
 
bool contains (Point2I const &point) const
 Return true if the box contains the point. More...
 
bool contains (Box2I const &other) const
 Return true if all points contained by other are also contained by this. More...
 
bool overlaps (Box2I const &other) const
 Return true if any points in other are also in this. More...
 
void grow (int buffer)
 Increase the size of the box by the given buffer amount in all directions. More...
 
void grow (Extent2I const &buffer)
 Increase the size of the box by the given buffer amount in each direction. More...
 
void shift (Extent2I const &offset)
 Shift the position of the box by the given offset. More...
 
void flipLR (int xExtent)
 Flip a bounding box about the y-axis given a parent box of extent (xExtent). More...
 
void flipTB (int yExtent)
 Flip a bounding box about the x-axis given a parent box of extent (yExtent). More...
 
void include (Point2I const &point)
 Expand this to ensure that this->contains(point). More...
 
void include (Box2I const &other)
 Expand this to ensure that this->contains(other). More...
 
void clip (Box2I const &other)
 Shrink this to ensure that other.contains(*this). More...
 
bool operator== (Box2I const &other) const
 Compare two boxes for equality. More...
 
bool operator!= (Box2I const &other) const
 Compare two boxes for equality. More...
 
std::vector< Point2IgetCorners () const
 Get the corner points. More...
 
std::string toString () const
 
Min/Max Accessors

Return the minimum and maximum coordinates of the box (inclusive).

Point2I const getMin () const
 
int getMinX () const
 
int getMinY () const
 
Point2I const getMax () const
 
int getMaxX () const
 
int getMaxY () const
 
Begin/End Accessors

Return STL-style begin (inclusive) and end (exclusive) coordinates for the box.

Point2I const getBegin () const
 
int getBeginX () const
 
int getBeginY () const
 
Point2I const getEnd () const
 
int getEndX () const
 
int getEndY () const
 
Size Accessors

Return the size of the box in pixels.

Extent2I const getDimensions () const
 
int getWidth () const
 
int getHeight () const
 
int getArea () const
 

Detailed Description

An integer coordinate rectangle.

Box2I is an inclusive box that represents a rectangular region of pixels. A box never has negative dimensions; the empty box is defined to have zero-size dimensions, and is treated as though it does not have a well-defined position (regardless of the return value of getMin() or getMax() for an empty box).

Examples:
image2.cc, maskedImage2.cc, spatialCellExample.cc, testSpatialCell.cc, and testSpatialCell.h.

Definition at line 55 of file Box.h.

Member Typedef Documentation

◆ Element

Definition at line 59 of file Box.h.

◆ Extent

Definition at line 58 of file Box.h.

◆ Point

Definition at line 57 of file Box.h.

Member Enumeration Documentation

◆ EdgeHandlingEnum

Enumerator
EXPAND 
SHRINK 

Definition at line 61 of file Box.h.

Constructor & Destructor Documentation

◆ Box2I() [1/6]

lsst::afw::geom::Box2I::Box2I ( )
inline

Construct an empty box.

Definition at line 64 of file Box.h.

64 : _minimum(0), _dimensions(0) {}

◆ Box2I() [2/6]

lsst::afw::geom::Box2I::Box2I ( Point2I const &  minimum,
Point2I const &  maximum,
bool  invert = true 
)

Construct a box from its minimum and maximum points.

Parameters
[in]minimumMinimum (lower left) coordinate (inclusive).
[in]maximumMaximum (upper right) coordinate (inclusive).
[in]invertIf true (default), swap the minimum and maximum coordinates if minimum > maximum instead of creating an empty box.

Definition at line 32 of file Box.cc.

33  : _minimum(minimum), _dimensions(maximum - minimum) {
34  for (int n = 0; n < 2; ++n) {
35  if (_dimensions[n] < 0) {
36  if (invert) {
37  _minimum[n] += _dimensions[n];
38  _dimensions[n] = -_dimensions[n];
39  } else {
40  *this = Box2I();
41  return;
42  }
43  }
44  }
45  _dimensions += Extent2I(1);
46 }
Box2I()
Construct an empty box.
Definition: Box.h:64
Extent< int, 2 > Extent2I
Definition: Extent.h:380
Relationship invert(Relationship r)
Given the relationship between two sets A and B (i.e.
Definition: Relationship.h:55

◆ Box2I() [3/6]

lsst::afw::geom::Box2I::Box2I ( Point2I const &  minimum,
Extent2I const &  dimensions,
bool  invert = true 
)

Construct a box from its minimum point and dimensions.

Parameters
[in]minimumMinimum (lower left) coordinate.
[in]dimensionsBox dimensions. If either dimension coordinate is 0, the box will be empty.
[in]invertIf true (default), invert any negative dimensions instead of creating an empty box.

Definition at line 48 of file Box.cc.

49  : _minimum(minimum), _dimensions(dimensions) {
50  for (int n = 0; n < 2; ++n) {
51  if (_dimensions[n] == 0) {
52  *this = Box2I();
53  return;
54  } else if (_dimensions[n] < 0) {
55  if (invert) {
56  _minimum[n] += (_dimensions[n] + 1);
57  _dimensions[n] = -_dimensions[n];
58  } else {
59  *this = Box2I();
60  return;
61  }
62  }
63  }
64  if (!isEmpty() && any(getMin().gt(getMax()))) {
65  throw LSST_EXCEPT(pex::exceptions::OverflowError,
66  "Box dimensions too large; integer overflow detected.");
67  }
68 }
Point2I const getMin() const
Definition: Box.h:123
afw::table::PointKey< int > dimensions
Definition: GaussianPsf.cc:44
bool isEmpty() const
Return true if the box contains no points.
Definition: Box.h:163
Box2I()
Construct an empty box.
Definition: Box.h:64
Relationship invert(Relationship r)
Given the relationship between two sets A and B (i.e.
Definition: Relationship.h:55
Point2I const getMax() const
Definition: Box.h:127
bool any(CoordinateExpr< N > const &expr)
Return true if any elements are true.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:47

◆ Box2I() [4/6]

lsst::afw::geom::Box2I::Box2I ( Box2D const &  other,
EdgeHandlingEnum  edgeHandling = EXPAND 
)
explicit

Construct an integer box from a floating-point box.

Floating-point to integer box conversion is based on the concept that a pixel is not an infinitesimal point but rather a square of unit size centered on integer-valued coordinates. Converting a floating-point box to an integer box thus requires a choice on how to handle pixels which are only partially contained by the input floating-point box.

Parameters
[in]otherA floating-point box to convert.
[in]edgeHandlingIf EXPAND, the integer box will contain any pixels that overlap the floating-point box. If SHRINK, the integer box will contain only pixels completely contained by the floating-point box.

Definition at line 70 of file Box.cc.

70  : _minimum(), _dimensions() {
71  if (other.isEmpty()) {
72  *this = Box2I();
73  return;
74  }
75  if (!std::isfinite(other.getMinX()) || !std::isfinite(other.getMinY()) ||
76  !std::isfinite(other.getMaxX()) || !std::isfinite(other.getMaxY())) {
77  throw LSST_EXCEPT(pex::exceptions::InvalidParameterError, "Cannot convert non-finite Box2D to Box2I");
78  }
79  Point2D fpMin(other.getMin() + Extent2D(0.5));
80  Point2D fpMax(other.getMax() - Extent2D(0.5));
81  switch (edgeHandling) {
82  case EXPAND:
83  for (int n = 0; n < 2; ++n) {
84  _minimum[n] = static_cast<int>(std::floor(fpMin[n]));
85  _dimensions[n] = static_cast<int>(std::ceil(fpMax[n])) + 1 - _minimum[n];
86  }
87  break;
88  case SHRINK:
89  for (int n = 0; n < 2; ++n) {
90  _minimum[n] = static_cast<int>(std::ceil(fpMin[n]));
91  _dimensions[n] = static_cast<int>(std::floor(fpMax[n])) + 1 - _minimum[n];
92  }
93  break;
94  }
95 }
T ceil(T... args)
Extent< double, 2 > Extent2D
Definition: Extent.h:383
Box2I()
Construct an empty box.
Definition: Box.h:64
T floor(T... args)
Point< double, 2 > Point2D
Definition: Point.h:304
T isfinite(T... args)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:47
ItemVariant const * other
Definition: Schema.cc:55

◆ Box2I() [5/6]

lsst::afw::geom::Box2I::Box2I ( Box2I const &  )
default

Standard copy constructor.

◆ Box2I() [6/6]

lsst::afw::geom::Box2I::Box2I ( Box2I &&  )
default

◆ ~Box2I()

lsst::afw::geom::Box2I::~Box2I ( )
default

Member Function Documentation

◆ clip()

void lsst::afw::geom::Box2I::clip ( Box2I const &  other)

Shrink this to ensure that other.contains(*this).

Definition at line 179 of file Box.cc.

179  {
180  if (isEmpty()) return;
181  if (other.isEmpty()) {
182  *this = Box2I();
183  return;
184  }
185  Point2I maximum(getMax());
186  Point2I const& otherMin = other.getMin();
187  Point2I const otherMax = other.getMax();
188  for (int n = 0; n < 2; ++n) {
189  if (otherMin[n] > _minimum[n]) {
190  _minimum[n] = otherMin[n];
191  }
192  if (otherMax[n] < maximum[n]) {
193  maximum[n] = otherMax[n];
194  }
195  }
196  if (any(maximum.lt(_minimum))) {
197  *this = Box2I();
198  return;
199  }
200  _dimensions = Extent2I(1) + maximum - _minimum;
201 }
bool isEmpty() const
Return true if the box contains no points.
Definition: Box.h:163
Box2I()
Construct an empty box.
Definition: Box.h:64
Extent< int, 2 > Extent2I
Definition: Extent.h:380
Point2I const getMax() const
Definition: Box.h:127
bool any(CoordinateExpr< N > const &expr)
Return true if any elements are true.
ItemVariant const * other
Definition: Schema.cc:55
Point< int, 2 > Point2I
Definition: Point.h:301

◆ contains() [1/2]

bool lsst::afw::geom::Box2I::contains ( Point2I const &  point) const

Return true if the box contains the point.

Definition at line 102 of file Box.cc.

102  {
103  return all(point.ge(this->getMin())) && all(point.le(this->getMax()));
104 }
bool all(CoordinateExpr< N > const &expr)
Return true if all elements are true.

◆ contains() [2/2]

bool lsst::afw::geom::Box2I::contains ( Box2I const &  other) const

Return true if all points contained by other are also contained by this.

An empty box is contained by every other box, including other empty boxes.

Definition at line 106 of file Box.cc.

106  {
107  return other.isEmpty() ||
108  (all(other.getMin().ge(this->getMin())) && all(other.getMax().le(this->getMax())));
109 }
Point2I const getMin() const
Definition: Box.h:123
bool all(CoordinateExpr< N > const &expr)
Return true if all elements are true.
Point2I const getMax() const
Definition: Box.h:127
ItemVariant const * other
Definition: Schema.cc:55

◆ flipLR()

void lsst::afw::geom::Box2I::flipLR ( int  xExtent)

Flip a bounding box about the y-axis given a parent box of extent (xExtent).

Definition at line 128 of file Box.cc.

128  {
129  if (isEmpty()) return; // should we throw an exception here instead of a no-op?
130  // Apply flip about y-axis assumine parent coordinate system
131  _minimum[0] = xextent - (_minimum[0] + _dimensions[0]);
132  // _dimensions should remain unchanged
133 }
bool isEmpty() const
Return true if the box contains no points.
Definition: Box.h:163

◆ flipTB()

void lsst::afw::geom::Box2I::flipTB ( int  yExtent)

Flip a bounding box about the x-axis given a parent box of extent (yExtent).

Definition at line 135 of file Box.cc.

135  {
136  if (isEmpty()) return; // should we throw an exception here instead of a no-op?
137  // Apply flip about y-axis assumine parent coordinate system
138  _minimum[1] = yextent - (_minimum[1] + _dimensions[1]);
139  // _dimensions should remain unchanged
140 }
bool isEmpty() const
Return true if the box contains no points.
Definition: Box.h:163

◆ getArea()

int lsst::afw::geom::Box2I::getArea ( ) const
inline
Examples:
spatialCellExample.cc, and testSpatialCell.h.

Definition at line 156 of file Box.h.

156 { return getWidth() * getHeight(); }
int getHeight() const
Definition: Box.h:155
int getWidth() const
Definition: Box.h:154

◆ getBegin()

Point2I const lsst::afw::geom::Box2I::getBegin ( ) const
inline

Definition at line 138 of file Box.h.

138 { return _minimum; }

◆ getBeginX()

int lsst::afw::geom::Box2I::getBeginX ( ) const
inline

Definition at line 139 of file Box.h.

139 { return _minimum.getX(); }

◆ getBeginY()

int lsst::afw::geom::Box2I::getBeginY ( ) const
inline

Definition at line 140 of file Box.h.

140 { return _minimum.getY(); }

◆ getCorners()

std::vector< Point2I > lsst::afw::geom::Box2I::getCorners ( ) const

Get the corner points.

The order is counterclockise, starting from the lower left corner, i.e.: (minX, minY), (maxX, maxY), (maxX, maxX), (minX, maxY)

Definition at line 211 of file Box.cc.

211  {
212  std::vector<Point2I> retVec;
213  retVec.push_back(getMin());
214  retVec.push_back(Point2I(getMaxX(), getMinY()));
215  retVec.push_back(getMax());
216  retVec.push_back(Point2I(getMinX(), getMaxY()));
217  return retVec;
218 }
Point2I const getMin() const
Definition: Box.h:123
int getMinX() const
Definition: Box.h:124
Point2I const getMax() const
Definition: Box.h:127
T push_back(T... args)
STL class.
int getMaxX() const
Definition: Box.h:128
int getMaxY() const
Definition: Box.h:129
Point< int, 2 > Point2I
Definition: Point.h:301
int getMinY() const
Definition: Box.h:125

◆ getDimensions()

Extent2I const lsst::afw::geom::Box2I::getDimensions ( ) const
inline

Definition at line 153 of file Box.h.

153 { return _dimensions; }

◆ getEnd()

Point2I const lsst::afw::geom::Box2I::getEnd ( ) const
inline

Definition at line 142 of file Box.h.

142 { return _minimum + _dimensions; }

◆ getEndX()

int lsst::afw::geom::Box2I::getEndX ( ) const
inline

Definition at line 143 of file Box.h.

143 { return _minimum.getX() + _dimensions.getX(); }

◆ getEndY()

int lsst::afw::geom::Box2I::getEndY ( ) const
inline

Definition at line 144 of file Box.h.

144 { return _minimum.getY() + _dimensions.getY(); }

◆ getHeight()

int lsst::afw::geom::Box2I::getHeight ( ) const
inline

Definition at line 155 of file Box.h.

155 { return _dimensions.getY(); }

◆ getMax()

Point2I const lsst::afw::geom::Box2I::getMax ( ) const
inline

Definition at line 127 of file Box.h.

127 { return _minimum + _dimensions - Extent2I(1); }
Extent< int, 2 > Extent2I
Definition: Extent.h:380

◆ getMaxX()

int lsst::afw::geom::Box2I::getMaxX ( ) const
inline
Examples:
spatialCellExample.cc.

Definition at line 128 of file Box.h.

128 { return _minimum.getX() + _dimensions.getX() - 1; }

◆ getMaxY()

int lsst::afw::geom::Box2I::getMaxY ( ) const
inline
Examples:
spatialCellExample.cc.

Definition at line 129 of file Box.h.

129 { return _minimum.getY() + _dimensions.getY() - 1; }

◆ getMin()

Point2I const lsst::afw::geom::Box2I::getMin ( ) const
inline

Definition at line 123 of file Box.h.

123 { return _minimum; }

◆ getMinX()

int lsst::afw::geom::Box2I::getMinX ( ) const
inline
Examples:
spatialCellExample.cc.

Definition at line 124 of file Box.h.

124 { return _minimum.getX(); }

◆ getMinY()

int lsst::afw::geom::Box2I::getMinY ( ) const
inline
Examples:
spatialCellExample.cc.

Definition at line 125 of file Box.h.

125 { return _minimum.getY(); }

◆ getSlices()

ndarray::View< boost::fusion::vector2< ndarray::index::Range, ndarray::index::Range > > lsst::afw::geom::Box2I::getSlices ( ) const

Return slices to extract the box's region from an ndarray::Array.

Definition at line 97 of file Box.cc.

98  {
99  return ndarray::view(getBeginY(), getEndY())(getBeginX(), getEndX());
100 }
int getEndY() const
Definition: Box.h:144
int getBeginX() const
Definition: Box.h:139
int getBeginY() const
Definition: Box.h:140
int getEndX() const
Definition: Box.h:143

◆ getWidth()

int lsst::afw::geom::Box2I::getWidth ( ) const
inline

Definition at line 154 of file Box.h.

154 { return _dimensions.getX(); }

◆ grow() [1/2]

void lsst::afw::geom::Box2I::grow ( int  buffer)
inline

Increase the size of the box by the given buffer amount in all directions.

If a negative buffer is passed and the final size of the box is less than or equal to zero, the box will be made empty.

Definition at line 188 of file Box.h.

188 { grow(Extent2I(buffer)); }
Extent< int, 2 > Extent2I
Definition: Extent.h:380
void grow(int buffer)
Increase the size of the box by the given buffer amount in all directions.
Definition: Box.h:188

◆ grow() [2/2]

void lsst::afw::geom::Box2I::grow ( Extent2I const &  buffer)

Increase the size of the box by the given buffer amount in each direction.

If a negative buffer is passed and the final size of the box is less than or equal to zero, the box will be made empty.

Definition at line 116 of file Box.cc.

116  {
117  if (isEmpty()) return; // should we throw an exception here instead of a no-op?
118  _minimum -= buffer;
119  _dimensions += buffer * 2;
120  if (any(_dimensions.le(0))) *this = Box2I();
121 }
bool isEmpty() const
Return true if the box contains no points.
Definition: Box.h:163
Box2I()
Construct an empty box.
Definition: Box.h:64
CoordinateExpr< N > le(Extent< T, N > const &other) const
Definition: Extent.cc:66
bool any(CoordinateExpr< N > const &expr)
Return true if any elements are true.

◆ include() [1/2]

void lsst::afw::geom::Box2I::include ( Point2I const &  point)

Expand this to ensure that this->contains(point).

Definition at line 142 of file Box.cc.

142  {
143  if (isEmpty()) {
144  _minimum = point;
145  _dimensions = Extent2I(1);
146  return;
147  }
148  Point2I maximum(getMax());
149  for (int n = 0; n < 2; ++n) {
150  if (point[n] < _minimum[n]) {
151  _minimum[n] = point[n];
152  } else if (point[n] > maximum[n]) {
153  maximum[n] = point[n];
154  }
155  }
156  _dimensions = Extent2I(1) + maximum - _minimum;
157 }
bool isEmpty() const
Return true if the box contains no points.
Definition: Box.h:163
Extent< int, 2 > Extent2I
Definition: Extent.h:380
Point2I const getMax() const
Definition: Box.h:127
Point< int, 2 > Point2I
Definition: Point.h:301

◆ include() [2/2]

void lsst::afw::geom::Box2I::include ( Box2I const &  other)

Expand this to ensure that this->contains(other).

Definition at line 159 of file Box.cc.

159  {
160  if (other.isEmpty()) return;
161  if (this->isEmpty()) {
162  *this = other;
163  return;
164  }
165  Point2I maximum(getMax());
166  Point2I const& otherMin = other.getMin();
167  Point2I const otherMax = other.getMax();
168  for (int n = 0; n < 2; ++n) {
169  if (otherMin[n] < _minimum[n]) {
170  _minimum[n] = otherMin[n];
171  }
172  if (otherMax[n] > maximum[n]) {
173  maximum[n] = otherMax[n];
174  }
175  }
176  _dimensions = Extent2I(1) + maximum - _minimum;
177 }
bool isEmpty() const
Return true if the box contains no points.
Definition: Box.h:163
Extent< int, 2 > Extent2I
Definition: Extent.h:380
Point2I const getMax() const
Definition: Box.h:127
ItemVariant const * other
Definition: Schema.cc:55
Point< int, 2 > Point2I
Definition: Point.h:301

◆ isEmpty()

bool lsst::afw::geom::Box2I::isEmpty ( ) const
inline

Return true if the box contains no points.

Definition at line 163 of file Box.h.

163 { return _dimensions.getX() == 0 && _dimensions.getY() == 0; }

◆ operator!=()

bool lsst::afw::geom::Box2I::operator!= ( Box2I const &  other) const

Compare two boxes for equality.

All empty boxes are equal.

Definition at line 207 of file Box.cc.

207  {
208  return other._minimum != this->_minimum || other._dimensions != this->_dimensions;
209 }
ItemVariant const * other
Definition: Schema.cc:55

◆ operator=() [1/2]

Box2I& lsst::afw::geom::Box2I::operator= ( Box2I const &  )
default

Standard assignment operator.

◆ operator=() [2/2]

Box2I& lsst::afw::geom::Box2I::operator= ( Box2I &&  )
default

◆ operator==()

bool lsst::afw::geom::Box2I::operator== ( Box2I const &  other) const

Compare two boxes for equality.

All empty boxes are equal.

Definition at line 203 of file Box.cc.

203  {
204  return other._minimum == this->_minimum && other._dimensions == this->_dimensions;
205 }
ItemVariant const * other
Definition: Schema.cc:55

◆ overlaps()

bool lsst::afw::geom::Box2I::overlaps ( Box2I const &  other) const

Return true if any points in other are also in this.

Any overlap operation involving an empty box returns false.

Definition at line 111 of file Box.cc.

111  {
112  return !(other.isEmpty() || this->isEmpty() || any(other.getMax().lt(this->getMin())) ||
113  any(other.getMin().gt(this->getMax())));
114 }
Point2I const getMin() const
Definition: Box.h:123
bool isEmpty() const
Return true if the box contains no points.
Definition: Box.h:163
Point2I const getMax() const
Definition: Box.h:127
bool any(CoordinateExpr< N > const &expr)
Return true if any elements are true.
ItemVariant const * other
Definition: Schema.cc:55

◆ shift()

void lsst::afw::geom::Box2I::shift ( Extent2I const &  offset)

Shift the position of the box by the given offset.

Definition at line 123 of file Box.cc.

123  {
124  if (isEmpty()) return; // should we throw an exception here instead of a no-op?
125  _minimum += offset;
126 }
bool isEmpty() const
Return true if the box contains no points.
Definition: Box.h:163

◆ swap()

void lsst::afw::geom::Box2I::swap ( Box2I other)
inline

Definition at line 108 of file Box.h.

108  {
109  _minimum.swap(other._minimum);
110  _dimensions.swap(other._dimensions);
111  }
void swap(Point &other)
Definition: Point.h:189
void swap(Extent &other)
Definition: Extent.h:227
ItemVariant const * other
Definition: Schema.cc:55

◆ toString()

std::string lsst::afw::geom::Box2I::toString ( ) const
inline

Definition at line 238 of file Box.h.

238  {
239  return (boost::format("Box2I(%s,%s)") % _minimum.toString() % _dimensions.toString()).str();
240  }
std::string toString() const
Definition: Point.h:131
std::string toString() const
Definition: Extent.h:163
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:134

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