1
0
Fork 0

Remove unneeded includes and "using" declarations from header files

This commit is contained in:
Christian Schmitt 2012-11-22 18:33:37 +01:00
parent d5659f4ac8
commit 7ed3965933
20 changed files with 61 additions and 124 deletions

View file

@ -1,4 +1 @@
include_directories(${PROJECT_SOURCE_DIR}/src/Lib)
include_directories(${PROJECT_SOURCE_DIR}/src/BuildTiles)
add_subdirectory(GenAirports850)
add_subdirectory(GenAirports850)

View file

@ -1,3 +1,5 @@
include_directories(${PROJECT_SOURCE_DIR}/src/Lib)
add_executable(genapts850
airport.hxx airport.cxx
apt_math.hxx apt_math.cxx

View file

@ -29,8 +29,6 @@
#include "global.hxx"
#include "elevations.hxx"
string SGLOG_GREEN = "\033[0;32m";
string SGLOG_NORMAL = "\033[0m";
static std::string my_ctime(time_t& tt)
{
@ -282,7 +280,7 @@ static tgPolygon calc_elevations( TGAptSurface &surf,
return result;
}
void Airport::BuildBtg(const string& root, const string_list& elev_src )
void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
{
tgcontour_list slivers;
tgcontour_list line_slivers;
@ -844,7 +842,7 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
for ( unsigned int k = 0; k < rwy_polys.size(); ++k )
{
SG_LOG(SG_GENERAL, SG_DEBUG, "tri " << k);
string material = rwy_polys[k].GetMaterial();
std::string material = rwy_polys[k].GetMaterial();
SG_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
SG_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << rwy_polys[k].Triangles());
for ( unsigned int i = 0; i < rwy_polys[k].Triangles(); ++i )
@ -876,7 +874,7 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
for ( unsigned int k = 0; k < pvmt_polys.size(); ++k )
{
SG_LOG(SG_GENERAL, SG_DEBUG, "tri " << k);
string material = pvmt_polys[k].GetMaterial();
std::string material = pvmt_polys[k].GetMaterial();
SG_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
SG_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << pvmt_polys[k].Triangles());
for ( unsigned int i = 0; i < pvmt_polys[k].Triangles(); ++i )
@ -907,7 +905,7 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
for ( unsigned int k = 0; k < line_polys.size(); ++k )
{
SG_LOG(SG_GENERAL, SG_DEBUG, "tri " << k);
string material = line_polys[k].GetMaterial();
std::string material = line_polys[k].GetMaterial();
SG_LOG(SG_GENERAL, SG_DEBUG, "material = " << material);
SG_LOG(SG_GENERAL, SG_DEBUG, "triangles = " << line_polys[k].Triangles());
for ( unsigned int i = 0; i < line_polys[k].Triangles(); ++i )
@ -1280,8 +1278,8 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
group_list fans_tc; fans_tc.clear();
string_list fan_materials; fan_materials.clear();
string objpath = root + "/AirportObj";
string name = icao + ".btg";
std::string objpath = root + "/AirportObj";
std::string name = icao + ".btg";
SGBinObject obj;
obj.set_gbs_center( gbs_center );
@ -1383,10 +1381,8 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
}
}
string holepath = root + "/AirportArea";
std::string holepath = root + "/AirportArea";
tgPolygon::Chop( divided_base, holepath, "Hole", false, true );
tgPolygon::Chop( apt_clearing, holepath, "Airport", false, false );
//SG_LOG( SG_GENERAL, SG_ALERT, SGLOG_GREEN << "\nSUCCESS generating " << icao << SGLOG_NORMAL << "\n" );
}

View file

@ -1,10 +1,8 @@
#ifndef _AIRPORT_H_
#define _AIRPORT_H_
#include <stdio.h>
#include <stdlib.h>
#include <simgear/timing/timestamp.hxx>
#include <simgear/math/sg_types.hxx>
#include "runway.hxx"
#include "object.hxx"
@ -14,8 +12,6 @@
#include "linearfeature.hxx"
#include "linked_objects.hxx"
using std::string;
typedef std::map<std::string, std::vector<int>, std::less<std::string> > debug_map;
typedef debug_map::iterator debug_map_iterator;
typedef debug_map::const_iterator debug_map_const_iterator;
@ -94,7 +90,7 @@ public:
signs.push_back( sign );
}
string GetIcao( )
std::string GetIcao( )
{
return icao;
}
@ -115,7 +111,7 @@ public:
}
void merge_slivers( tgpolygon_list& polys, tgcontour_list& slivers );
void BuildBtg( const string& root, const string_list& elev_src );
void BuildBtg( const std::string& root, const string_list& elev_src );
void DumpStats( void );
@ -137,10 +133,10 @@ public:
bool isDebugFeature ( int i );
private:
int code; // airport, heliport or sea port
int altitude; // in meters
string icao; // airport code
string description; // description
int code; // airport, heliport or sea port
int altitude; // in meters
std::string icao; // airport code
std::string description; // description
PavementList pavements;
FeatureList features;
@ -160,7 +156,7 @@ private:
SGTimeStamp triangulation_time;
// debug
string debug_path;
std::string debug_path;
debug_map debug_runways;
debug_map debug_pavements;
debug_map debug_taxiways;

