SAGA API  v9.7
shapes.cpp
Go to the documentation of this file.
1 
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shapes.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51 
52 //---------------------------------------------------------
53 #include "shapes.h"
54 #include "pointcloud.h"
55 #include "tool_library.h"
56 
57 
59 // //
60 // //
61 // //
63 
64 //---------------------------------------------------------
66 {
67  switch( Type )
68  {
69  case SHAPE_TYPE_Point : return( _TL("Point" ) );
70  case SHAPE_TYPE_Points : return( _TL("Points" ) );
71  case SHAPE_TYPE_Line : return( _TL("Line" ) );
72  case SHAPE_TYPE_Polygon: return( _TL("Polygon" ) );
73  default : return( _TL("Undefined") );
74  }
75 }
76 
77 
79 // //
80 // //
81 // //
83 
84 //---------------------------------------------------------
86 {
87  return( new CSG_Shapes );
88 }
89 
90 //---------------------------------------------------------
92 {
93  switch( Shapes.Get_ObjectType() )
94  {
96  return( new CSG_Shapes(Shapes) );
97 
99  return( SG_Create_PointCloud(*((CSG_PointCloud *)&Shapes)) );
100 
101  default:
102  return( NULL );
103  }
104 }
105 
106 //---------------------------------------------------------
107 CSG_Shapes * SG_Create_Shapes(const char *File) { return( SG_Create_Shapes(CSG_String(File)) ); }
108 CSG_Shapes * SG_Create_Shapes(const wchar_t *File) { return( SG_Create_Shapes(CSG_String(File)) ); }
110 {
111  CSG_Shapes *pShapes = new CSG_Shapes();
112 
113  if( pShapes->Create(File) )
114  {
115  return( pShapes );
116  }
117 
118  delete(pShapes); return( NULL );
119 }
120 
121 //---------------------------------------------------------
122 CSG_Shapes * SG_Create_Shapes(TSG_Shape_Type Type, const SG_Char *Name, CSG_Table *pTemplate, TSG_Vertex_Type Vertex_Type)
123 {
124  return( new CSG_Shapes(Type, Name, pTemplate, Vertex_Type) );
125 }
126 
127 //---------------------------------------------------------
129 {
130  if( pTemplate )
131  {
132  switch( pTemplate->Get_ObjectType() )
133  {
135  return( new CSG_Shapes(pTemplate->Get_Type(), pTemplate->Get_Name(), pTemplate, pTemplate->Get_Vertex_Type()) );
136 
138  return( SG_Create_PointCloud((CSG_PointCloud *)pTemplate) );
139 
140  default:
141  break;
142  }
143  }
144 
145  return( new CSG_Shapes() );
146 }
147 
148 
150 // //
151 // //
152 // //
154 
155 //---------------------------------------------------------
157  : CSG_Table()
158 {
160 }
161 
162 //---------------------------------------------------------
164  : CSG_Table()
165 {
166  _On_Construction(); Create(Shapes);
167 }
168 
169 //---------------------------------------------------------
170 CSG_Shapes::CSG_Shapes(const char *File) : CSG_Shapes(CSG_String(File)) {}
171 CSG_Shapes::CSG_Shapes(const wchar_t *File) : CSG_Shapes(CSG_String(File)) {}
173  : CSG_Table()
174 {
175  _On_Construction(); Create(File);
176 }
177 
178 //---------------------------------------------------------
179 CSG_Shapes::CSG_Shapes(TSG_Shape_Type Type, const SG_Char *Name, CSG_Table *pTemplate, TSG_Vertex_Type Vertex_Type)
180  : CSG_Table()
181 {
182  _On_Construction(); Create(Type, Name, pTemplate, Vertex_Type);
183 }
184 
185 
187 // //
188 // //
189 // //
191 
192 //---------------------------------------------------------
194 {
196 
199 
201 }
202 
203 
205 // //
207 
208 //---------------------------------------------------------
209 bool CSG_Shapes::Create(const CSG_Shapes &Shapes)
210 {
211  return( Assign((CSG_Data_Object *)&Shapes) );
212 }
213 
214 //---------------------------------------------------------
215 bool CSG_Shapes::Create(const char *File) { return( Create(CSG_String(File)) ); }
216 bool CSG_Shapes::Create(const wchar_t *File) { return( Create(CSG_String(File)) ); }
218 {
219  Destroy();
220 
221  SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Loading"), _TL("shapes"), File.c_str()), true);
222 
223  bool bResult = false;
224 
225  //-----------------------------------------------------
226  if( File.BeforeFirst(':').Cmp("PGSQL") == 0 ) // database source
227  {
228  CSG_String s(File);
229 
230  s = s.AfterFirst(':'); CSG_String Host (s.BeforeFirst(':'));
231  s = s.AfterFirst(':'); CSG_String Port (s.BeforeFirst(':'));
232  s = s.AfterFirst(':'); CSG_String DBase(s.BeforeFirst(':'));
233  s = s.AfterFirst(':'); CSG_String Table(s.BeforeFirst(':'));
234 
235  CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("db_pgsql", 20, true); // CPGIS_Shapes_Load
236 
237  if( pTool != NULL )
238  {
240 
241  CSG_String Connection(DBase + " [" + Host + ":" + Port + "]");
242 
243  bResult = pTool->Set_Manager(NULL) && pTool->On_Before_Execution()
244  && pTool->Set_Parameter("CONNECTION", Connection)
245  && pTool->Set_Parameter("DB_TABLE" , Table )
246  && pTool->Set_Parameter("SHAPES" , this )
247  && pTool->Execute();
248 
250 
252  }
253  }
254  else
255  {
256  if( SG_File_Cmp_Extension(File, "shp") )
257  {
258  bResult = _Load_ESRI(File);
259  }
260 
261  if( !bResult )
262  {
263  bResult = _Load_GDAL(File);
264  }
265  }
266 
267  //-----------------------------------------------------
268  if( bResult )
269  {
270  Set_Modified(false);
271  Set_Update_Flag();
272 
274  SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
275 
276  return( true );
277  }
278 
279  //-----------------------------------------------------
280  for(sLong iShape=Get_Count()-1; iShape>=0; iShape--) // be kind, keep at least those shapes that have been loaded successfully
281  {
282  if( !Get_Shape(iShape)->is_Valid() )
283  {
284  Del_Shape(iShape);
285  }
286  }
287 
288  if( Get_Count() <= 0 )
289  {
290  Destroy();
291  }
292 
293  //-----------------------------------------------------
295  SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
296 
297  return( false );
298 }
299 
300 //---------------------------------------------------------
301 bool CSG_Shapes::Create(TSG_Shape_Type Type, const SG_Char *Name, CSG_Table *pTemplate, TSG_Vertex_Type Vertex_Type)
302 {
303  Destroy();
304 
305  CSG_Table::Create(pTemplate);
306 
307  if( Name )
308  {
309  Set_Name(CSG_String(Name));
310  }
311 
312  m_Type = Type; m_Vertex_Type = Vertex_Type;
313 
314  return( true );
315 }
316 
317 
319 // //
320 // //
321 // //
323 
324 //---------------------------------------------------------
326 {
327  Destroy();
328 }
329 
330 //---------------------------------------------------------
332 {
333  if( CSG_Table::Destroy() )
334  {
336 
337  return( true );
338  }
339 
340  return( false );
341 }
342 
343 
345 // //
346 // //
347 // //
349 
350 //---------------------------------------------------------
352 {
353  if( CSG_Data_Object::Assign(pObject) && pObject->asShapes(true) )
354  {
355  CSG_Shapes *pShapes = pObject->asShapes(true);
356 
357  Create(pShapes->Get_Type(), pShapes->Get_Name(), pShapes, pShapes->Get_Vertex_Type());
358 
359  Get_Projection().Create(pShapes->Get_Projection());
360 
361  for(sLong iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Get_Okay(); iShape++)
362  {
363  Add_Shape(pShapes->Get_Shape(iShape));
364  }
365 
366  return( true );
367  }
368 
369  return( false );
370 }
371 
372 
374 // //
375 // //
376 // //
378 
379 //---------------------------------------------------------
381 {
382  switch( m_Type )
383  {
384  case SHAPE_TYPE_Polygon : return( new CSG_Shape_Polygon (this, Index) );
385  case SHAPE_TYPE_Line : return( new CSG_Shape_Line (this, Index) );
386  case SHAPE_TYPE_Points : return( new CSG_Shape_Points (this, Index) );
387  case SHAPE_TYPE_Point :
388  switch( m_Vertex_Type )
389  {
390  case SG_VERTEX_TYPE_XY : return( new CSG_Shape_Point (this, Index) );
391  case SG_VERTEX_TYPE_XYZ : return( new CSG_Shape_Point_Z (this, Index) );
392  case SG_VERTEX_TYPE_XYZM: return( new CSG_Shape_Point_ZM(this, Index) );
393  default:
394  return( NULL );
395  }
396  default:
397  return( NULL );
398  }
399 }
400 
401 //---------------------------------------------------------
403 {
404  CSG_Shape *pShape = (CSG_Shape *)Add_Record();
405 
406  if( pShape && pCopy && mCopy != SHAPE_NO_COPY )
407  {
408  pShape->Assign(pCopy, mCopy);
409  }
410 
411  return( pShape );
412 }
413 
414 //---------------------------------------------------------
416 {
417  return( Del_Record(pShape->Get_Index()) );
418 }
419 
421 {
422  return( Del_Record(Index) );
423 }
424 
425 
427 // //
428 // //
429 // //
431 
432 //---------------------------------------------------------
434 {
435  if( Get_Count() > 0 )
436  {
437  CSG_Shape *pShape = Get_Shape(0);
438 
439  m_Extent = pShape->Get_Extent();
440  m_ZMin = pShape->Get_ZMin();
441  m_ZMax = pShape->Get_ZMax();
442  m_MMin = pShape->Get_MMin();
443  m_MMax = pShape->Get_MMax();
444 
445  for(sLong i=1; i<Get_Count(); i++)
446  {
447  pShape = Get_Shape(i);
448 
449  m_Extent.Union(pShape->Get_Extent());
450 
451  switch( m_Vertex_Type )
452  {
453  case SG_VERTEX_TYPE_XYZM:
454  if( m_MMin > pShape->Get_MMin() ) m_MMin = pShape->Get_MMin();
455  if( m_MMax < pShape->Get_MMax() ) m_MMax = pShape->Get_MMax();
456 
457  case SG_VERTEX_TYPE_XYZ:
458  if( m_ZMin > pShape->Get_ZMin() ) m_ZMin = pShape->Get_ZMin();
459  if( m_ZMax < pShape->Get_ZMax() ) m_ZMax = pShape->Get_ZMax();
460  break;
461 
462  default:
463  break;
464  }
465  }
466  }
467  else
468  {
469  m_Extent.Assign(0.0, 0.0, 0.0, 0.0);
470  }
471 
472  return( CSG_Table::On_Update() );
473 }
474 
475 
477 // //
478 // //
479 // //
481 
482 //---------------------------------------------------------
483 CSG_Shape * CSG_Shapes::Get_Shape(const CSG_Point &Point, double Epsilon)
484 {
485  CSG_Rect r(Point.x - Epsilon, Point.y - Epsilon, Point.x + Epsilon, Point.y + Epsilon);
486 
487  CSG_Shape *pNearest = NULL;
488 
490  {
491  double dNearest = -1.;
492 
493  for(sLong iShape=0; iShape<Get_Count(); iShape++)
494  {
495  CSG_Shape *pShape = Get_Shape(iShape);
496 
497  if( pShape->Intersects(r) )
498  {
499  double d = pShape->Get_Distance(Point);
500 
501  if( d == 0. )
502  {
503  return( pShape );
504  }
505  else if( d > 0. && d <= Epsilon && (pNearest == NULL || d < dNearest) )
506  {
507  dNearest = d;
508  pNearest = pShape;
509  }
510  }
511  }
512  }
513 
514  return( pNearest );
515 }
516 
517 
519 // //
520 // //
521 // //
523 
524 //---------------------------------------------------------
526 {
527  if( m_Type != SHAPE_TYPE_Polygon )
528  {
529  return( true );
530  }
531 
532  for(sLong iShape=0; iShape<Get_Count() && SG_UI_Process_Set_Progress(iShape, Get_Count()); iShape++)
533  {
534  CSG_Shape_Polygon *pPolygon = (CSG_Shape_Polygon *)Get_Shape(iShape);
535 
536  for(int iPart=0; iPart<pPolygon->Get_Part_Count(); iPart++)
537  {
538  // currently we have to disable this check for 3D shapefiles since the
539  // _Update_Area() method can not handle polygons with no horizontal extent
541  {
542  if( pPolygon->is_Lake(iPart) == pPolygon->is_Clockwise(iPart) )
543  {// ring direction: outer rings > clockwise, inner rings (lakes) > counterclockwise !
544  pPolygon->Revert_Points(iPart);
545  }
546  }
547 
548  //---------------------------------------------
549  if( !CSG_Point(pPolygon->Get_Point(0, iPart)).is_Equal(pPolygon->Get_Point(pPolygon->Get_Point_Count(iPart) - 1, iPart)) )
550  { // last point == first point !
551  ((CSG_Shape *)pPolygon)->Add_Point(pPolygon->Get_Point(0, iPart), iPart);
552 
554  {
555  pPolygon->Set_Z(pPolygon->Get_Z(0, iPart), pPolygon->Get_Point_Count(iPart) - 1, iPart);
556 
558  {
559  pPolygon->Set_M(pPolygon->Get_M(0, iPart), pPolygon->Get_Point_Count(iPart) - 1, iPart);
560  }
561  }
562  }
563 
564  //--------------------------------------------
565  // to do: ensure there is no self intersection !
566  }
567  }
568 
569  return( true );
570 }
571 
572 
574 // //
575 // //
576 // //
578 
579 //---------------------------------------------------------
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:690
CSG_Rect
Definition: geo_tools.h:474
CSG_Shapes::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: shapes.cpp:351
CSG_Data_Object::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: dataobject.cpp:797
CSG_Shape_Point_ZM
Definition: shapes.h:342
CSG_Rect::Assign
CSG_Rect & Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:727
CSG_Shapes::m_ZMin
double m_ZMin
Definition: shapes.h:843
CSG_Shapes::Del_Shape
virtual bool Del_Shape(sLong Index)
Definition: shapes.cpp:420
CSG_Shapes::m_MMax
double m_MMax
Definition: shapes.h:843
_TL
#define _TL(s)
Definition: api_core.h:1507
CSG_Shape_Points::Revert_Points
virtual bool Revert_Points(int iPart)
Definition: shapes.h:550
CSG_Shapes::_Get_New_Record
virtual CSG_Table_Record * _Get_New_Record(sLong Index)
Definition: shapes.cpp:380
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:483
CSG_Shape_Polygon::is_Clockwise
bool is_Clockwise(int iPart)
Definition: shape_polygon.cpp:826
CSG_Table_Record
Definition: table.h:130
CSG_Shape_Points::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:531
CSG_Shape_Points::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:532
CSG_Shape_Point
Definition: shapes.h:263
TSG_ADD_Shape_Copy_Mode
TSG_ADD_Shape_Copy_Mode
Definition: shapes.h:124
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
SG_Create_PointCloud
CSG_PointCloud * SG_Create_PointCloud(void)
Definition: pointcloud.cpp:76
SG_UI_MSG_STYLE_SUCCESS
@ SG_UI_MSG_STYLE_SUCCESS
Definition: api_core.h:1523
SG_File_Cmp_Extension
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
Definition: api_file.cpp:1091
CSG_Shapes::Create
bool Create(const CSG_Shapes &Shapes)
Definition: shapes.cpp:209
CSG_Shapes::Get_MMax
double Get_MMax(void)
Definition: shapes.h:816
SG_UI_Process_Get_Okay
bool SG_UI_Process_Get_Okay(bool bBlink)
Definition: api_callback.cpp:207
SHAPE_TYPE_Polygon
@ SHAPE_TYPE_Polygon
Definition: shapes.h:105
CSG_Rect::Intersects
TSG_Intersection Intersects(const CSG_Rect &Rect) const
Definition: geo_classes.cpp:881
CSG_Shape_Points
Definition: shapes.h:484
CSG_Tool
Definition: tool.h:151
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:325
CSG_Shapes::~CSG_Shapes
virtual ~CSG_Shapes(void)
Definition: shapes.cpp:325
CSG_Data_Object::Get_Name
const SG_Char * Get_Name(void) const
Definition: dataobject.cpp:349
CSG_Shapes::m_ZMax
double m_ZMax
Definition: shapes.h:843
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:258
CSG_Shapes::_On_Construction
virtual void _On_Construction(void)
Definition: shapes.cpp:193
CSG_Shapes::m_Type
TSG_Shape_Type m_Type
Definition: shapes.h:845
CSG_Table::m_Extent
CSG_Rect m_Extent
Definition: table.h:472
CSG_Shape::Intersects
TSG_Intersection Intersects(CSG_Shape *pShape)
Definition: shape.cpp:118
CSG_Shapes::is_Valid
virtual bool is_Valid(void) const
Definition: shapes.h:805
CSG_Shapes::CSG_Shapes
CSG_Shapes(void)
Definition: shapes.cpp:156
CSG_Tool_Library_Manager::Delete_Tool
bool Delete_Tool(CSG_Tool *pTool) const
Definition: tool_library.cpp:865
CSG_Shape::Get_Distance
virtual double Get_Distance(TSG_Point Point) const =0
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:285
CSG_Table::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: table.cpp:1106
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
CSG_Shape_Points::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const
Definition: shape_points.cpp:294
CSG_Shapes::Add_Shape
virtual CSG_Shape * Add_Shape(CSG_Table_Record *pCopy=NULL, TSG_ADD_Shape_Copy_Mode mCopy=SHAPE_COPY)
Definition: shapes.cpp:402
SG_VERTEX_TYPE_XY
@ SG_VERTEX_TYPE_XY
Definition: shapes.h:92
CSG_Tool::Set_Parameter
bool Set_Parameter(const CSG_String &ID, CSG_Parameter *pValue)
Definition: tool.cpp:1140
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1524
CSG_Data_Object::asShapes
class CSG_Shapes * asShapes(bool bPolymorph=false) const
Definition: dataobject.cpp:509
CSG_Shape_Points::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:536
CSG_Shapes::Get_Vertex_Type
TSG_Vertex_Type Get_Vertex_Type(void) const
Definition: shapes.h:809
CSG_Data_Object
Definition: dataobject.h:180
CSG_Point
Definition: geo_tools.h:135
CSG_Shapes::m_MMin
double m_MMin
Definition: shapes.h:843
SG_VERTEX_TYPE_XYZM
@ SG_VERTEX_TYPE_XYZM
Definition: shapes.h:94
CSG_Shape_Line
Definition: shapes.h:601
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
CSG_Shape_Points::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:537
sLong
signed long long sLong
Definition: api_core.h:158
SG_Get_Tool_Library_Manager
CSG_Tool_Library_Manager & SG_Get_Tool_Library_Manager(void)
Definition: tool_library.cpp:286
CSG_Shape::Get_ZMax
virtual double Get_ZMax(void)
Definition: shapes.h:195
CSG_Shape::Get_ZMin
virtual double Get_ZMin(void)
Definition: shapes.h:194
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:397
CSG_Table::On_Update
virtual bool On_Update(void)
Definition: table.cpp:1281
pointcloud.h
CSG_Shape::Get_MMin
virtual double Get_MMin(void)
Definition: shapes.h:210
CSG_Shape::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: shape.cpp:195
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:811
CSG_Rect::Union
CSG_Rect & Union(double x, double y)
Definition: geo_classes.cpp:824
SG_Get_ShapeType_Name
CSG_String SG_Get_ShapeType_Name(TSG_Shape_Type Type)
Definition: shapes.cpp:65
CSG_Shapes::m_Vertex_Type
TSG_Vertex_Type m_Vertex_Type
Definition: shapes.h:847
CSG_Data_Object::Set_Name
void Set_Name(const CSG_String &Name)
Definition: dataobject.cpp:300
CSG_Table::m_Encoding
int m_Encoding
Definition: table.h:460
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
SHAPE_TYPE_Line
@ SHAPE_TYPE_Line
Definition: shapes.h:104
CSG_Tool_Library_Manager::Create_Tool
CSG_Tool * Create_Tool(const CSG_String &Library, int Index, bool bWithGUI=false, bool bWithCMD=true) const
Definition: tool_library.cpp:836
CSG_Table
Definition: table.h:285
SG_DATAOBJECT_TYPE_Shapes
@ SG_DATAOBJECT_TYPE_Shapes
Definition: dataobject.h:121
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:668
CSG_Shapes::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: shapes.h:797
SHAPE_NO_COPY
@ SHAPE_NO_COPY
Definition: shapes.h:125
CSG_Table::Del_Record
virtual bool Del_Record(sLong Index)
Definition: table.cpp:862
SG_Char
#define SG_Char
Definition: api_core.h:536
TSG_Vertex_Type
TSG_Vertex_Type
Definition: shapes.h:91
shapes.h
CSG_String
Definition: api_core.h:563
CSG_Tool::Set_Manager
bool Set_Manager(class CSG_Data_Manager *pManager)
Definition: tool.cpp:570
SHAPE_TYPE_Point
@ SHAPE_TYPE_Point
Definition: shapes.h:102
CSG_Shapes::Destroy
virtual bool Destroy(void)
Definition: shapes.cpp:331
CSG_Shape::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:211
SG_UI_Process_Set_Progress
bool SG_UI_Process_Set_Progress(int Position, int Range)
Definition: api_callback.cpp:255
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Shape_Point_Z
Definition: shapes.h:321
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Shapes::Make_Clean
bool Make_Clean(void)
Definition: shapes.cpp:525
CSG_Table_Record::Get_Index
sLong Get_Index(void) const
Definition: table.h:136
CSG_Shape_Polygon::is_Lake
bool is_Lake(int iPart)
Definition: shape_polygon.cpp:766
CSG_Shape::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
CSG_Shape_Points::Get_Point_Count
virtual int Get_Point_Count(void) const
Definition: shapes.h:494
CSG_Table::Create
bool Create(void)
Definition: table.cpp:153
CSG_Tool::On_Before_Execution
virtual bool On_Before_Execution(void)
Definition: tool.h:245
CSG_Shapes
Definition: shapes.h:773
SG_UI_ProgressAndMsg_Lock
void SG_UI_ProgressAndMsg_Lock(bool bOn)
Definition: api_callback.cpp:589
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
tool_library.h
SHAPE_TYPE_Points
@ SHAPE_TYPE_Points
Definition: shapes.h:103
CSG_PointCloud
Definition: pointcloud.h:105
SG_UI_Process_Set_Ready
bool SG_UI_Process_Set_Ready(void)
Definition: api_callback.cpp:305
CSG_Shapes::Get_Type
virtual TSG_Shape_Type Get_Type(void) const
Definition: shapes.h:807
CSG_Shape_Points::Get_Part_Count
virtual int Get_Part_Count(void) const
Definition: shapes.h:496
CSG_Shapes::On_Update
virtual bool On_Update(void)
Definition: shapes.cpp:433
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:788
CSG_Shape_Polygon
Definition: shapes.h:699
CSG_Projection::Create
bool Create(const CSG_Projection &Projection)
Definition: projections.cpp:96
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:552
CSG_Shape
Definition: shapes.h:141
CSG_Data_Object::Get_Projection
CSG_Projection & Get_Projection(void)
Definition: dataobject.cpp:637
SG_VERTEX_TYPE_XYZ
@ SG_VERTEX_TYPE_XYZ
Definition: shapes.h:93
CSG_Shapes::Get_ZMax
double Get_ZMax(void)
Definition: shapes.h:814
SG_DATAOBJECT_TYPE_PointCloud
@ SG_DATAOBJECT_TYPE_PointCloud
Definition: dataobject.h:123
SHAPE_TYPE_Undefined
@ SHAPE_TYPE_Undefined
Definition: shapes.h:101
SG_UI_Msg_Add
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)
Definition: api_callback.cpp:502
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:295
SG_Create_Shapes
CSG_Shapes * SG_Create_Shapes(void)
Definition: shapes.cpp:85