1
0
Fork 0

whitespace only

This commit is contained in:
scttgs0 2023-05-07 18:41:09 -05:00
parent 631bc02111
commit d021c32840
12 changed files with 385 additions and 354 deletions

View file

@ -178,8 +178,6 @@ bool Airport::isDebugFeature( int feat )
return dbg; return dbg;
} }
void Airport::BuildBtg(const std::string& root, const string_list& elev_src ) void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
{ {
tgcontour_list slivers; tgcontour_list slivers;

View file

@ -611,7 +611,6 @@ void Runway::gen_rwy( tgpolygon_list& rwy_polys,
runway_half.AddNode( 0, runway.GetNode(5) ); runway_half.AddNode( 0, runway.GetNode(5) );
runway_half.AddNode( 0, runway.GetNode(2) ); runway_half.AddNode( 0, runway.GetNode(2) );
} }
else { else {
heading = rwy.heading; heading = rwy.heading;

View file

@ -31,10 +31,10 @@
#include <terragear/tg_polygon.hxx> #include <terragear/tg_polygon.hxx>
class TGAreaDefinition { class TGAreaDefinition
{
public: public:
TGAreaDefinition( const std::string& n, const std::string& c, unsigned int p ) : TGAreaDefinition(const std::string& n, const std::string& c, unsigned int p) : name(n),
name(n),
category(c) category(c)
{ {
priority = p; priority = p;
@ -43,15 +43,18 @@ public:
default_layer = 0; default_layer = 0;
}; };
std::string const& GetName() const { std::string const& GetName() const
{
return name; return name;
} }
unsigned int GetPriority() const { unsigned int GetPriority() const
{
return priority; return priority;
} }
std::string const& GetCategory() const { std::string const& GetCategory() const
{
return category; return category;
} }
@ -70,20 +73,22 @@ private:
typedef std::vector<TGAreaDefinition> area_definition_list; typedef std::vector<TGAreaDefinition> area_definition_list;
typedef area_definition_list::const_iterator area_definition_iterator; typedef area_definition_list::const_iterator area_definition_iterator;
class TGAreaDefinitions { class TGAreaDefinitions
{
public: public:
TGAreaDefinitions() : TGAreaDefinitions() : sliver_area_name("<unnamed>")
sliver_area_name("<unnamed>")
{ {
sliver_area_priority = 0; sliver_area_priority = 0;
}; };
int init(const std::string& filename); int init(const std::string& filename);
unsigned int size() const { unsigned int size() const
{
return area_defs.size(); return area_defs.size();
} }
bool is_hole_area( unsigned int p ) const { bool is_hole_area(unsigned int p) const
{
if (area_defs[p].GetCategory() == "hole") { if (area_defs[p].GetCategory() == "hole") {
return true; return true;
} else { } else {
@ -91,7 +96,8 @@ public:
} }
} }
bool is_landmass_area( unsigned int p ) const { bool is_landmass_area(unsigned int p) const
{
if ((area_defs[p].GetCategory() == "landmass") || if ((area_defs[p].GetCategory() == "landmass") ||
(area_defs[p].GetCategory() == "other") || (area_defs[p].GetCategory() == "other") ||
(area_defs[p].GetCategory() == "cliff")) { (area_defs[p].GetCategory() == "cliff")) {
@ -101,7 +107,8 @@ public:
} }
} }
bool is_island_area( unsigned int p ) const { bool is_island_area(unsigned int p) const
{
if (area_defs[p].GetCategory() == "island") { if (area_defs[p].GetCategory() == "island") {
return true; return true;
} else { } else {
@ -109,7 +116,8 @@ public:
} }
} }
bool is_road_area( unsigned int p ) const { bool is_road_area(unsigned int p) const
{
if (area_defs[p].GetCategory() == "road") { if (area_defs[p].GetCategory() == "road") {
return true; return true;
} else { } else {
@ -117,7 +125,8 @@ public:
} }
} }
bool is_water_area( unsigned int p ) const { bool is_water_area(unsigned int p) const
{
if ((area_defs[p].GetCategory() == "ocean") || if ((area_defs[p].GetCategory() == "ocean") ||
(area_defs[p].GetCategory() == "lake")) { (area_defs[p].GetCategory() == "lake")) {
return true; return true;
@ -126,7 +135,8 @@ public:
} }
} }
bool is_lake_area( unsigned int p ) const { bool is_lake_area(unsigned int p) const
{
if (area_defs[p].GetCategory() == "lake") { if (area_defs[p].GetCategory() == "lake") {
return true; return true;
} else { } else {
@ -134,7 +144,8 @@ public:
} }
} }
bool is_stream_area( unsigned int p ) const { bool is_stream_area(unsigned int p) const
{
if (area_defs[p].GetCategory() == "stream") { if (area_defs[p].GetCategory() == "stream") {
return true; return true;
} else { } else {
@ -142,7 +153,8 @@ public:
} }
} }
bool is_ocean_area( unsigned int p ) const { bool is_ocean_area(unsigned int p) const
{
if (area_defs[p].GetCategory() == "ocean") { if (area_defs[p].GetCategory() == "ocean") {
return true; return true;
} else { } else {
@ -150,7 +162,8 @@ public:
} }
} }
bool is_cliff_area( unsigned int p ) const { bool is_cliff_area(unsigned int p) const
{
if (area_defs[p].GetCategory() == "cliff") { if (area_defs[p].GetCategory() == "cliff") {
return true; return true;
} else { } else {
@ -158,11 +171,13 @@ public:
} }
} }
std::string const& get_area_name( unsigned int p ) const { std::string const& get_area_name(unsigned int p) const
{
return area_defs[p].GetName(); return area_defs[p].GetName();
} }
unsigned int get_area_priority( const std::string& name ) const { unsigned int get_area_priority(const std::string& name) const
{
for (unsigned int i = 0; i < area_defs.size(); i++) { for (unsigned int i = 0; i < area_defs.size(); i++) {
if (area_defs[i].GetName() == name) { if (area_defs[i].GetName() == name) {
return i; return i;
@ -175,11 +190,13 @@ public:
} }
std::string const& get_sliver_area_name( void ) const { std::string const& get_sliver_area_name(void) const
{
return sliver_area_name; return sliver_area_name;
} }
unsigned int get_sliver_area_priority( void ) const { unsigned int get_sliver_area_priority(void) const
{
return sliver_area_priority; return sliver_area_priority;
} }

View file

@ -30,12 +30,12 @@
#error This library requires C++ #error This library requires C++
#endif #endif
#include <simgear/threads/SGThread.hxx>
#include <simgear/threads/SGQueue.hxx> #include <simgear/threads/SGQueue.hxx>
#include <simgear/threads/SGThread.hxx>
#include <Array/array.hxx> #include <Array/array.hxx>
#include <terragear/tg_nodes.hxx>
#include <landcover/landcover.hxx> #include <landcover/landcover.hxx>
#include <terragear/tg_nodes.hxx>
#include "tglandclass.hxx" #include "tglandclass.hxx"
#include "priorities.hxx" #include "priorities.hxx"
@ -123,12 +123,15 @@ private:
// void merge_slivers( TGLandclass& clipped, tgcontour_list& sliver_list ); // void merge_slivers( TGLandclass& clipped, tgcontour_list& sliver_list );
// Shared edge Matching // Shared edge Matching
void writeGeodCollection(std::vector<SGGeod>&, gzFile&);
void writeFaceCollection(std::string&&, std::vector<SGGeod>&);
void SaveSharedEdgeData(int stage); void SaveSharedEdgeData(int stage);
void LoadSharedEdgeData(int stage); void LoadSharedEdgeData(int stage);
void LoadMatchedEdge(int, int);
void LoadMatchedEdgeFiles(); void LoadMatchedEdgeFiles();
void LoadNeighboorEdgeDataStage1( SGBucket& b, std::vector<SGGeod>& north, std::vector<SGGeod>& south, std::vector<SGGeod>& east, std::vector<SGGeod>& west ); void LoadNeighborEdgeDataStage1(SGBucket& b, std::vector<SGGeod>& north, std::vector<SGGeod>& south, std::vector<SGGeod>& east, std::vector<SGGeod>& west);
void LoadNeighboorMatchDataStage1( SGBucket& b, std::vector<SGGeod>& north, std::vector<SGGeod>& south, std::vector<SGGeod>& east, std::vector<SGGeod>& west ); void LoadNeighborMatchDataStage1(SGBucket& b, std::vector<SGGeod>& north, std::vector<SGGeod>& south, std::vector<SGGeod>& east, std::vector<SGGeod>& west);
void ReadNeighborFaces(gzFile& fp); void ReadNeighborFaces(gzFile& fp);
void WriteNeighborFaces(gzFile& fp, const SGGeod& pt) const; void WriteNeighborFaces(gzFile& fp, const SGGeod& pt) const;

View file

@ -32,7 +32,8 @@
#include "tgconstruct.hxx" #include "tgconstruct.hxx"
void TGConstruct::FixTJunctions( void ) { void TGConstruct::FixTJunctions(void)
{
int before, after; int before, after;
std::vector<TGNode*> points; std::vector<TGNode*> points;
tgRectangle bb; tgRectangle bb;
@ -81,7 +82,8 @@ void TGConstruct::merge_slivers( TGLandclass& clipped, tgcontour_list& sliver_l
} }
#endif #endif
void TGConstruct::CleanClippedPolys() { void TGConstruct::CleanClippedPolys()
{
// Clean the polys // Clean the polys
for (unsigned int area = 0; area < area_defs.size(); area++) { for (unsigned int area = 0; area < area_defs.size(); area++) {
for (unsigned int p = 0; p < polys_clipped.area_size(area); p++) { for (unsigned int p = 0; p < polys_clipped.area_size(area); p++) {

View file

@ -60,8 +60,7 @@ void TGConstruct::get_debug( void )
} else { } else {
std::stringstream ss(dsd); std::stringstream ss(dsd);
int idx; int idx;
while (ss >> idx) while (ss >> idx) {
{
SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug area " << idx); SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug area " << idx);
debug_areas.push_back(idx); debug_areas.push_back(idx);
@ -86,8 +85,7 @@ void TGConstruct::get_debug( void )
} else { } else {
std::stringstream ss(dsd); std::stringstream ss(dsd);
int idx; int idx;
while (ss >> idx) while (ss >> idx) {
{
SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug shape " << idx); SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug shape " << idx);
debug_shapes.push_back(idx); debug_shapes.push_back(idx);

View file

@ -32,7 +32,8 @@ using std::string;
// Load elevation data from an Array file (a regular grid of elevation data) // Load elevation data from an Array file (a regular grid of elevation data)
// and return list of fitted nodes. // and return list of fitted nodes.
void TGConstruct::LoadElevationArray( bool add_nodes ) { void TGConstruct::LoadElevationArray(bool add_nodes)
{
string base = bucket.gen_base_path(); string base = bucket.gen_base_path();
for (int i = 0; i < (int)load_dirs.size(); ++i) { for (int i = 0; i < (int)load_dirs.size(); ++i) {
@ -127,8 +128,14 @@ void TGConstruct::CalcElevations( void )
min = e1; min = e1;
SGGeod src = raw_nodes[n1]; SGGeod src = raw_nodes[n1];
if ( e2 < min ) { min = e2; src = raw_nodes[n2]; } if (e2 < min) {
if ( e3 < min ) { min = e3; src = raw_nodes[n3]; } min = e2;
src = raw_nodes[n2];
}
if (e3 < min) {
min = e3;
src = raw_nodes[n3];
}
double d1, d2, d3; double d1, d2, d3;
if (min == e1) { if (min == e1) {
@ -174,8 +181,14 @@ void TGConstruct::CalcElevations( void )
min = e1; min = e1;
SGGeod src = raw_nodes[n1]; SGGeod src = raw_nodes[n1];
if ( e2 < min ) { min = e2; src = raw_nodes[n2]; } if (e2 < min) {
if ( e3 < min ) { min = e3; src = raw_nodes[n3]; } min = e2;
src = raw_nodes[n2];
}
if (e3 < min) {
min = e3;
src = raw_nodes[n3];
}
double d1, d2, d3; double d1, d2, d3;
if (min == e1) { if (min == e1) {

View file

@ -28,7 +28,8 @@
#include "tgconstruct.hxx" #include "tgconstruct.hxx"
SGVec3f TGConstruct::calc_normal( double area, const SGVec3d& p1, const SGVec3d& p2, const SGVec3d& p3 ) const { SGVec3f TGConstruct::calc_normal(double area, const SGVec3d& p1, const SGVec3d& p2, const SGVec3d& p3) const
{
SGVec3f v1, v2; SGVec3f v1, v2;
SGVec3f normal; SGVec3f normal;
@ -66,7 +67,8 @@ SGVec3f TGConstruct::calc_normal( double area, const SGVec3d& p1, const SGVec3d&
return normal; return normal;
} }
void TGConstruct::calc_normals( std::vector<SGGeod>& geod_nodes, std::vector<SGVec3d>& wgs84_nodes, tgPolygon& poly ) { void TGConstruct::calc_normals(std::vector<SGGeod>& geod_nodes, std::vector<SGVec3d>& wgs84_nodes, tgPolygon& poly)
{
// for each face in the superpoly, calculate a face normal // for each face in the superpoly, calculate a face normal
SGVec3f normal; SGVec3f normal;
@ -144,7 +146,7 @@ void TGConstruct::CalcPointNormals( void )
average += normal; average += normal;
} }
// if this node exists in the shared edge db, add the faces from the neighbooring tile // if this node exists in the shared edge db, add the faces from the neighboring tile
neighbor_faces = FindNeighborFaces(node.GetPosition()); neighbor_faces = FindNeighborFaces(node.GetPosition());
if (neighbor_faces) { if (neighbor_faces) {
int num_faces = neighbor_faces->face_areas.size(); int num_faces = neighbor_faces->face_areas.size();

View file

@ -50,8 +50,7 @@ void TGConstruct::TesselatePolys( void )
tgRectangle rect = poly.GetBoundingBox(); tgRectangle rect = poly.GetBoundingBox();
nodes.get_geod_inside(rect.getMin(), rect.getMax(), poly_extra); nodes.get_geod_inside(rect.getMin(), rect.getMax(), poly_extra);
SG_LOG( SG_CLIPPER, SG_DEBUG, "Tesselating " << area_defs.get_area_name(area) << "(" << area << "): " << SG_LOG(SG_CLIPPER, SG_DEBUG, "Tesselating " << area_defs.get_area_name(area) << "(" << area << "): " << p + 1 << " of " << polys_clipped.area_size(area) << ": id = " << poly.GetId());
p+1 << " of " << polys_clipped.area_size(area) << ": id = " << poly.GetId() );
if (IsDebugShape(poly.GetId())) { if (IsDebugShape(poly.GetId())) {
SG_LOG(SG_CLIPPER, SG_INFO, poly); SG_LOG(SG_CLIPPER, SG_INFO, poly);