OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimDrect.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: David Burken
8 //
9 // Description:
10 //
11 // Contains class definition for ossimDrect.
12 //*******************************************************************
13 // $Id: ossimDrect.cpp 23372 2015-06-12 13:08:53Z gpotts $
14 
15 #include <iostream>
16 #include <sstream>
17 
18 #include <ossim/base/ossimDrect.h>
19 #include <ossim/base/ossimIrect.h>
23 
24 // XXX not replaced with std::max since the test is backward here
25 // and will give a different answer in the case of nan.
26 #define d_MAX(a,b) (((a)>(b)) ? a : b)
27 
28 static int
29 clip_1d (double *x0,
30  double *y0,
31  double *x1,
32  double *y1,
33  double maxdim)
34 {
35  double m; /* gradient of line */
36  if (*x0 < 0)
37  { /* start of line is left of window */
38  if (*x1 < 0) /* as is the end, so the line never cuts the window */
39  return 0;
40  m = (*y1 - *y0) / (double) (*x1 - *x0); /* calculate the slope of the line */
41  /* adjust x0 to be on the left boundary (ie to be zero), and y0 to match */
42  *y0 -= m * *x0;
43  *x0 = 0;
44  /* now, perhaps, adjust the far end of the line as well */
45  if (*x1 > maxdim)
46  {
47  *y1 += m * (maxdim - *x1);
48  *x1 = maxdim;
49  }
50  return 1;
51  }
52  if (*x0 > maxdim)
53  { /* start of line is right of window -
54  complement of above */
55  if (*x1 > maxdim) /* as is the end, so the line misses the window */
56  return 0;
57  m = (*y1 - *y0) / (double) (*x1 - *x0); /* calculate the slope of the line */
58  *y0 += m * (maxdim - *x0); /* adjust so point is on the right
59  boundary */
60  *x0 = maxdim;
61  /* now, perhaps, adjust the end of the line */
62  if (*x1 < 0)
63  {
64  *y1 -= m * *x1;
65  *x1 = 0;
66  }
67  return 1;
68  }
69  /* the final case - the start of the line is inside the window */
70  if (*x1 > maxdim)
71  { /* other end is outside to the right */
72  m = (*y1 - *y0) / (double) (*x1 - *x0); /* calculate the slope of the line */
73  *y1 += m * (maxdim - *x1);
74  *x1 = maxdim;
75  return 1;
76  }
77  if (*x1 < 0)
78  { /* other end is outside to the left */
79  m = (*y1 - *y0) / (double) (*x1 - *x0); /* calculate the slope of the line */
80  *y1 -= m * *x1;
81  *x1 = 0;
82  return 1;
83  }
84  /* only get here if both points are inside the window */
85  return 1;
86 }
87 
88 //*******************************************************************
89 // Public Constructor: ossimDrect
90 //
91 //*******************************************************************
93  :
94  theUlCorner(rect.ul()),
95  theUrCorner(rect.ur()),
96  theLrCorner(rect.lr()),
97  theLlCorner(rect.ll()),
98  theOrientMode(rect.orientMode())
99 {
100  if(rect.isNan())
101  {
102  makeNan();
103  }
104 }
105 
106 
107 //*****************************************************************************
108 // CONSTRUCTOR: ossimDrect(const vector<ossimDpt>& points)
109 //
110 //*****************************************************************************
113  :
114  theOrientMode (mode)
115 {
116  std::vector<ossimDpt> vertices;
117  ossimDpt point;
118  int index = 0;
119  while (polygon.vertex(index, point))
120  {
121  vertices.push_back(point);
122  index++;
123  }
124 
125  initBoundingRect(vertices);
126 }
127 
128 //*****************************************************************************
129 // CONSTRUCTOR: ossimDrect(const vector<ossimDpt>& points)
130 //
131 //*****************************************************************************
132 ossimDrect::ossimDrect(const std::vector<ossimDpt>& points,
134  :
135  theOrientMode (mode)
136 {
137  if(points.size())
138  {
139  unsigned long index;
140  double minx, miny;
141  double maxx, maxy;
142 
143  minx = points[0].x;
144  miny = points[0].y;
145  maxx = points[0].x;
146  maxy = points[0].y;
147 
148  // find the bounds
149  for(index = 1; index < points.size();index++)
150  {
151 
152  minx = std::min(minx, points[index].x);
153  miny = std::min(miny, points[index].y);
154  maxx = std::max(maxx, points[index].x);
155  maxy = std::max(maxy, points[index].y);
156 
157  }
159  {
160  *this = ossimDrect(minx, miny, maxx, maxy, mode);
161  }
162  else
163  {
164  *this = ossimDrect(minx,maxy, maxx, miny, mode);
165  }
166  }
167  else
168  {
169  makeNan();
170  }
171 }
173  const ossimDpt& p2,
174  const ossimDpt& p3,
175  const ossimDpt& p4,
177 : theOrientMode(mode)
178 {
179  if(p1.hasNans()||p2.hasNans()||p3.hasNans()||p4.hasNans())
180  {
181  makeNan();
182  }
183  else
184  {
185  double minx, miny;
186  double maxx, maxy;
187 
188  minx = std::min( p1.x, std::min(p2.x, std::min(p3.x, p4.x)));
189  miny = std::min( p1.y, std::min(p2.y, std::min(p3.y, p4.y)));
190  maxx = std::max( p1.x, std::max(p2.x, std::max(p3.x, p4.x)));
191  maxy = std::max( p1.y, std::max(p2.y, std::max(p3.y, p4.y)));
192 
193  if(mode == OSSIM_LEFT_HANDED)
194  {
195  *this = ossimDrect(minx, miny, maxx, maxy, mode);
196  }
197  else
198  {
199  *this = ossimDrect(minx,maxy, maxx, miny, mode);
200  }
201  }
202 }
203 
204 
205 //*******************************************************************
207 //*******************************************************************
209  const double& size_x,
210  const double& size_y,
212 : theOrientMode(mode)
213 {
214  double dx = fabs(size_x);
215  double dy = fabs(size_y);
216 
217  double minx = center.x - dx/2.0;
218  double maxx = minx + dx;
219 
220  double miny = center.y - dy/2.0;
221  double maxy = miny + dy;
222 
223  if(mode == OSSIM_LEFT_HANDED)
224  *this = ossimDrect(minx, miny, maxx, maxy, mode);
225  else
226  *this = ossimDrect(minx,maxy, maxx, miny, mode);
227 }
228 
230 {
231 }
232 
233 void ossimDrect::initBoundingRect(const std::vector<ossimDpt>& points)
234 {
235  unsigned long index;
236 
237  // initialize everyone to the first point
238  if(points.size() > 0)
239  {
240  theUlCorner.x = points[0].x;
241  theUlCorner.y = points[0].y;
244  }
245 
246  // find the bounds
247  for(index = 1; index < points.size();index++)
248  {
249  // find left most
250  if(points[index].x < theUlCorner.x)
251  theUlCorner.x = points[index].x;
252 
253  // find right most
254  else if(points[index].x > theLrCorner.x)
255  theLrCorner.x = points[index].x;
256 
258  {
259  //find top most
260  if(points[index].y < theUlCorner.y)
261  theUlCorner.y = points[index].y;
262 
263  // find bottom most
264  else if(points[index].y > theLrCorner.y)
265  theLrCorner.y = points[index].y;
266  }
267 
268  else // right handed coord system
269  {
270  if(points[index].y > theUlCorner.y)
271  theUlCorner.y = points[index].y;
272 
273  // find bottom most
274  else if(points[index].y < theLrCorner.y)
275  theLrCorner.y = points[index].y;
276  }
277  }
278 
279  // now set the other points for the rect.
284 }
285 
286 //*******************************************************************
287 // Public Method:
288 //*******************************************************************
289 bool ossimDrect::intersects(const ossimDrect& rect) const
290 {
291  if(rect.hasNans() || hasNans())
292  {
293  return false;
294  }
295  if (theOrientMode != rect.theOrientMode)
296  return false;
297 
298  ossim_float64 ulx = ossim::max(rect.ul().x,ul().x);
299  ossim_float64 lrx = ossim::min(rect.lr().x,lr().x);
300  ossim_float64 uly, lry;
301  bool rtn=false;
303  {
304  uly = ossim::max(rect.ul().y,ul().y);
305  lry = ossim::min(rect.lr().y,lr().y);
306  rtn = ((ulx <= lrx) && (uly <= lry));
307  }
308  else
309  {
310  uly = ossim::max(rect.ll().y,ll().y);
311  lry = ossim::min(rect.ur().y,ur().y);
312  rtn = ((ulx <= lrx) && (uly <= lry));
313  }
314 
315  return (rtn);
316 }
317 
318 //*******************************************************************
319 // Public Method: ossimDrect::completely_within
320 //*******************************************************************
322 {
323  if(hasNans() || rect.hasNans())
324  {
325  return false;
326  }
327  if (theOrientMode != rect.theOrientMode)
328  return false;
329 
330  /* --------------
331  | 1 |
332  | ---------- |
333  | | | |
334  | | | |
335  | | 2 | |
336  | | | |
337  | | | |
338  | ---------- |
339  | |
340  -------------- */
341 
342  bool rtn = true;
343  if ((theUlCorner.x > rect.ur().x)||
344  (theUlCorner.x < rect.ul().x))
345  rtn = false;
346 
347  else if ((theLrCorner.x > rect.lr().x)||
348  (theLrCorner.x < rect.ll().x))
349  rtn = false;
350 
351  else if (theOrientMode == OSSIM_LEFT_HANDED)
352  {
353  if ((theUlCorner.y < rect.ul().y)||
354  (theUlCorner.y > rect.lr().y))
355  rtn = false;
356 
357  else if ((theLrCorner.y > rect.lr().y)||
358  (theLrCorner.y < rect.ul().y))
359  rtn = false;
360  }
361 
362  else
363  {
364  if ( (theUlCorner.y > rect.ul().y)||
365  (theUlCorner.y < rect.lr().y))
366  rtn = false;
367 
368  else if ((theLrCorner.y < rect.lr().y)||
369  (theLrCorner.y > rect.ul().y))
370  rtn = false;
371  }
372 
373  return rtn;
374 }
375 
376 //*******************************************************************
377 // Public Method: ossimDrect::stretchOut
378 //*******************************************************************
380 {
381  set_ulx(floor(theUlCorner.x));
382  set_lrx(ceil(theLrCorner.x));
383 
385  {
386  set_uly(floor(theUlCorner.y));
387  set_lry(ceil(theLrCorner.y));
388  }
389  else
390  {
391  set_uly(ceil(theUlCorner.y));
392  set_lry(floor(theLrCorner.y));
393  }
394 }
395 
397 {
398  ossimDpt ul;
399  ossimDpt lr;
400  ossim_int32 evenDivision=0;
401 
403  {
404  ul.x = theUlCorner.x;
405  if( fmod(theUlCorner.x, widthHeight.x) != 0)
406  {
407  ul.x = ((long)(ul.x / widthHeight.x))*widthHeight.x;
408  if(ul.x > theUlCorner.x)
409  {
410  ul.x -= widthHeight.x;
411  }
412  }
413  ul.y = theUlCorner.y;
414  if( fmod(theUlCorner.y, widthHeight.y) != 0)
415  {
416  ul.y = ((long)(ul.y / widthHeight.y))*widthHeight.y;
417  if(ul.y > theUlCorner.y)
418  {
419  ul.y -= widthHeight.y;
420  }
421  }
422 
423  evenDivision = fmod(theLrCorner.x, widthHeight.x) == 0;
424  lr.x = theLrCorner.x;
425  if(!evenDivision)
426  {
427  lr.x = ((long)((lr.x)/widthHeight.x)) * widthHeight.x;
428  if(lr.x < theLrCorner.x)
429  {
430  lr.x += widthHeight.x;
431  }
432  }
433 
434  evenDivision = fmod(theLrCorner.y, widthHeight.y) == 0;
435  lr.y = theLrCorner.y;
436  if(!evenDivision)
437  {
438  lr.y = ((long)(lr.y/widthHeight.y)) * widthHeight.y;
439  if(lr.y < theLrCorner.y)
440  {
441  lr.y += widthHeight.y;
442  }
443  }
444  }
445  else
446  {
447  ul.x = theUlCorner.x;
448  ul.y = theUlCorner.y;
449  if( !ossim::almostEqual(fmod(theUlCorner.x, widthHeight.x), 0.0))
450  {
451  ul.x = ((long)(ul.x/ widthHeight.x))*widthHeight.x;
452  if(ul.x > theUlCorner.x)
453  {
454  ul.x -= widthHeight.x;
455  }
456  }
457  if( !ossim::almostEqual((double)fmod(theUlCorner.y, widthHeight.y), 0.0) )
458  {
459  ul.y = ((long)(ul.y / widthHeight.y))*widthHeight.y;
460  if(ul.y < theUlCorner.y)
461  {
462  ul.y += widthHeight.y;
463  }
464  }
465 
466  evenDivision = ossim::almostEqual( fmod(theLrCorner.x, widthHeight.x), 0.0);
467  lr.x = theLrCorner.x;
468  if(!evenDivision)
469  {
470  lr.x = ((long)(lr.x/widthHeight.x)) * widthHeight.x;
471  if(lr.x < theLrCorner.x)
472  {
473  lr.x += widthHeight.x;
474  }
475  }
476 
477  evenDivision = ossim::almostEqual(fmod(theLrCorner.y, widthHeight.y), 0.0);
478  lr.y = theLrCorner.y;
479  if(!evenDivision)
480  {
481  lr.y = ((long)(lr.y/widthHeight.y)) * widthHeight.y;
482 
483  if(lr.y > theLrCorner.y)
484  {
485  lr.y -= widthHeight.y;
486  }
487  }
488  }
489 
490  *this = ossimDrect(ul, lr, theOrientMode);
491 }
492 
493 const ossimDrect& ossimDrect::expand(const ossimDpt& padding)
494 {
495  theUlCorner.x -= padding.x;
496  theUrCorner.x += padding.x;
497  theLrCorner.x += padding.x;
498  theLlCorner.x -= padding.x;
500  {
501  theUlCorner.y -= padding.y;
502  theUrCorner.y -= padding.y;
503  theLrCorner.y += padding.y;
504  theLlCorner.y += padding.y;
505  }
506  else
507  {
508  theUlCorner.y += padding.y;
509  theUrCorner.y += padding.y;
510  theLrCorner.y -= padding.y;
511  theLlCorner.y -= padding.y;
512  }
513 
514  return *this;
515 }
517 {
518  ossimString result="(";
519 
521  {
522  ossimDpt origin = ul();
523  result += (ossimString::toString(origin.x,20) + ",");
524  result += (ossimString::toString(origin.y,20) + ",");
525  result += (ossimString::toString(width(),20) + ",");
526  result += (ossimString::toString(height(),20) + ",");
527  result += "LH";
528  }
529  else
530  {
531  ossimDpt origin = ll();
532  result += (ossimString::toString(origin.x,20) + ",");
533  result += (ossimString::toString(origin.y,20) + ",");
534  result += (ossimString::toString(width(),20) + ",");
535  result += (ossimString::toString(height(),20) + ",");
536  result += "RH";
537  }
538 
539  result += ")";
540  return result;
541 }
542 
543 bool ossimDrect::toRect(const ossimString& rectString)
544 {
545  bool result = false;
546 
547 
548  std::istringstream in(rectString);
549  ossim::skipws(in);
550  char charString[2];
551  charString[1] = '\0';
552  ossimString interior;
553  if(in.peek() == '(')
554  {
555  in.ignore();
556  while((in.peek() != ')')&&
557  (in.peek() != '\n') &&
558  in.good())
559  {
560  charString[0] = in.get();
561  interior += charString;
562  }
563  if(in.peek() == ')')
564  {
565  result = true;
566  }
567  }
568  if(result)
569  {
570  std::vector<ossimString> splitArray;
571  interior.split(splitArray, ",");
572 
573  // assume left handed
574  if(splitArray.size() >= 4)
575  {
576  ossim_float64 x = splitArray[0].toDouble();
577  ossim_float64 y = splitArray[1].toDouble();
578  ossim_float64 w = splitArray[2].toDouble();
579  ossim_float64 h = splitArray[3].toDouble();
580  ossimString orientation = "lh";
581  if(splitArray.size() == 5)
582  {
583  orientation = splitArray[4].downcase();
584  }
585  if(orientation == "lh")
586  {
587  // origin upper left
588  *this = ossimDrect(x,y,x + (w-1), y+h-1, OSSIM_LEFT_HANDED);
589  }
590  else
591  {
592  // origin lower left so construct and make an upper left
593  *this = ossimDrect(x,y+(h-1),x + (w-1), y, OSSIM_RIGHT_HANDED);
594  }
595  }
596  else
597  {
598  result = false;
599  }
600 
601  }
602  return result;
603 }
604 
606  const char* prefix)const
607 {
608  kwl.add(prefix,
610  "ossimDrect",
611  true);
612 
613  kwl.add(prefix, "rect", toString());
614 
615  return true;
616 }
617 
619  const char* prefix)
620 {
621  const char* rect = kwl.find(prefix, "rect");
622  makeNan();
623 
624  if(rect)
625  {
626  toRect(rect);
627  }
628 
629  return true;
630 }
631 
632 //*******************************************************************
633 // Public Method: ossimDrect::print
634 //*******************************************************************
636 {
637  os << toString();
638 }
639 
640 //*******************************************************************
641 // friend function: operator<<
642 //*******************************************************************
644 {
645  rect.print(os);
646 
647  return os;
648 }
649 
650 //*******************************************************************
651 // Public Method: ossimDrect::clip
652 //*******************************************************************
653 bool ossimDrect::clip(ossimDpt &p1, ossimDpt &p2)const
654 {
655  if(p1.isNan() || p2.isNan())
656  {
657  return false;
658  }
659  ossimDpt shift(-theUlCorner.x,
660  -theUlCorner.y);
661 
662  ossimDpt tempShiftP1 = p1+shift;
663  ossimDpt tempShiftP2 = p2+shift;
664  double maxW = width()-1;
665  double maxH = height()-1;
666  if (clip_1d (&tempShiftP1.x, &tempShiftP1.y,
667  &tempShiftP2.x, &tempShiftP2.y,
668  maxW) == 0)
669  {
670  return false;
671  }
672  if(clip_1d (&tempShiftP1.y,
673  &tempShiftP1.x,
674  &tempShiftP2.y,
675  &tempShiftP2.x, maxH) == 0)
676  {
677  return false;
678  }
679  p1 = tempShiftP1-shift;
680  p2 = tempShiftP2-shift;
681  return true;
682 }
683 
684 //*******************************************************************
685 // Public Method: ossimDrect::getCode
686 //*******************************************************************
687 long ossimDrect::getCode(const ossimDpt& aPoint,
688  const ossimDrect& clipRect)
689 {
690  long result=NONE; // initialize to inside rect
691 
692  if( (aPoint.x > clipRect.lr().x) )
693  result |= RIGHT;
694  else if( (aPoint.x < clipRect.ul().x) )
695  result |= LEFT;
696 
697  if (clipRect.theOrientMode == OSSIM_LEFT_HANDED)
698  {
699  if( (aPoint.y < clipRect.ul().y) )
700  result |= TOP;
701  else if( (aPoint.y > clipRect.lr().y) )
702  result |= BOTTOM;
703  }
704  else
705  {
706  if( (aPoint.y > clipRect.ul().y) )
707  result |= TOP;
708  else if( (aPoint.y < clipRect.lr().y) )
709  result |= BOTTOM;
710  }
711 
712  return result;
713 }
714 
715 
717  ossimDrect& urRect,
718  ossimDrect& lrRect,
719  ossimDrect& llRect)
720 {
721  ossimDpt ulPt = this->ul();
722  ossimDpt urPt = this->ur();
723  ossimDpt lrPt = this->lr();
724  ossimDpt llPt = this->ll();
725  ossimIpt midPt = this->midPoint();
726 
727  ulRect = ossimDrect(ulPt.x,
728  ulPt.y,
729  midPt.x,
730  midPt.y,
731  theOrientMode);
732 
733  urRect = ossimDrect(midPt.x,
734  ulPt.y,
735  urPt.x,
736  midPt.y,
737  theOrientMode);
738 
740  {
741  lrRect = ossimDrect(midPt.x,
742  midPt.y,
743  lrPt.x,
744  theOrientMode);
745  llRect = ossimDrect(ulPt.x,
746  midPt.y,
747  midPt.x,
748  llPt.y,
749  theOrientMode);
750  }
751  else
752  {
753  lrRect = ossimDrect(midPt.x,
754  midPt.y,
755  lrPt.x,
756  theOrientMode);
757  llRect = ossimDrect(ulPt.x,
758  midPt.y,
759  midPt.x,
760  llPt.y,
761  theOrientMode);
762  }
763 
764 }
765 
766 //*******************************************************************
767 // Public Method: ossimDrect::clipToRect
768 //*******************************************************************
770 {
771  ossimDrect result;
772  result.makeNan();
773  if(rect.hasNans() || hasNans())
774  {
775  return result;
776  }
777 
778  if (theOrientMode != rect.theOrientMode)
779  return (*this);
780 
781  double x0 = ossim::max(rect.ul().x, ul().x);
782  double x1 = ossim::min(rect.lr().x, lr().x);
783  double y0, y1;
784 
786  {
787  y0 = ossim::max(rect.ul().y, ul().y);
788  y1 = ossim::min(rect.lr().y, lr().y);
789 
790  if( (x1 < x0) || (y1 < y0) )
791  {
792  return result;
793  }
794  else
795  {
796  result = ossimDrect(x0, y0, x1, y1, theOrientMode);
797  }
798  }
799  else
800  {
801  y0 = ossim::max(rect.ll().y,ll().y);
802  y1 = ossim::min(rect.ur().y,ur().y);
803  if( (x1 < x0) || (y1 < y0) )
804  {
805  return result;
806  }
807  else
808  {
809  result = ossimDrect(x0, y1, x1, y0, theOrientMode);
810  }
811  }
812  return result;
813 }
814 
816 {
817  if(rect.isNan())
818  {
819  makeNan();
820  }
821  else
822  {
823  theUlCorner = rect.ul();
824  theUrCorner = rect.ur();
825  theLrCorner = rect.lr();
826  theLlCorner = rect.ll();
827  theOrientMode = rect.orientMode();
828  }
829 
830  return *this;
831 }
832 
833 //*************************************************************************************************
834 // Finds the point on the rect boundary that is closest to the arg_point. Closest is defined as
835 // the minimum perpendicular distance.
836 //*************************************************************************************************
838 {
839  double dXleft = theUlCorner.x - arg_point.x;
840  double dXright = theLrCorner.x - arg_point.x;
841  double dYupper = theUlCorner.y - arg_point.y;
842  double dYlower = theLrCorner.y - arg_point.y;
843 
844  ossimDpt edge_point (theLrCorner);
845 
846  if (dXleft*dXright < 0.0)
847  edge_point.x = arg_point.x;
848  else if (fabs(dXleft) < fabs(dXright))
849  edge_point.x = theUlCorner.x;
850 
851  if (dYupper*dYlower < 0.0)
852  edge_point.y = arg_point.y;
853  else if (fabs(dYupper) < fabs(dYlower))
854  edge_point.y = theUlCorner.y;
855 
856  return edge_point;
857 }
858 
void set_uly(ossim_float64 y)
Definition: ossimDrect.h:718
void makeNan()
Definition: ossimDrect.h:388
ossim_uint32 x
ossimDpt theLlCorner
Definition: ossimDrect.h:620
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Definition: ossimDrect.cpp:618
void set_ulx(ossim_float64 x)
Definition: ossimDrect.h:709
T max(T a, T b)
Definition: ossimCommon.h:236
ossim_float64 width() const
Definition: ossimDrect.h:522
void print(std::ostream &os) const
Definition: ossimDrect.cpp:635
Represents serializable keyword/value map.
ossim_uint32 y
bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Definition: ossimDrect.cpp:605
const char * find(const char *key) const
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53
const ossimDpt & ul() const
Definition: ossimDrect.h:339
double y
Definition: ossimDpt.h:165
ossimDpt theUrCorner
Definition: ossimDrect.h:618
void initBoundingRect(const std::vector< ossimDpt > &points)
Definition: ossimDrect.cpp:233
static ossimString toString(bool aValue)
Numeric to string methods.
const ossimIpt & ul() const
Definition: ossimIrect.h:274
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
bool isNan() const
Definition: ossimDpt.h:72
const ossimDrect & operator=(const ossimDrect &rect)
Definition: ossimDrect.h:628
const ossimIpt & ll() const
Definition: ossimIrect.h:277
bool vertex(int index, ossimDpt &tbd_vertex) const
METHOD: vertex(index) Returns the ossimDpt vertex given the index.
const ossimDrect & expand(const ossimDpt &padding)
Definition: ossimDrect.cpp:493
static const char * TYPE_KW
ossimCoordSysOrientMode
double ossim_float64
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimCoordSysOrientMode orientMode() const
Definition: ossimIrect.h:351
ossimDrect clipToRect(const ossimDrect &rect) const
Definition: ossimDrect.cpp:769
void set_lry(ossim_float64 y)
Definition: ossimDrect.h:754
bool completely_within(const ossimDrect &rect) const
Definition: ossimDrect.cpp:321
std::ostream & operator<<(std::ostream &os, const ossimDrect &rect)
Definition: ossimDrect.cpp:643
OSSIM_DLL std::istream & skipws(std::istream &in)
Definition: ossimCommon.cpp:38
bool isNan() const
Definition: ossimIrect.h:342
ossimDpt findClosestEdgePointTo(const ossimDpt &arg_point) const
Definition: ossimDrect.cpp:837
const ossimIpt & lr() const
Definition: ossimIrect.h:276
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
void splitToQuad(ossimDrect &ulRect, ossimDrect &urRect, ossimDrect &lrRect, ossimDrect &llRect)
Definition: ossimDrect.cpp:716
bool hasNans() const
Definition: ossimDrect.h:396
T min(T a, T b)
Definition: ossimCommon.h:203
bool toRect(const ossimString &rectString)
expected Format: form 1: ( 30, -90, 512, 512, [LH|RH] ) -x- -y- -w- -h- -Right or left handed- ...
Definition: ossimDrect.cpp:543
bool hasNans() const
Definition: ossimDpt.h:67
bool intersects(const ossimDrect &rect) const
Definition: ossimDrect.cpp:289
ossim_float64 height() const
Definition: ossimDrect.h:517
ossimDpt theLrCorner
Definition: ossimDrect.h:619
const ossimIpt & ur() const
Definition: ossimIrect.h:275
ossimCoordSysOrientMode theOrientMode
Definition: ossimDrect.h:622
ossimDpt theUlCorner
Definition: ossimDrect.h:617
bool clip(ossimDpt &p1, ossimDpt &p2) const
Definition: ossimDrect.cpp:653
void stretchToTileBoundary(const ossimDpt &widthHeight)
Definition: ossimDrect.cpp:396
~ossimDrect()
destructor
Definition: ossimDrect.cpp:229
ossimDpt midPoint() const
Definition: ossimDrect.h:817
#define max(a, b)
Definition: auxiliary.h:76
ossim_int32 y
Definition: ossimIpt.h:142
const ossimDpt & ur() const
Definition: ossimDrect.h:340
double x
Definition: ossimDpt.h:164
static long getCode(const ossimDpt &aPoint, const ossimDrect &clipRect)
Definition: ossimDrect.cpp:687
ossim_int32 x
Definition: ossimIpt.h:141
const ossimDpt & ll() const
Definition: ossimDrect.h:342
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
void set_lrx(ossim_float64 x)
Definition: ossimDrect.h:745
const ossimDpt & lr() const
Definition: ossimDrect.h:341
void stretchOut()
Definition: ossimDrect.cpp:379
ossimString toString() const
Definition: ossimDrect.cpp:516
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
#define min(a, b)
Definition: auxiliary.h:75
int ossim_int32