SAGA API v9.10
Loading...
Searching...
No Matches
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//---------------------------------------------------------
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//---------------------------------------------------------
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//---------------------------------------------------------
signed long long sLong
Definition api_core.h:158
CSG_Rect & Assign(double xMin, double yMin, double xMax, double yMax)
friend class CSG_Shapes
Definition shapes.h:263
virtual bool On_Assign(CSG_Shape *pShape)
virtual const CSG_Rect & Get_Extent(void)
TSG_Point m_Point
Definition shapes.h:309
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)
Definition shapes.h:283
virtual TSG_Intersection On_Intersects(CSG_Shape *pShape)
CSG_Shape_Point(class CSG_Shapes *pOwner, sLong Index)
virtual ~CSG_Shape_Point(void)
virtual int Get_Point_Count(void) const =0
virtual void Set_M(double m, int iPoint=0, int iPart=0)
Definition shapes.h:207
CSG_Shape(class CSG_Shapes *pOwner, sLong Index)
Definition shape.cpp:63
virtual TSG_Point Get_Point(int iPoint=0) const =0
virtual double Get_Z(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition shapes.h:192
virtual double Get_M(int iPoint=0, int iPart=0, bool bAscending=true) const
Definition shapes.h:208
virtual void Set_Z(double z, int iPoint=0, int iPart=0)
Definition shapes.h:191
TSG_Intersection
Definition geo_tools.h:101
@ INTERSECTION_Overlaps
Definition geo_tools.h:104
@ INTERSECTION_None
Definition geo_tools.h:102
struct SSG_Rect TSG_Rect
double xMin
Definition geo_tools.h:468
double xMax
Definition geo_tools.h:468
double yMin
Definition geo_tools.h:468
double yMax
Definition geo_tools.h:468