SAGA API  v9.6
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(File);
112 
113  if( !pShapes->is_Valid() ) { delete(pShapes); return( NULL ); } return( pShapes );
114 }
115 
116 //---------------------------------------------------------
117 CSG_Shapes * SG_Create_Shapes(TSG_Shape_Type Type, const SG_Char *Name, CSG_Table *pTemplate, TSG_Vertex_Type Vertex_Type)
118 {
119  return( new CSG_Shapes(Type, Name, pTemplate, Vertex_Type) );
120 }
121 
122 //---------------------------------------------------------
124 {
125  if( pTemplate )
126  {
127  switch( pTemplate->Get_ObjectType() )
128  {
130  return( new CSG_Shapes(pTemplate->Get_Type(), pTemplate->Get_Name(), pTemplate, pTemplate->Get_Vertex_Type()) );
131 
133  return( SG_Create_PointCloud((CSG_PointCloud *)pTemplate) );
134 
135  default:
136  break;
137  }
138  }
139 
140  return( new CSG_Shapes() );
141 }
142 
143 
145 // //
146 // //
147 // //
149 
150 //---------------------------------------------------------
152  : CSG_Table()
153 {
155 }
156 
157 //---------------------------------------------------------
159  : CSG_Table()
160 {
161  _On_Construction(); Create(Shapes);
162 }
163 
164 //---------------------------------------------------------
165 CSG_Shapes::CSG_Shapes(const char *File) : CSG_Shapes(CSG_String(File)) {}
166 CSG_Shapes::CSG_Shapes(const wchar_t *File) : CSG_Shapes(CSG_String(File)) {}
168  : CSG_Table()
169 {
170  _On_Construction(); Create(File);
171 }
172 
173 //---------------------------------------------------------
174 CSG_Shapes::CSG_Shapes(TSG_Shape_Type Type, const SG_Char *Name, CSG_Table *pTemplate, TSG_Vertex_Type Vertex_Type)
175  : CSG_Table()
176 {
177  _On_Construction(); Create(Type, Name, pTemplate, Vertex_Type);
178 }
179 
180 
182 // //
183 // //
184 // //
186 
187 //---------------------------------------------------------
189 {
191 
194 
196 }
197 
198 
200 // //
202 
203 //---------------------------------------------------------
204 bool CSG_Shapes::Create(const CSG_Shapes &Shapes)
205 {
206  return( Assign((CSG_Data_Object *)&Shapes) );
207 }
208 
209 //---------------------------------------------------------
210 bool CSG_Shapes::Create(const char *File) { return( Create(CSG_String(File)) ); }
211 bool CSG_Shapes::Create(const wchar_t *File) { return( Create(CSG_String(File)) ); }
213 {
214  Destroy();
215 
216  SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Loading"), _TL("shapes"), File.c_str()), true);
217 
218  bool bResult = false;
219 
220  //-----------------------------------------------------
221  if( File.BeforeFirst(':').Cmp("PGSQL") == 0 ) // database source
222  {
223  CSG_String s(File);
224 
225  s = s.AfterFirst(':'); CSG_String Host (s.BeforeFirst(':'));
226  s = s.AfterFirst(':'); CSG_String Port (s.BeforeFirst(':'));
227  s = s.AfterFirst(':'); CSG_String DBName(s.BeforeFirst(':'));
228  s = s.AfterFirst(':'); CSG_String Table (s.BeforeFirst(':'));
229 
230  CSG_Tool *pTool = SG_Get_Tool_Library_Manager().Create_Tool("db_pgsql", 0, true); // CGet_Connections
231 
232  if( pTool != NULL )
233  {
235 
236  //---------------------------------------------
237  CSG_Table Connections; CSG_String Connection(DBName + " [" + Host + ":" + Port + "]");
238 
239  pTool->Set_Manager(NULL); pTool->On_Before_Execution();
240 
241  if( SG_TOOL_PARAMETER_SET("CONNECTIONS", &Connections) && pTool->Execute() ) // CGet_Connections
242  {
243  for(int i=0; !bResult && i<Connections.Get_Count(); i++)
244  {
245  if( !Connection.Cmp(Connections[i].asString(0)) )
246  {
247  bResult = true;
248  }
249  }
250  }
251 
253 
254  //---------------------------------------------
255  if( bResult && (bResult = (pTool = SG_Get_Tool_Library_Manager().Create_Tool("db_pgsql", 20, true)) != NULL) == true ) // CPGIS_Shapes_Load
256  {
257  pTool->Set_Manager(NULL); pTool->On_Before_Execution();
258 
259  bResult = SG_TOOL_PARAMETER_SET("CONNECTION", Connection)
260  && SG_TOOL_PARAMETER_SET("DB_TABLE" , Table )
261  && SG_TOOL_PARAMETER_SET("SHAPES" , this )
262  && pTool->Execute();
263 
265  }
266 
268  }
269  }
270  else
271  {
272  if( SG_File_Cmp_Extension(File, "shp") )
273  {
274  bResult = _Load_ESRI(File);
275  }
276 
277  if( !bResult )
278  {
279  bResult = _Load_GDAL(File);
280  }
281  }
282 
283  //-----------------------------------------------------
284  if( bResult )
285  {
286  Set_Modified(false);
287  Set_Update_Flag();
288 
290  SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
291 
292  return( true );
293  }
294 
295  //-----------------------------------------------------
296  for(sLong iShape=Get_Count()-1; iShape>=0; iShape--) // be kind, keep at least those shapes that have been loaded successfully
297  {
298  if( !Get_Shape(iShape)->is_Valid() )
299  {
300  Del_Shape(iShape);
301  }
302  }
303 
304  if( Get_Count() <= 0 )
305  {
306  Destroy();
307  }
308 
309  //-----------------------------------------------------
311  SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
312 
313  return( false );
314 }
315 
316 //---------------------------------------------------------
317 bool CSG_Shapes::Create(TSG_Shape_Type Type, const SG_Char *Name, CSG_Table *pTemplate, TSG_Vertex_Type Vertex_Type)
318 {
319  Destroy();
320 
321  CSG_Table::Create(pTemplate);
322 
323  if( Name )
324  {
325  Set_Name(CSG_String(Name));
326  }
327 
328  m_Type = Type; m_Vertex_Type = Vertex_Type;
329 
330  return( true );
331 }
332 
333 
335 // //
336 // //
337 // //
339 
340 //---------------------------------------------------------
342 {
343  Destroy();
344 }
345 
346 //---------------------------------------------------------
348 {
349  if( CSG_Table::Destroy() )
350  {
352 
353  return( true );
354  }
355 
356  return( false );
357 }
358 
359 
361 // //
362 // //
363 // //
365 
366 //---------------------------------------------------------
368 {
369  if( CSG_Data_Object::Assign(pObject) && pObject->asShapes(true) )
370  {
371  CSG_Shapes *pShapes = pObject->asShapes(true);
372 
373  Create(pShapes->Get_Type(), pShapes->Get_Name(), pShapes, pShapes->Get_Vertex_Type());
374 
375  Get_Projection().Create(pShapes->Get_Projection());
376 
377  for(sLong iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Get_Okay(); iShape++)
378  {
379  Add_Shape(pShapes->Get_Shape(iShape));
380  }
381 
382  return( true );
383  }
384 
385  return( false );
386 }
387 
388 
390 // //
391 // //
392 // //
394 
395 //---------------------------------------------------------
397 {
398  switch( m_Type )
399  {
400  case SHAPE_TYPE_Polygon : return( new CSG_Shape_Polygon (this, Index) );
401  case SHAPE_TYPE_Line : return( new CSG_Shape_Line (this, Index) );
402  case SHAPE_TYPE_Points : return( new CSG_Shape_Points (this, Index) );
403  case SHAPE_TYPE_Point :
404  switch( m_Vertex_Type )
405  {
406  case SG_VERTEX_TYPE_XY : return( new CSG_Shape_Point (this, Index) );
407  case SG_VERTEX_TYPE_XYZ : return( new CSG_Shape_Point_Z (this, Index) );
408  case SG_VERTEX_TYPE_XYZM: return( new CSG_Shape_Point_ZM(this, Index) );
409  default:
410  return( NULL );
411  }
412  default:
413  return( NULL );
414  }
415 }
416 
417 //---------------------------------------------------------
419 {
420  CSG_Shape *pShape = (CSG_Shape *)Add_Record();
421 
422  if( pShape && pCopy && mCopy != SHAPE_NO_COPY )
423  {
424  pShape->Assign(pCopy, mCopy);
425  }
426 
427  return( pShape );
428 }
429 
430 //---------------------------------------------------------
432 {
433  return( Del_Record(pShape->Get_Index()) );
434 }
435 
437 {
438  return( Del_Record(Index) );
439 }
440 
441 
443 // //
444 // //
445 // //
447 
448 //---------------------------------------------------------
450 {
451  if( Get_Count() > 0 )
452  {
453  CSG_Shape *pShape = Get_Shape(0);
454 
455  m_Extent = pShape->Get_Extent();
456  m_ZMin = pShape->Get_ZMin();
457  m_ZMax = pShape->Get_ZMax();
458  m_MMin = pShape->Get_MMin();
459  m_MMax = pShape->Get_MMax();
460 
461  for(sLong i=1; i<Get_Count(); i++)
462  {
463  pShape = Get_Shape(i);
464 
465  m_Extent.Union(pShape->Get_Extent());
466 
467  switch( m_Vertex_Type )
468  {
469  case SG_VERTEX_TYPE_XYZM:
470  if( m_MMin > pShape->Get_MMin() ) m_MMin = pShape->Get_MMin();
471  if( m_MMax < pShape->Get_MMax() ) m_MMax = pShape->Get_MMax();
472 
473  case SG_VERTEX_TYPE_XYZ:
474  if( m_ZMin > pShape->Get_ZMin() ) m_ZMin = pShape->Get_ZMin();
475  if( m_ZMax < pShape->Get_ZMax() ) m_ZMax = pShape->Get_ZMax();
476  break;
477 
478  default:
479  break;
480  }
481  }
482  }
483  else
484  {
485  m_Extent.Assign(0.0, 0.0, 0.0, 0.0);
486  }
487 
488  return( CSG_Table::On_Update() );
489 }
490 
491 
493 // //
494 // //
495 // //
497 
498 //---------------------------------------------------------
499 CSG_Shape * CSG_Shapes::Get_Shape(const CSG_Point &Point, double Epsilon)
500 {
501  CSG_Rect r(Point.x - Epsilon, Point.y - Epsilon, Point.x + Epsilon, Point.y + Epsilon);
502 
503  CSG_Shape *pNearest = NULL;
504 
506  {
507  double dNearest = -1.;
508 
509  for(sLong iShape=0; iShape<Get_Count(); iShape++)
510  {
511  CSG_Shape *pShape = Get_Shape(iShape);
512 
513  if( pShape->Intersects(r) )
514  {
515  double d = pShape->Get_Distance(Point);
516 
517  if( d == 0. )
518  {
519  return( pShape );
520  }
521  else if( d > 0. && d <= Epsilon && (pNearest == NULL || d < dNearest) )
522  {
523  dNearest = d;
524  pNearest = pShape;
525  }
526  }
527  }
528  }
529 
530  return( pNearest );
531 }
532 
533 
535 // //
536 // //
537 // //
539 
540 //---------------------------------------------------------
542 {
543  if( m_Type != SHAPE_TYPE_Polygon )
544  {
545  return( true );
546  }
547 
548  for(sLong iShape=0; iShape<Get_Count() && SG_UI_Process_Set_Progress(iShape, Get_Count()); iShape++)
549  {
550  CSG_Shape_Polygon *pPolygon = (CSG_Shape_Polygon *)Get_Shape(iShape);
551 
552  for(int iPart=0; iPart<pPolygon->Get_Part_Count(); iPart++)
553  {
554  // currently we have to disable this check for 3D shapefiles since the
555  // _Update_Area() method can not handle polygons with no horizontal extent
557  {
558  if( pPolygon->is_Lake(iPart) == pPolygon->is_Clockwise(iPart) )
559  {// ring direction: outer rings > clockwise, inner rings (lakes) > counterclockwise !
560  pPolygon->Revert_Points(iPart);
561  }
562  }
563 
564  //---------------------------------------------
565  if( !CSG_Point(pPolygon->Get_Point(0, iPart)).is_Equal(pPolygon->Get_Point(pPolygon->Get_Point_Count(iPart) - 1, iPart)) )
566  { // last point == first point !
567  ((CSG_Shape *)pPolygon)->Add_Point(pPolygon->Get_Point(0, iPart), iPart);
568 
570  {
571  pPolygon->Set_Z(pPolygon->Get_Z(0, iPart), pPolygon->Get_Point_Count(iPart) - 1, iPart);
572 
574  {
575  pPolygon->Set_M(pPolygon->Get_M(0, iPart), pPolygon->Get_Point_Count(iPart) - 1, iPart);
576  }
577  }
578  }
579 
580  //--------------------------------------------
581  // to do: ensure there is no self intersection !
582  }
583  }
584 
585  return( true );
586 }
587 
588 
590 // //
591 // //
592 // //
594 
595 //---------------------------------------------------------
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:666
CSG_Rect
Definition: geo_tools.h:471
CSG_Shapes::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: shapes.cpp:367
CSG_Data_Object::Assign
virtual bool Assign(CSG_Data_Object *pObject)
Definition: dataobject.cpp:793
CSG_Shape_Point_ZM
Definition: shapes.h:344
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:845
CSG_Shapes::Del_Shape
virtual bool Del_Shape(sLong Index)
Definition: shapes.cpp:436
CSG_Shapes::m_MMax
double m_MMax
Definition: shapes.h:845
_TL
#define _TL(s)
Definition: api_core.h:1489
CSG_Shape_Points::Revert_Points
virtual bool Revert_Points(int iPart)
Definition: shapes.h:552
CSG_Shapes::_Get_New_Record
virtual CSG_Table_Record * _Get_New_Record(sLong Index)
Definition: shapes.cpp:396
CSG_Shapes::Get_Shape
virtual CSG_Shape * Get_Shape(const CSG_Point &Point, double Epsilon=0.)
Definition: shapes.cpp:499
CSG_Shape_Polygon::is_Clockwise
bool is_Clockwise(int iPart)
Definition: shape_polygon.cpp:871
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:533
CSG_Shape_Points::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:534
CSG_Shape_Point
Definition: shapes.h:265
TSG_ADD_Shape_Copy_Mode
TSG_ADD_Shape_Copy_Mode
Definition: shapes.h:124
TSG_Shape_Type
TSG_Shape_Type
Definition: shapes.h:100
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:1505
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:952
CSG_Shapes::Get_MMax
double Get_MMax(void)
Definition: shapes.h:818
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:486
CSG_Tool
Definition: tool.h:151
CSG_Table::Destroy
virtual bool Destroy(void)
Definition: table.cpp:332
CSG_Shapes::~CSG_Shapes
virtual ~CSG_Shapes(void)
Definition: shapes.cpp:341
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:845
CSG_Tool::Execute
bool Execute(bool bAddHistory=false)
Definition: tool.cpp:258
CSG_Shapes::_On_Construction
virtual void _On_Construction(void)
Definition: shapes.cpp:188
CSG_Shapes::m_Type
TSG_Shape_Type m_Type
Definition: shapes.h:847
CSG_Table::m_Extent
CSG_Rect m_Extent
Definition: table.h:461
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:807
CSG_Shapes::CSG_Shapes
CSG_Shapes(void)
Definition: shapes.cpp:151
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:1113
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:418
SG_VERTEX_TYPE_XY
@ SG_VERTEX_TYPE_XY
Definition: shapes.h:92
SG_UI_MSG_STYLE_FAILURE
@ SG_UI_MSG_STYLE_FAILURE
Definition: api_core.h:1506
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:538
SG_TOOL_PARAMETER_SET
#define SG_TOOL_PARAMETER_SET(IDENTIFIER, VALUE)
Definition: tool_library.h:354
CSG_Shapes::Get_Vertex_Type
TSG_Vertex_Type Get_Vertex_Type(void) const
Definition: shapes.h:811
CSG_Data_Object
Definition: dataobject.h:180
CSG_Point
Definition: geo_tools.h:135
CSG_Shapes::m_MMin
double m_MMin
Definition: shapes.h:845
SG_VERTEX_TYPE_XYZM
@ SG_VERTEX_TYPE_XYZM
Definition: shapes.h:94
CSG_Shape_Line
Definition: shapes.h:603
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:539
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:197
CSG_Shape::Get_ZMin
virtual double Get_ZMin(void)
Definition: shapes.h:196
CSG_Table::Get_Count
sLong Get_Count(void) const
Definition: table.h:392
CSG_Table::On_Update
virtual bool On_Update(void)
Definition: table.cpp:1288
pointcloud.h
CSG_Shape::Get_MMin
virtual double Get_MMin(void)
Definition: shapes.h:212
CSG_Shape::Assign
virtual bool Assign(CSG_Table_Record *pRecord)
Definition: shape.cpp:195
CSG_Shapes::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shapes.h:813
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:849
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:449
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:283
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:644
CSG_Shapes::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Returns the object type as defined by TSG_Data_Object_Type. Used for run time type checking.
Definition: shapes.h:799
SHAPE_NO_COPY
@ SHAPE_NO_COPY
Definition: shapes.h:125
CSG_Table::Del_Record
virtual bool Del_Record(sLong Index)
Definition: table.cpp:869
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:347
CSG_Shape::Get_MMax
virtual double Get_MMax(void)
Definition: shapes.h:213
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:323
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Shapes::Make_Clean
bool Make_Clean(void)
Definition: shapes.cpp:541
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:811
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:496
CSG_Table::Create
bool Create(void)
Definition: table.cpp:139
CSG_Tool::On_Before_Execution
virtual bool On_Before_Execution(void)
Definition: tool.h:245
CSG_Shapes
Definition: shapes.h:775
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:809
CSG_Shape_Points::Get_Part_Count
virtual int Get_Part_Count(void) const
Definition: shapes.h:498
CSG_Shapes::On_Update
virtual bool On_Update(void)
Definition: shapes.cpp:449
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:795
CSG_Shape_Polygon
Definition: shapes.h:701
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:816
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:302
SG_Create_Shapes
CSG_Shapes * SG_Create_Shapes(void)
Definition: shapes.cpp:85