SAGA API  v9.7
shapes.h
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 // shapes.h //
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 #ifndef HEADER_INCLUDED__SAGA_API__shapes_H
54 #define HEADER_INCLUDED__SAGA_API__shapes_H
55 
56 
58 // //
59 // //
60 // //
62 
63 //---------------------------------------------------------
73 // //
75 // //
76 // //
78 
79 //---------------------------------------------------------
80 #include "table.h"
81 
82 
84 // //
85 // //
86 // //
88 
89 //---------------------------------------------------------
90 typedef enum
91 {
95 }
97 
98 //---------------------------------------------------------
99 typedef enum
100 {
106 }
108 
109 //---------------------------------------------------------
111 
112 //---------------------------------------------------------
113 typedef enum
114 {
119 }
121 
122 //---------------------------------------------------------
123 typedef enum
124 {
128  SHAPE_COPY
129 }
131 
132 
134 // //
135 // //
136 // //
138 
139 //---------------------------------------------------------
141 {
142  friend class CSG_Shapes;
143 
144 public:
145 
146  //-----------------------------------------------------
147  virtual void Destroy (void);
148 
149  virtual bool Assign (CSG_Table_Record *pRecord);
150  virtual bool Assign (CSG_Table_Record *pRecord, bool bAssign_Attributes);
151  virtual bool Assign (CSG_Table_Record *pRecord, TSG_ADD_Shape_Copy_Mode mCopy);
152 
153  TSG_Shape_Type Get_Type (void) const;
154  TSG_Vertex_Type Get_Vertex_Type (void) const;
155 
156  class CSG_Shape_Point * asPoint (void) const { return( Get_Type() == SHAPE_TYPE_Point ? (CSG_Shape_Point *)this : NULL ); }
157  class CSG_Shape_Points * asPoints (void) const { return( Get_Type() == SHAPE_TYPE_Points ? (CSG_Shape_Points *)this : NULL ); }
158  class CSG_Shape_Line * asLine (void) const { return( Get_Type() == SHAPE_TYPE_Line ? (CSG_Shape_Line *)this : NULL ); }
159  class CSG_Shape_Polygon * asPolygon (void) const { return( Get_Type() == SHAPE_TYPE_Polygon ? (CSG_Shape_Polygon *)this : NULL ); }
160 
161  //-----------------------------------------------------
162  virtual int Get_Point_Count (void) const = 0;
163  virtual int Get_Point_Count (int iPart) const = 0;
164  virtual int Get_Part_Count (void) const = 0;
165 
166  virtual int Add_Part (class CSG_Shape_Part *pPart, bool bRevert = false) { return( -1 ); }
167  virtual CSG_Shape_Part * Get_Part (int iPart) const { return( NULL ); }
168  virtual int Del_Part (int iPart) { return( -1 ); }
169  virtual int Del_Parts (void) { return( -1 ); }
170 
171  virtual int Add_Point (double x, double y, int iPart = 0) = 0;
172  virtual int Add_Point (const CSG_Point &p, int iPart = 0) = 0;
173  virtual int Add_Point (const CSG_Point_3D &p, int iPart = 0) = 0;
174  virtual int Add_Point (const CSG_Point_4D &p, int iPart = 0) = 0;
175 
176  virtual int Ins_Point (double x, double y, int iPoint , int iPart = 0) = 0;
177  virtual int Ins_Point (const CSG_Point &p, int iPoint , int iPart = 0) = 0;
178  virtual int Ins_Point (const CSG_Point_3D &p, int iPoint , int iPart = 0) = 0;
179  virtual int Ins_Point (const CSG_Point_4D &p, int iPoint , int iPart = 0) = 0;
180 
181  virtual int Set_Point (double x, double y, int iPoint = 0, int iPart = 0) = 0;
182  virtual int Set_Point (const CSG_Point &p, int iPoint = 0, int iPart = 0) = 0;
183  virtual int Set_Point (const CSG_Point_3D &p, int iPoint = 0, int iPart = 0) = 0;
184  virtual int Set_Point (const CSG_Point_4D &p, int iPoint = 0, int iPart = 0) = 0;
185 
186  virtual int Del_Point ( int iPoint , int iPart = 0) = 0;
187 
188  virtual TSG_Point Get_Point (int iPoint = 0) const = 0;
189  virtual TSG_Point Get_Point (int iPoint, int iPart, bool bAscending = true) const = 0;
190 
191  //-----------------------------------------------------
192  virtual void Set_Z (double z, int iPoint = 0, int iPart = 0) { }
193  virtual double Get_Z (int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( 0. ); }
194  virtual double Get_ZMin (void) { return( 0. ); }
195  virtual double Get_ZMax (void) { return( 0. ); }
196  virtual TSG_Point_3D Get_Point_Z (int iPoint = 0, int iPart = 0, bool bAscending = true) const
197  {
198  TSG_Point_3D Point; TSG_Point p = Get_Point(iPoint, iPart, bAscending);
199 
200  Point.x = p.x;
201  Point.y = p.y;
202  Point.z = Get_Z(iPoint, iPart, bAscending);
203 
204  return( Point );
205  }
206 
207  //-----------------------------------------------------
208  virtual void Set_M (double m, int iPoint = 0, int iPart = 0) { }
209  virtual double Get_M (int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( 0. ); }
210  virtual double Get_MMin (void) { return( 0. ); }
211  virtual double Get_MMax (void) { return( 0. ); }
212  virtual TSG_Point_4D Get_Point_ZM (int iPoint = 0, int iPart = 0, bool bAscending = true) const
213  {
214  TSG_Point_4D Point; TSG_Point p = Get_Point(iPoint, iPart, bAscending);
215 
216  Point.x = p.x;
217  Point.y = p.y;
218  Point.z = Get_Z(iPoint, iPart, bAscending);
219  Point.m = Get_M(iPoint, iPart, bAscending);
220 
221  return( Point );
222  }
223 
224  //-----------------------------------------------------
225  virtual const CSG_Rect & Get_Extent (void) = 0;
226  virtual const CSG_Rect & Get_Extent (int iPart) { return( Get_Extent() ); }
227 
228  virtual TSG_Point Get_Centroid (void) = 0;
229 
231  TSG_Intersection Intersects (const TSG_Rect &Extent);
232 
233  virtual double Get_Distance (TSG_Point Point ) const = 0;
234  virtual double Get_Distance (TSG_Point Point , int iPart) const = 0;
235  virtual double Get_Distance (TSG_Point Point, TSG_Point &Next ) const = 0;
236  virtual double Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const = 0;
237 
238  virtual bool Revert_Points (int iPart) { return( true ); }
239 
240 
241 protected:
242 
243  CSG_Shape(class CSG_Shapes *pOwner, sLong Index);
244  virtual ~CSG_Shape(void);
245 
246  virtual bool On_Assign (CSG_Shape *pShape) = 0;
247  virtual TSG_Intersection On_Intersects (CSG_Shape *pShape) = 0;
249 
250  virtual void _Invalidate (void);
251 
252 };
253 
254 
256 // //
257 // Point //
258 // //
260 
261 //---------------------------------------------------------
263 {
264  friend class CSG_Shapes;
265 
266 public:
267 
268  virtual bool is_Valid (void) const { return( true ); }
269 
270  virtual int Get_Point_Count (void) const { return( 1 ); }
271  virtual int Get_Point_Count (int iPart) const { return( 1 ); }
272  virtual int Get_Part_Count (void) const { return( 1 ); }
273 
274  virtual int Add_Point (double x, double y, int iPart = 0) { return( Set_Point(x, y, 0) ); }
275  virtual int Add_Point (const CSG_Point &p, int iPart = 0) { return( Set_Point(p , 0) ); }
276  virtual int Add_Point (const CSG_Point_3D &p, int iPart = 0) { return( Set_Point(p , 0) ); }
277  virtual int Add_Point (const CSG_Point_4D &p, int iPart = 0) { return( Set_Point(p , 0) ); }
278 
279  virtual int Ins_Point (double x, double y, int iPoint , int iPart = 0) { return( Set_Point(x, y, 0) ); }
280  virtual int Ins_Point (const CSG_Point &p, int iPoint , int iPart = 0) { return( Set_Point(p , 0) ); }
281  virtual int Ins_Point (const CSG_Point_3D &p, int iPoint , int iPart = 0) { return( Set_Point(p , 0) ); }
282  virtual int Ins_Point (const CSG_Point_4D &p, int iPoint , int iPart = 0) { return( Set_Point(p , 0) ); }
283 
284  virtual int Set_Point (double x, double y, int iPoint = 0, int iPart = 0) { m_Point.x = x; m_Point.y = y; _Invalidate(); return( 1 ); }
285  virtual int Set_Point (const CSG_Point &p, int iPoint = 0, int iPart = 0) { m_Point.x = p.x; m_Point.y = p.y; _Invalidate(); return( 1 ); }
286  virtual int Set_Point (const CSG_Point_3D &p, int iPoint = 0, int iPart = 0) { m_Point.x = p.x; m_Point.y = p.y; Set_Z(p.z, 0); _Invalidate(); return( 1 ); }
287  virtual int Set_Point (const CSG_Point_4D &p, int iPoint = 0, int iPart = 0) { m_Point.x = p.x; m_Point.y = p.y; Set_Z(p.z, 0); Set_M(p.m, 0); _Invalidate(); return( 1 ); }
288 
289  virtual int Del_Point ( int iPoint , int iPart = 0) { return( -1 ); }
290 
291  virtual TSG_Point Get_Point (int iPoint = 0) const { return( m_Point ); }
292  virtual TSG_Point Get_Point (int iPoint, int iPart, bool bAscending = true) const { return( m_Point ); }
293 
294  virtual TSG_Point Get_Centroid (void) { return( m_Point ); }
295 
296  virtual const CSG_Rect & Get_Extent (void);
297 
298  virtual double Get_Distance (TSG_Point Point ) const { return( SG_Get_Distance(Point, m_Point) ); }
299  virtual double Get_Distance (TSG_Point Point , int iPart) const { return( SG_Get_Distance(Point, m_Point) ); }
300  virtual double Get_Distance (TSG_Point Point, TSG_Point &Next ) const { Next = m_Point; return( SG_Get_Distance(Point, m_Point) ); }
301  virtual double Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const { Next = m_Point; return( SG_Get_Distance(Point, m_Point) ); }
302 
303 
304 protected:
305 
306  CSG_Shape_Point(class CSG_Shapes *pOwner, sLong Index);
307  virtual ~CSG_Shape_Point(void);
308 
309 
311 
312 
313  virtual bool On_Assign (CSG_Shape *pShape);
314  virtual TSG_Intersection On_Intersects (CSG_Shape *pShape);
315  virtual TSG_Intersection On_Intersects (TSG_Rect Region);
316 
317 };
318 
319 //---------------------------------------------------------
321 {
322  friend class CSG_Shapes;
323 
324 public:
325 
326  CSG_Shape_Point_Z(class CSG_Shapes *pOwner, sLong Index) : CSG_Shape_Point(pOwner, Index) { m_Z = 0.; }
327 
328  virtual void Set_Z (double z, int iPoint = 0, int iPart = 0) { m_Z = z; _Invalidate(); }
329  virtual double Get_Z (int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( m_Z ); }
330  virtual double Get_ZMin (void) { return( m_Z ); }
331  virtual double Get_ZMax (void) { return( m_Z ); }
332 
333 
334 private:
335 
336  double m_Z;
337 
338 };
339 
340 //---------------------------------------------------------
342 {
343  friend class CSG_Shapes;
344 
345 public:
346 
347  CSG_Shape_Point_ZM(class CSG_Shapes *pOwner, sLong Index) : CSG_Shape_Point_Z(pOwner, Index) { m_M = 0.; }
348 
349  virtual void Set_M (double m, int iPoint = 0, int iPart = 0) { m_M = m; _Invalidate(); }
350  virtual double Get_M (int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( m_M ); }
351  virtual double Get_MMin (void) { return( m_M ); }
352  virtual double Get_MMax (void) { return( m_M ); }
353 
354 
355 private:
356 
357  double m_M;
358 
359 };
360 
361 
363 // //
364 // Points //
365 // //
367 
368 //---------------------------------------------------------
370 {
371  friend class CSG_Shape_Points;
372  friend class CSG_Shape_Line;
373  friend class CSG_Shape_Polygon;
374 
375 public:
376 
377  class CSG_Shape_Points * Get_Owner (void) { return( m_pOwner ); }
378 
379  virtual bool Destroy (void);
380  virtual bool Assign (CSG_Shape_Part *pPart);
381 
382  const CSG_Rect & Get_Extent (void) { _Update_Extent(); return( m_Extent ); }
383 
384  int Get_Count (void) const { return( m_nPoints ); }
385 
386  TSG_Point Get_Point (int iPoint, bool bAscending = true) const
387  {
388  if( iPoint >= 0 && iPoint < m_nPoints )
389  {
390  return( m_Points[bAscending ? iPoint : m_nPoints - 1 - iPoint] );
391  }
392 
393  return( (TSG_Point)CSG_Point(0., 0.) );
394  }
395 
396 
397  int Add_Point (double x, double y ) { return( Ins_Point(x, y, m_nPoints) ); }
398  int Add_Point (const CSG_Point &p) { return( Ins_Point(p , m_nPoints) ); }
399  int Add_Point (const CSG_Point_3D &p) { return( Ins_Point(p , m_nPoints) ); }
400  int Add_Point (const CSG_Point_4D &p) { return( Ins_Point(p , m_nPoints) ); }
401 
402  int Ins_Point (double x, double y , int iPoint);
403  int Ins_Point (const CSG_Point &p, int iPoint) { return( Ins_Point(p.x, p.y, iPoint) ); }
404  int Ins_Point (const CSG_Point_3D &p, int iPoint);
405  int Ins_Point (const CSG_Point_4D &p, int iPoint);
406 
407  int Set_Point (double x, double y , int iPoint);
408  int Set_Point (const CSG_Point &p, int iPoint) { return( Set_Point(p.x, p.y, iPoint) ); }
409  int Set_Point (const CSG_Point_3D &p, int iPoint);
410  int Set_Point (const CSG_Point_4D &p, int iPoint);
411 
412  int Del_Point ( int iPoint);
413 
414  void Set_Z (double z, int iPoint) { if ( m_Z && iPoint >= 0 && iPoint < m_nPoints ) { m_Z[iPoint] = z; _Invalidate(); } }
415  double Get_Z (int iPoint, bool bAscending = true) const { return( m_Z && iPoint >= 0 && iPoint < m_nPoints ? m_Z[bAscending ? iPoint : m_nPoints - 1 - iPoint] : 0. ); }
416  double Get_ZMin (void) { _Update_Extent(); return( m_ZMin ); }
417  double Get_ZMax (void) { _Update_Extent(); return( m_ZMax ); }
418  TSG_Point_3D Get_Point_Z (int iPoint, bool bAscending = true) const
419  {
420  TSG_Point_3D Point; TSG_Point p = Get_Point(iPoint, bAscending);
421 
422  Point.x = p.x;
423  Point.y = p.y;
424  Point.z = Get_Z(iPoint, bAscending);
425 
426  return( Point );
427  }
428 
429  void Set_M (double m, int iPoint) { if ( m_M && iPoint >= 0 && iPoint < m_nPoints ) { m_M[iPoint] = m; _Invalidate(); } }
430  double Get_M (int iPoint, bool bAscending = true) const { return( m_M && iPoint >= 0 && iPoint < m_nPoints ? m_M[bAscending ? iPoint : m_nPoints - 1 - iPoint] : 0. ); }
431  double Get_MMin (void) { _Update_Extent(); return( m_MMin ); }
432  double Get_MMax (void) { _Update_Extent(); return( m_MMax ); }
433  TSG_Point_4D Get_Point_ZM (int iPoint, bool bAscending = true) const
434  {
435  TSG_Point_4D Point; TSG_Point p = Get_Point(iPoint, bAscending);
436 
437  Point.x = p.x;
438  Point.y = p.y;
439  Point.z = Get_Z(iPoint, bAscending);
440  Point.m = Get_M(iPoint, bAscending);
441 
442  return( Point );
443  }
444 
445  bool Add_Points (CSG_Shape_Part *pPoints, bool bAscending = true);
446 
447  bool Revert_Points (void);
448 
449 
450 protected:
451 
452  CSG_Shape_Part(class CSG_Shape_Points *pOwner);
453  virtual ~CSG_Shape_Part(void);
454 
455 
456  bool m_bUpdate;
457 
458  int m_nPoints, m_nBuffer;
459 
460  double *m_Z, m_ZMin, m_ZMax, *m_M, m_MMin, m_MMax;
461 
463 
465 
467 
468 
469  virtual bool _Alloc_Memory (int nPoints);
470  virtual void _Invalidate (void);
471  virtual void _Update_Extent (void);
472 
473 };
474 
475 
477 // //
478 // Points //
479 // //
481 
482 //---------------------------------------------------------
484 {
485  friend class CSG_Shapes;
486  friend class CSG_Shape_Part;
487 
488 public:
489 
490  virtual void Destroy (void);
491 
492  virtual bool is_Valid (void) const { return( m_nParts > 0 && m_pParts[0]->Get_Count() > 0 ); }
493 
494  virtual int Get_Point_Count (void) const { return( m_nPoints ); }
495  virtual int Get_Point_Count (int iPart) const { return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart]->Get_Count() : 0 ); }
496  virtual int Get_Part_Count (void) const { return( m_nParts ); }
497 
498  virtual int Add_Part (class CSG_Shape_Part *pPart, bool bRevert = false);
499  virtual CSG_Shape_Part * Get_Part (int iPart) const { return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart] : NULL ); }
500  virtual int Del_Part (int iPart);
501  virtual int Del_Parts (void);
502 
503  virtual int Add_Point (double x, double y, int iPart = 0) { return( Ins_Point(x, y, Get_Point_Count(iPart), iPart) ); }
504  virtual int Add_Point (const CSG_Point &p, int iPart = 0) { return( Ins_Point(p , Get_Point_Count(iPart), iPart) ); }
505  virtual int Add_Point (const CSG_Point_3D &p, int iPart = 0) { return( Ins_Point(p , Get_Point_Count(iPart), iPart) ); }
506  virtual int Add_Point (const CSG_Point_4D &p, int iPart = 0) { return( Ins_Point(p , Get_Point_Count(iPart), iPart) ); }
507 
508  virtual int Ins_Point (double x, double y, int iPoint , int iPart = 0);
509  virtual int Ins_Point (const CSG_Point &p, int iPoint , int iPart = 0) { return( Ins_Point(p.x, p.y, iPoint, iPart) ); }
510  virtual int Ins_Point (const CSG_Point_3D &p, int iPoint , int iPart = 0);
511  virtual int Ins_Point (const CSG_Point_4D &p, int iPoint , int iPart = 0);
512 
513  virtual int Set_Point (double x, double y, int iPoint = 0, int iPart = 0);
514  virtual int Set_Point (const CSG_Point &p, int iPoint = 0, int iPart = 0) { return( Set_Point(p.x, p.y, iPoint, iPart) ); }
515  virtual int Set_Point (const CSG_Point_3D &p, int iPoint = 0, int iPart = 0);
516  virtual int Set_Point (const CSG_Point_4D &p, int iPoint = 0, int iPart = 0);
517 
518  virtual int Del_Point ( int iPoint , int iPart = 0);
519 
520  virtual TSG_Point Get_Point (int iPoint = 0) const;
521  virtual TSG_Point Get_Point (int iPoint, int iPart, bool bAscending = true) const
522  {
523  if( iPart >= 0 && iPart < m_nParts )
524  {
525  return( m_pParts[iPart]->Get_Point(iPoint, bAscending) );
526  }
527 
528  return( (TSG_Point)CSG_Point(0., 0.) );
529  }
530 
531  virtual void Set_Z (double z, int iPoint = 0, int iPart = 0) { if ( iPart >= 0 && iPart < m_nParts ) m_pParts[iPart]->Set_Z(z, iPoint); }
532  virtual double Get_Z ( int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart]->Get_Z( iPoint, bAscending) : 0. ); }
533  virtual double Get_ZMin (void) { _Update_Extent(); return( m_ZMin ); }
534  virtual double Get_ZMax (void) { _Update_Extent(); return( m_ZMax ); }
535 
536  virtual void Set_M (double m, int iPoint = 0, int iPart = 0) { if ( iPart >= 0 && iPart < m_nParts ) m_pParts[iPart]->Set_M(m, iPoint); }
537  virtual double Get_M ( int iPoint = 0, int iPart = 0, bool bAscending = true) const { return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart]->Get_M( iPoint, bAscending) : 0. ); }
538  virtual double Get_MMin (void) { _Update_Extent(); return( m_MMin ); }
539  virtual double Get_MMax (void) { _Update_Extent(); return( m_MMax ); }
540 
541  virtual const CSG_Rect & Get_Extent (void) { _Update_Extent(); return( m_Extent ); }
542 
543  virtual TSG_Point Get_Centroid (void);
544 
545  virtual double Get_Distance (TSG_Point Point ) const;
546  virtual double Get_Distance (TSG_Point Point , int iPart) const;
547  virtual double Get_Distance (TSG_Point Point, TSG_Point &Next ) const;
548  virtual double Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const;
549 
550  virtual bool Revert_Points (int iPart) { return( iPart >= 0 && iPart < m_nParts ? m_pParts[iPart]->Revert_Points() : false ); }
551 
552 
553 protected:
554 
555  CSG_Shape_Points(class CSG_Shapes *pOwner, sLong Index);
556  virtual ~CSG_Shape_Points(void);
557 
558 
559  bool m_bUpdate;
560 
561  int m_nParts, m_nPoints;
562 
564 
566 
568 
569 
570  int _Add_Part (void);
571 
572  virtual CSG_Shape_Part * _Get_Part (void) { return( new CSG_Shape_Part(this) ); }
573 
574  virtual void _Invalidate (void)
575  {
576  if( !m_bUpdate )
577  {
578  m_bUpdate = true;
579 
581  }
582  }
583 
584  void _Update_Extent (void);
585 
586  virtual bool On_Assign (CSG_Shape *pShape);
587  virtual TSG_Intersection On_Intersects (CSG_Shape *pShape);
588  virtual TSG_Intersection On_Intersects (TSG_Rect Region);
589 
590 };
591 
592 
594 // //
595 // Line //
596 // //
598 
599 //---------------------------------------------------------
601 {
602  friend class CSG_Shapes;
603 
604 public:
605 
606  virtual bool is_Valid (void) const { return( m_nParts > 0 && m_pParts[0]->Get_Count() > 1 ); }
607 
608  virtual TSG_Point Get_Centroid (void);
609 
610  double Get_Length (void);
611  double Get_Length (int iPart);
612 
613  virtual double Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const;
614 
615 
616 protected:
617 
618  CSG_Shape_Line(class CSG_Shapes *pOwner, sLong Index);
619  virtual ~CSG_Shape_Line(void);
620 
621  virtual TSG_Intersection On_Intersects (CSG_Shape *pShape);
622  virtual TSG_Intersection On_Intersects (TSG_Rect Region);
623 
624 };
625 
626 
628 // //
629 // Polygon //
630 // //
632 
633 //---------------------------------------------------------
634 typedef enum
635 {
640 }
642 
643 //---------------------------------------------------------
645 {
646  friend class CSG_Shape_Polygon;
647 
648 public:
649 
650  bool is_Clockwise (void) { _Update_Area(); return( m_bClockwise == 1 ); }
651 
652  double Get_Perimeter (void) { _Update_Area(); return( m_Perimeter ); }
653 
654  double Get_Area (void) { _Update_Area(); return( m_Area ); }
655 
656  const TSG_Point & Get_Centroid (void) { _Update_Area(); return( m_Centroid ); }
657 
659  TSG_Polygon_Point_Relation Get_Point_Relation (double x, double y);
660 
661  bool is_OnEdge (const CSG_Point &p);
662  bool is_OnEdge (double x, double y);
663 
664  bool Contains (const CSG_Point &p);
665  bool Contains (double x, double y);
666 
667  bool is_Neighbour (CSG_Shape_Polygon_Part *pPart, bool bSimpleCheck = true);
668 
669  CSG_Lines Get_Shared_Edges (CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon = 0.);
670  double Get_Shared_Length (CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon = 0.);
671 
672  double Get_Distance (TSG_Point Point, TSG_Point &Next);
673 
674 
675 protected:
676 
678  virtual ~CSG_Shape_Polygon_Part(void);
679 
680 
681  int m_bClockwise, m_bLake;
682 
683  double m_Area, m_Perimeter;
684 
686 
687 
688  virtual void _Invalidate (void);
689 
690  void _Update_Area (void);
691 
692  void _Add_Edge_Points (CSG_Shape_Polygon_Part *pPart, const CSG_Point &P0, const CSG_Point &P1, CSG_Points &Part, double Epsilon);
693  bool _is_OnEdge (CSG_Shape_Polygon_Part *pPart, const CSG_Point &P, bool bVertex , double Epsilon);
694 
695 };
696 
697 //---------------------------------------------------------
699 {
700  friend class CSG_Shapes;
701 
702 public:
703 
704  virtual bool is_Valid (void) const { return( m_nParts > 0 && m_pParts[0]->Get_Count() > 2 ); }
705 
706 
707  CSG_Shape_Polygon_Part * Get_Polygon_Part (int iPart) const { return( (CSG_Shape_Polygon_Part *)Get_Part(iPart) ); }
708 
709  bool is_Lake (int iPart);
710 
711  bool is_Clockwise (int iPart);
712 
713  double Get_Perimeter (int iPart);
714  double Get_Perimeter (void);
715 
716  double Get_Area (int iPart);
717  double Get_Area (void);
718 
719  TSG_Point Get_Centroid (int iPart);
720  TSG_Point Get_Centroid (void);
721 
722  TSG_Polygon_Point_Relation Get_Point_Relation (const CSG_Point &p, int iPart);
723  TSG_Polygon_Point_Relation Get_Point_Relation (double x, double y, int iPart);
724  TSG_Polygon_Point_Relation Get_Point_Relation (const CSG_Point &p);
725  TSG_Polygon_Point_Relation Get_Point_Relation (double x, double y);
726 
727 
728  bool is_OnEdge (const CSG_Point &p, int iPart);
729  bool is_OnEdge (double x, double y, int iPart);
730  bool is_OnEdge (const CSG_Point &p);
731  bool is_OnEdge (double x, double y);
732 
733  bool Contains (const CSG_Point &p, int iPart);
734  bool Contains (double x, double y, int iPart);
735  bool Contains (const CSG_Point &p);
736  bool Contains (double x, double y);
737 
738  bool is_Neighbour (CSG_Shape_Polygon *pPolygon, bool bSimpleCheck = true);
739 
740  CSG_Lines Get_Shared_Edges (CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon = 0.);
741  double Get_Shared_Length (CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon = 0.);
742 
743  virtual double Get_Distance (TSG_Point Point, TSG_Point &Next, int iPart) const;
744 
745 
746 protected:
747 
748  CSG_Shape_Polygon(class CSG_Shapes *pOwner, sLong Index);
749  virtual ~CSG_Shape_Polygon(void);
750 
751 
753 
754 
755  virtual CSG_Shape_Part * _Get_Part (void) { return( new CSG_Shape_Polygon_Part(this) ); }
756 
757  virtual void _Invalidate (void);
758 
759  virtual TSG_Intersection On_Intersects (CSG_Shape *pShape);
760  virtual TSG_Intersection On_Intersects (TSG_Rect Region);
761 
762 };
763 
764 
766 // //
767 // Shapes //
768 // //
770 
771 //---------------------------------------------------------
773 {
774  friend class CSG_Shape;
775 
776 public:
777 
778  CSG_Shapes(void);
779 
780  CSG_Shapes (const CSG_Shapes &Shapes);
781  bool Create (const CSG_Shapes &Shapes);
782 
783  CSG_Shapes (const char *File);
784  bool Create (const char *File);
785  CSG_Shapes (const wchar_t *File);
786  bool Create (const wchar_t *File);
787  CSG_Shapes (const CSG_String &File);
788  bool Create (const CSG_String &File);
789 
790  CSG_Shapes (TSG_Shape_Type Type, const SG_Char *Name = NULL, CSG_Table *pTemplate = NULL, TSG_Vertex_Type Vertex_Type = SG_VERTEX_TYPE_XY);
791  bool Create (TSG_Shape_Type Type, const SG_Char *Name = NULL, CSG_Table *pTemplate = NULL, TSG_Vertex_Type Vertex_Type = SG_VERTEX_TYPE_XY);
792 
793  virtual ~CSG_Shapes(void);
794 
795  virtual bool Destroy (void);
796 
798 
799  virtual bool Assign (CSG_Data_Object *pObject);
800 
801  virtual bool Save (const CSG_String &File, int Format = 0);
802  virtual bool Save (const char *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
803  virtual bool Save (const wchar_t *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
804 
805  virtual bool is_Valid (void) const { return( m_Type != SHAPE_TYPE_Undefined && Get_Count() >= 0 ); }
806 
807  virtual TSG_Shape_Type Get_Type (void) const { return( m_Type ); }
808 
809  TSG_Vertex_Type Get_Vertex_Type (void) const { return( m_Vertex_Type ); }
810 
811  virtual const CSG_Rect & Get_Extent (void) { Update(); return( m_Extent ); }
812 
813  double Get_ZMin (void) { Update(); return( m_ZMin ); }
814  double Get_ZMax (void) { Update(); return( m_ZMax ); }
815  double Get_MMin (void) { Update(); return( m_MMin ); }
816  double Get_MMax (void) { Update(); return( m_MMax ); }
817 
818  //-----------------------------------------------------
819  virtual CSG_Shape * Add_Shape (CSG_Table_Record *pCopy = NULL, TSG_ADD_Shape_Copy_Mode mCopy = SHAPE_COPY);
820  virtual bool Del_Shape (sLong Index);
821  virtual bool Del_Shape (CSG_Shape *pShape);
822  virtual bool Del_Shapes (void) { return( Del_Records() ); }
823 
824  virtual CSG_Shape * Get_Shape (const CSG_Point &Point, double Epsilon = 0.);
825  virtual CSG_Shape * Get_Shape (sLong Index) const { return( (CSG_Shape *)Get_Record (Index) ); }
826  virtual CSG_Shape * Get_Shape_byIndex (sLong Index) const { return( (CSG_Shape *)Get_Record_byIndex(Index) ); }
827 
828  //-----------------------------------------------------
829  bool Make_Clean (void);
830 
831  //-----------------------------------------------------
832  virtual const CSG_Rect & Get_Selection_Extent (void);
833  virtual CSG_Shape * Get_Selection (sLong Index = 0) { return( (CSG_Shape *)CSG_Table::Get_Selection(Index) ); };
834 
835  virtual bool Select (sLong Index , bool bInvert = false);
836  virtual bool Select (CSG_Table_Record *pShape = NULL, bool bInvert = false);
837  virtual bool Select (const TSG_Rect &Extent , bool bInvert = false);
838  virtual bool Select (const TSG_Point &Point , bool bInvert = false);
839 
840 
841 protected:
842 
843  double m_ZMin, m_ZMax, m_MMin, m_MMax;
844 
846 
848 
850 
851 
852  virtual bool On_Update (void);
853  virtual bool On_Reload (void);
854  virtual bool On_Delete (void);
855 
856  virtual void _On_Construction (void);
857 
858  virtual CSG_Table_Record * _Get_New_Record (sLong Index);
859 
860 
861 private:
862 
863  bool _Load_GDAL (const CSG_String &File);
864  bool _Save_GDAL (const CSG_String &File, const CSG_String &Driver);
865 
866  bool _Load_ESRI (const CSG_String &File);
867  bool _Save_ESRI (const CSG_String &File);
868 
869 };
870 
871 
873 // //
874 // //
875 // //
877 
878 //---------------------------------------------------------
881 
884 
886 SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes (const char *File);
888 SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes (const wchar_t *File);
891 
893 SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes (TSG_Shape_Type Type, const SG_Char *Name = NULL, CSG_Table *pTemplate = NULL, TSG_Vertex_Type Vertex_Type = SG_VERTEX_TYPE_XY);
894 
897 
898 
899 //---------------------------------------------------------
903 
904 
906 // //
907 // Point Region QuadTree //
908 // //
910 
911 //---------------------------------------------------------
913 {
914 public:
915 
916  virtual bool is_Leaf (void) const { return( false ); }
917  virtual bool is_Node (void) const { return( false ); }
918  virtual bool has_Statistics (void) const { return( false ); }
919 
920  const CSG_Rect & Get_Extent (void) const { return( m_Extent ); }
921  double Get_xMin (void) const { return( m_Extent.xMin ); }
922  double Get_xCenter (void) const { return( m_Extent.Get_XCenter() ); }
923  double Get_xMax (void) const { return( m_Extent.xMax ); }
924  double Get_yMin (void) const { return( m_Extent.yMin ); }
925  double Get_yCenter (void) const { return( m_Extent.Get_YCenter() ); }
926  double Get_yMax (void) const { return( m_Extent.yMax ); }
927  double Get_Size (void) const { return( m_Extent.Get_XRange() ); }
928 
929  bool Contains (const CSG_Point &p) const { return( m_Extent.Contains(p ) ); }
930  bool Contains (double x, double y) const { return( m_Extent.Contains(x, y) ); }
931 
932  class CSG_PRQuadTree_Leaf * asLeaf (void) const { return( (class CSG_PRQuadTree_Leaf *)this ); }
933  class CSG_PRQuadTree_Node * asNode (void) const { return( (class CSG_PRQuadTree_Node *)this ); }
934 
935 
936 protected:
937 
938  CSG_PRQuadTree_Item(const CSG_Rect &Extent, int Quadrant = -1) { Set_Extent(Extent, Quadrant); }
939 
940  virtual ~CSG_PRQuadTree_Item(void) {}
941 
942  void Set_Extent (const CSG_Rect &Extent, int Quadrant = -1)
943  {
944  switch( Quadrant )
945  {
946  case 0: m_Extent.Assign(Extent.Get_XMin (), Extent.Get_YMin (), Extent.Get_XCenter(), Extent.Get_YCenter()); break; // bottom left
947  case 1: m_Extent.Assign(Extent.Get_XMin (), Extent.Get_YCenter(), Extent.Get_XCenter(), Extent.Get_YMax ()); break; // top left
948  case 2: m_Extent.Assign(Extent.Get_XCenter(), Extent.Get_YCenter(), Extent.Get_XMax (), Extent.Get_YMax ()); break; // top right
949  case 3: m_Extent.Assign(Extent.Get_XCenter(), Extent.Get_YMin (), Extent.Get_XMax (), Extent.Get_YCenter()); break; // bottom right
950  default: m_Extent.Assign(Extent); break;
951  }
952  }
953 
954  int Get_Quadrant (const TSG_Point &p) const { return( Get_Quadrant(p.x, p.y) ); }
955 
956  int Get_Quadrant (double x, double y) const
957  {
958  return( y < Get_yCenter() ? (x < Get_xCenter() ? 0 : 3) : (x < Get_xCenter() ? 1 : 2) );
959  }
960 
961 
963 
964 };
965 
966 //---------------------------------------------------------
968 {
969  friend class CSG_PRQuadTree_Node;
970 
971 public:
972 
973  virtual bool is_Leaf (void) const { return( true ); }
974 
975  const TSG_Point & Get_Point (void) const { return( m_Point ); }
976  double Get_X (void) const { return( m_Point.x ); }
977  double Get_Y (void) const { return( m_Point.y ); }
978  double Get_Z (void) const { return( m_z ); }
979 
980 
981 protected:
982 
983  CSG_PRQuadTree_Leaf(const CSG_Rect &Extent, int Quadrant, double x, double y, double z)
984  : CSG_PRQuadTree_Item(Extent, Quadrant)
985  {
986  m_Point.x = x;
987  m_Point.y = y;
988  m_z = z;
989  }
990 
991  virtual ~CSG_PRQuadTree_Leaf(void) {}
992 
993 
994  double m_z;
995 
997 
998 };
999 
1000 //---------------------------------------------------------
1002 {
1003  friend class CSG_PRQuadTree_Node;
1004 
1005 public:
1006 
1007  virtual bool has_Statistics (void) const { return( true ); }
1008 
1009  sLong Get_Count (void) { return( s_z.Get_Count () ); }
1010  double Get_Value (sLong i) { return( s_z.Get_Value (i) ); }
1011  double Get_Minimum (void) { return( s_z.Get_Minimum () ); }
1012  double Get_Maximum (void) { return( s_z.Get_Maximum () ); }
1013  double Get_Range (void) { return( s_z.Get_Range () ); }
1014  double Get_Sum (void) { return( s_z.Get_Sum () ); }
1015  double Get_Mean (void) { return( s_z.Get_Mean () ); }
1016  double Get_Variance (void) { return( s_z.Get_Variance() ); }
1017  double Get_StdDev (void) { return( s_z.Get_StdDev () ); }
1018 
1019 
1020 protected:
1021 
1022  CSG_PRQuadTree_Leaf_List(const CSG_Rect &Extent, int Quadrant, double x, double y, double z)
1023  : CSG_PRQuadTree_Leaf(Extent, Quadrant, x, y, z)
1024  {
1025  s_z.Create(true);
1026 
1027  s_z.Add_Value(z);
1028  }
1029 
1030  virtual ~CSG_PRQuadTree_Leaf_List(void) {}
1031 
1032  void Add_Value (double z)
1033  {
1034  s_z.Add_Value(z);
1035 
1036  m_z = s_z.Get_Mean();
1037  }
1038 
1040 
1041 };
1042 
1043 //---------------------------------------------------------
1045 {
1046  friend class CSG_PRQuadTree;
1047 
1048 public:
1049 
1050  virtual bool is_Node (void) const { return( true ); }
1051 
1052  CSG_PRQuadTree_Item * Get_Child (int Quadrant) const { return( Quadrant >= 0 && Quadrant < 4 ? m_pChildren[Quadrant] : NULL ); }
1053  CSG_PRQuadTree_Item * Get_Child (double x, double y);
1054 
1055  bool Add_Point (double x, double y, double z);
1056 
1057  virtual CSG_Simple_Statistics * Get_X (void) { return( NULL ); }
1058  virtual CSG_Simple_Statistics * Get_Y (void) { return( NULL ); }
1059  virtual CSG_Simple_Statistics * Get_Z (void) { return( NULL ); }
1060 
1061 
1062 protected:
1063 
1064  CSG_PRQuadTree_Node(const CSG_Rect &Extent, int Quadrant = -1);
1066  virtual ~CSG_PRQuadTree_Node(void);
1067 
1068 
1069  CSG_PRQuadTree_Item *m_pChildren[4];
1070 
1071 };
1072 
1073 //---------------------------------------------------------
1075 {
1076  friend class CSG_PRQuadTree;
1077  friend class CSG_PRQuadTree_Node;
1078 
1079 public:
1080 
1081  virtual bool has_Statistics (void) const { return( true ); }
1082 
1083  virtual CSG_Simple_Statistics * Get_X (void) { return( &m_x ); }
1084  virtual CSG_Simple_Statistics * Get_Y (void) { return( &m_y ); }
1085  virtual CSG_Simple_Statistics * Get_Z (void) { return( &m_z ); }
1086 
1087 
1088 protected:
1089 
1090  CSG_PRQuadTree_Node_Statistics(const CSG_Rect &Extent, int Quadrant = -1)
1091  : CSG_PRQuadTree_Node(Extent, Quadrant)
1092  {}
1093 
1095  : CSG_PRQuadTree_Node(pLeaf)
1096  {}
1097 
1099 
1100 
1102 
1103 };
1104 
1105 //---------------------------------------------------------
1107 {
1108 public:
1109  CSG_PRQuadTree(void);
1110  virtual ~CSG_PRQuadTree(void);
1111 
1112  CSG_PRQuadTree (const TSG_Rect &Extent, bool bStatistics = false);
1113  bool Create (const CSG_Rect &Extent, bool bStatistics = false);
1114 
1115  CSG_PRQuadTree (CSG_Shapes *pShapes, int Attribute, bool bStatistics = false);
1116  bool Create (CSG_Shapes *pShapes, int Attribute, bool bStatistics = false);
1117 
1118  void Destroy (void);
1119 
1120  bool Add_Point (double x, double y, double z);
1121  bool Add_Point (const TSG_Point &p, double z);
1122 
1123  size_t Get_Point_Count (void) const { return( m_nPoints ); }
1124 
1125  const CSG_PRQuadTree_Node & Get_Root (void) const { return( *m_pRoot ); }
1126  CSG_PRQuadTree_Node * Get_Root_Pointer (void) const { return( m_pRoot ); }
1127 
1128  bool is_Okay (void) const { return( m_pRoot != NULL ); }
1129 
1130  bool is_Polar (void) const { return( m_bPolar ); }
1131  void Set_Polar_Search (bool bOn) { m_bPolar = bOn; }
1132 
1133  CSG_PRQuadTree_Leaf * Get_Nearest_Leaf (const TSG_Point &p, double &Distance) const;
1134  CSG_PRQuadTree_Leaf * Get_Nearest_Leaf (double x, double y, double &Distance) const;
1135  bool Get_Nearest_Point (const TSG_Point &p, TSG_Point &Point, double &Value, double &Distance) const;
1136  bool Get_Nearest_Point (double x, double y, TSG_Point &Point, double &Value, double &Distance) const;
1137 
1138  size_t Get_Nearest_Points (CSG_Points_3D &Points, const TSG_Point &p, size_t maxPoints, double Radius = 0., int iQuadrant = -1) const;
1139  size_t Get_Nearest_Points (CSG_Points_3D &Points, double x, double y, size_t maxPoints, double Radius = 0., int iQuadrant = -1) const;
1140 
1141  size_t Select_Nearest_Points (const TSG_Point &p, size_t maxPoints, double Radius = 0., int iQuadrant = -1);
1142  size_t Select_Nearest_Points (double x, double y, size_t maxPoints, double Radius = 0., int iQuadrant = -1);
1143 
1144  size_t Get_Selected_Count (void) const { return( m_Selection.Get_Size() ); }
1145  CSG_PRQuadTree_Leaf * Get_Selected_Leaf (size_t i) const { return( i >= (size_t)m_Selection.Get_Size() ? NULL : (((TLeaf *)m_Selection.Get_Array()) + i)->pLeaf ); }
1146  double Get_Selected_Z (size_t i) const { return( i >= (size_t)m_Selection.Get_Size() ? 0. : (((TLeaf *)m_Selection.Get_Array()) + i)->pLeaf->Get_Z() ); }
1147  double Get_Selected_Distance (size_t i) const { return( i >= (size_t)m_Selection.Get_Size() ? -1. : (((TLeaf *)m_Selection.Get_Array()) + i)->Distance ); }
1148  bool Get_Selected_Point (size_t i, double &x, double &y, double &z) const
1149  {
1150  CSG_PRQuadTree_Leaf *pLeaf = Get_Selected_Leaf(i);
1151 
1152  if( pLeaf )
1153  {
1154  x = pLeaf->Get_X();
1155  y = pLeaf->Get_Y();
1156  z = pLeaf->Get_Z();
1157 
1158  return( true );
1159  }
1160 
1161  return( false );
1162  }
1163 
1164 
1165 private:
1166 
1167  typedef struct SLeaf
1168  {
1169  CSG_PRQuadTree_Leaf *pLeaf;
1170 
1171  double Distance;
1172  }
1173  TLeaf;
1174 
1175 
1176 private:
1177 
1178  bool m_bPolar;
1179 
1180  size_t m_nPoints;
1181 
1182  CSG_Array m_Selection;
1183 
1184  CSG_PRQuadTree_Node *m_pRoot;
1185 
1186  bool _Check_Root (double x, double y);
1187 
1188  bool _Quadrant_Contains (double x, double y, int iQuadrant, const TSG_Point &p) const;
1189  bool _Radius_Contains (double x, double y, double r, const TSG_Point &p) const;
1190  bool _Radius_Contains (double x, double y, double r, int iQuadrant, const TSG_Point &p) const;
1191  bool _Quadrant_Intersects (double x, double y, int iQuadrant, CSG_PRQuadTree_Item *pItem) const;
1192  bool _Radius_Intersects (double x, double y, double r, CSG_PRQuadTree_Item *pItem) const;
1193  bool _Radius_Intersects (double x, double y, double r, int iQuadrant, CSG_PRQuadTree_Item *pItem) const;
1194 
1195  CSG_PRQuadTree_Leaf * _Get_Nearest_Point (CSG_PRQuadTree_Item *pItem, double x, double y, double &Distance) const;
1196 
1197  TLeaf * _Get_Selected (const CSG_Array &Selection, size_t i) const;
1198  bool _Add_Selected ( CSG_Array &Selection , CSG_PRQuadTree_Leaf *pLeaf, double Distance) const;
1199  bool _Set_Selected ( CSG_Array &Selection, size_t i, CSG_PRQuadTree_Leaf *pLeaf, double Distance) const;
1200  void _Select_Nearest_Points ( CSG_Array &Selection, CSG_PRQuadTree_Item *pItem, double x, double y, double &Distance, double Radius, size_t maxPoints, int iQuadrant) const;
1201  size_t _Select_Nearest_Points ( CSG_Array &Selection, double x, double y, size_t maxPoints, double Radius, int iQuadrant) const;
1202 
1203 };
1204 
1205 
1207 // //
1208 // Point Search Engine //
1209 // //
1211 
1212 //---------------------------------------------------------
1214 {
1215 public:
1216  CSG_KDTree(void);
1217  virtual ~CSG_KDTree(void);
1218 
1219  static const char * Get_Version (void);
1220 
1221  virtual bool Destroy (void);
1222 
1223  bool is_Okay (void) const { return( m_pKDTree != NULL ); }
1224 
1225  size_t Get_Match_Count (void ) const { return( m_Indices.Get_Size() ); }
1226  size_t Get_Match_Index (size_t i) const { return( m_Indices [i] ); }
1227  double Get_Match_Distance (size_t i) const { return( m_Distances[i] ); }
1228  CSG_Shape * Get_Match_Shape (size_t i) const;
1229 
1230  int Get_Point_Count (void) const { return( m_Points.Get_NY() ); }
1231  double * Get_Point (int i) const { return( m_Points[i] ); }
1232  double * Get_Point (size_t i) const { return( m_Points[i] ); }
1233  double * operator [] (int i) const { return( m_Points[i] ); }
1234  double * operator [] (size_t i) const { return( m_Points[i] ); }
1235  virtual double Get_Point_Value (int i) const { return( Get_Point_Value((size_t)i) ); }
1236  virtual double Get_Point_Value (size_t i) const = 0;
1237 
1238 
1239 protected:
1240 
1241  class CSG_KDTree_Adaptor *m_pAdaptor;
1242 
1243  void *m_pKDTree;
1244 
1246 
1248 
1250 
1251 
1252  void _On_Construction (void);
1253 
1254 };
1255 
1256 
1258 // //
1260 
1261 //---------------------------------------------------------
1263 {
1264 public:
1265  CSG_KDTree_2D(void);
1266  virtual ~CSG_KDTree_2D(void);
1267 
1268  CSG_KDTree_2D (CSG_Shapes *pPoints, int Field = -1);
1269  bool Create (CSG_Shapes *pPoints, int Field = -1);
1270 
1271  CSG_KDTree_2D (CSG_PointCloud *pPoints);
1272  bool Create (CSG_PointCloud *pPoints);
1273 
1274  CSG_KDTree_2D (const CSG_Matrix &Points);
1275  bool Create (const CSG_Matrix &Points);
1276 
1277  CSG_KDTree_2D (const double **Points, size_t nPoints);
1278  bool Create (const double **Points, size_t nPoints);
1279 
1280  virtual bool Destroy (void);
1281 
1282  virtual double Get_Point_Value (size_t i) const { return( m_Points[i][2] ); }
1283 
1284  virtual size_t Get_Nearest_Points (double Coordinate[2], size_t Count, double Radius);
1285  virtual size_t Get_Nearest_Points (double Coordinate[2], size_t Count, double Radius, CSG_Array_sLong &Indices, CSG_Vector &Distances);
1286  virtual size_t Get_Nearest_Points (double Coordinate[2], size_t Count, size_t *Indices, double *Distances);
1287  virtual bool Get_Nearest_Point (double Coordinate[2], size_t &Index, double &Distance);
1288  virtual bool Get_Nearest_Point (double Coordinate[2], size_t &Index);
1289  virtual bool Get_Nearest_Value (double Coordinate[2], double &Value);
1290  virtual CSG_Shape * Get_Nearest_Shape (double Coordinate[2]);
1291  virtual size_t Get_Duplicates (double Coordinate[2], CSG_Array_sLong &Indices, CSG_Vector &Distances);
1292  virtual size_t Get_Duplicates (double Coordinate[2]);
1293 
1294  virtual size_t Get_Nearest_Points (double x, double y, size_t Count, double Radius);
1295  virtual size_t Get_Nearest_Points (double x, double y, size_t Count, double Radius, CSG_Array_sLong &Indices, CSG_Vector &Distances);
1296  virtual size_t Get_Nearest_Points (double x, double y, size_t Count, size_t *Indices, double *Distances);
1297  virtual bool Get_Nearest_Point (double x, double y, size_t &Index, double &Distance);
1298  virtual bool Get_Nearest_Point (double x, double y, size_t &Index);
1299  virtual bool Get_Nearest_Value (double x, double y, double &Value);
1300  virtual CSG_Shape * Get_Nearest_Shape (double x, double y);
1301  virtual size_t Get_Duplicates (double x, double y, CSG_Array_sLong &Indices, CSG_Vector &Distances);
1302  virtual size_t Get_Duplicates (double x, double y);
1303 
1304 };
1305 
1306 
1308 // //
1310 
1311 //---------------------------------------------------------
1313 {
1314 public:
1315  CSG_KDTree_3D(void);
1316  virtual ~CSG_KDTree_3D(void);
1317 
1318  CSG_KDTree_3D (CSG_Shapes *pPoints, int Field = -1, int zField = -1, double zScale = 1.);
1319  bool Create (CSG_Shapes *pPoints, int Field = -1, int zField = -1, double zScale = 1.);
1320 
1321  CSG_KDTree_3D (CSG_PointCloud *pPoints);
1322  bool Create (CSG_PointCloud *pPoints);
1323 
1324  CSG_KDTree_3D (const CSG_Matrix &Points);
1325  bool Create (const CSG_Matrix &Points);
1326 
1327  CSG_KDTree_3D (const double **Points, size_t nPoints);
1328  bool Create (const double **Points, size_t nPoints);
1329 
1330  virtual bool Destroy (void);
1331 
1332  virtual double Get_Point_Value (size_t i) const { return( m_Points[i][3] ); }
1333 
1334  virtual size_t Get_Nearest_Points (double Coordinate[3], size_t Count, double Radius);
1335 
1336  virtual size_t Get_Nearest_Points (double Coordinate[3], size_t Count, size_t *Indices, double *Distances);
1337  virtual size_t Get_Nearest_Points (double Coordinate[3], size_t Count, double Radius, CSG_Array_sLong &Indices, CSG_Vector &Distances);
1338  virtual bool Get_Nearest_Point (double Coordinate[3], size_t &Index, double &Distance);
1339  virtual bool Get_Nearest_Point (double Coordinate[3], size_t &Index);
1340  virtual bool Get_Nearest_Value (double Coordinate[3], double &Value);
1341  virtual CSG_Shape * Get_Nearest_Shape (double Coordinate[3]);
1342  virtual size_t Get_Duplicates (double Coordinate[3], CSG_Array_sLong &Indices, CSG_Vector &Distances);
1343  virtual size_t Get_Duplicates (double Coordinate[3]);
1344 
1345  virtual size_t Get_Nearest_Points (double x, double y, double z, size_t Count, double Radius);
1346  virtual size_t Get_Nearest_Points (double x, double y, double z, size_t Count, double Radius, CSG_Array_sLong &Indices, CSG_Vector &Distances);
1347  virtual size_t Get_Nearest_Points (double x, double y, double z, size_t Count, size_t *Indices, double *Distances);
1348  virtual bool Get_Nearest_Point (double x, double y, double z, size_t &Index, double &Distance);
1349  virtual bool Get_Nearest_Point (double x, double y, double z, size_t &Index);
1350  virtual bool Get_Nearest_Value (double x, double y, double z, double &Value);
1351  virtual CSG_Shape * Get_Nearest_Shape (double x, double y, double z);
1352  virtual size_t Get_Duplicates (double x, double y, double z, CSG_Array_sLong &Indices, CSG_Vector &Distances);
1353  virtual size_t Get_Duplicates (double x, double y, double z);
1354 
1355 };
1356 
1357 
1359 // //
1361 
1362 //---------------------------------------------------------
1364 {
1365 public:
1368 
1369  virtual bool Create (class CSG_Parameters *pParameters, const CSG_String &Parent = "", size_t minPoints = 0);
1370 
1371  virtual bool On_Parameter_Changed (class CSG_Parameters *pParameters, class CSG_Parameter *pParameter);
1372  virtual bool On_Parameters_Enable (class CSG_Parameters *pParameters, class CSG_Parameter *pParameter);
1373 
1374  bool Do_Use_All (void) const { return( m_maxPoints == 0 && m_Radius <= 0. ); }
1375  bool Do_Use_All (bool bUpdate);
1376 
1377  size_t Get_Min_Points (void) const { return( m_minPoints ); }
1378  size_t Get_Max_Points (void) const { return( m_maxPoints ); }
1379  double Get_Radius (void) const { return( m_Radius ); }
1380 
1381 
1382 protected:
1383 
1384  bool Update (void);
1385 
1386 
1387  size_t m_minPoints, m_maxPoints;
1388 
1389  double m_Radius;
1390 
1392 
1393 };
1394 
1395 //---------------------------------------------------------
1397 {
1398 public:
1401 
1402  bool Initialize (CSG_Shapes *pPoints, int zField = -1);
1403  bool Finalize (void);
1404 
1405  sLong Set_Location (double x, double y);
1406  sLong Set_Location (const CSG_Point &p);
1407 
1408  sLong Get_Count (void) const { return( m_pPoints ? m_pPoints->Get_Count() : m_Search.Get_Match_Count() ); }
1409  bool Get_Point (sLong Index, double &x, double &y, double &z);
1410 
1411  bool Get_Points (double x, double y, CSG_Points_3D &Points);
1412  bool Get_Points (const CSG_Point &p, CSG_Points_3D &Points);
1413 
1414  bool Get_Points (double x, double y, CSG_Array_sLong &Indices);
1415  bool Get_Points (const CSG_Point &p, CSG_Array_sLong &Indices);
1416 
1417  bool Get_Points (double x, double y, CSG_Array_sLong &Indices, CSG_Vector &Distances);
1418  bool Get_Points (const CSG_Point &p, CSG_Array_sLong &Indices, CSG_Vector &Distances);
1419 
1420 
1421 private:
1422 
1423  int m_zField;
1424 
1425  CSG_Shapes *m_pPoints;
1426 
1427  CSG_KDTree_2D m_Search;
1428 
1429 };
1430 
1431 
1433 // //
1434 // Polygon Tools //
1435 // //
1437 
1438 //---------------------------------------------------------
1439 SAGA_API_DLL_EXPORT bool SG_Shape_Get_Intersection (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution = NULL);
1440 SAGA_API_DLL_EXPORT bool SG_Shape_Get_Difference (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution = NULL);
1441 SAGA_API_DLL_EXPORT bool SG_Shape_Get_ExclusiveOr (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution = NULL);
1442 SAGA_API_DLL_EXPORT bool SG_Shape_Get_Union (CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution = NULL);
1443 SAGA_API_DLL_EXPORT bool SG_Shape_Get_Dissolve (CSG_Shape *pSubject , CSG_Shape *pSolution = NULL);
1444 SAGA_API_DLL_EXPORT bool SG_Shape_Get_Offset (CSG_Shape *pSubject, double Size, double dArc, CSG_Shape *pSolution = NULL);
1445 
1446 SAGA_API_DLL_EXPORT const char * SG_Clipper_Get_Version (void);
1447 
1448 
1450 // //
1451 // OpenGIS //
1452 // //
1454 
1455 //---------------------------------------------------------
1457 {
1458  SG_OGIS_BYTEORDER_XDR = 0, // Big Endian
1459  SG_OGIS_BYTEORDER_NDR = 1 // Little Endian
1460 };
1461 
1462 //---------------------------------------------------------
1463 typedef enum
1464 {
1466 
1477 
1488 
1499 
1512 
1513 
1515 // //
1517 
1518 //---------------------------------------------------------
1520 {
1521 public:
1523 
1524  static bool from_WKText (const CSG_String &Text, CSG_Shape *pShape);
1525  static bool to_WKText (CSG_Shape *pShape, CSG_String &Text);
1526 
1527  static bool from_WKBinary (CSG_Bytes &Bytes, CSG_Shape *pShape);
1528  static bool to_WKBinary (CSG_Shape *pShape, CSG_Bytes &Bytes);
1529 
1530  static bool from_ShapeType ( CSG_String &Type, TSG_Shape_Type Shape, TSG_Vertex_Type Vertex = SG_VERTEX_TYPE_XY);
1531  static CSG_String from_ShapeType ( TSG_Shape_Type Shape, TSG_Vertex_Type Vertex = SG_VERTEX_TYPE_XY);
1532  static bool to_ShapeType (const CSG_String &Type, TSG_Shape_Type &Shape, TSG_Vertex_Type &Vertex);
1533  static TSG_Shape_Type to_ShapeType (const CSG_String &Type);
1534  static TSG_Vertex_Type to_VertexType (const CSG_String &Type);
1535 
1536  static bool from_ShapeType (DWORD &Type, TSG_Shape_Type Shape, TSG_Vertex_Type Vertex = SG_VERTEX_TYPE_XY);
1537  static bool to_ShapeType (DWORD Type, TSG_Shape_Type &Shape, TSG_Vertex_Type &Vertex);
1538  static TSG_Shape_Type to_ShapeType (DWORD Type);
1539  static TSG_Vertex_Type to_VertexType (DWORD Type);
1540 
1541  static CSG_String Type_asWKText (DWORD Type);
1542  static DWORD Type_asWKBinary (const CSG_String &Type);
1543 
1544 
1545 private:
1546 
1547  static bool _WKT_Read_Point (const CSG_String &Text, CSG_Shape *pShape, int iPart);
1548  static bool _WKT_Read_Points (const CSG_String &Text, CSG_Shape *pShape);
1549  static bool _WKT_Read_Parts (const CSG_String &Text, CSG_Shape *pShape);
1550  static bool _WKT_Read_Polygon (const CSG_String &Text, CSG_Shape *pShape);
1551 
1552  static bool _WKT_Write_Point (CSG_String &Text, CSG_Shape *pShape, int iPoint, int iPart);
1553  static bool _WKT_Write_Points (CSG_String &Text, CSG_Shape *pShape, int iPart);
1554  static bool _WKT_Write_Parts (CSG_String &Text, CSG_Shape *pShape);
1555  static bool _WKT_Write_Polygon (CSG_String &Text, CSG_Shape *pShape);
1556 
1557  static bool _WKB_Read_Point (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape, int iPart);
1558  static bool _WKB_Read_Points (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape);
1559  static bool _WKB_Read_Polygon (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape);
1560  static bool _WKB_Read_MultiPoint (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape);
1561  static bool _WKB_Read_MultiLine (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape);
1562  static bool _WKB_Read_MultiPolygon (CSG_Bytes &Bytes, bool bSwapBytes, TSG_Vertex_Type Vertex, CSG_Shape *pShape);
1563 
1564  static bool _WKB_Write_Point (CSG_Bytes &Bytes, CSG_Shape *pShape, int iPoint, int iPart);
1565  static bool _WKB_Write_Points (CSG_Bytes &Bytes, CSG_Shape *pShape, int iPart);
1566  static bool _WKB_Write_MultiPoint (CSG_Bytes &Bytes, CSG_Shape *pShape);
1567  static bool _WKB_Write_MultiLine (CSG_Bytes &Bytes, CSG_Shape *pShape);
1568  static bool _WKB_Write_MultiPolygon (CSG_Bytes &Bytes, CSG_Shape *pShape);
1569 
1570 };
1571 
1572 
1574 // //
1576 
1577 //---------------------------------------------------------
1579 {
1580 public:
1582 
1583  static bool from_WKBinary (CSG_Bytes &Bytes, class CSG_Grid *pGrid);
1584  static bool to_WKBinary (CSG_Bytes &Bytes, class CSG_Grid *pGrid, int SRID = -1);
1585 
1586 };
1587 
1588 
1590 // //
1591 // //
1592 // //
1594 
1595 //---------------------------------------------------------
1596 #endif // #ifndef HEADER_INCLUDED__SAGA_API__shapes_H
CSG_Shape::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next) const =0
SG_POLYGON_POINT_Edge
@ SG_POLYGON_POINT_Edge
Definition: shapes.h:638
CSG_Shape_Part::Get_MMax
double Get_MMax(void)
Definition: shapes.h:432
CSG_Rect
Definition: geo_tools.h:474
CSG_Shape_Polygon_Part::is_Clockwise
bool is_Clockwise(void)
Definition: shapes.h:650
CSG_Grid_OGIS_Converter::CSG_Grid_OGIS_Converter
CSG_Grid_OGIS_Converter(void)
Definition: shapes.h:1581
SHAPE_COPY_ATTR
@ SHAPE_COPY_ATTR
Definition: shapes.h:127
CSG_Shape_Polygon_Part::Get_Centroid
const TSG_Point & Get_Centroid(void)
Definition: shapes.h:656
SG_OGIS_TYPE_TriangleM
@ SG_OGIS_TYPE_TriangleM
Definition: shapes.h:1498
CSG_Shape_Polygon::Get_Point_Relation
TSG_Polygon_Point_Relation Get_Point_Relation(const CSG_Point &p, int iPart)
Definition: shape_polygon.cpp:932
CSG_Shape_Points::m_pParts
CSG_Shape_Part ** m_pParts
Definition: shapes.h:567
CSG_Shape_Point::Get_Distance
virtual double Get_Distance(TSG_Point Point) const
Definition: shapes.h:298
CSG_Table::Assign
virtual bool Assign(CSG_Data_Object *pTable)
Definition: table.cpp:370
CSG_Shape_Point_ZM
Definition: shapes.h:342
CSG_Shape_Point::Del_Point
virtual int Del_Point(int iPoint, int iPart=0)
Definition: shapes.h:289
CSG_Rect::Assign
CSG_Rect & Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:727
CSG_Shapes::m_Extent_Selected
CSG_Rect m_Extent_Selected
Definition: shapes.h:849
CSG_Shapes::m_ZMin
double m_ZMin
Definition: shapes.h:843
CSG_Shape_Part::m_pOwner
class CSG_Shape_Points * m_pOwner
Definition: shapes.h:466
CSG_Shape_Part::m_MMax
double m_MMax
Definition: shapes.h:460
CSG_Shape_Points::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:539
CSG_Shapes::Save
virtual bool Save(const wchar_t *File, int Format=0)
Definition: shapes.h:803
SG_POLYGON_POINT_Interior
@ SG_POLYGON_POINT_Interior
Definition: shapes.h:639
CSG_Shape_Polygon::m_bUpdate_Lakes
int m_bUpdate_Lakes
Definition: shapes.h:752
CSG_Shape::Add_Point
virtual int Add_Point(const CSG_Point_3D &p, int iPart=0)=0
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Points_3D
Definition: geo_tools.h:322
CSG_Parameters_Point_Search
Definition: shapes.h:1364
SG_Get_ShapeType_Name
SAGA_API_DLL_EXPORT CSG_String SG_Get_ShapeType_Name(TSG_Shape_Type Type)
Definition: shapes.cpp:65
CSG_Parameters_Point_Search::Get_Radius
double Get_Radius(void) const
Definition: shapes.h:1379
SG_OGIS_TYPE_TINZ
@ SG_OGIS_TYPE_TINZ
Definition: shapes.h:1486
CSG_KDTree::m_Points
CSG_Matrix m_Points
Definition: shapes.h:1249
CSG_Shapes_OGIS_Converter::CSG_Shapes_OGIS_Converter
CSG_Shapes_OGIS_Converter(void)
Definition: shapes.h:1522
CSG_Shape::Ins_Point
virtual int Ins_Point(const CSG_Point &p, int iPoint, int iPart=0)=0
CSG_Table::Del_Records
virtual bool Del_Records(void)
Definition: table.cpp:901
CSG_Shape::Set_Point
virtual int Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0)=0
CSG_Shape_Points::Revert_Points
virtual bool Revert_Points(int iPart)
Definition: shapes.h:550
SG_OGIS_TYPE_PolygonZ
@ SG_OGIS_TYPE_PolygonZ
Definition: shapes.h:1480
CSG_PRQuadTree_Leaf::CSG_PRQuadTree_Leaf
CSG_PRQuadTree_Leaf(const CSG_Rect &Extent, int Quadrant, double x, double y, double z)
Definition: shapes.h:983
CSG_PRQuadTree_Leaf_List
Definition: shapes.h:1002
CSG_Shape_Point::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const
Definition: shapes.h:291
CSG_PRQuadTree_Item::Get_yCenter
double Get_yCenter(void) const
Definition: shapes.h:925
CSG_PRQuadTree_Node_Statistics
Definition: shapes.h:1075
CSG_KDTree_2D
Definition: shapes.h:1263
CSG_Shapes::Save
virtual bool Save(const char *File, int Format=0)
Definition: shapes.h:802
CSG_Shape_Points::Get_MMin
virtual double Get_MMin(void)
Definition: shapes.h:538
CSG_Shape_Part::Add_Point
int Add_Point(const CSG_Point &p)
Definition: shapes.h:398
CSG_PRQuadTree::Get_Root_Pointer
CSG_PRQuadTree_Node * Get_Root_Pointer(void) const
Definition: shapes.h:1126
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:777
CSG_KDTree_3D
Definition: shapes.h:1313
CSG_Shapes::Get_Selection
virtual CSG_Shape * Get_Selection(sLong Index=0)
Definition: shapes.h:833
CSG_PRQuadTree_Leaf_List::Get_Value
double Get_Value(sLong i)
Definition: shapes.h:1010
CSG_Shape_Points::Get_ZMin
virtual double Get_ZMin(void)
Definition: shapes.h:533
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(sLong Index) const
Definition: shapes.h:825
CSG_Table_Record
Definition: table.h:130
CSG_Shape::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:193
CSG_PRQuadTree::Get_Selected_Count
size_t Get_Selected_Count(void) const
Definition: shapes.h:1144
CSG_Shape_Part::Get_ZMin
double Get_ZMin(void)
Definition: shapes.h:416
CSG_Shape_Points::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:531
CSG_Shape::Del_Parts
virtual int Del_Parts(void)
Definition: shapes.h:169
CSG_Parameters_Point_Search::Do_Use_All
bool Do_Use_All(void) const
Definition: shapes.h:1374
CSG_Shape_Points::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:532
CSG_Shape_Part::Get_Point
TSG_Point Get_Point(int iPoint, bool bAscending=true) const
Definition: shapes.h:386
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:506
CSG_PRQuadTree_Node_Statistics::has_Statistics
virtual bool has_Statistics(void) const
Definition: shapes.h:1081
CSG_Shape_Point
Definition: shapes.h:263
TSG_ADD_Shape_Copy_Mode
TSG_ADD_Shape_Copy_Mode
Definition: shapes.h:124
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
CSG_Shape_Point::Get_Part_Count
virtual int Get_Part_Count(void) const
Definition: shapes.h:272
SHAPE_COPY_GEOM
@ SHAPE_COPY_GEOM
Definition: shapes.h:126
CSG_Shape_Point::Set_Point
virtual int Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0)
Definition: shapes.h:285
CSG_Shape::Del_Point
virtual int Del_Point(int iPoint, int iPart=0)=0
CSG_Shape::Ins_Point
virtual int Ins_Point(double x, double y, int iPoint, int iPart=0)=0
CSG_Shape_Part::Get_Z
double Get_Z(int iPoint, bool bAscending=true) const
Definition: shapes.h:415
CSG_PRQuadTree_Leaf_List::Get_Minimum
double Get_Minimum(void)
Definition: shapes.h:1011
CSG_KDTree::m_pKDTree
void * m_pKDTree
Definition: shapes.h:1243
CSG_Parameters_Point_Search::Get_Max_Points
size_t Get_Max_Points(void) const
Definition: shapes.h:1378
CSG_Shape_Points::Get_Point_Count
virtual int Get_Point_Count(int iPart) const
Definition: shapes.h:495
CSG_Shape_Point::Ins_Point
virtual int Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart=0)
Definition: shapes.h:282
CSG_Shape_Points::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:492
CSG_PRQuadTree_Leaf_List::has_Statistics
virtual bool has_Statistics(void) const
Definition: shapes.h:1007
CSG_Shape_Points::m_MMax
double m_MMax
Definition: shapes.h:563
CSG_Shapes::Get_MMax
double Get_MMax(void)
Definition: shapes.h:816
CSG_Shape_Polygon_Part
Definition: shapes.h:645
CSG_PRQuadTree_Leaf_List::Get_Mean
double Get_Mean(void)
Definition: shapes.h:1015
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_Shape_Part::Get_Point_Z
TSG_Point_3D Get_Point_Z(int iPoint, bool bAscending=true) const
Definition: shapes.h:418
CSG_Shape_Polygon_Part::m_Perimeter
double m_Perimeter
Definition: shapes.h:683
CSG_Shapes::Get_MMin
double Get_MMin(void)
Definition: shapes.h:815
CSG_Shape_Point_ZM::Get_MMin
virtual double Get_MMin(void)
Definition: shapes.h:351
SSG_Point_4D
Definition: geo_tools.h:359
SSG_Point_3D
Definition: geo_tools.h:265
SG_Shapes_Get_File_Extension_Default
SAGA_API_DLL_EXPORT CSG_String SG_Shapes_Get_File_Extension_Default(void)
Definition: shapes_io.cpp:124
CSG_Shape_Point::Set_Point
virtual int Set_Point(const CSG_Point_3D &p, int iPoint=0, int iPart=0)
Definition: shapes.h:286
CSG_Table_Record::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: table_record.cpp:543
CSG_KDTree::m_Distances
CSG_Vector m_Distances
Definition: shapes.h:1247
CSG_PRQuadTree_Node::Get_Child
CSG_PRQuadTree_Item * Get_Child(int Quadrant) const
Definition: shapes.h:1052
CSG_Shape_Points
Definition: shapes.h:484
CSG_Table::Get_Selection
virtual CSG_Table_Record * Get_Selection(sLong Index=0) const
Definition: table.h:427
CSG_PRQuadTree_Leaf::Get_Y
double Get_Y(void) const
Definition: shapes.h:977
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:325
CSG_Table::On_Reload
virtual bool On_Reload(void)
Definition: table_io.cpp:64
SSG_Point_3D::x
double x
Definition: geo_tools.h:266
CSG_Shape_Polygon::Get_Shared_Edges
CSG_Lines Get_Shared_Edges(CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon=0.)
Definition: shape_polygon.cpp:1138
CSG_Shape::Get_Part
virtual CSG_Shape_Part * Get_Part(int iPart) const
Definition: shapes.h:167
CSG_PRQuadTree_Leaf_List::Get_Sum
double Get_Sum(void)
Definition: shapes.h:1014
SG_OGIS_TYPE_PolyhedralSurfaceZM
@ SG_OGIS_TYPE_PolyhedralSurfaceZM
Definition: shapes.h:1507
SG_OGIS_TYPE_MultiPolygon
@ SG_OGIS_TYPE_MultiPolygon
Definition: shapes.h:1472
SG_Shapes_Get_File_Format_Default
SAGA_API_DLL_EXPORT TSG_Shape_File_Format SG_Shapes_Get_File_Format_Default(void)
Definition: shapes_io.cpp:118
CSG_PRQuadTree_Leaf_List::Get_Count
sLong Get_Count(void)
Definition: shapes.h:1009
CSG_Shape_Points::_Update_Extent
void _Update_Extent(void)
Definition: shape_points.cpp:313
CSG_Shape_Points::Ins_Point
virtual int Ins_Point(const CSG_Point &p, int iPoint, int iPart=0)
Definition: shapes.h:509
SG_OGIS_TYPE_PointM
@ SG_OGIS_TYPE_PointM
Definition: shapes.h:1489
CSG_Shapes::m_Type
TSG_Shape_Type m_Type
Definition: shapes.h:845
CSG_Shape_Polygon::is_OnEdge
bool is_OnEdge(const CSG_Point &p, int iPart)
Definition: shape_polygon.cpp:984
SHAPE_COPY
@ SHAPE_COPY
Definition: shapes.h:128
CSG_Shapes::Get_Shape_byIndex
virtual CSG_Shape * Get_Shape_byIndex(sLong Index) const
Definition: shapes.h:826
CSG_PRQuadTree_Item::Get_xCenter
double Get_xCenter(void) const
Definition: shapes.h:922
SG_OGIS_TYPE_PointZ
@ SG_OGIS_TYPE_PointZ
Definition: shapes.h:1478
CSG_Shape::asPoint
class CSG_Shape_Point * asPoint(void) const
Definition: shapes.h:156
CSG_Shape_Part::_Invalidate
virtual void _Invalidate(void)
Definition: shape_part.cpp:391
CSG_Shape::CSG_Shape
CSG_Shape(class CSG_Shapes *pOwner, sLong Index)
Definition: shape.cpp:63
CSG_Shape::Intersects
TSG_Intersection Intersects(CSG_Shape *pShape)
Definition: shape.cpp:118
CSG_Shape::Add_Part
virtual int Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false)
Definition: shapes.h:166
CSG_Shape_Polygon::Get_Shared_Length
double Get_Shared_Length(CSG_Shape_Polygon *pPolygon, bool bVertexCheck, double Epsilon=0.)
Definition: shape_polygon.cpp:1163
SG_OGIS_TYPE_MultiPoint
@ SG_OGIS_TYPE_MultiPoint
Definition: shapes.h:1470
CSG_Table::On_Delete
virtual bool On_Delete(void)
Definition: table_io.cpp:70
SG_OGIS_TYPE_MultiLineString
@ SG_OGIS_TYPE_MultiLineString
Definition: shapes.h:1471
SSG_Point
Definition: geo_tools.h:128
CSG_KDTree::Get_Match_Distance
double Get_Match_Distance(size_t i) const
Definition: shapes.h:1227
CSG_Shapes::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:805
CSG_KDTree_3D::Get_Point_Value
virtual double Get_Point_Value(size_t i) const
Definition: shapes.h:1332
CSG_PRQuadTree::Get_Point_Count
size_t Get_Point_Count(void) const
Definition: shapes.h:1123
CSG_Shape_Points::Destroy
virtual void Destroy(void)
Definition: shape_points.cpp:86
CSG_PRQuadTree_Node
Definition: shapes.h:1045
CSG_Shape_Points::m_ZMax
double m_ZMax
Definition: shapes.h:563
CSG_Shape_Points::Set_Point
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)
Definition: shape_points.cpp:245
CSG_Shape::Get_Type
TSG_Shape_Type Get_Type(void) const
Definition: shape.cpp:88
TSG_Polygon_Point_Relation
TSG_Polygon_Point_Relation
Definition: shapes.h:635
CSG_Shapes::Get_ZMin
double Get_ZMin(void)
Definition: shapes.h:813
CSG_Shape::Get_Distance
virtual double Get_Distance(TSG_Point Point) const =0
CSG_Shape_Part::CSG_Shape_Part
CSG_Shape_Part(class CSG_Shape_Points *pOwner)
Definition: shape_part.cpp:63
CSG_Shape_Point_ZM::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:352
CSG_Shape_Points::Add_Point
virtual int Add_Point(const CSG_Point_4D &p, int iPart=0)
Definition: shapes.h:506
CSG_PRQuadTree_Leaf::Get_Point
const TSG_Point & Get_Point(void) const
Definition: shapes.h:975
CSG_Shape_Part::Get_M
double Get_M(int iPoint, bool bAscending=true) const
Definition: shapes.h:430
CSG_Shape_Point::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next) const
Definition: shapes.h:300
SG_OGIS_TYPE_MultiPolygonZM
@ SG_OGIS_TYPE_MultiPolygonZM
Definition: shapes.h:1505
CSG_Shape::Get_Extent
virtual const CSG_Rect & Get_Extent(int iPart)
Definition: shapes.h:226
CSG_Shape::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const =0
CSG_PRQuadTree_Leaf_List::Get_StdDev
double Get_StdDev(void)
Definition: shapes.h:1017
SSG_Rect
Definition: geo_tools.h:467
CSG_Shape_Points::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const
Definition: shape_points.cpp:294
CSG_PRQuadTree::Get_Root
const CSG_PRQuadTree_Node & Get_Root(void) const
Definition: shapes.h:1125
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
CSG_Shape_Point::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const
Definition: shapes.h:301
SG_VERTEX_TYPE_XY
@ SG_VERTEX_TYPE_XY
Definition: shapes.h:92
SG_OGIS_TYPE_PolygonM
@ SG_OGIS_TYPE_PolygonM
Definition: shapes.h:1491
SG_OGIS_TYPE_Undefined
@ SG_OGIS_TYPE_Undefined
Definition: shapes.h:1465
SG_POLYGON_POINT_Vertex
@ SG_POLYGON_POINT_Vertex
Definition: shapes.h:637
CSG_Shape_Points::m_MMin
double m_MMin
Definition: shapes.h:563
CSG_Shape::Destroy
virtual void Destroy(void)
Definition: shape.cpp:79
CSG_Shape_Points::Get_Distance
virtual double Get_Distance(TSG_Point Point) const
Definition: shape_points.cpp:391
CSG_Shape::Del_Part
virtual int Del_Part(int iPart)
Definition: shapes.h:168
SG_OGIS_BYTEORDER_NDR
@ SG_OGIS_BYTEORDER_NDR
Definition: shapes.h:1459
SG_Shape_Get_ExclusiveOr
SAGA_API_DLL_EXPORT bool SG_Shape_Get_ExclusiveOr(CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:329
CSG_Shape_Points::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:536
CSG_Shape::Get_Part_Count
virtual int Get_Part_Count(void) const =0
CSG_Shape_Part::m_ZMin
double m_ZMin
Definition: shapes.h:460
CSG_Shapes::Del_Shapes
virtual bool Del_Shapes(void)
Definition: shapes.h:822
CSG_PRQuadTree::Set_Polar_Search
void Set_Polar_Search(bool bOn)
Definition: shapes.h:1131
CSG_Shape_Polygon::Contains
bool Contains(const CSG_Point &p, int iPart)
Definition: shape_polygon.cpp:1026
CSG_Shapes::Get_Vertex_Type
TSG_Vertex_Type Get_Vertex_Type(void) const
Definition: shapes.h:809
CSG_Shape_Points::Ins_Point
virtual int Ins_Point(double x, double y, int iPoint, int iPart=0)
Definition: shape_points.cpp:199
SG_OGIS_TYPE_LineString
@ SG_OGIS_TYPE_LineString
Definition: shapes.h:1468
CSG_Parameters_Point_Search_KDTree_2D
Definition: shapes.h:1397
CSG_Vector
Definition: mat_tools.h:360
CSG_Data_Object
Definition: dataobject.h:180
CSG_Point
Definition: geo_tools.h:135
CSG_Parameter
Definition: parameters.h:207
SG_Shapes_Set_File_Format_Default
SAGA_API_DLL_EXPORT bool SG_Shapes_Set_File_Format_Default(int Format)
Definition: shapes_io.cpp:103
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:507
SG_VERTEX_TYPE_XYZM
@ SG_VERTEX_TYPE_XYZM
Definition: shapes.h:94
CSG_Shape_Line
Definition: shapes.h:601
SG_OGIS_TYPE_GeometryCollectionZM
@ SG_OGIS_TYPE_GeometryCollectionZM
Definition: shapes.h:1506
SG_POLYGON_POINT_Outside
@ SG_POLYGON_POINT_Outside
Definition: shapes.h:636
CSG_PRQuadTree_Item::Contains
bool Contains(const CSG_Point &p) const
Definition: shapes.h:929
SSG_Point_4D::m
double m
Definition: geo_tools.h:360
CSG_Shape::asPoints
class CSG_Shape_Points * asPoints(void) const
Definition: shapes.h:157
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint, int iPart, bool bAscending=true) const =0
CSG_PRQuadTree_Leaf_List::Get_Range
double Get_Range(void)
Definition: shapes.h:1013
CSG_Shape_Part::CSG_Shape_Points
friend class CSG_Shape_Points
Definition: shapes.h:371
CSG_Shape_Part::Get_Extent
const CSG_Rect & Get_Extent(void)
Definition: shapes.h:382
CSG_PRQuadTree_Item::is_Node
virtual bool is_Node(void) const
Definition: shapes.h:917
CSG_PRQuadTree_Node::Get_Y
virtual CSG_Simple_Statistics * Get_Y(void)
Definition: shapes.h:1058
CSG_PRQuadTree_Item::~CSG_PRQuadTree_Item
virtual ~CSG_PRQuadTree_Item(void)
Definition: shapes.h:940
CSG_Shape_Points::m_ZMin
double m_ZMin
Definition: shapes.h:563
CSG_Shape_Point_Z::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:329
CSG_Shape_Points::Get_ZMax
virtual double Get_ZMax(void)
Definition: shapes.h:534
CSG_Shape_Part::m_Points
TSG_Point * m_Points
Definition: shapes.h:462
CSG_Shape_Polygon_Part::m_bLake
int m_bLake
Definition: shapes.h:681
SSG_Point_4D::z
double z
Definition: geo_tools.h:360
SG_OGIS_TYPE_TINM
@ SG_OGIS_TYPE_TINM
Definition: shapes.h:1497
CSG_PRQuadTree_Node_Statistics::m_z
CSG_Simple_Statistics m_z
Definition: shapes.h:1101
CSG_Point_3D
Definition: geo_tools.h:272
CSG_Shape_Points::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:537
CSG_PRQuadTree_Item::CSG_PRQuadTree_Item
CSG_PRQuadTree_Item(const CSG_Rect &Extent, int Quadrant=-1)
Definition: shapes.h:938
CSG_Shape_Points::Add_Point
virtual int Add_Point(const CSG_Point_3D &p, int iPart=0)
Definition: shapes.h:505
SG_OGIS_TYPE_TINZM
@ SG_OGIS_TYPE_TINZM
Definition: shapes.h:1508
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:366
CSG_PRQuadTree_Leaf::Get_X
double Get_X(void) const
Definition: shapes.h:976
SG_OGIS_TYPE_PolyhedralSurface
@ SG_OGIS_TYPE_PolyhedralSurface
Definition: shapes.h:1474
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Shape_Polygon_Part::m_Centroid
TSG_Point m_Centroid
Definition: shapes.h:685
CSG_Shape::Get_ZMax
virtual double Get_ZMax(void)
Definition: shapes.h:195
CSG_Shape_Part::m_nPoints
int m_nPoints
Definition: shapes.h:458
CSG_PRQuadTree_Item::m_Extent
CSG_Rect m_Extent
Definition: shapes.h:962
CSG_PRQuadTree_Node::is_Node
virtual bool is_Node(void) const
Definition: shapes.h:1050
CSG_Shape_Part::Set_M
void Set_M(double m, int iPoint)
Definition: shapes.h:429
CSG_Shape_Point_ZM::CSG_Shape_Point_ZM
CSG_Shape_Point_ZM(class CSG_Shapes *pOwner, sLong Index)
Definition: shapes.h:347
CSG_KDTree::m_Indices
CSG_Array_sLong m_Indices
Definition: shapes.h:1245
CSG_Shape::Revert_Points
virtual bool Revert_Points(int iPart)
Definition: shapes.h:238
SHAPE_FILE_FORMAT_GeoPackage
@ SHAPE_FILE_FORMAT_GeoPackage
Definition: shapes.h:117
CSG_Shape::Get_ZMin
virtual double Get_ZMin(void)
Definition: shapes.h:194
CSG_Shape_Polygon::_Invalidate
virtual void _Invalidate(void)
Definition: shape_polygon.cpp:609
CSG_Shape_Point::Ins_Point
virtual int Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart=0)
Definition: shapes.h:281
CSG_Shape_Points::_Get_Part
virtual CSG_Shape_Part * _Get_Part(void)
Definition: shapes.h:572
CSG_PRQuadTree_Item::is_Leaf
virtual bool is_Leaf(void) const
Definition: shapes.h:916
CSG_PRQuadTree_Node_Statistics::~CSG_PRQuadTree_Node_Statistics
virtual ~CSG_PRQuadTree_Node_Statistics(void)
Definition: shapes.h:1098
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:397
CSG_Shape_Points::Add_Point
virtual int Add_Point(const CSG_Point &p, int iPart=0)
Definition: shapes.h:504
SG_OGIS_TYPE_Point
@ SG_OGIS_TYPE_Point
Definition: shapes.h:1467
CSG_Table::On_Update
virtual bool On_Update(void)
Definition: table.cpp:1281
SG_OGIS_TYPE_PolyhedralSurfaceZ
@ SG_OGIS_TYPE_PolyhedralSurfaceZ
Definition: shapes.h:1485
CSG_Shape_Points::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)
Definition: shapes.h:503
CSG_PRQuadTree_Node::Get_Z
virtual CSG_Simple_Statistics * Get_Z(void)
Definition: shapes.h:1059
CSG_Shape_Polygon::Get_Distance
virtual double Get_Distance(TSG_Point Point, TSG_Point &Next, int iPart) const
Definition: shape_polygon.cpp:1176
CSG_Shape_Line::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:606
CSG_PRQuadTree_Item::asNode
class CSG_PRQuadTree_Node * asNode(void) const
Definition: shapes.h:933
CSG_PRQuadTree_Leaf::Get_Z
double Get_Z(void) const
Definition: shapes.h:978
SG_Shape_Get_Union
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Union(CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:353
CSG_Shape_Point::Get_Point_Count
virtual int Get_Point_Count(void) const
Definition: shapes.h:270
CSG_PRQuadTree_Leaf_List::Get_Maximum
double Get_Maximum(void)
Definition: shapes.h:1012
SG_OGIS_TYPE_TriangleZ
@ SG_OGIS_TYPE_TriangleZ
Definition: shapes.h:1487
CSG_Shape::Get_Centroid
virtual TSG_Point Get_Centroid(void)=0
SG_OGIS_TYPE_GeometryCollectionZ
@ SG_OGIS_TYPE_GeometryCollectionZ
Definition: shapes.h:1484
SG_OGIS_TYPE_LineStringZM
@ SG_OGIS_TYPE_LineStringZM
Definition: shapes.h:1501
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Shape_Part::Set_Z
void Set_Z(double z, int iPoint)
Definition: shapes.h:414
CSG_Shape::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:209
SG_Create_Shapes
SAGA_API_DLL_EXPORT CSG_Shapes * SG_Create_Shapes(void)
Definition: shapes.cpp:85
CSG_PRQuadTree_Item::Get_yMin
double Get_yMin(void) const
Definition: shapes.h:924
SG_OGIS_TYPE_GeometryCollection
@ SG_OGIS_TYPE_GeometryCollection
Definition: shapes.h:1473
CSG_KDTree::m_pAdaptor
class CSG_KDTree_Adaptor * m_pAdaptor
Definition: shapes.h:1241
CSG_Shape::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)=0
CSG_Shape_Polygon::Get_Polygon_Part
CSG_Shape_Polygon_Part * Get_Polygon_Part(int iPart) const
Definition: shapes.h:707
CSG_PRQuadTree::Get_Selected_Leaf
CSG_PRQuadTree_Leaf * Get_Selected_Leaf(size_t i) const
Definition: shapes.h:1145
CSG_Shape::CSG_Shapes
friend class CSG_Shapes
Definition: shapes.h:142
CSG_Grid_OGIS_Converter
Definition: shapes.h:1579
SG_Clipper_Get_Version
SAGA_API_DLL_EXPORT const char * SG_Clipper_Get_Version(void)
Definition: shapes_clipper.cpp:405
CSG_Shape_Part::m_Extent
CSG_Rect m_Extent
Definition: shapes.h:464
CSG_PRQuadTree::Get_Selected_Z
double Get_Selected_Z(size_t i) const
Definition: shapes.h:1146
SHAPE_FILE_FORMAT_Undefined
@ SHAPE_FILE_FORMAT_Undefined
Definition: shapes.h:115
CSG_PRQuadTree_Node_Statistics::Get_X
virtual CSG_Simple_Statistics * Get_X(void)
Definition: shapes.h:1083
CSG_Shape::Add_Point
virtual int Add_Point(const CSG_Point &p, int iPart=0)=0
CSG_Shape_Polygon::_Get_Part
virtual CSG_Shape_Part * _Get_Part(void)
Definition: shapes.h:755
CSG_Table::Get_Record_byIndex
CSG_Table_Record * Get_Record_byIndex(sLong Index) const
Definition: table.h:404
CSG_Shape::Get_MMin
virtual double Get_MMin(void)
Definition: shapes.h:210
CSG_Shape::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: shape.cpp:195
CSG_Shapes_OGIS_Converter
Definition: shapes.h:1520
SG_OGIS_TYPE_TIN
@ SG_OGIS_TYPE_TIN
Definition: shapes.h:1475
CSG_Shape_Point_Z::Get_ZMax
virtual double Get_ZMax(void)
Definition: shapes.h:331
SG_Shape_Get_Dissolve
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Dissolve(CSG_Shape *pSubject, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:388
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:811
CSG_Parameters_Point_Search_KDTree_2D::~CSG_Parameters_Point_Search_KDTree_2D
virtual ~CSG_Parameters_Point_Search_KDTree_2D(void)
Definition: shapes.h:1400
CSG_Shape_Point_Z::Get_ZMin
virtual double Get_ZMin(void)
Definition: shapes.h:330
CSG_Points
Definition: geo_tools.h:185
CSG_Shapes::m_Vertex_Type
TSG_Vertex_Type m_Vertex_Type
Definition: shapes.h:847
CSG_Shape_Part::Get_Owner
class CSG_Shape_Points * Get_Owner(void)
Definition: shapes.h:377
CSG_Bytes
Definition: api_core.h:813
CSG_PRQuadTree_Node::Get_X
virtual CSG_Simple_Statistics * Get_X(void)
Definition: shapes.h:1057
CSG_Shape_Part::Set_Point
int Set_Point(const CSG_Point &p, int iPoint)
Definition: shapes.h:408
CSG_PRQuadTree_Item::Contains
bool Contains(double x, double y) const
Definition: shapes.h:930
CSG_Shape_Part::_Update_Extent
virtual void _Update_Extent(void)
Definition: shape_part.cpp:402
CSG_Shape_Part::m_ZMax
double m_ZMax
Definition: shapes.h:460
CSG_KDTree::Get_Point
double * Get_Point(size_t i) const
Definition: shapes.h:1232
CSG_Shape_Part::m_MMin
double m_MMin
Definition: shapes.h:460
CSG_Shape::asLine
class CSG_Shape_Line * asLine(void) const
Definition: shapes.h:158
CSG_Shape_Part::Add_Point
int Add_Point(const CSG_Point_3D &p)
Definition: shapes.h:399
SG_OGIS_TYPE_PolyhedralSurfaceM
@ SG_OGIS_TYPE_PolyhedralSurfaceM
Definition: shapes.h:1496
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
SG_OGIS_TYPE_GeometryCollectionM
@ SG_OGIS_TYPE_GeometryCollectionM
Definition: shapes.h:1495
CSG_Shape_Point::Get_Centroid
virtual TSG_Point Get_Centroid(void)
Definition: shapes.h:294
CSG_Table
Definition: table.h:285
TSG_Shape_File_Format
TSG_Shape_File_Format
Definition: shapes.h:114
SG_Shape_Get_Difference
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Difference(CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:311
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
SG_OGIS_TYPE_TriangleZM
@ SG_OGIS_TYPE_TriangleZM
Definition: shapes.h:1509
CSG_Shape::Set_Point
virtual int Set_Point(const CSG_Point_3D &p, int iPoint=0, int iPart=0)=0
CSG_Shape_Points::m_Extent
CSG_Rect m_Extent
Definition: shapes.h:565
CSG_PRQuadTree::is_Okay
bool is_Okay(void) const
Definition: shapes.h:1128
CSG_PRQuadTree::Get_Selected_Distance
double Get_Selected_Distance(size_t i) const
Definition: shapes.h:1147
SSG_Point_4D::y
double y
Definition: geo_tools.h:360
CSG_Shape_Points::_Invalidate
virtual void _Invalidate(void)
Definition: shapes.h:574
CSG_PRQuadTree_Leaf::m_Point
TSG_Point m_Point
Definition: shapes.h:996
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
CSG_Shapes::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: shapes.h:797
SHAPE_NO_COPY
@ SHAPE_NO_COPY
Definition: shapes.h:125
CSG_Shape_Point::Set_Point
virtual int Set_Point(const CSG_Point_4D &p, int iPoint=0, int iPart=0)
Definition: shapes.h:287
CSG_Shape_Point::Set_Point
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)
Definition: shapes.h:284
SHAPE_FILE_FORMAT_GeoJSON
@ SHAPE_FILE_FORMAT_GeoJSON
Definition: shapes.h:118
SG_Char
#define SG_Char
Definition: api_core.h:536
CSG_PRQuadTree
Definition: shapes.h:1107
TSG_Vertex_Type
TSG_Vertex_Type
Definition: shapes.h:91
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_Array
Definition: api_core.h:308
CSG_Parameters_Point_Search::m_pParameters
class CSG_Parameters * m_pParameters
Definition: shapes.h:1391
SG_OGIS_TYPE_Triangle
@ SG_OGIS_TYPE_Triangle
Definition: shapes.h:1476
CSG_Parameters_Point_Search_KDTree_2D::Get_Count
sLong Get_Count(void) const
Definition: shapes.h:1408
CSG_String
Definition: api_core.h:563
CSG_KDTree::Get_Match_Index
size_t Get_Match_Index(size_t i) const
Definition: shapes.h:1226
CSG_Parameters_Point_Search::~CSG_Parameters_Point_Search
virtual ~CSG_Parameters_Point_Search(void)
Definition: shapes.h:1367
CSG_Shape_Polygon_Part::Get_Perimeter
double Get_Perimeter(void)
Definition: shapes.h:652
CSG_Shape::_Invalidate
virtual void _Invalidate(void)
Definition: shape.cpp:105
CSG_Shape_Polygon::is_Neighbour
bool is_Neighbour(CSG_Shape_Polygon *pPolygon, bool bSimpleCheck=true)
Definition: shape_polygon.cpp:1081
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
CSG_Shape::Set_Point
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)=0
CSG_Shape_Points::Get_Part
virtual CSG_Shape_Part * Get_Part(int iPart) const
Definition: shapes.h:499
CSG_PRQuadTree_Item::Set_Extent
void Set_Extent(const CSG_Rect &Extent, int Quadrant=-1)
Definition: shapes.h:942
CSG_Shape_Part::Add_Point
int Add_Point(double x, double y)
Definition: shapes.h:397
CSG_PRQuadTree_Item::Get_Extent
const CSG_Rect & Get_Extent(void) const
Definition: shapes.h:920
SG_OGIS_TYPE_PointZM
@ SG_OGIS_TYPE_PointZM
Definition: shapes.h:1500
CSG_Shape::Get_Point_Z
virtual TSG_Point_3D Get_Point_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:196
CSG_Shapes::Destroy
virtual bool Destroy(void)
Definition: shapes.cpp:331
CSG_KDTree
Definition: shapes.h:1214
SSG_Point_3D::y
double y
Definition: geo_tools.h:266
CSG_Shape_Polygon_Part::Get_Area
double Get_Area(void)
Definition: shapes.h:654
CSG_PRQuadTree_Item::asLeaf
class CSG_PRQuadTree_Leaf * asLeaf(void) const
Definition: shapes.h:932
CSG_KDTree::is_Okay
bool is_Okay(void) const
Definition: shapes.h:1223
CSG_Shape::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:211
CSG_PRQuadTree_Item::Get_Size
double Get_Size(void) const
Definition: shapes.h:927
CSG_Parameters_Point_Search::m_minPoints
size_t m_minPoints
Definition: shapes.h:1387
CSG_Shape::~CSG_Shape
virtual ~CSG_Shape(void)
Definition: shape.cpp:68
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Shape_Point::Get_Distance
virtual double Get_Distance(TSG_Point Point, int iPart) const
Definition: shapes.h:299
SSG_Point_4D::x
double x
Definition: geo_tools.h:360
SG_OGIS_TYPE_MultiPolygonM
@ SG_OGIS_TYPE_MultiPolygonM
Definition: shapes.h:1494
CSG_Shape_Points::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:541
CSG_Shape_Points::CSG_Shape_Part
friend class CSG_Shape_Part
Definition: shapes.h:486
CSG_Shape_Point_Z::CSG_Shape_Point_Z
CSG_Shape_Point_Z(class CSG_Shapes *pOwner, sLong Index)
Definition: shapes.h:326
CSG_Shape_Point_ZM::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:350
CSG_PRQuadTree_Leaf_List::Add_Value
void Add_Value(double z)
Definition: shapes.h:1032
CSG_Rect::Get_XCenter
double Get_XCenter(void) const
Definition: geo_tools.h:520
SG_OGIS_BYTEORDER_XDR
@ SG_OGIS_BYTEORDER_XDR
Definition: shapes.h:1458
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:508
SG_OGIS_TYPE_MultiPointZM
@ SG_OGIS_TYPE_MultiPointZM
Definition: shapes.h:1503
CSG_Shape_Point_Z
Definition: shapes.h:321
CSG_Shape::Ins_Point
virtual int Ins_Point(const CSG_Point_3D &p, int iPoint, int iPart=0)=0
CSG_Shape::Get_Point_ZM
virtual TSG_Point_4D Get_Point_ZM(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:212
SG_Shape_Get_Intersection
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Intersection(CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:291
CSG_Shape_Point::Add_Point
virtual int Add_Point(const CSG_Point_3D &p, int iPart=0)
Definition: shapes.h:276
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:505
CSG_KDTree::Get_Point_Value
virtual double Get_Point_Value(size_t i) const =0
CSG_Parameters_Point_Search::Get_Min_Points
size_t Get_Min_Points(void) const
Definition: shapes.h:1377
SHAPE_FILE_FORMAT_ESRI
@ SHAPE_FILE_FORMAT_ESRI
Definition: shapes.h:116
CSG_Shape_Part::Get_Count
int Get_Count(void) const
Definition: shapes.h:384
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid
Definition: grid.h:475
CSG_KDTree::Get_Point_Value
virtual double Get_Point_Value(int i) const
Definition: shapes.h:1235
CSG_Shape_Points::On_Intersects
virtual TSG_Intersection On_Intersects(CSG_Shape *pShape)
Definition: shape_points.cpp:449
CSG_PRQuadTree_Node_Statistics::CSG_PRQuadTree_Node_Statistics
CSG_PRQuadTree_Node_Statistics(const CSG_Rect &Extent, int Quadrant=-1)
Definition: shapes.h:1090
CSG_Shape_Polygon::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:704
CSG_PRQuadTree_Node_Statistics::Get_Y
virtual CSG_Simple_Statistics * Get_Y(void)
Definition: shapes.h:1084
CSG_PRQuadTree_Item::Get_Quadrant
int Get_Quadrant(double x, double y) const
Definition: shapes.h:956
CSG_Shape_Point::Add_Point
virtual int Add_Point(const CSG_Point_4D &p, int iPart=0)
Definition: shapes.h:277
CSG_Shape_Point::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:268
CSG_Shape::Set_Point
virtual int Set_Point(const CSG_Point_4D &p, int iPoint=0, int iPart=0)=0
ESG_OGIS_ByteOrder
ESG_OGIS_ByteOrder
Definition: shapes.h:1457
CSG_Shape_Point::Add_Point
virtual int Add_Point(const CSG_Point &p, int iPart=0)
Definition: shapes.h:275
CSG_KDTree::Destroy
virtual bool Destroy(void)
Definition: kdtree.cpp:279
CSG_PRQuadTree_Node_Statistics::CSG_PRQuadTree_Node_Statistics
CSG_PRQuadTree_Node_Statistics(CSG_PRQuadTree_Leaf *pLeaf)
Definition: shapes.h:1094
CSG_PRQuadTree_Leaf_List::s_z
CSG_Simple_Statistics s_z
Definition: shapes.h:1039
CSG_KDTree::Get_Point_Count
int Get_Point_Count(void) const
Definition: shapes.h:1230
SSG_Point_3D::z
double z
Definition: geo_tools.h:266
CSG_Shape_Point::Get_Point
virtual TSG_Point Get_Point(int iPoint, int iPart, bool bAscending=true) const
Definition: shapes.h:292
SG_OGIS_TYPE_MultiPointZ
@ SG_OGIS_TYPE_MultiPointZ
Definition: shapes.h:1481
CSG_KDTree::Get_Point
double * Get_Point(int i) const
Definition: shapes.h:1231
CSG_Shape_Points::Del_Point
virtual int Del_Point(int iPoint, int iPart=0)
Definition: shape_points.cpp:283
CSG_Shape::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
CSG_PRQuadTree_Leaf_List::Get_Variance
double Get_Variance(void)
Definition: shapes.h:1016
CSG_Rect::Get_YCenter
double Get_YCenter(void) const
Definition: geo_tools.h:521
CSG_Shape_Part::Ins_Point
int Ins_Point(const CSG_Point &p, int iPoint)
Definition: shapes.h:403
SG_OGIS_TYPE_PolygonZM
@ SG_OGIS_TYPE_PolygonZM
Definition: shapes.h:1502
CSG_Shape::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:192
CSG_Shape_Part::Get_ZMax
double Get_ZMax(void)
Definition: shapes.h:417
CSG_Shape_Points::Get_Point_Count
virtual int Get_Point_Count(void) const
Definition: shapes.h:494
CSG_Table::Create
bool Create(void)
Definition: table.cpp:153
CSG_PRQuadTree_Leaf::m_z
double m_z
Definition: shapes.h:994
CSG_Shapes
Definition: shapes.h:773
CSG_Shape_Points::Set_Point
virtual int Set_Point(const CSG_Point &p, int iPoint=0, int iPart=0)
Definition: shapes.h:514
CSG_Table::Save
virtual bool Save(const CSG_String &File, int Format, SG_Char Separator, int Encoding=SG_FILE_ENCODING_UNDEFINED)
Definition: table_io.cpp:150
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
SG_Shape_Get_Offset
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Offset(CSG_Shape *pSubject, double Size, double dArc, CSG_Shape *pSolution=NULL)
Definition: shapes_clipper.cpp:394
CSG_Shape_Point::Ins_Point
virtual int Ins_Point(const CSG_Point &p, int iPoint, int iPart=0)
Definition: shapes.h:280
TSG_OGIS_Type_Geometry
TSG_OGIS_Type_Geometry
Definition: shapes.h:1464
CSG_PRQuadTree_Leaf_List::~CSG_PRQuadTree_Leaf_List
virtual ~CSG_PRQuadTree_Leaf_List(void)
Definition: shapes.h:1030
CSG_Shape_Point_Z::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:328
CSG_PointCloud
Definition: pointcloud.h:105
CSG_Lines
Definition: geo_tools.h:217
CSG_PRQuadTree_Leaf::is_Leaf
virtual bool is_Leaf(void) const
Definition: shapes.h:973
CSG_Shape_Part::Add_Point
int Add_Point(const CSG_Point_4D &p)
Definition: shapes.h:400
CSG_Shape::Ins_Point
virtual int Ins_Point(const CSG_Point_4D &p, int iPoint, int iPart=0)=0
CSG_Shape_Points::m_nPoints
int m_nPoints
Definition: shapes.h:561
CSG_PRQuadTree_Item::has_Statistics
virtual bool has_Statistics(void) const
Definition: shapes.h:918
CSG_Shape::asPolygon
class CSG_Shape_Polygon * asPolygon(void) const
Definition: shapes.h:159
SG_OGIS_TYPE_Polygon
@ SG_OGIS_TYPE_Polygon
Definition: shapes.h:1469
SG_OGIS_TYPE_LineStringZ
@ SG_OGIS_TYPE_LineStringZ
Definition: shapes.h:1479
CSG_KDTree::Get_Match_Count
size_t Get_Match_Count(void) const
Definition: shapes.h:1225
SG_OGIS_TYPE_MultiPointM
@ SG_OGIS_TYPE_MultiPointM
Definition: shapes.h:1492
CSG_Shape_Part::Get_Point_ZM
TSG_Point_4D Get_Point_ZM(int iPoint, bool bAscending=true) const
Definition: shapes.h:433
CSG_Parameters
Definition: parameters.h:1690
CSG_Array_sLong
Definition: api_core.h:479
SG_OGIS_TYPE_MultiLineStringZM
@ SG_OGIS_TYPE_MultiLineStringZM
Definition: shapes.h:1504
CSG_PRQuadTree_Item::Get_Quadrant
int Get_Quadrant(const TSG_Point &p) const
Definition: shapes.h:954
CSG_Table::Select
virtual bool Select(sLong Index, bool bInvert=false)
Definition: table_selection.cpp:136
CSG_KDTree_2D::Get_Point_Value
virtual double Get_Point_Value(size_t i) const
Definition: shapes.h:1282
CSG_Shapes::Get_Type
virtual TSG_Shape_Type Get_Type(void) const
Definition: shapes.h:807
CSG_Shape_Points::Get_Part_Count
virtual int Get_Part_Count(void) const
Definition: shapes.h:496
CSG_PRQuadTree_Item::Get_xMin
double Get_xMin(void) const
Definition: shapes.h:921
CSG_Shape_Part::m_bUpdate
bool m_bUpdate
Definition: shapes.h:456
CSG_Shape_Points::Get_Point
virtual TSG_Point Get_Point(int iPoint, int iPart, bool bAscending=true) const
Definition: shapes.h:521
CSG_Shape_Polygon
Definition: shapes.h:699
CSG_Shape_Point::Ins_Point
virtual int Ins_Point(double x, double y, int iPoint, int iPart=0)
Definition: shapes.h:279
CSG_Matrix
Definition: mat_tools.h:478
CSG_Shape_Point::Get_Point_Count
virtual int Get_Point_Count(int iPart) const
Definition: shapes.h:271
CSG_Shape::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:208
CSG_PRQuadTree_Item
Definition: shapes.h:913
CSG_Simple_Statistics
Definition: mat_tools.h:723
CSG_Shape_Point::Add_Point
virtual int Add_Point(double x, double y, int iPart=0)
Definition: shapes.h:274
CSG_Shape_Points::m_bUpdate
bool m_bUpdate
Definition: shapes.h:559
SG_OGIS_TYPE_MultiPolygonZ
@ SG_OGIS_TYPE_MultiPolygonZ
Definition: shapes.h:1483
CSG_Shape_Points::Get_Centroid
virtual TSG_Point Get_Centroid(void)
Definition: shape_points.cpp:364
CSG_Shape
Definition: shapes.h:141
CSG_PRQuadTree_Node_Statistics::Get_Z
virtual CSG_Simple_Statistics * Get_Z(void)
Definition: shapes.h:1085
table.h
CSG_PRQuadTree_Item::Get_yMax
double Get_yMax(void) const
Definition: shapes.h:926
CSG_Shape_Part
Definition: shapes.h:370
SG_VERTEX_TYPE_XYZ
@ SG_VERTEX_TYPE_XYZ
Definition: shapes.h:93
CSG_Shape_Point::m_Point
TSG_Point m_Point
Definition: shapes.h:310
CSG_Shapes::Get_ZMax
double Get_ZMax(void)
Definition: shapes.h:814
CSG_Shape::Add_Point
virtual int Add_Point(const CSG_Point_4D &p, int iPart=0)=0
CSG_Table::_Get_New_Record
virtual CSG_Table_Record * _Get_New_Record(sLong Index)
Definition: table.cpp:782
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
CSG_Shape::On_Intersects
virtual TSG_Intersection On_Intersects(CSG_Shape *pShape)=0
CSG_Parameters_Point_Search::m_Radius
double m_Radius
Definition: shapes.h:1389
CSG_Shape_Point_ZM::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:349
CSG_PRQuadTree_Leaf
Definition: shapes.h:968
SG_OGIS_TYPE_MultiLineStringM
@ SG_OGIS_TYPE_MultiLineStringM
Definition: shapes.h:1493
CSG_PRQuadTree_Leaf_List::CSG_PRQuadTree_Leaf_List
CSG_PRQuadTree_Leaf_List(const CSG_Rect &Extent, int Quadrant, double x, double y, double z)
Definition: shapes.h:1022
SG_OGIS_TYPE_MultiLineStringZ
@ SG_OGIS_TYPE_MultiLineStringZ
Definition: shapes.h:1482
CSG_PRQuadTree::is_Polar
bool is_Polar(void) const
Definition: shapes.h:1130
CSG_Shape::On_Intersects
virtual TSG_Intersection On_Intersects(TSG_Rect Extent)=0
CSG_Shape::Get_Distance
virtual double Get_Distance(TSG_Point Point, int iPart) const =0
SG_OGIS_TYPE_LineStringM
@ SG_OGIS_TYPE_LineStringM
Definition: shapes.h:1490
CSG_PRQuadTree::Add_Point
bool Add_Point(double x, double y, double z)
Definition: quadtree.cpp:297
CSG_PRQuadTree_Leaf::~CSG_PRQuadTree_Leaf
virtual ~CSG_PRQuadTree_Leaf(void)
Definition: shapes.h:991
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:295
CSG_PRQuadTree::Get_Selected_Point
bool Get_Selected_Point(size_t i, double &x, double &y, double &z) const
Definition: shapes.h:1148
CSG_Shape::On_Assign
virtual bool On_Assign(CSG_Shape *pShape)=0
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(int iPart) const =0
CSG_Shape_Part::Get_MMin
double Get_MMin(void)
Definition: shapes.h:431
CSG_PRQuadTree_Item::Get_xMax
double Get_xMax(void) const
Definition: shapes.h:923