1
0
Fork 0

Remove another point2d occurence from Demchop

This commit is contained in:
Christian Schmitt 2012-10-13 13:05:45 +02:00
parent a7b49565b3
commit e8896f891c
3 changed files with 11 additions and 66 deletions

View file

@ -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}

View file

@ -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 );
}
}

View file

@ -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