SAGA API  v9.2
geo_classes.cpp
Go to the documentation of this file.
1 
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // geo_classes.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51 
52 //---------------------------------------------------------
53 #include "parameters.h"
54 
55 #include "geo_tools.h"
56 
57 
59 // //
60 // CSG_Point //
61 // //
63 
64 //---------------------------------------------------------
66 {
67  Assign(0., 0.);
68 }
69 
71 {
72  Assign(Point.x, Point.y);
73 }
74 
76 {
77  Assign(Point.x, Point.y);
78 }
79 
80 CSG_Point::CSG_Point(double _x, double _y)
81 {
82  Assign(_x, _y);
83 }
84 
85 //---------------------------------------------------------
86 void CSG_Point::Assign(double _x, double _y)
87 {
88  x = _x;
89  y = _y;
90 }
91 
92 void CSG_Point::Assign(const CSG_Point &Point)
93 {
94  x = Point.x;
95  y = Point.y;
96 }
97 
98 //---------------------------------------------------------
99 void CSG_Point::Add(const CSG_Point &Point)
100 {
101  x += Point.x;
102  y += Point.y;
103 }
104 
105 void CSG_Point::Subtract(const CSG_Point &Point)
106 {
107  x -= Point.x;
108  y -= Point.y;
109 }
110 
111 void CSG_Point::Multiply(const CSG_Point &Point)
112 {
113  x *= Point.x;
114  y *= Point.y;
115 }
116 
117 void CSG_Point::Multiply(double Value)
118 {
119  x *= Value;
120  y *= Value;
121 }
122 
123 void CSG_Point::Divide(double Value)
124 {
125  x /= Value;
126  y /= Value;
127 }
128 
129 //---------------------------------------------------------
130 double CSG_Point::Get_Length(void) const
131 {
132  return( sqrt(x*x + y*y) );
133 }
134 
135 
137 // //
139 
140 //---------------------------------------------------------
142 {
143  Assign(0., 0., 0.);
144 }
145 
147 {
148  Assign(Point.x, Point.y, Point.z);
149 }
150 
152 {
153  Assign(Point.x, Point.y, Point.z);
154 }
155 
156 CSG_Point_3D::CSG_Point_3D(double _x, double _y, double _z)
157 {
158  Assign(_x, _y, _z);
159 }
160 
161 //---------------------------------------------------------
162 void CSG_Point_3D::Assign(double _x, double _y, double _z)
163 {
164  x = _x;
165  y = _y;
166  z = _z;
167 }
168 
170 {
171  x = Point.x;
172  y = Point.y;
173  z = Point.z;
174 }
175 
176 //---------------------------------------------------------
177 void CSG_Point_3D::Add(const CSG_Point_3D &Point)
178 {
179  x += Point.x;
180  y += Point.y;
181  z += Point.z;
182 }
183 
185 {
186  x -= Point.x;
187  y -= Point.y;
188  z -= Point.z;
189 }
190 
192 {
193  x *= Point.x;
194  y *= Point.y;
195  z *= Point.z;
196 }
197 
198 void CSG_Point_3D::Multiply(double Value)
199 {
200  x *= Value;
201  y *= Value;
202  z *= Value;
203 }
204 
205 void CSG_Point_3D::Divide(double Value)
206 {
207  x /= Value;
208  y /= Value;
209  z /= Value;
210 }
211 
212 //---------------------------------------------------------
213 double CSG_Point_3D::Get_Length(void) const
214 {
215  return( sqrt(x*x + y*y + z*z) );
216 }
217 
218 
220 // //
222 
223 //---------------------------------------------------------
225 {
226  Assign(0., 0., 0., 0.);
227 }
228 
230 {
231  Assign(Point.x, Point.y, Point.z, Point.m);
232 }
233 
235 {
236  Assign(Point.x, Point.y, Point.z, Point.m);
237 }
238 
239 CSG_Point_4D::CSG_Point_4D(double _x, double _y, double _z, double _m)
240 {
241  Assign(_x, _y, _z, _m);
242 }
243 
244 //---------------------------------------------------------
245 void CSG_Point_4D::Assign(double _x, double _y, double _z, double _m)
246 {
247  x = _x;
248  y = _y;
249  z = _z;
250  m = _m;
251 }
252 
254 {
255  x = Point.x;
256  y = Point.y;
257  z = Point.z;
258  m = Point.m;
259 }
260 
261 //---------------------------------------------------------
262 void CSG_Point_4D::Add(const CSG_Point_4D &Point)
263 {
264  x += Point.x;
265  y += Point.y;
266  z += Point.z;
267  m += Point.m;
268 }
269 
271 {
272  x -= Point.x;
273  y -= Point.y;
274  z -= Point.z;
275  m -= Point.m;
276 }
277 
279 {
280  x *= Point.x;
281  y *= Point.y;
282  z *= Point.z;
283  m *= Point.m;
284 }
285 
286 void CSG_Point_4D::Multiply(double Value)
287 {
288  x *= Value;
289  y *= Value;
290  z *= Value;
291  m *= Value;
292 }
293 
294 void CSG_Point_4D::Divide(double Value)
295 {
296  x /= Value;
297  y /= Value;
298  z /= Value;
299  m /= Value;
300 }
301 
302 //---------------------------------------------------------
303 double CSG_Point_4D::Get_Length(void) const
304 {
305  return( sqrt(x*x + y*y + z*z + m*m) );
306 }
307 
308 
310 // //
311 // //
312 // //
314 
315 //---------------------------------------------------------
317 {
318  m_Points.Create(sizeof(TSG_Point), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
319 }
320 
322 {
323  m_Points.Create(sizeof(TSG_Point), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
324 
325  Assign(Points);
326 }
327 
329 {
330  m_Points.Create(sizeof(TSG_Point), nPoints, Growth);
331 }
332 
333 //---------------------------------------------------------
334 bool CSG_Points::Assign(const CSG_Points &Points)
335 {
336  if( m_Points.Set_Array(Points.m_Points.Get_Size()) )
337  {
338  if( m_Points.Get_Size() > 0 )
339  {
340  memcpy(m_Points.Get_Array(), Points.m_Points.Get_Array(), m_Points.Get_Size() * m_Points.Get_Value_Size());
341  }
342 
343  return( true );
344  }
345 
346  return( false );
347 }
348 
349 //---------------------------------------------------------
350 bool CSG_Points::Add(double x, double y)
351 {
352  if( m_Points.Inc_Array() )
353  {
354  TSG_Point *Point = (TSG_Point *)m_Points.Get_Entry(m_Points.Get_Size() - 1);
355 
356  Point->x = x;
357  Point->y = y;
358 
359  return( true );
360  }
361 
362  return( false );
363 }
364 
365 
367 // //
368 // //
369 // //
371 
372 //---------------------------------------------------------
374 {
375  m_Lines.Create(0, TSG_Array_Growth::SG_ARRAY_GROWTH_0);
376 }
377 
379 {
380  m_Lines.Create(0, TSG_Array_Growth::SG_ARRAY_GROWTH_0);
381 
382  Create(Lines);
383 }
384 
385 bool CSG_Lines::Create(const CSG_Lines &Lines)
386 {
387  return( Assign(Lines) );
388 }
389 
391 {
392  m_Lines.Create(0, TSG_Array_Growth::SG_ARRAY_GROWTH_0);
393 
394  Create(nLines);
395 }
396 
398 {
399  return( Set_Count(nLines) );
400 }
401 
402 //---------------------------------------------------------
404 {
405  Destroy();
406 }
407 
408 //---------------------------------------------------------
410 {
411  return( Set_Count(0) );
412 }
413 
414 //---------------------------------------------------------
416 {
417  return( Set_Count(0) );
418 }
419 
420 //---------------------------------------------------------
421 bool CSG_Lines::Assign(const CSG_Lines &Lines)
422 {
423  if( Set_Count(Lines.Get_Count()) )
424  {
425  for(sLong i=0; i<Lines.Get_Count(); i++)
426  {
427  Get_Line(i).Assign(Lines[i]);
428  }
429 
430  return( true );
431  }
432 
433  return( false );
434 }
435 
436 //---------------------------------------------------------
438 {
439  Set_Count(Get_Count() + 1);
440 
441  return( Get_Line(Get_Count() - 1) );
442 }
443 
444 //---------------------------------------------------------
445 bool CSG_Lines::Add(const CSG_Points &Line)
446 {
447  Add().Assign(Line);
448 
449  return( true );
450 }
451 
452 //---------------------------------------------------------
453 bool CSG_Lines::Add(const CSG_Lines &Lines)
454 {
455  for(sLong i=0; i<Lines.Get_Count(); i++)
456  {
457  Add(Lines[i]);
458  }
459 
460  return( true );
461 }
462 
463 //---------------------------------------------------------
465 {
466  if( Index >= 0 && Index < m_Lines.Get_Size() )
467  {
468  delete((CSG_Points *)m_Lines[Index]);
469 
470  return( m_Lines.Del(Index) );
471  }
472 
473  return( false );
474 }
475 
476 //---------------------------------------------------------
478 {
479  if( new_Count < 0 )
480  {
481  new_Count = 0;
482  }
483 
484  sLong old_Count = m_Lines.Get_Size();
485 
486  if( new_Count > old_Count )
487  {
488  m_Lines.Set_Array(new_Count);
489 
490  for(sLong i=old_Count; i<new_Count; i++)
491  {
492  m_Lines[i] = new CSG_Points;
493  }
494  }
495  else if( new_Count < old_Count )
496  {
497  for(sLong i=new_Count; i<old_Count; i++)
498  {
499  delete((CSG_Points *)m_Lines[i]);
500  }
501 
502  m_Lines.Set_Array(new_Count);
503  }
504 
505  return( true );
506 }
507 
508 double CSG_Lines::Get_Length(void) const
509 {
510  double Length = 0.;
511 
512  for(sLong i=0; i<Get_Count(); i++)
513  {
514  Length += Get_Length(i);
515  }
516 
517  return( Length );
518 }
519 
520 double CSG_Lines::Get_Length(sLong Index) const
521 {
522  double Length = 0.;
523 
524  if( Index >= 0 && Index < Get_Count() )
525  {
526  const CSG_Points &Line = Get_Line(Index);
527 
528  if( Line.Get_Count() > 1 )
529  {
530  for(sLong i=0, j=1; j<Line.Get_Count(); i++, j++)
531  {
532  Length += SG_Get_Distance(Line[i], Line[j]);
533  }
534  }
535  }
536 
537  return( Length );
538 }
539 
540 
542 // //
543 // //
544 // //
546 
547 //---------------------------------------------------------
549 {
550  m_Points.Create(sizeof(TSG_Point_3D), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
551 }
552 
554 {
555  m_Points.Create(sizeof(CSG_Points_3D), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
556 
557  Assign(Points);
558 }
559 
561 {
562  m_Points.Create(sizeof(TSG_Point_3D), nPoints, Growth);
563 }
564 
565 //---------------------------------------------------------
567 {
568  if( m_Points.Set_Array(Points.m_Points.Get_Size()) )
569  {
570  if( m_Points.Get_Size() > 0 )
571  {
572  memcpy(m_Points.Get_Array(), Points.m_Points.Get_Array(), m_Points.Get_Size() * m_Points.Get_Value_Size());
573  }
574 
575  return( true );
576  }
577 
578  return( false );
579 }
580 
581 //---------------------------------------------------------
582 bool CSG_Points_3D::Add(double x, double y, double z)
583 {
584  if( m_Points.Inc_Array() )
585  {
586  TSG_Point_3D *Point = (TSG_Point_3D *)m_Points.Get_Entry(m_Points.Get_Size() - 1);
587 
588  Point->x = x;
589  Point->y = y;
590  Point->z = z;
591 
592  return( true );
593  }
594 
595  return( false );
596 }
597 
598 
600 // //
601 // //
602 // //
604 
605 //---------------------------------------------------------
607 {
608  m_Points.Create(sizeof(TSG_Point_Int), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
609 }
610 
612 {
613  m_Points.Create(sizeof(TSG_Point_Int), 0, TSG_Array_Growth::SG_ARRAY_GROWTH_1);
614 
615  Assign(Points);
616 }
617 
619 {
620  m_Points.Create(sizeof(TSG_Point_Int), nPoints, Growth);
621 }
622 
623 //---------------------------------------------------------
625 {
626  if( m_Points.Set_Array(Points.m_Points.Get_Size()) )
627  {
628  if( m_Points.Get_Size() > 0 )
629  {
630  memcpy(m_Points.Get_Array(), Points.m_Points.Get_Array(), m_Points.Get_Size() * m_Points.Get_Value_Size());
631  }
632 
633  return( true );
634  }
635 
636  return( false );
637 }
638 
639 //---------------------------------------------------------
640 bool CSG_Points_Int::Add(int x, int y)
641 {
642  if( m_Points.Inc_Array() )
643  {
644  TSG_Point_Int *Point = (TSG_Point_Int *)m_Points.Get_Entry(m_Points.Get_Size() - 1);
645 
646  Point->x = x;
647  Point->y = y;
648 
649  return( true );
650  }
651 
652  return( false );
653 }
654 
655 
657 // //
658 // CSG_Rect //
659 // //
661 
662 //---------------------------------------------------------
664 {
665  Assign(0., 0., 0., 0.);
666 }
667 
669 {
670  Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
671 }
672 
674 {
675  Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
676 }
677 
679 {
680  Assign(A.x, A.y, B.x, B.y);
681 }
682 
683 CSG_Rect::CSG_Rect(double xMin, double yMin, double xMax, double yMax)
684 {
685  Assign(xMin, yMin, xMax, yMax);
686 }
687 
688 //---------------------------------------------------------
690 {}
691 
692 //---------------------------------------------------------
693 bool CSG_Rect::operator == (const CSG_Rect &Rect) const
694 {
695  return( is_Equal(Rect) );
696 }
697 
698 bool CSG_Rect::operator != (const CSG_Rect &Rect) const
699 {
700  return( !is_Equal(Rect) );
701 }
702 
704 {
705  Assign(Rect);
706 
707  return( *this );
708 }
709 
711 {
712  Move( Point.x, Point.y);
713 }
714 
716 {
717  Move(-Point.y, -Point.y);
718 }
719 
720 //---------------------------------------------------------
721 void CSG_Rect::Assign(double xMin, double yMin, double xMax, double yMax)
722 {
723  if( xMin < xMax )
724  {
725  this->xMin = xMin;
726  this->xMax = xMax;
727  }
728  else
729  {
730  this->xMin = xMax;
731  this->xMax = xMin;
732  }
733 
734  if( yMin < yMax )
735  {
736  this->yMin = yMin;
737  this->yMax = yMax;
738  }
739  else
740  {
741  this->yMin = yMax;
742  this->yMax = yMin;
743  }
744 }
745 
746 void CSG_Rect::Assign(const CSG_Point &A, const CSG_Point &B)
747 {
748  Assign(A.x, A.y, B.x, B.y);
749 }
750 
751 void CSG_Rect::Assign(const CSG_Rect &Rect)
752 {
753  Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
754 }
755 
756 //---------------------------------------------------------
757 void CSG_Rect::Set_BottomLeft(double x, double y)
758 {
759  Assign(x, y, xMax, yMax);
760 }
761 
763 {
764  Set_BottomLeft(Point.x, Point.y );
765 }
766 
767 void CSG_Rect::Set_TopRight(double x, double y)
768 {
769  Assign(xMin, yMin, x, y);
770 }
771 
773 {
774  Set_TopRight(Point.x, Point.y );
775 }
776 
777 //---------------------------------------------------------
778 bool CSG_Rect::is_Equal(double xMin, double yMin, double xMax, double yMax, double epsilon) const
779 {
780  return( SG_Is_Equal(this->xMin, xMin, epsilon) && SG_Is_Equal(this->yMin, yMin, epsilon)
781  && SG_Is_Equal(this->xMax, xMax, epsilon) && SG_Is_Equal(this->yMax, yMax, epsilon) );
782 }
783 
784 bool CSG_Rect::is_Equal(const CSG_Rect &Rect, double epsilon) const
785 {
786  return( is_Equal(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax, epsilon) );
787 }
788 
789 //---------------------------------------------------------
790 void CSG_Rect::Move(double dx, double dy)
791 {
792  xMin += dx; yMin += dy;
793  xMax += dx; yMax += dy;
794 }
795 
796 void CSG_Rect::Move(const CSG_Point &Point)
797 {
798  Move(Point.x, Point.y);
799 }
800 
801 //---------------------------------------------------------
802 void CSG_Rect::Inflate(double dx, double dy, bool bPercent)
803 {
804  if( bPercent )
805  {
806  dx = (Get_XRange() * 0.01 * dx) / 2.;
807  dy = (Get_YRange() * 0.01 * dy) / 2.;
808  }
809 
810  Assign(
811  xMin - dx, yMin - dy,
812  xMax + dx, yMax + dy
813  );
814 }
815 
816 void CSG_Rect::Inflate(double d, bool bPercent)
817 {
818  Inflate(d, d, bPercent);
819 }
820 
821 void CSG_Rect::Deflate(double dx, double dy, bool bPercent)
822 {
823  Inflate(-dx, -dy, bPercent);
824 }
825 
826 void CSG_Rect::Deflate(double d, bool bPercent)
827 {
828  Deflate(d, d, bPercent);
829 }
830 
831 //---------------------------------------------------------
832 void CSG_Rect::Union(double x, double y)
833 {
834  if( xMin > x ) { xMin = x; } else if( xMax < x ) { xMax = x; }
835  if( yMin > y ) { yMin = y; } else if( yMax < y ) { yMax = y; }
836 }
837 
838 //---------------------------------------------------------
839 void CSG_Rect::Union(const CSG_Point &Point)
840 {
841  if( xMin > Point.x ) { xMin = Point.x; } else if( xMax < Point.x ) { xMax = Point.x; }
842  if( yMin > Point.y ) { yMin = Point.y; } else if( yMax < Point.y ) { yMax = Point.y; }
843 }
844 
845 //---------------------------------------------------------
846 void CSG_Rect::Union(const CSG_Rect &Rect)
847 {
848  if( xMin > Rect.Get_XMin() ) { xMin = Rect.Get_XMin(); }
849  if( yMin > Rect.Get_YMin() ) { yMin = Rect.Get_YMin(); }
850  if( xMax < Rect.Get_XMax() ) { xMax = Rect.Get_XMax(); }
851  if( yMax < Rect.Get_YMax() ) { yMax = Rect.Get_YMax(); }
852 }
853 
854 //---------------------------------------------------------
855 bool CSG_Rect::Intersect(const CSG_Rect &Rect)
856 {
857  switch( Intersects(Rect) )
858  {
859  case INTERSECTION_None: default:
860  return( false );
861 
864  break;
865 
867  (*this) = Rect;
868  break;
869 
871  if( xMin < Rect.Get_XMin() ) { xMin = Rect.Get_XMin(); }
872  if( yMin < Rect.Get_YMin() ) { yMin = Rect.Get_YMin(); }
873  if( xMax > Rect.Get_XMax() ) { xMax = Rect.Get_XMax(); }
874  if( yMax > Rect.Get_YMax() ) { yMax = Rect.Get_YMax(); }
875  break;
876  }
877 
878  return( true );
879 }
880 
881 //---------------------------------------------------------
883 {
884  if( xMax < Rect.Get_XMin() || Rect.Get_XMax() < xMin
885  || yMax < Rect.Get_YMin() || Rect.Get_YMax() < yMin )
886  {
887  return( INTERSECTION_None );
888  }
889 
890  if( is_Equal(Rect) )
891  {
892  return( INTERSECTION_Identical );
893  }
894 
895  if( Contains(Rect.Get_XMin(), Rect.Get_YMin())
896  && Contains(Rect.Get_XMax(), Rect.Get_YMax()) )
897  {
898  return( INTERSECTION_Contains );
899  }
900 
901  if( Rect.Contains(Get_XMin(), Get_YMin())
902  && Rect.Contains(Get_XMax(), Get_YMax()) )
903  {
904  return( INTERSECTION_Contained );
905  }
906 
907  return( INTERSECTION_Overlaps );
908 }
909 
910 //---------------------------------------------------------
911 bool CSG_Rect::Contains(double x, double y) const
912 {
913  return( xMin <= x && x <= xMax && yMin <= y && y <= yMax );
914 }
915 
916 bool CSG_Rect::Contains(const CSG_Point &Point) const
917 {
918  return( Contains(Point.x, Point.y) );
919 }
920 
921 
923 // //
925 
926 //---------------------------------------------------------
928 {
929  m_nRects = 0; m_Rects = NULL;
930 }
931 
932 //---------------------------------------------------------
934 {
935  m_nRects = 0; m_Rects = NULL;
936 
937  Assign(Rects);
938 }
939 
940 //---------------------------------------------------------
942 {
943  Clear();
944 }
945 
946 //---------------------------------------------------------
948 {
949  if( m_Rects )
950  {
951  for(int i=0; i<m_nRects; i++)
952  {
953  delete(m_Rects[i]);
954  }
955 
956  SG_Free(m_Rects);
957  }
958 
959  m_nRects = 0;
960  m_Rects = NULL;
961 }
962 
963 //---------------------------------------------------------
964 bool CSG_Rects::Assign(const CSG_Rects &Rects)
965 {
966  Clear();
967 
968  for(int i=0; i<Rects.m_nRects; i++)
969  {
970  Add(*Rects.m_Rects[i]);
971  }
972 
973  return( true );
974 }
975 
976 //---------------------------------------------------------
978 {
979  Assign(Rects);
980 
981  return( *this );
982 }
983 
984 //---------------------------------------------------------
985 bool CSG_Rects::Add(void)
986 {
987  return( Add(CSG_Rect()) );
988 }
989 
990 //---------------------------------------------------------
991 bool CSG_Rects::Add(double xMin, double yMin, double xMax, double yMax)
992 {
993  return( Add(CSG_Rect(xMin, yMin, xMax, yMax)) );
994 }
995 
996 //---------------------------------------------------------
997 bool CSG_Rects::Add(const CSG_Rect &Rect)
998 {
999  m_Rects = (CSG_Rect **)SG_Realloc(m_Rects, ((uLong)m_nRects + 1) * sizeof(CSG_Rect *));
1000  m_Rects[m_nRects] = new CSG_Rect(Rect);
1001  m_nRects++;
1002 
1003  return( true );
1004 }
1005 
1006 
1008 // //
1009 // CSG_Rect_Int //
1010 // //
1012 
1013 //---------------------------------------------------------
1015 {
1016  Assign(0, 0, 0, 0);
1017 }
1018 
1020 {
1021  Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
1022 }
1023 
1025 {
1026  Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
1027 }
1028 
1030 {
1031  Assign(A.x, A.y, B.x, B.y);
1032 }
1033 
1034 CSG_Rect_Int::CSG_Rect_Int(int xMin, int yMin, int xMax, int yMax)
1035 {
1036  Assign(xMin, yMin, xMax, yMax);
1037 }
1038 
1039 //---------------------------------------------------------
1041 {}
1042 
1043 //---------------------------------------------------------
1045 {
1046  return( is_Equal(Rect) );
1047 }
1048 
1050 {
1051  return( !is_Equal(Rect) );
1052 }
1053 
1055 {
1056  Assign(Rect);
1057 
1058  return( *this );
1059 }
1060 
1062 {
1063  Move( Point.x, Point.y);
1064 }
1065 
1067 {
1068  Move(-Point.y, -Point.y);
1069 }
1070 
1071 //---------------------------------------------------------
1072 void CSG_Rect_Int::Assign(int xMin, int yMin, int xMax, int yMax)
1073 {
1074  if( xMin < xMax )
1075  {
1076  this->xMin = xMin;
1077  this->xMax = xMax;
1078  }
1079  else
1080  {
1081  this->xMin = xMax;
1082  this->xMax = xMin;
1083  }
1084 
1085  if( yMin < yMax )
1086  {
1087  this->yMin = yMin;
1088  this->yMax = yMax;
1089  }
1090  else
1091  {
1092  this->yMin = yMax;
1093  this->yMax = yMin;
1094  }
1095 }
1096 
1098 {
1099  Assign(A.x, A.y, B.x, B.y);
1100 }
1101 
1103 {
1104  Assign(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax);
1105 }
1106 
1107 //---------------------------------------------------------
1109 {
1110  Assign(x, y, xMax, yMax);
1111 }
1112 
1114 {
1115  Set_BottomLeft(Point.x, Point.y );
1116 }
1117 
1118 void CSG_Rect_Int::Set_TopRight(int x, int y)
1119 {
1120  Assign(xMin, yMin, x, y);
1121 }
1122 
1124 {
1125  Set_TopRight(Point.x, Point.y );
1126 }
1127 
1128 //---------------------------------------------------------
1129 bool CSG_Rect_Int::is_Equal(int xMin, int yMin, int xMax, int yMax) const
1130 {
1131  return( (this->xMin == xMin) && (this->yMin == yMin)
1132  && (this->xMax == xMax) && (this->yMax == yMax) );
1133 }
1134 
1135 bool CSG_Rect_Int::is_Equal(const CSG_Rect_Int &Rect) const
1136 {
1137  return( is_Equal(Rect.xMin, Rect.yMin, Rect.xMax, Rect.yMax) );
1138 }
1139 
1140 //---------------------------------------------------------
1141 void CSG_Rect_Int::Move(int dx, int dy)
1142 {
1143  xMin += dx; yMin += dy;
1144  xMax += dx; yMax += dy;
1145 }
1146 
1148 {
1149  Move(Point.x, Point.y);
1150 }
1151 
1152 //---------------------------------------------------------
1153 void CSG_Rect_Int::Inflate(int dx, int dy)
1154 {
1155  Assign(xMin - dx, yMin - dy, xMax + dx, yMax + dy);
1156 }
1157 
1159 {
1160  Inflate(d, d);
1161 }
1162 
1163 void CSG_Rect_Int::Deflate(int dx, int dy)
1164 {
1165  Inflate(-dx, -dy);
1166 }
1167 
1169 {
1170  Deflate(d, d);
1171 }
1172 
1173 //---------------------------------------------------------
1174 void CSG_Rect_Int::Union(int x, int y)
1175 {
1176  if( xMin > x ) { xMin = x; } else if( xMax < x ) { xMax = x; }
1177  if( yMin > y ) { yMin = y; } else if( yMax < y ) { yMax = y; }
1178 }
1179 
1180 //---------------------------------------------------------
1182 {
1183  if( xMin > Point.x ) { xMin = Point.x; } else if( xMax < Point.x ) { xMax = Point.x; }
1184  if( yMin > Point.y ) { yMin = Point.y; } else if( yMax < Point.y ) { yMax = Point.y; }
1185 }
1186 
1187 //---------------------------------------------------------
1189 {
1190  if( xMin > Rect.Get_XMin() ) { xMin = Rect.Get_XMin(); }
1191  if( yMin > Rect.Get_YMin() ) { yMin = Rect.Get_YMin(); }
1192  if( xMax < Rect.Get_XMax() ) { xMax = Rect.Get_XMax(); }
1193  if( yMax < Rect.Get_YMax() ) { yMax = Rect.Get_YMax(); }
1194 }
1195 
1196 //---------------------------------------------------------
1198 {
1199  switch( Intersects(Rect) )
1200  {
1201  case INTERSECTION_None: default:
1202  return( false );
1203 
1206  break;
1207 
1208  case INTERSECTION_Contains:
1209  (*this) = Rect;
1210  break;
1211 
1212  case INTERSECTION_Overlaps:
1213  if( xMin < Rect.Get_XMin() ) { xMin = Rect.Get_XMin(); }
1214  if( yMin < Rect.Get_YMin() ) { yMin = Rect.Get_YMin(); }
1215  if( xMax > Rect.Get_XMax() ) { xMax = Rect.Get_XMax(); }
1216  if( yMax > Rect.Get_YMax() ) { yMax = Rect.Get_YMax(); }
1217  break;
1218  }
1219 
1220  return( true );
1221 }
1222 
1223 //---------------------------------------------------------
1225 {
1226  if( xMax < Rect.Get_XMin() || Rect.Get_XMax() < xMin
1227  || yMax < Rect.Get_YMin() || Rect.Get_YMax() < yMin )
1228  {
1229  return( INTERSECTION_None );
1230  }
1231 
1232  if( is_Equal(Rect) )
1233  {
1234  return( INTERSECTION_Identical );
1235  }
1236 
1237  if( Contains(Rect.Get_XMin(), Rect.Get_YMin())
1238  && Contains(Rect.Get_XMax(), Rect.Get_YMax()) )
1239  {
1240  return( INTERSECTION_Contains );
1241  }
1242 
1243  if( Rect.Contains(Get_XMin(), Get_YMin())
1244  && Rect.Contains(Get_XMax(), Get_YMax()) )
1245  {
1246  return( INTERSECTION_Contained );
1247  }
1248 
1249  return( INTERSECTION_Overlaps );
1250 }
1251 
1252 //---------------------------------------------------------
1253 bool CSG_Rect_Int::Contains(double x, double y) const
1254 {
1255  return( xMin <= x && x <= xMax && yMin <= y && y <= yMax );
1256 }
1257 
1258 bool CSG_Rect_Int::Contains(const TSG_Point_Int &Point) const
1259 {
1260  return( Contains(Point.x, Point.y) );
1261 }
1262 
1263 
1265 // //
1267 
1268 //---------------------------------------------------------
1270 {
1271  m_nRects = 0;
1272  m_Rects = NULL;
1273 }
1274 
1275 //---------------------------------------------------------
1277 {
1278  Clear();
1279 }
1280 
1281 //---------------------------------------------------------
1283 {
1284  if( m_Rects )
1285  {
1286  for(int i=0; i<m_nRects; i++)
1287  {
1288  delete(m_Rects[i]);
1289  }
1290 
1291  SG_Free(m_Rects);
1292  }
1293 
1294  m_nRects = 0;
1295  m_Rects = NULL;
1296 }
1297 
1298 //---------------------------------------------------------
1300 {
1301  Clear();
1302 
1303  for(int i=0; i<Rects.m_nRects; i++)
1304  {
1305  Add(*Rects.m_Rects[i]);
1306  }
1307 
1308  return( true );
1309 }
1310 
1311 //---------------------------------------------------------
1313 {
1314  Assign(Rects);
1315 
1316  return( *this );
1317 }
1318 
1319 //---------------------------------------------------------
1321 {
1322  return( Add(CSG_Rect_Int()) );
1323 }
1324 
1325 //---------------------------------------------------------
1326 bool CSG_Rects_Int::Add(int xMin, int yMin, int xMax, int yMax)
1327 {
1328  return( Add(CSG_Rect_Int(xMin, yMin, xMax, yMax)) );
1329 }
1330 
1331 //---------------------------------------------------------
1333 {
1334  m_Rects = (CSG_Rect_Int **)SG_Realloc(m_Rects, ((uLong)m_nRects + 1) * sizeof(CSG_Rect_Int *));
1335  m_Rects[m_nRects] = new CSG_Rect_Int(Rect);
1336  m_nRects++;
1337 
1338  return( true );
1339 }
1340 
1341 
1343 // //
1344 // //
1345 // //
1347 
1348 //---------------------------------------------------------
1350 {
1351  m_Weighting = SG_DISTWGHT_None;
1352 
1353  m_IDW_Power = 2.;
1354  m_IDW_bOffset = true;
1355 
1356  m_Bandwidth = 1.;
1357 }
1358 
1359 //---------------------------------------------------------
1361 {}
1362 
1363 //---------------------------------------------------------
1364 bool CSG_Distance_Weighting::Create_Parameters(CSG_Parameters &Parameters, const CSG_String &Parent, bool bIDW_Offset)
1365 {
1366  if( Add_Parameters(Parameters, Parent, bIDW_Offset) )
1367  {
1368  if( Parameters("DW_WEIGHTING" ) ) { Parameters("DW_WEIGHTING" )->Set_Value((int)m_Weighting ); }
1369  if( Parameters("DW_IDW_POWER" ) ) { Parameters("DW_IDW_POWER" )->Set_Value( m_IDW_Power ); }
1370  if( Parameters("DW_IDW_OFFSET") ) { Parameters("DW_IDW_OFFSET")->Set_Value( m_IDW_bOffset); }
1371  if( Parameters("DW_BANDWIDTH" ) ) { Parameters("DW_BANDWIDTH" )->Set_Value( m_Bandwidth ); }
1372 
1373  return( true );
1374  }
1375 
1376  return( false );
1377 }
1378 
1379 //---------------------------------------------------------
1380 bool CSG_Distance_Weighting::Add_Parameters(CSG_Parameters &Parameters, const CSG_String &Parent, bool bIDW_Offset)
1381 {
1382  Parameters.Add_Choice(Parent,
1383  "DW_WEIGHTING" , _TL("Weighting Function"),
1384  _TL(""),
1385  CSG_String::Format("%s|%s|%s|%s",
1386  _TL("no distance weighting"),
1387  _TL("inverse distance to a power"),
1388  _TL("exponential"),
1389  _TL("gaussian")
1390  ), 0
1391  );
1392 
1393  Parameters.Add_Double("DW_WEIGHTING",
1394  "DW_IDW_POWER" , _TL("Power"),
1395  _TL(""),
1396  2., 0., true
1397  );
1398 
1399  if( bIDW_Offset )
1400  {
1401  Parameters.Add_Bool ("DW_WEIGHTING",
1402  "DW_IDW_OFFSET" , _TL("Offset"),
1403  _TL("Calculates weights for distance plus one, avoiding division by zero for zero distances"),
1404  true
1405  );
1406  }
1407 
1408  Parameters.Add_Double("DW_WEIGHTING",
1409  "DW_BANDWIDTH" , _TL("Bandwidth"),
1410  _TL("Bandwidth for exponential and Gaussian weighting"),
1411  1., 0., true
1412  );
1413 
1414  return( true );
1415 }
1416 
1417 //---------------------------------------------------------
1419 {
1420  if( Parameters("DW_WEIGHTING") )
1421  {
1422  int Method = Parameters("DW_WEIGHTING")->asInt();
1423 
1424  Parameters.Set_Enabled("DW_IDW_OFFSET", Method == 1);
1425  Parameters.Set_Enabled("DW_IDW_POWER" , Method == 1);
1426  Parameters.Set_Enabled("DW_BANDWIDTH" , Method >= 2);
1427  }
1428 
1429  return( true );
1430 }
1431 
1432 //---------------------------------------------------------
1434 {
1435  if( Parameters("DW_WEIGHTING") )
1436  {
1437  switch( Parameters("DW_WEIGHTING")->asInt() )
1438  {
1439  case 0: Set_Weighting(SG_DISTWGHT_None ); break;
1440  case 1: Set_Weighting(SG_DISTWGHT_IDW ); break;
1441  case 2: Set_Weighting(SG_DISTWGHT_EXP ); break;
1442  case 3: Set_Weighting(SG_DISTWGHT_GAUSS); break;
1443  }
1444  }
1445 
1446  if( Parameters("DW_IDW_OFFSET") )
1447  {
1448  Set_IDW_Offset(Parameters("DW_IDW_OFFSET")->asBool ());
1449  }
1450 
1451  if( Parameters("DW_IDW_POWER" ) )
1452  {
1453  Set_IDW_Power (Parameters("DW_IDW_POWER" )->asDouble());
1454  }
1455 
1456  if( Parameters("DW_BANDWIDTH" ) )
1457  {
1458  Set_BandWidth (Parameters("DW_BANDWIDTH" )->asDouble());
1459  }
1460 
1461  return( true );
1462 }
1463 
1464 
1466 // //
1468 
1469 //---------------------------------------------------------
1471 {
1472  m_Weighting = Weighting;
1473 
1474  return( true );
1475 }
1476 
1477 //---------------------------------------------------------
1479 {
1480  if( Value <= 0. )
1481  {
1482  return( false );
1483  }
1484 
1485  m_IDW_Power = Value;
1486 
1487  return( true );
1488 }
1489 
1490 //---------------------------------------------------------
1492 {
1493  m_IDW_bOffset = bOn;
1494 
1495  return( true );
1496 }
1497 
1498 //---------------------------------------------------------
1500 {
1501  if( Value <= 0. )
1502  {
1503  return( false );
1504  }
1505 
1506  m_Bandwidth = Value;
1507 
1508  return( true );
1509 }
1510 
1511 
1513 // //
1514 // //
1515 // //
1517 
1518 //---------------------------------------------------------
CSG_Rects_Int::CSG_Rects_Int
CSG_Rects_Int(void)
Definition: geo_classes.cpp:1269
CSG_Rect
Definition: geo_tools.h:471
CSG_Array::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_memory.cpp:310
CSG_Points::Add
bool Add(double x, double y)
Definition: geo_classes.cpp:350
CSG_Rect_Int::Get_XMin
int Get_XMin(void) const
Definition: geo_tools.h:612
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Points_3D
Definition: geo_tools.h:320
CSG_Rect_Int::Contains
bool Contains(double x, double y) const
Definition: geo_classes.cpp:1253
CSG_Point_3D::Add
virtual void Add(const CSG_Point_3D &Point)
Definition: geo_classes.cpp:177
SSG_Rect_Int::yMax
int yMax
Definition: geo_tools.h:577
TSG_Array_Growth
TSG_Array_Growth
Definition: api_core.h:291
CSG_Rects_Int::Assign
bool Assign(const CSG_Rects_Int &Rects)
Definition: geo_classes.cpp:1299
CSG_Rects
Definition: geo_tools.h:540
CSG_Rect::operator!=
bool operator!=(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:698
CSG_Lines::Create
bool Create(const CSG_Lines &Lines)
Definition: geo_classes.cpp:385
CSG_Rect_Int::Get_YMin
int Get_YMin(void) const
Definition: geo_tools.h:614
CSG_Points_3D::CSG_Points_3D
CSG_Points_3D(void)
Definition: geo_classes.cpp:548
_TL
#define _TL(s)
Definition: api_core.h:1480
TSG_Distance_Weighting
TSG_Distance_Weighting
Definition: geo_tools.h:685
CSG_Array::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:327
CSG_Distance_Weighting::Enable_Parameters
static bool Enable_Parameters(class CSG_Parameters &Parameters)
Definition: geo_classes.cpp:1418
CSG_Points_3D::Add
bool Add(double x, double y, double z)
Definition: geo_classes.cpp:582
SSG_Rect_Int::yMin
int yMin
Definition: geo_tools.h:577
CSG_Points_Int::Add
bool Add(int x, int y)
Definition: geo_classes.cpp:640
CSG_Point_3D::Get_Length
virtual double Get_Length(void) const
Definition: geo_classes.cpp:213
CSG_Point_3D::Subtract
virtual void Subtract(const CSG_Point_3D &Point)
Definition: geo_classes.cpp:184
CSG_Rect_Int::Get_XMax
int Get_XMax(void) const
Definition: geo_tools.h:613
SG_DISTWGHT_EXP
@ SG_DISTWGHT_EXP
Definition: geo_tools.h:688
A
#define A
CSG_Point::Subtract
virtual void Subtract(const CSG_Point &Point)
Definition: geo_classes.cpp:105
CSG_Points_Int
Definition: geo_tools.h:425
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:501
CSG_Array_Pointer::Get_Size
sLong Get_Size(void) const
Definition: api_core.h:381
CSG_Rects::~CSG_Rects
virtual ~CSG_Rects(void)
Definition: geo_classes.cpp:941
CSG_Rect::~CSG_Rect
~CSG_Rect(void)
Definition: geo_classes.cpp:689
CSG_Rect_Int::operator=
CSG_Rect_Int & operator=(const CSG_Rect_Int &Rect)
Definition: geo_classes.cpp:1054
CSG_Point::Get_Length
virtual double Get_Length(void) const
Definition: geo_classes.cpp:130
SG_DISTWGHT_GAUSS
@ SG_DISTWGHT_GAUSS
Definition: geo_tools.h:689
CSG_Point::Multiply
virtual void Multiply(const CSG_Point &Point)
Definition: geo_classes.cpp:111
CSG_Distance_Weighting::Set_IDW_Power
bool Set_IDW_Power(double Value)
Definition: geo_classes.cpp:1478
CSG_Rect_Int::Set_BottomLeft
void Set_BottomLeft(int x, int y)
Definition: geo_classes.cpp:1108
CSG_Point::Add
virtual void Add(const CSG_Point &Point)
Definition: geo_classes.cpp:99
CSG_Rect_Int::Union
void Union(int x, int y)
Definition: geo_classes.cpp:1174
CSG_Rect_Int::Set_TopRight
void Set_TopRight(int x, int y)
Definition: geo_classes.cpp:1118
SSG_Point_4D
Definition: geo_tools.h:357
SSG_Point_3D
Definition: geo_tools.h:264
INTERSECTION_Contains
@ INTERSECTION_Contains
Definition: geo_tools.h:106
CSG_Rect::Intersects
TSG_Intersection Intersects(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:882
CSG_Lines::Destroy
bool Destroy(void)
Definition: geo_classes.cpp:409
SSG_Rect_Int
Definition: geo_tools.h:576
CSG_Lines::~CSG_Lines
virtual ~CSG_Lines(void)
Definition: geo_classes.cpp:403
CSG_Lines::Del
bool Del(sLong Index)
Definition: geo_classes.cpp:464
SSG_Point_3D::x
double x
Definition: geo_tools.h:265
CSG_Parameters::Add_Double
CSG_Parameter * Add_Double(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
Definition: parameters.cpp:406
CSG_Lines::Set_Count
bool Set_Count(sLong nLines)
Definition: geo_classes.cpp:477
CSG_Rects::Clear
void Clear(void)
Definition: geo_classes.cpp:947
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
CSG_Rects_Int::~CSG_Rects_Int
virtual ~CSG_Rects_Int(void)
Definition: geo_classes.cpp:1276
CSG_Rect::operator+=
void operator+=(const CSG_Point &Point)
Definition: geo_classes.cpp:710
CSG_Rect_Int::Deflate
void Deflate(int d)
Definition: geo_classes.cpp:1168
SG_Free
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
Definition: api_memory.cpp:83
CSG_Point::CSG_Point
CSG_Point(void)
Definition: geo_classes.cpp:65
SSG_Point
Definition: geo_tools.h:128
CSG_Distance_Weighting::CSG_Distance_Weighting
CSG_Distance_Weighting(void)
Definition: geo_classes.cpp:1349
CSG_Array_Pointer::Create
void ** Create(const CSG_Array_Pointer &Array)
Definition: api_memory.cpp:469
CSG_Rects_Int::Add
bool Add(void)
Definition: geo_classes.cpp:1320
CSG_Distance_Weighting::Set_Parameters
bool Set_Parameters(class CSG_Parameters &Parameters)
Definition: geo_classes.cpp:1433
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
CSG_Rect::Contains
bool Contains(double x, double y) const
Definition: geo_classes.cpp:911
SSG_Rect
Definition: geo_tools.h:464
CSG_Rect::Intersect
bool Intersect(const CSG_Rect &Rect)
Definition: geo_classes.cpp:855
CSG_Point_4D::Assign
virtual void Assign(double x, double y, double z, double m)
Definition: geo_classes.cpp:245
CSG_Rect_Int
Definition: geo_tools.h:583
SG_DISTWGHT_IDW
@ SG_DISTWGHT_IDW
Definition: geo_tools.h:687
CSG_Rect::Deflate
void Deflate(double d, bool bPercent=true)
Definition: geo_classes.cpp:826
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:505
CSG_Point
Definition: geo_tools.h:135
CSG_Array_Pointer::Del
bool Del(sLong Index)
Definition: api_memory.cpp:512
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
CSG_Point_4D::Add
virtual void Add(const CSG_Point_4D &Point)
Definition: geo_classes.cpp:262
CSG_Point_4D::Subtract
virtual void Subtract(const CSG_Point_4D &Point)
Definition: geo_classes.cpp:270
CSG_Points::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:200
SSG_Point_4D::m
double m
Definition: geo_tools.h:358
CSG_Rects_Int::operator=
CSG_Rects_Int & operator=(const CSG_Rects_Int &Rects)
Definition: geo_classes.cpp:1312
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Rect::operator-=
void operator-=(const CSG_Point &Point)
Definition: geo_classes.cpp:715
CSG_Rect::operator==
bool operator==(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:693
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
SSG_Point_4D::z
double z
Definition: geo_tools.h:358
CSG_Rects_Int::Clear
void Clear(void)
Definition: geo_classes.cpp:1282
CSG_Point_3D
Definition: geo_tools.h:271
CSG_Rect_Int::is_Equal
bool is_Equal(int xMin, int yMin, int xMax, int yMax) const
Definition: geo_classes.cpp:1129
CSG_Rect::Set_BottomLeft
void Set_BottomLeft(double x, double y)
Definition: geo_classes.cpp:757
CSG_Array::Get_Value_Size
size_t Get_Value_Size(void) const
Definition: api_core.h:326
SG_Get_Distance
double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
Definition: geo_functions.cpp:103
CSG_Point_4D
Definition: geo_tools.h:364
CSG_Point_4D::CSG_Point_4D
CSG_Point_4D(void)
Definition: geo_classes.cpp:224
CSG_Parameters::Set_Enabled
void Set_Enabled(bool bEnabled=true)
Definition: parameters.cpp:336
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Distance_Weighting::Create_Parameters
bool Create_Parameters(class CSG_Parameters &Parameters, const CSG_String &Parent="", bool bIDW_Offset=false)
Definition: geo_classes.cpp:1364
CSG_Rect::Inflate
void Inflate(double d, bool bPercent=true)
Definition: geo_classes.cpp:816
CSG_Point::Assign
virtual void Assign(double x, double y)
Definition: geo_classes.cpp:86
CSG_Point_4D::Get_Length
virtual double Get_Length(void) const
Definition: geo_classes.cpp:303
SSG_Rect_Int::xMax
int xMax
Definition: geo_tools.h:577
CSG_Point_3D::Assign
virtual void Assign(double x, double y, double z)
Definition: geo_classes.cpp:162
CSG_Rects::CSG_Rects
CSG_Rects(void)
Definition: geo_classes.cpp:927
SSG_Rect_Int::xMin
int xMin
Definition: geo_tools.h:577
CSG_Distance_Weighting::Set_Weighting
bool Set_Weighting(TSG_Distance_Weighting Weighting)
Definition: geo_classes.cpp:1470
CSG_Rect::Union
void Union(double x, double y)
Definition: geo_classes.cpp:832
CSG_Rects::Assign
bool Assign(const CSG_Rects &Rects)
Definition: geo_classes.cpp:964
CSG_Rect_Int::Intersect
bool Intersect(const CSG_Rect_Int &Rect)
Definition: geo_classes.cpp:1197
CSG_Array::Create
void * Create(const CSG_Array &Array)
Definition: api_memory.cpp:250
CSG_Distance_Weighting::Set_IDW_Offset
bool Set_IDW_Offset(bool bOn=true)
Definition: geo_classes.cpp:1491
CSG_Lines::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:239
INTERSECTION_Identical
@ INTERSECTION_Identical
Definition: geo_tools.h:103
CSG_Rect_Int::~CSG_Rect_Int
~CSG_Rect_Int(void)
Definition: geo_classes.cpp:1040
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
CSG_Array::Get_Array
void * Get_Array(void) const
Definition: api_core.h:336
CSG_Lines::Add
CSG_Points & Add(void)
Definition: geo_classes.cpp:437
CSG_Point_3D::CSG_Point_3D
CSG_Point_3D(void)
Definition: geo_classes.cpp:141
SG_Is_Equal
bool SG_Is_Equal(double a, double b, double epsilon)
Definition: geo_functions.cpp:64
CSG_Points
Definition: geo_tools.h:184
parameters.h
CSG_Lines::Assign
bool Assign(const CSG_Lines &Lines)
Definition: geo_classes.cpp:421
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Points::CSG_Points
CSG_Points(void)
Definition: geo_classes.cpp:316
CSG_Lines::CSG_Lines
CSG_Lines(void)
Definition: geo_classes.cpp:373
CSG_Rect::CSG_Rect
CSG_Rect(void)
Definition: geo_classes.cpp:663
CSG_Points_Int::CSG_Points_Int
CSG_Points_Int(void)
Definition: geo_classes.cpp:606
SSG_Point_4D::y
double y
Definition: geo_tools.h:358
CSG_Point::Divide
virtual void Divide(double Value)
Definition: geo_classes.cpp:123
CSG_Array::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_memory.cpp:414
B
#define B
CSG_String
Definition: api_core.h:557
CSG_Point_3D::Multiply
virtual void Multiply(const CSG_Point_3D &Point)
Definition: geo_classes.cpp:191
CSG_Rect::is_Equal
bool is_Equal(double xMin, double yMin, double xMax, double yMax, double epsilon=0.) const
Definition: geo_classes.cpp:778
CSG_Rect::Move
void Move(double dx, double dy)
Definition: geo_classes.cpp:790
CSG_Rects::Add
bool Add(void)
Definition: geo_classes.cpp:985
CSG_Rect::operator=
CSG_Rect & operator=(const CSG_Rect &Rect)
Definition: geo_classes.cpp:703
SSG_Point_Int
Definition: geo_tools.h:418
CSG_Distance_Weighting::Add_Parameters
static bool Add_Parameters(class CSG_Parameters &Parameters, const CSG_String &Parent="", bool bIDW_Offset=false)
Definition: geo_classes.cpp:1380
CSG_Points_Int::Assign
bool Assign(const CSG_Points_Int &Points)
Definition: geo_classes.cpp:624
SSG_Point_3D::y
double y
Definition: geo_tools.h:265
CSG_Rect_Int::operator!=
bool operator!=(const CSG_Rect_Int &Rect) const
Definition: geo_classes.cpp:1049
CSG_Rect_Int::operator==
bool operator==(const CSG_Rect_Int &Rect) const
Definition: geo_classes.cpp:1044
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Point_4D::x
double x
Definition: geo_tools.h:358
CSG_Array_Pointer::Set_Array
bool Set_Array(sLong nValues, bool bShrink=true)
Definition: api_core.h:387
CSG_Lines::Get_Length
double Get_Length(void) const
Definition: geo_classes.cpp:508
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
CSG_Rect_Int::Get_YMax
int Get_YMax(void) const
Definition: geo_tools.h:615
CSG_Rects_Int
Definition: geo_tools.h:648
CSG_Point_4D::Divide
virtual void Divide(double Value)
Definition: geo_classes.cpp:294
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
CSG_Rect_Int::operator-=
void operator-=(const TSG_Point_Int &Point)
Definition: geo_classes.cpp:1066
SSG_Point_Int::y
int y
Definition: geo_tools.h:419
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Rect::Set_TopRight
void Set_TopRight(double x, double y)
Definition: geo_classes.cpp:767
CSG_Lines::Clear
bool Clear(void)
Definition: geo_classes.cpp:415
CSG_Rect_Int::CSG_Rect_Int
CSG_Rect_Int(void)
Definition: geo_classes.cpp:1014
CSG_Rect_Int::Assign
void Assign(int xMin, int yMin, int xMax, int yMax)
Definition: geo_classes.cpp:1072
SSG_Point_3D::z
double z
Definition: geo_tools.h:265
CSG_Rect_Int::Move
void Move(int dx, int dy)
Definition: geo_classes.cpp:1141
CSG_Lines::Get_Line
CSG_Points & Get_Line(sLong Index)
Definition: geo_tools.h:241
CSG_Point_4D::Multiply
virtual void Multiply(const CSG_Point_4D &Point)
Definition: geo_classes.cpp:278
CSG_Point_3D::Divide
virtual void Divide(double Value)
Definition: geo_classes.cpp:205
CSG_Points_3D::Assign
bool Assign(const CSG_Points_3D &Points)
Definition: geo_classes.cpp:566
CSG_Lines
Definition: geo_tools.h:216
INTERSECTION_Contained
@ INTERSECTION_Contained
Definition: geo_tools.h:105
CSG_Parameters
Definition: parameters.h:1650
SG_Realloc
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
Definition: api_memory.cpp:77
CSG_Rect_Int::Inflate
void Inflate(int d)
Definition: geo_classes.cpp:1158
CSG_Rect_Int::operator+=
void operator+=(const TSG_Point_Int &Point)
Definition: geo_classes.cpp:1061
CSG_Distance_Weighting::~CSG_Distance_Weighting
virtual ~CSG_Distance_Weighting(void)
Definition: geo_classes.cpp:1360
SSG_Point_Int::x
int x
Definition: geo_tools.h:419
SG_DISTWGHT_None
@ SG_DISTWGHT_None
Definition: geo_tools.h:686
CSG_Rect_Int::Intersects
TSG_Intersection Intersects(const CSG_Rect_Int &Rect) const
Definition: geo_classes.cpp:1224
uLong
unsigned long long uLong
Definition: api_core.h:159
CSG_Points::Assign
bool Assign(const CSG_Points &Points)
Definition: geo_classes.cpp:334
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:506
CSG_Array::Get_Entry
void * Get_Entry(sLong Index) const
Returns a pointer to the memory address of the requested variable. You have to type cast and derefere...
Definition: api_core.h:331
CSG_Parameters::Add_Bool
CSG_Parameter * Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
Definition: parameters.cpp:396
geo_tools.h
CSG_Rects::operator=
CSG_Rects & operator=(const CSG_Rects &Rects)
Definition: geo_classes.cpp:977
CSG_Distance_Weighting::Set_BandWidth
bool Set_BandWidth(double Value)
Definition: geo_classes.cpp:1499
CSG_Parameters::Add_Choice
CSG_Parameter * Add_Choice(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items, int Default=0)
Definition: parameters.cpp:464