From e8896f891c7fe2829b171737b46f612c84bf6843 Mon Sep 17 00:00:00 2001
From: Christian Schmitt <chris@ilovelinux.de>
Date: Sat, 13 Oct 2012 13:05:45 +0200
Subject: [PATCH] Remove another point2d occurence from Demchop

---
 src/Prep/DemChop/CMakeLists.txt |  6 ++--
 src/Prep/DemChop/demchop.cxx    | 18 +++++------
 src/Prep/DemChop/point2d.hxx    | 53 ---------------------------------
 3 files changed, 11 insertions(+), 66 deletions(-)
 delete mode 100644 src/Prep/DemChop/point2d.hxx

diff --git a/src/Prep/DemChop/CMakeLists.txt b/src/Prep/DemChop/CMakeLists.txt
index f1a6176f..dc25ad89 100644
--- a/src/Prep/DemChop/CMakeLists.txt
+++ b/src/Prep/DemChop/CMakeLists.txt
@@ -1,5 +1,5 @@
 
-add_executable(demchop demchop.cxx point2d.hxx)
+add_executable(demchop demchop.cxx)
 
 target_link_libraries(demchop 
     DEM
@@ -8,7 +8,7 @@ target_link_libraries(demchop
 
 install(TARGETS demchop RUNTIME DESTINATION bin)
 
-add_executable(hgtchop hgtchop.cxx point2d.hxx)
+add_executable(hgtchop hgtchop.cxx)
 
 target_link_libraries(hgtchop 
     HGT
@@ -21,7 +21,7 @@ if(TIFF_FOUND)
 if(MSVC AND CMAKE_CL_64)
 	set( SRTMCHOP_LIBRARIES ${JPEG_LIBRARY} )
 endif(MSVC AND CMAKE_CL_64)
-add_executable(srtmchop srtmchop.cxx point2d.hxx)
+add_executable(srtmchop srtmchop.cxx)
 target_link_libraries(srtmchop 
     HGT
     ${TIFF_LIBRARIES}
diff --git a/src/Prep/DemChop/demchop.cxx b/src/Prep/DemChop/demchop.cxx
index 39c37835..1222704b 100644
--- a/src/Prep/DemChop/demchop.cxx
+++ b/src/Prep/DemChop/demchop.cxx
@@ -38,8 +38,6 @@
 
 #include <DEM/dem.hxx>
 
-#include "point2d.hxx"
-
 using std::endl;
 using std::cout;
 using std::string;
@@ -65,16 +63,16 @@ int main(int argc, char **argv) {
     dem.parse();
     dem.close();
 
-    point2d min, max;
-    min.x = dem.get_originx() / 3600.0 + SG_HALF_BUCKET_SPAN;
-    min.y = dem.get_originy() / 3600.0 + SG_HALF_BUCKET_SPAN;
-    SGBucket b_min( min.x, min.y );
+    SGVec2d min, max;
+    min.x() = dem.get_originx() / 3600.0 + SG_HALF_BUCKET_SPAN;
+    min.y() = dem.get_originy() / 3600.0 + SG_HALF_BUCKET_SPAN;
+    SGBucket b_min( min.x(), min.y() );
 
-    max.x = (dem.get_originx() + dem.get_cols() * dem.get_col_step()) / 3600.0 
+    max.x() = (dem.get_originx() + dem.get_cols() * dem.get_col_step()) / 3600.0
 	- SG_HALF_BUCKET_SPAN;
-    max.y = (dem.get_originy() + dem.get_rows() * dem.get_row_step()) / 3600.0 
+    max.y() = (dem.get_originy() + dem.get_rows() * dem.get_row_step()) / 3600.0
 	- SG_HALF_BUCKET_SPAN;
-    SGBucket b_max( max.x, max.y );
+    SGBucket b_max( max.x(), max.y() );
 
     if ( b_min == b_max ) {
 	dem.write_area( work_dir, b_min, true );
@@ -93,7 +91,7 @@ int main(int argc, char **argv) {
 
 	for ( j = 0; j <= dy; j++ ) {
 	    for ( i = 0; i <= dx; i++ ) {
-		b_cur = sgBucketOffset(min.x, min.y, i, j);
+		b_cur = sgBucketOffset(min.x(), min.y(), i, j);
 		dem.write_area( work_dir, b_cur, true );
 	    }
 	}
diff --git a/src/Prep/DemChop/point2d.hxx b/src/Prep/DemChop/point2d.hxx
deleted file mode 100644
index a6047a6b..00000000
--- a/src/Prep/DemChop/point2d.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-// point2d.hxx -- define a 2d point class
-//
-// Written by Curtis Olson, started February 1998.
-//
-// Copyright (C) 1998  Curtis L. Olson  - http://www.flightgear.org/~curt
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// $Id: point2d.hxx,v 1.2 2004-11-19 22:25:51 curt Exp $
-//
-
-
-#ifndef _POINT2D_HXX
-#define _POINT2D_HXX
-
-
-#include <list>
-
-
-class point2d {
-public:
-    union {
-	double x;
-	double dist;
-	double lon;
-    };
-    union {
-	double y;
-	double theta;
-	double lat;
-    };
-};
-
-
-// convert a point from cartesian to polar coordinates
-point2d cart_to_polar_2d(point2d in);
-
-
-#endif // _POINT2D_HXX
-
-