15 #ifndef ossimIrect_HEADER 16 #define ossimIrect_HEADER 1 72 theUlCorner(ul_corner),
73 theUrCorner(lr_corner.
x, ul_corner.
y),
74 theLrCorner(lr_corner),
75 theLlCorner(ul_corner.
x, lr_corner.
y),
85 theUlCorner(ul_corner_x, ul_corner_y),
86 theUrCorner(lr_corner_x, ul_corner_y),
87 theLrCorner(lr_corner_x, lr_corner_y),
88 theLlCorner(ul_corner_x, lr_corner_y),
94 theUlCorner(rect.ul()),
95 theUrCorner(rect.ur()),
96 theLrCorner(rect.lr()),
97 theLlCorner(rect.ll()),
98 theOrientMode(rect.orientMode())
107 ossimIrect(
const std::vector<ossimIpt>& points,
142 (theUlCorner.y*scalar),
143 (theUlCorner.x*scalar+width()*scalar-1),
144 (theUlCorner.y*scalar+height()*scalar-1),
152 (theUlCorner.y*scalar),
153 (theUlCorner.x*scalar+width()*scalar-1),
154 (theUlCorner.y*scalar+height()*scalar-1),
160 *
this =
ossimIrect((
int)floor(theUlCorner.x*scalar),
161 (
int)floor(theUlCorner.y*scalar),
162 (
int)ceil(theUlCorner.x*scalar+width()*scalar-1),
163 (
int)ceil(theUlCorner.y*scalar+height()*scalar-1),
170 return ossimIrect((
int)floor(theUlCorner.x*scalar),
171 (
int)floor(theUlCorner.y*scalar),
172 (
int)ceil(theUlCorner.x*scalar+width()*scalar-1),
173 (
int)ceil(theUlCorner.y*scalar+height()*scalar-1),
179 *
this =
ossimIrect((
int)floor(theUlCorner.x*scalar.
x),
180 (
int)floor(theUlCorner.y*scalar.
y),
181 (
int)ceil(theUlCorner.x*scalar.
x+width()*scalar.
x-1),
182 (
int)ceil(theUlCorner.y*scalar.
y+height()*scalar.
y-1),
189 return ossimIrect((
int)floor(theUlCorner.x*scalar.
x),
190 (
int)floor(theUlCorner.y*scalar.
y),
191 (
int)ceil(theUlCorner.x*scalar.
x+width()*scalar.
x-1),
192 (
int)ceil(theUlCorner.y*scalar.
y+height()*scalar.
y-1),
198 theUlCorner.y+shift.
y,
199 theLrCorner.x+shift.
x,
200 theLrCorner.y+shift.
y,
208 theUlCorner.y-shift.
y,
209 theLrCorner.x-shift.
x,
210 theLrCorner.y-shift.
y,
218 theUlCorner.y+shift.
y,
219 theLrCorner.x+shift.
x,
220 theLrCorner.y+shift.
y,
227 theUlCorner.y-shift.
y,
228 theLrCorner.x-shift.
x,
229 theLrCorner.y-shift.
y,
236 *
this =
ossimIrect((
int)floor(theUlCorner.x+shift.
x),
237 (
int)floor(theUlCorner.y+shift.
y),
238 (
int)ceil(theUlCorner.x+shift.
x+width()-1),
239 (
int)ceil(theUlCorner.y+shift.
y+height()-1),
246 *
this =
ossimIrect((
int)floor(theUlCorner.x-shift.
x),
247 (
int)floor(theUlCorner.y-shift.
y),
248 (
int)ceil(theUlCorner.x-shift.
x+width()-1),
249 (
int)ceil(theUlCorner.y-shift.
y+height()-1),
256 return ossimIrect((
int)floor(theUlCorner.x+shift.
x),
257 (
int)floor(theUlCorner.y+shift.
y),
258 (
int)ceil(theUlCorner.x+shift.
x+width()-1),
259 (
int)ceil(theUlCorner.y+shift.
y+height()-1),
265 return ossimIrect((
int)floor(theUlCorner.x-shift.
x),
266 (
int)floor(theUlCorner.y-shift.
y),
267 (
int)ceil(theUlCorner.x-shift.
x+width()-1),
268 (
int)ceil(theUlCorner.y-shift.
y+height()-1),
283 if(mode == theOrientMode)
return *
this;
302 theOrientMode = mode;
309 minx = theUlCorner.x;
310 maxx = theLrCorner.x;
313 miny = theUlCorner.y;
314 maxy = theLrCorner.y;
318 maxy = theUlCorner.y;
319 miny = theLrCorner.y;
327 void getCenter(
ossimDpt& center_point)
const;
331 theUlCorner.makeNan();
332 theLlCorner.makeNan();
333 theLrCorner.makeNan();
334 theUrCorner.makeNan();
337 bool hasNans()
const{
return (theUlCorner.hasNans() ||
338 theLlCorner.hasNans() ||
339 theLrCorner.hasNans() ||
340 theUrCorner.hasNans());}
342 bool isNan()
const{
return (theUlCorner.isNan() &&
343 theLlCorner.isNan() &&
344 theLrCorner.isNan() &&
345 theUrCorner.isNan());}
354 void stretchToTileBoundary(
const ossimIpt& tileWidthHeight);
394 bool insureMinimumSize(
const ossimIpt& width_height);
398 return width()*height();
405 inline void set_ul(
const ossimIpt& pt);
411 inline void set_ur(
const ossimIpt& pt);
417 inline void set_lr(
const ossimIpt& pt);
423 inline void set_ll(
const ossimIpt& pt);
469 inline bool pointWithin(
const ossimIpt& pt)
const;
475 bool intersects(
const ossimIrect& rect)
const;
524 const char* prefix=0)
const;
526 const char* prefix=0);
736 return ((pt.
x >=
ul().
x) &&
741 return ((pt.
x >=
ul().
x) &&
760 ossim::round<int>(
y));
void set_uly(ossim_int32 y)
ossimRationalNumber operator-(ossim_int32 i, ossimRationalNumber &r)
bool operator!=(const ossimIrect &rect) const
bool operator!=(const ossimRefPtr< _Tp1 > &__a, const ossimRefPtr< _Tp2 > &__b) noexcept
Represents serializable keyword/value map.
bool operator==(const ossimIrect &rect) const
void combine(const std::string &left, const std::string &right, char separator, std::string &result)
ossim_uint32 height() const
const ossimIpt & ul() const
std::ostream & print(H5::H5File *file, std::ostream &out)
Print method.
ossimRationalNumber operator*(ossim_int32 i, ossimRationalNumber &r)
const ossimIpt & ll() const
void setOrientMode(ossimCoordSysOrientMode mode)
ossimIrect(ossimIpt ul_corner, ossimIpt lr_corner, ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED)
void set_ul(const ossimIpt &pt)
void getBounds(ossim_int32 &minx, ossim_int32 &miny, ossim_int32 &maxx, ossim_int32 &maxy) const
ossimCoordSysOrientMode orientMode() const
ostream & operator<<(ostream &out, const ossimAxes &axes)
const ossimIrect & operator*=(ossim_int32 scalar)
ossimCoordSysOrientMode orientationMode() const
ossimIpt midPoint() const
unsigned int ossim_uint32
const ossimIrect & operator=(const ossimIrect &rect)
ossimIrect(const ossimIrect &rect)
const ossimIpt & lr() const
bool operator==(const ossimRefPtr< _Tp1 > &__a, const ossimRefPtr< _Tp2 > &__b) noexcept
ossim_uint32 width() const
const ossimIpt & ur() const
const ossimIrect & changeOrientationMode(ossimCoordSysOrientMode mode)
void set_lrx(ossim_int32 x)
ossimIrect operator*(ossim_int32 scalar) const
void set_lr(const ossimIpt &pt)
void set_ll(const ossimIpt &pt)
void set_lry(ossim_int32 y)
ossimCoordSysOrientMode theOrientMode
void set_ury(ossim_int32 y)
ossimIrect(ossim_int32 ul_corner_x, ossim_int32 ul_corner_y, ossim_int32 lr_corner_x, ossim_int32 lr_corner_y, ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED)
void set_llx(ossim_int32 x)
ossim_uint32 area() const
int completely_within(extent_type extent1, extent_type extent2)
ossimRationalNumber operator+(ossim_int32 i, ossimRationalNumber &r)
void set_lly(ossim_int32 y)
void set_ur(const ossimIpt &pt)
std::basic_ostream< char > ostream
Base class for char output streams.
void set_urx(ossim_int32 x)
void set_ulx(ossim_int32 x)
friend ossimIrect operator*(double scalar, const ossimIrect &rect)
bool pointWithin(const ossimIpt &pt) const