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