SAGA API  v9.5
shape_point.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: Shapes //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // shape_point.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 
55 
57 // //
58 // //
59 // //
61 
62 //---------------------------------------------------------
64  : CSG_Shape(pOwner, Index)
65 {}
66 
67 //---------------------------------------------------------
69 {}
70 
71 
73 // //
75 
76 //---------------------------------------------------------
78 {
79  if( pShape->Get_Point_Count(0) > 0 )
80  {
81  Set_Point(pShape->Get_Point());
82  Set_Z (pShape->Get_Z ());
83  Set_M (pShape->Get_M ());
84 
85  return( true );
86  }
87 
88  return( false );
89 }
90 
91 
93 // //
95 
96 //---------------------------------------------------------
98 {
99  static CSG_Rect Extent;
100 
101  Extent.Assign(m_Point.x, m_Point.y, m_Point.x, m_Point.y);
102 
103  return( Extent );
104 }
105 
106 //---------------------------------------------------------
108 {
109  return( INTERSECTION_None );
110 }
111 
112 //---------------------------------------------------------
114 {
115  if( Extent.xMin <= m_Point.x && m_Point.x <= Extent.xMax
116  && Extent.yMin <= m_Point.y && m_Point.y <= Extent.yMax )
117  {
118  return( INTERSECTION_Overlaps );
119  }
120 
121  return( INTERSECTION_None );
122 }
123 
124 
126 // //
127 // //
128 // //
130 
131 //---------------------------------------------------------
CSG_Rect
Definition: geo_tools.h:471
CSG_Rect::Assign
CSG_Rect & Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:727
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Shape_Point::On_Assign
virtual bool On_Assign(CSG_Shape *pShape)
Definition: shape_point.cpp:77
CSG_Shape::Get_Z
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:195
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SSG_Rect
Definition: geo_tools.h:464
CSG_Shape::Get_Point
virtual TSG_Point Get_Point(int iPoint=0) const =0
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Shape::Get_M
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition: shapes.h:211
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
CSG_Shape_Point::~CSG_Shape_Point
virtual ~CSG_Shape_Point(void)
Definition: shape_point.cpp:68
CSG_Shape::Get_Point_Count
virtual int Get_Point_Count(void) const =0
CSG_Shape_Point::Set_Point
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)
Definition: shapes.h:286
shapes.h
CSG_Shape_Point::CSG_Shape_Point
CSG_Shape_Point(class CSG_Shapes *pOwner, sLong Index)
Definition: shape_point.cpp:63
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Shape_Point::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: shape_point.cpp:97
CSG_Shape_Point::On_Intersects
virtual TSG_Intersection On_Intersects(CSG_Shape *pShape)
Definition: shape_point.cpp:107
CSG_Shape::Set_Z
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition: shapes.h:194
CSG_Shapes
Definition: shapes.h:775
CSG_Shape::Set_M
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition: shapes.h:210
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Shape
Definition: shapes.h:141
CSG_Shape_Point::m_Point
TSG_Point m_Point
Definition: shapes.h:312