whitespace only
This commit is contained in:
parent
631bc02111
commit
d021c32840
12 changed files with 385 additions and 354 deletions
|
@ -178,8 +178,6 @@ bool Airport::isDebugFeature( int feat )
|
|||
return dbg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Airport::BuildBtg(const std::string& root, const string_list& elev_src )
|
||||
{
|
||||
tgcontour_list slivers;
|
||||
|
|
|
@ -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(2) );
|
||||
}
|
||||
|
||||
else {
|
||||
heading = rwy.heading;
|
||||
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
|
||||
#include <terragear/tg_polygon.hxx>
|
||||
|
||||
class TGAreaDefinition {
|
||||
class TGAreaDefinition
|
||||
{
|
||||
public:
|
||||
TGAreaDefinition( const std::string& n, const std::string& c, unsigned int p ) :
|
||||
name(n),
|
||||
TGAreaDefinition(const std::string& n, const std::string& c, unsigned int p) : name(n),
|
||||
category(c)
|
||||
{
|
||||
priority = p;
|
||||
|
@ -43,15 +43,18 @@ public:
|
|||
default_layer = 0;
|
||||
};
|
||||
|
||||
std::string const& GetName() const {
|
||||
std::string const& GetName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
unsigned int GetPriority() const {
|
||||
unsigned int GetPriority() const
|
||||
{
|
||||
return priority;
|
||||
}
|
||||
|
||||
std::string const& GetCategory() const {
|
||||
std::string const& GetCategory() const
|
||||
{
|
||||
return category;
|
||||
}
|
||||
|
||||
|
@ -70,20 +73,22 @@ private:
|
|||
typedef std::vector<TGAreaDefinition> area_definition_list;
|
||||
typedef area_definition_list::const_iterator area_definition_iterator;
|
||||
|
||||
class TGAreaDefinitions {
|
||||
class TGAreaDefinitions
|
||||
{
|
||||
public:
|
||||
TGAreaDefinitions() :
|
||||
sliver_area_name("<unnamed>")
|
||||
TGAreaDefinitions() : sliver_area_name("<unnamed>")
|
||||
{
|
||||
sliver_area_priority = 0;
|
||||
};
|
||||
|
||||
int init(const std::string& filename);
|
||||
unsigned int size() const {
|
||||
unsigned int size() const
|
||||
{
|
||||
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") {
|
||||
return true;
|
||||
} 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") ||
|
||||
(area_defs[p].GetCategory() == "other") ||
|
||||
(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") {
|
||||
return true;
|
||||
} 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") {
|
||||
return true;
|
||||
} 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") ||
|
||||
(area_defs[p].GetCategory() == "lake")) {
|
||||
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") {
|
||||
return true;
|
||||
} 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") {
|
||||
return true;
|
||||
} 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") {
|
||||
return true;
|
||||
} 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") {
|
||||
return true;
|
||||
} 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();
|
||||
}
|
||||
|
||||
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++) {
|
||||
if (area_defs[i].GetName() == name) {
|
||||
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;
|
||||
}
|
||||
|
||||
unsigned int get_sliver_area_priority( void ) const {
|
||||
unsigned int get_sliver_area_priority(void) const
|
||||
{
|
||||
return sliver_area_priority;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,12 +30,12 @@
|
|||
#error This library requires C++
|
||||
#endif
|
||||
|
||||
#include <simgear/threads/SGThread.hxx>
|
||||
#include <simgear/threads/SGQueue.hxx>
|
||||
#include <simgear/threads/SGThread.hxx>
|
||||
|
||||
#include <Array/array.hxx>
|
||||
#include <terragear/tg_nodes.hxx>
|
||||
#include <landcover/landcover.hxx>
|
||||
#include <terragear/tg_nodes.hxx>
|
||||
|
||||
#include "tglandclass.hxx"
|
||||
#include "priorities.hxx"
|
||||
|
@ -123,12 +123,15 @@ private:
|
|||
// void merge_slivers( TGLandclass& clipped, tgcontour_list& sliver_list );
|
||||
|
||||
// Shared edge Matching
|
||||
void writeGeodCollection(std::vector<SGGeod>&, gzFile&);
|
||||
void writeFaceCollection(std::string&&, std::vector<SGGeod>&);
|
||||
void SaveSharedEdgeData(int stage);
|
||||
void LoadSharedEdgeData(int stage);
|
||||
void LoadMatchedEdge(int, int);
|
||||
void LoadMatchedEdgeFiles();
|
||||
|
||||
void LoadNeighboorEdgeDataStage1( 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 LoadNeighborEdgeDataStage1(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 WriteNeighborFaces(gzFile& fp, const SGGeod& pt) const;
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
|
||||
#include "tgconstruct.hxx"
|
||||
|
||||
void TGConstruct::FixTJunctions( void ) {
|
||||
void TGConstruct::FixTJunctions(void)
|
||||
{
|
||||
int before, after;
|
||||
std::vector<TGNode*> points;
|
||||
tgRectangle bb;
|
||||
|
@ -81,7 +82,8 @@ void TGConstruct::merge_slivers( TGLandclass& clipped, tgcontour_list& sliver_l
|
|||
}
|
||||
#endif
|
||||
|
||||
void TGConstruct::CleanClippedPolys() {
|
||||
void TGConstruct::CleanClippedPolys()
|
||||
{
|
||||
// Clean the polys
|
||||
for (unsigned int area = 0; area < area_defs.size(); area++) {
|
||||
for (unsigned int p = 0; p < polys_clipped.area_size(area); p++) {
|
||||
|
|
|
@ -60,8 +60,7 @@ void TGConstruct::get_debug( void )
|
|||
} else {
|
||||
std::stringstream ss(dsd);
|
||||
int idx;
|
||||
while (ss >> idx)
|
||||
{
|
||||
while (ss >> idx) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug area " << idx);
|
||||
|
||||
debug_areas.push_back(idx);
|
||||
|
@ -86,8 +85,7 @@ void TGConstruct::get_debug( void )
|
|||
} else {
|
||||
std::stringstream ss(dsd);
|
||||
int idx;
|
||||
while (ss >> idx)
|
||||
{
|
||||
while (ss >> idx) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "Adding debug shape " << idx);
|
||||
|
||||
debug_shapes.push_back(idx);
|
||||
|
|
|
@ -32,7 +32,8 @@ using std::string;
|
|||
|
||||
// Load elevation data from an Array file (a regular grid of elevation data)
|
||||
// and return list of fitted nodes.
|
||||
void TGConstruct::LoadElevationArray( bool add_nodes ) {
|
||||
void TGConstruct::LoadElevationArray(bool add_nodes)
|
||||
{
|
||||
string base = bucket.gen_base_path();
|
||||
|
||||
for (int i = 0; i < (int)load_dirs.size(); ++i) {
|
||||
|
@ -127,8 +128,14 @@ void TGConstruct::CalcElevations( void )
|
|||
min = e1;
|
||||
SGGeod src = raw_nodes[n1];
|
||||
|
||||
if ( e2 < min ) { min = e2; src = raw_nodes[n2]; }
|
||||
if ( e3 < min ) { min = e3; src = raw_nodes[n3]; }
|
||||
if (e2 < min) {
|
||||
min = e2;
|
||||
src = raw_nodes[n2];
|
||||
}
|
||||
if (e3 < min) {
|
||||
min = e3;
|
||||
src = raw_nodes[n3];
|
||||
}
|
||||
|
||||
double d1, d2, d3;
|
||||
if (min == e1) {
|
||||
|
@ -174,8 +181,14 @@ void TGConstruct::CalcElevations( void )
|
|||
min = e1;
|
||||
SGGeod src = raw_nodes[n1];
|
||||
|
||||
if ( e2 < min ) { min = e2; src = raw_nodes[n2]; }
|
||||
if ( e3 < min ) { min = e3; src = raw_nodes[n3]; }
|
||||
if (e2 < min) {
|
||||
min = e2;
|
||||
src = raw_nodes[n2];
|
||||
}
|
||||
if (e3 < min) {
|
||||
min = e3;
|
||||
src = raw_nodes[n3];
|
||||
}
|
||||
|
||||
double d1, d2, d3;
|
||||
if (min == e1) {
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
|
||||
#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 normal;
|
||||
|
||||
|
@ -66,7 +67,8 @@ SGVec3f TGConstruct::calc_normal( double area, const SGVec3d& p1, const SGVec3d&
|
|||
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
|
||||
SGVec3f normal;
|
||||
|
||||
|
@ -144,7 +146,7 @@ void TGConstruct::CalcPointNormals( void )
|
|||
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());
|
||||
if (neighbor_faces) {
|
||||
int num_faces = neighbor_faces->face_areas.size();
|
||||
|
|
|
@ -50,8 +50,7 @@ void TGConstruct::TesselatePolys( void )
|
|||
tgRectangle rect = poly.GetBoundingBox();
|
||||
nodes.get_geod_inside(rect.getMin(), rect.getMax(), poly_extra);
|
||||
|
||||
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() );
|
||||
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());
|
||||
|
||||
if (IsDebugShape(poly.GetId())) {
|
||||
SG_LOG(SG_CLIPPER, SG_INFO, poly);
|
||||
|
|
Loading…
Reference in a new issue