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