View file

@ -14,10 +14,6 @@
//
#include <simgear/compiler.h>
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include "apt_math.hxx"
tgContour gen_wgs84_area( SGGeod origin,
@ -82,7 +78,7 @@ tgContour gen_wgs84_area( SGGeod end1, SGGeod end2,
// move from end2 to the displaced threshold
SGGeod ref = SGGeodesy::direct( end2, heading_deg, length_ext / 2.0 - displ2);
// move to the l,-w corner
result.AddNode( SGGeodesy::direct(ref, left_hdg, -width_m / 2.0) );

View file

@ -1,16 +1,7 @@
#ifndef _APT_MATH_HXX_
#define _APT_MATH_HXX_
#include <stdio.h>
#include <stdlib.h>
#include <Polygon/polygon.hxx>
#include <Polygon/superpoly.hxx>
#include <Polygon/texparams.hxx>
#include <Geometry/point3d.hxx>
using std::string;
tgContour gen_wgs84_area( SGGeod origin,
double length_m,

View file

@ -1,11 +1,8 @@
#include <stdlib.h>
#include <list>
#include <simgear/debug/logstream.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include <Polygon/polygon.hxx>
#include <Polygon/chop.hxx>
#include <Geometry/poly_support.hxx>
#include "global.hxx"
@ -14,9 +11,9 @@
#define NO_BEZIER (0)
static void stringPurifier( string& s )
static void stringPurifier( std::string& s )
{
for ( string::iterator it = s.begin(), itEnd = s.end(); it!=itEnd; ++it) {
for ( std::string::iterator it = s.begin(), itEnd = s.end(); it!=itEnd; ++it) {
if ( static_cast<unsigned int>(*it) < 32 || static_cast<unsigned int>(*it) > 127 ) {
(*it) = ' ';
}
@ -36,7 +33,7 @@ ClosedPoly::ClosedPoly( char* desc )
{
description = "none";
}
boundary = NULL;
cur_contour = NULL;
cur_feature = NULL;
@ -58,7 +55,7 @@ ClosedPoly::ClosedPoly( int st, float s, float th, char* desc )
{
description = "none";
}
boundary = NULL;
cur_contour = NULL;
cur_feature = NULL;
@ -85,7 +82,7 @@ void ClosedPoly::AddNode( BezNode* node )
{
if (!cur_feature)
{
string feature_desc = description + " - ";
std::string feature_desc = description + " - ";
if (boundary)
{
feature_desc += "hole";
@ -97,7 +94,7 @@ void ClosedPoly::AddNode( BezNode* node )
SG_LOG(SG_GENERAL, SG_DEBUG, " Adding node " << node->GetLoc() << " to current linear feature " << cur_feature);
cur_feature = new LinearFeature(feature_desc, 1.0f );
}
}
cur_feature->AddNode( node );
}
}
@ -106,7 +103,7 @@ void ClosedPoly::CloseCurContour()
{
SG_LOG(SG_GENERAL, SG_DEBUG, "Close Contour");
// if we are recording a pavement marking - it must be closed -
// if we are recording a pavement marking - it must be closed -
// add the first node of the poly
if (cur_feature)
{
@ -114,7 +111,7 @@ void ClosedPoly::CloseCurContour()
cur_feature->Finish(true, features.size() );
features.push_back(cur_feature);
cur_feature = NULL;
cur_feature = NULL;
}
// add the contour to the poly - first one is the outer boundary
@ -170,7 +167,7 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
nextNode = src->at(0);
}
// now determine how we will iterate from current node to next node
// now determine how we will iterate from current node to next node
if( curNode->HasNextCp() )
{
// next curve is cubic or quadratic
@ -232,7 +229,7 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
else
{
if (curve_type != CURVE_LINEAR)
{
{
num_segs = 8;
SG_LOG(SG_GENERAL, SG_DEBUG, "Segment from " << curNode->GetLoc() << " to " << nextNode->GetLoc() );
SG_LOG(SG_GENERAL, SG_DEBUG, " Distance is " << total_dist << " (OK) so num_segs is " << num_segs );
@ -295,7 +292,7 @@ void ClosedPoly::ConvertContour( BezContour* src, tgContour& dst )
for (int p=0; p<num_segs; p++)
{
// calculate next location
nextLoc = CalculateLinearLocation( curNode->GetLoc(), nextNode->GetLoc(), (1.0f/num_segs) * (p+1) );
nextLoc = CalculateLinearLocation( curNode->GetLoc(), nextNode->GetLoc(), (1.0f/num_segs) * (p+1) );
// add the feature vertex
dst.AddNode( curLoc );
@ -347,7 +344,7 @@ void ClosedPoly::Finish()
ConvertContour( boundary, dst_contour );
dst_contour.SetHole( false );
// and add it to the geometry
// and add it to the geometry
pre_tess.AddContour( dst_contour );
// Then convert the hole contours
@ -386,7 +383,7 @@ void ClosedPoly::Finish()
std::string ClosedPoly::GetMaterial( int surface )
{
std::string material;
switch( surface ) {
case 1:
material = "pa_tiedown";
@ -473,7 +470,7 @@ int ClosedPoly::BuildBtg( tgpolygon_list& rwy_polys, tgcontour_list& slivers, st
}
// Just used for user defined border - add a little bit, as some modelers made the border exactly on the edges
// Just used for user defined border - add a little bit, as some modelers made the border exactly on the edges
// - resulting in no base, which we can't handle
int ClosedPoly::BuildBtg( tgPolygon& apt_base, tgPolygon& apt_clearing, std::string& shapefile_name )
{
@ -482,8 +479,8 @@ int ClosedPoly::BuildBtg( tgPolygon& apt_base, tgPolygon& apt_clearing, std::str
// verify the poly has been generated, and the contour isn't a pavement
if ( !is_pavement && pre_tess.Contours() )
{
base = tgPolygon::Expand( pre_tess, 2.0);
safe_base = tgPolygon::Expand( pre_tess, 5.0);
base = tgPolygon::Expand( pre_tess, 2.0);
safe_base = tgPolygon::Expand( pre_tess, 5.0);
// add this to the airport clearing
apt_clearing = tgPolygon::Union( safe_base, apt_clearing);
@ -493,4 +490,4 @@ int ClosedPoly::BuildBtg( tgPolygon& apt_base, tgPolygon& apt_clearing, std::str
}
return 1;
}
}

View file

@ -1,25 +1,19 @@
#ifndef _BEZPOLY_H_
#define _BEZPOLY_H_
#include <Polygon/polygon.hxx>
#include "beznode.hxx"
#include "linearfeature.hxx"
#include <Polygon/polygon.hxx>
#include <Polygon/superpoly.hxx>
#include <Polygon/texparams.hxx>
#include <Geometry/point3d.hxx>
using std::string;
class ClosedPoly
{
public:
ClosedPoly( char* desc );
ClosedPoly( int st, float s, float th, char* desc );
~ClosedPoly();
inline string GetDescription() { return description; }
inline std::string GetDescription() { return description; }
void AddNode( BezNode* node );
void CloseCurContour();
void Finish();
@ -57,8 +51,8 @@ private:
int surface_type;
float smoothness;
double texture_heading;
string description;
std::string description;
// outer boundary definition as bezier nodes
BezContour* boundary;

View file

@ -20,7 +20,6 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
//
#include <simgear/math/sg_types.hxx>
#include "apt_surface.hxx"

View file

@ -42,7 +42,4 @@ const double max_clamp = 100.0;
extern double slope_max; // = 0.02;
const double slope_eps = 0.00001;
// nurbs query/search epsilon
const double nurbs_eps = 0.0000001;
#endif // _GEN_AIRPORT_GLOBAL_HXX
#endif

View file

@ -73,7 +73,7 @@ tglightcontour_list Helipad::gen_helipad_lights(double maxsize) {
return result;
}
tgPolygon Helipad::WriteGeom( const tgContour& area, string material,
tgPolygon Helipad::WriteGeom( const tgContour& area, std::string material,
tgpolygon_list& rwy_polys,
tgcontour_list& slivers )
{
@ -117,7 +117,7 @@ void Helipad::BuildBtg( tgpolygon_list& rwy_polys,
tgContour helipad = gen_wgs84_area( GetLoc(), maxsize, 0, 0, maxsize, heli.heading, false);
helipad = tgContour::Snap( helipad, gSnap );
string material, shoulder_mat;
std::string material, shoulder_mat;
if (heli.surface == 1)
material = "pa_";
else

View file

@ -17,8 +17,6 @@
#define _HELIPAD_HXX
#include <Polygon/polygon.hxx>
#include <Polygon/superpoly.hxx>
#include <Polygon/texparams.hxx>
class Helipad
{
@ -86,7 +84,7 @@ private:
tgpolygon_list shoulder_polys;
tgPolygon WriteGeom( const tgContour& area,
string material,
std::string material,
tgpolygon_list& rwy_polys,
tgcontour_list& slivers );

View file

@ -478,7 +478,7 @@ int LinearFeature::Finish( bool closed, unsigned int idx )
double az2;
double last_end_v;
double width = 0;
string material;
std::string material;
double cur_light_dist = 0.0f;
double light_delta = 0;
bool markStarted;

View file

@ -3,9 +3,6 @@
#include <Polygon/polygon.hxx>
using std::string;
#define LF_NONE (0)
#define LF_SOLID_YELLOW (1)
#define LF_BROKEN_YELLOW (2)
@ -77,7 +74,7 @@ public:
offset = o;
}
LinearFeature( string desc, double o )
LinearFeature( std::string desc, double o )
{
description = desc;
offset = o;
@ -85,7 +82,7 @@ public:
~LinearFeature();
inline string GetDescription() { return description; }
inline std::string GetDescription() { return description; }
void AddNode( BezNode* b )
{
@ -112,7 +109,7 @@ private:
void ConvertContour( BezContour* src, bool closed );
// text description
string description;
std::string description;
// contour definition (each beznode has marking type)
BezContour contour;

View file

@ -1,4 +1,3 @@
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/debug/logstream.hxx>
#include "linked_objects.hxx"

View file

@ -1,13 +1,8 @@
#ifndef _LINKED_OBJECTS_H_
#define _LINKED_OBJECTS_H_
#include <stdio.h>
#include <stdlib.h>
#include <Polygon/polygon.hxx>
using std::string;
class Windsock
{
public:
@ -63,7 +58,7 @@ public:
double heading;
int reserved;
int size;
string sgn_def;
std::string sgn_def;
SGGeod GetLoc()
{
@ -75,7 +70,7 @@ public:
return heading;
}
string GetDefinition()
std::string GetDefinition()
{
return sgn_def;
}

View file

@ -1,14 +1,7 @@
#ifndef _OBJECT_H_
#define _OBJECT_H_
#include <stdio.h>
#include <stdlib.h>
#include <Polygon/polygon.hxx>
#include <Polygon/superpoly.hxx>
#include <Geometry/point3d.hxx>
using std::string;
class LightingObj
{
@ -27,4 +20,5 @@ void BuildBtg( tglightcontour_list& lights );
};
typedef std::vector <LightingObj *> LightingObjList;
#endif

View file

@ -1,15 +1,10 @@
#ifndef _RUNWAY_H_
#define _RUNWAY_H_
#include <stdio.h>
#include <stdlib.h>
#include <Polygon/polygon.hxx>
#include "apt_math.hxx"
using std::string;
class Runway
{
public:
@ -104,7 +99,7 @@ private:
return ( gen_wgs84_area( GetStart(), GetEnd(), 2.0*length_extend, displ1, displ2, rwy.width + 2.0*width_extend, rwy.heading, false) );
}
void gen_rw_designation( tgPolygon poly, double heading, string rwname,
void gen_rw_designation( tgPolygon poly, double heading, std::string rwname,
double &start_pct, double &end_pct,
tgpolygon_list& rwy_polys,
tgcontour_list& slivers,
@ -116,7 +111,7 @@ private:
double startw_pct, double endw_pct,
double minu, double maxu, double minv, double maxv,
double heading,
const string& material,
const std::string& material,
tgpolygon_list& rwy_polys,
tgpolygon_list& shoulder_polys,
tgcontour_list& slivers,
@ -128,7 +123,7 @@ private:
double startw_pct, double endw_pct,
double minu, double maxu, double minv, double maxv,
double heading,
const string& material,
const std::string& material,
tgpolygon_list& rwy_polys,
tgcontour_list& slivers,
std::string& shapefile_name );
@ -170,11 +165,11 @@ private:
tglightcontour_list gen_runway_center_line_lights( bool recip );
tgLightContour gen_touchdown_zone_lights( bool recip );
tgLightContour gen_reil( const int kind, bool recip );
tglightcontour_list gen_calvert( const string &kind, bool recip );
tglightcontour_list gen_alsf( const string &kind, bool recip );
tglightcontour_list gen_calvert( const std::string &kind, bool recip );
tglightcontour_list gen_alsf( const std::string &kind, bool recip );
tgLightContour gen_odals( const int kind, bool recip );
tglightcontour_list gen_ssalx( const string& kind, bool recip );
tglightcontour_list gen_malsx( const string& kind, bool recip );
tglightcontour_list gen_ssalx( const std::string& kind, bool recip );
tglightcontour_list gen_malsx( const std::string& kind, bool recip );
};
typedef std::vector <Runway *> RunwayList;

View file

@ -43,7 +43,6 @@
#define PL_STATE_ALL_LAUNCHED (3)
#define PL_STATE_DONE (10)
using namespace std;
using namespace Poco;
// Forward declaration
@ -213,4 +212,4 @@ private:
debug_map debug_pavements;
debug_map debug_taxiways;
debug_map debug_features;
};
};

View file

@ -1,15 +1,10 @@
#ifndef _TAXIWAY_H_
#define _TAXIWAY_H_
#include <stdio.h>
#include <stdlib.h>
#include <Polygon/polygon.hxx>
#include "apt_math.hxx"
using std::string;
class Taxiway
{
public: