Renaming:
- FGContourNode -> TGContourNode - FGTriNodes -> TGTriNodes - FGTriSeg -> TGTriSeg - FGTriSegments -> TGTriSegments
This commit is contained in:
parent
d2206e9214
commit
61445e9af6
19 changed files with 98 additions and 98 deletions
|
@ -663,7 +663,7 @@ void build_airport( string airport_raw, float alt_m,
|
|||
|
||||
// add segments to polygons to remove any possible "T"
|
||||
// intersections
|
||||
FGTriNodes tmp_nodes;
|
||||
TGTriNodes tmp_nodes;
|
||||
|
||||
// build temporary node list
|
||||
for ( k = 0; k < (int)rwy_polys.size(); ++k ) {
|
||||
|
@ -809,7 +809,7 @@ void build_airport( string airport_raw, float alt_m,
|
|||
// traverse the tri list and create ordered node and texture
|
||||
// coordinate lists
|
||||
|
||||
FGTriNodes nodes, normals, texcoords;
|
||||
TGTriNodes nodes, normals, texcoords;
|
||||
nodes.clear();
|
||||
normals.clear();
|
||||
texcoords.clear();
|
||||
|
@ -1022,7 +1022,7 @@ void build_airport( string airport_raw, float alt_m,
|
|||
// pass one, calculate raw elevations from DEM
|
||||
|
||||
for ( i = 0; i < (int)rwy_lights.size(); ++i ) {
|
||||
FGTriNodes light_nodes;
|
||||
TGTriNodes light_nodes;
|
||||
light_nodes.clear();
|
||||
point_list lights_v = rwy_lights[i].get_poly().get_contour(0);
|
||||
for ( j = 0; j < (int)lights_v.size(); ++j ) {
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
// Divide segment if there are other existing points on it, return the
|
||||
// new polygon
|
||||
void add_intermediate_nodes( int contour, const Point3D& start,
|
||||
const Point3D& end, const FGTriNodes& tmp_nodes,
|
||||
const Point3D& end, const TGTriNodes& tmp_nodes,
|
||||
FGPolygon *result )
|
||||
{
|
||||
point_list nodes = tmp_nodes.get_node_list();
|
||||
|
@ -70,7 +70,7 @@ void add_intermediate_nodes( int contour, const Point3D& start,
|
|||
// avoid "T" intersections.
|
||||
|
||||
FGPolygon add_nodes_to_poly( const FGPolygon& poly,
|
||||
const FGTriNodes& tmp_nodes ) {
|
||||
const TGTriNodes& tmp_nodes ) {
|
||||
int i, j;
|
||||
FGPolygon result; result.erase();
|
||||
Point3D p0, p1;
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
// Divide segment if there are other existing points on it, return the
|
||||
// new polygon
|
||||
void add_intermediate_nodes( int contour, const Point3D& start,
|
||||
const Point3D& end, const FGTriNodes& tmp_nodes,
|
||||
const Point3D& end, const TGTriNodes& tmp_nodes,
|
||||
FGPolygon *result );
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@ void add_intermediate_nodes( int contour, const Point3D& start,
|
|||
// avoid "T" intersections.
|
||||
|
||||
FGPolygon add_nodes_to_poly( const FGPolygon& poly,
|
||||
const FGTriNodes& tmp_nodes );
|
||||
const TGTriNodes& tmp_nodes );
|
||||
|
||||
|
||||
// Traverse a polygon and split edges until they are less than max_len
|
||||
|
|
|
@ -165,7 +165,7 @@ int_list FGGenOutput::calc_tex_coords( FGConstruct& c, point_list geod_nodes,
|
|||
int FGGenOutput::build( FGConstruct& c ) {
|
||||
int i, j;
|
||||
|
||||
FGTriNodes trinodes = c.get_tri_nodes();
|
||||
TGTriNodes trinodes = c.get_tri_nodes();
|
||||
|
||||
// copy the geodetic node list into this class
|
||||
geod_nodes = trinodes.get_node_list();
|
||||
|
@ -248,7 +248,7 @@ void FGGenOutput::calc_group_bounding_sphere( FGConstruct& c,
|
|||
point_list wgs84_nodes = c.get_wgs84_nodes();
|
||||
|
||||
// generate a list of unique points from the triangle list
|
||||
FGTriNodes nodes;
|
||||
TGTriNodes nodes;
|
||||
|
||||
const_opt_list_iterator f_current = fans.begin();
|
||||
const_opt_list_iterator f_last = fans.end();
|
||||
|
|
|
@ -63,7 +63,7 @@ private:
|
|||
triele_list tri_elements;
|
||||
|
||||
// texture coordinates
|
||||
FGTriNodes tex_coords;
|
||||
TGTriNodes tex_coords;
|
||||
|
||||
// fan list
|
||||
opt_list fans[FG_MAX_AREA_TYPES];
|
||||
|
|
|
@ -84,7 +84,7 @@ private:
|
|||
FGPolyList clipped_polys;
|
||||
|
||||
// raw node list (after triangulation)
|
||||
FGTriNodes tri_nodes;
|
||||
TGTriNodes tri_nodes;
|
||||
|
||||
// node list in geodetic coords (with fixed elevation)
|
||||
point_list geod_nodes;
|
||||
|
@ -96,7 +96,7 @@ private:
|
|||
triele_list tri_elements;
|
||||
|
||||
// edge segments (after triangulation)
|
||||
FGTriSegments tri_segs;
|
||||
TGTriSegments tri_segs;
|
||||
|
||||
// for each node, a list of triangle indices that contain this node
|
||||
belongs_to_list reverse_ele_lookup;
|
||||
|
@ -149,16 +149,16 @@ public:
|
|||
inline void set_clipped_polys( FGPolyList p ) { clipped_polys = p; }
|
||||
|
||||
// node list (after triangulation)
|
||||
inline FGTriNodes get_tri_nodes() const { return tri_nodes; }
|
||||
inline void set_tri_nodes( FGTriNodes n ) { tri_nodes = n; }
|
||||
inline TGTriNodes get_tri_nodes() const { return tri_nodes; }
|
||||
inline void set_tri_nodes( TGTriNodes n ) { tri_nodes = n; }
|
||||
|
||||
// triangle elements (after triangulation)
|
||||
inline triele_list get_tri_elements() const { return tri_elements; }
|
||||
inline void set_tri_elements( triele_list e ) { tri_elements = e; }
|
||||
|
||||
// edge segments (after triangulation)
|
||||
inline FGTriSegments get_tri_segs() const { return tri_segs; }
|
||||
inline void set_tri_segs( FGTriSegments s ) { tri_segs = s; }
|
||||
inline TGTriSegments get_tri_segs() const { return tri_segs; }
|
||||
inline void set_tri_segs( TGTriSegments s ) { tri_segs = s; }
|
||||
|
||||
// node list in geodetic coords (with fixed elevation)
|
||||
inline point_list get_geod_nodes() const { return geod_nodes; }
|
||||
|
|
|
@ -587,7 +587,7 @@ static void fix_point_heights( FGConstruct& c, const TGArray& array ) {
|
|||
|
||||
}
|
||||
|
||||
FGTriNodes tmp;
|
||||
TGTriNodes tmp;
|
||||
tmp.set_node_list( raw_nodes );
|
||||
c.set_tri_nodes( tmp );
|
||||
}
|
||||
|
|
|
@ -385,7 +385,7 @@ void FGMatch::split_tile( FGConstruct& c ) {
|
|||
// separate area edge segment into components
|
||||
cout << " extracting (shared) area edge segments" << endl;
|
||||
|
||||
FGTriSeg seg;
|
||||
TGTriSeg seg;
|
||||
Point3D p1, p2;
|
||||
triseg_list seg_list = c.get_tri_segs().get_seg_list();
|
||||
triseg_list_iterator current = seg_list.begin();
|
||||
|
@ -637,13 +637,13 @@ void insert_normal( point_list& normals, Point3D n, int i ) {
|
|||
// data)
|
||||
void FGMatch::assemble_tile( FGConstruct& c ) {
|
||||
int i;
|
||||
FGTriNodes new_nodes;
|
||||
TGTriNodes new_nodes;
|
||||
new_nodes.clear();
|
||||
|
||||
point_list new_normals;
|
||||
new_normals.clear();
|
||||
|
||||
FGTriSegments new_segs;
|
||||
TGTriSegments new_segs;
|
||||
new_segs.clear();
|
||||
|
||||
// add the corner points
|
||||
|
@ -705,13 +705,13 @@ void FGMatch::assemble_tile( FGConstruct& c ) {
|
|||
|
||||
// add the edge segments
|
||||
new_segs.unique_divide_and_add( new_nodes.get_node_list(),
|
||||
FGTriSeg(sw_index, se_index, 1) );
|
||||
TGTriSeg(sw_index, se_index, 1) );
|
||||
new_segs.unique_divide_and_add( new_nodes.get_node_list(),
|
||||
FGTriSeg(se_index, ne_index, 1) );
|
||||
TGTriSeg(se_index, ne_index, 1) );
|
||||
new_segs.unique_divide_and_add( new_nodes.get_node_list(),
|
||||
FGTriSeg(ne_index, nw_index, 1) );
|
||||
TGTriSeg(ne_index, nw_index, 1) );
|
||||
new_segs.unique_divide_and_add( new_nodes.get_node_list(),
|
||||
FGTriSeg(nw_index, sw_index, 1) );
|
||||
TGTriSeg(nw_index, sw_index, 1) );
|
||||
cout << "after adding edge segments:" << endl;
|
||||
cout << " new_nodes = " << new_nodes.size() << endl;
|
||||
cout << " new normals = " << new_normals.size() << endl;
|
||||
|
@ -720,7 +720,7 @@ void FGMatch::assemble_tile( FGConstruct& c ) {
|
|||
|
||||
point_list geod_nodes = c.get_geod_nodes();
|
||||
|
||||
FGTriSeg seg;
|
||||
TGTriSeg seg;
|
||||
Point3D p1, p2;
|
||||
int n1, n2, marker;
|
||||
|
||||
|
@ -755,7 +755,7 @@ void FGMatch::assemble_tile( FGConstruct& c ) {
|
|||
|
||||
// add the segment using the new indices
|
||||
new_segs.unique_divide_and_add( new_nodes.get_node_list(),
|
||||
FGTriSeg(n1, n2, marker) );
|
||||
TGTriSeg(n1, n2, marker) );
|
||||
}
|
||||
|
||||
c.set_tri_nodes( new_nodes );
|
||||
|
|
|
@ -238,11 +238,11 @@ FGTriangle::build( const point_list& corner_list,
|
|||
if ( i == (int)HoleArea ) {
|
||||
// mark as a boundary
|
||||
in_segs.unique_divide_and_add( node_list,
|
||||
FGTriSeg(i1, i2, 1) );
|
||||
TGTriSeg(i1, i2, 1) );
|
||||
} else {
|
||||
// non boundary
|
||||
in_segs.unique_divide_and_add( node_list,
|
||||
FGTriSeg(i1, i2, 0) );
|
||||
TGTriSeg(i1, i2, 0) );
|
||||
}
|
||||
}
|
||||
p1 = poly.get_pt( j, 0 );
|
||||
|
@ -253,11 +253,11 @@ FGTriangle::build( const point_list& corner_list,
|
|||
if ( i == (int)HoleArea ) {
|
||||
// mark as a boundary
|
||||
in_segs.unique_divide_and_add( node_list,
|
||||
FGTriSeg(i1, i2, 1) );
|
||||
TGTriSeg(i1, i2, 1) );
|
||||
} else {
|
||||
// non boundary
|
||||
in_segs.unique_divide_and_add( node_list,
|
||||
FGTriSeg(i1, i2, 0) );
|
||||
TGTriSeg(i1, i2, 0) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -532,7 +532,7 @@ int FGTriangle::run_triangulate( const string& angle, const int pass ) {
|
|||
// segments
|
||||
out_segs.clear();
|
||||
for ( i = 0; i < out.numberofsegments; ++i ) {
|
||||
out_segs.unique_add( FGTriSeg( out.segmentlist[2*i],
|
||||
out_segs.unique_add( TGTriSeg( out.segmentlist[2*i],
|
||||
out.segmentlist[2*i+1],
|
||||
out.segmentmarkerlist[i] ) );
|
||||
}
|
||||
|
|
|
@ -55,12 +55,12 @@ class FGTriangle {
|
|||
private:
|
||||
|
||||
// list of nodes
|
||||
FGTriNodes in_nodes;
|
||||
FGTriNodes out_nodes;
|
||||
TGTriNodes in_nodes;
|
||||
TGTriNodes out_nodes;
|
||||
|
||||
// list of segments
|
||||
FGTriSegments in_segs;
|
||||
FGTriSegments out_segs;
|
||||
TGTriSegments in_segs;
|
||||
TGTriSegments out_segs;
|
||||
|
||||
// polygon list
|
||||
poly_list polylist[FG_MAX_AREA_TYPES];
|
||||
|
@ -94,10 +94,10 @@ public:
|
|||
// generated.
|
||||
int run_triangulate( const string& angle, const int pass );
|
||||
|
||||
inline FGTriNodes get_out_nodes() const { return out_nodes; }
|
||||
inline TGTriNodes get_out_nodes() const { return out_nodes; }
|
||||
inline size_t get_out_nodes_size() const { return out_nodes.size(); }
|
||||
inline triele_list get_elelist() const { return elelist; }
|
||||
inline FGTriSegments get_out_segs() const { return out_segs; }
|
||||
inline TGTriSegments get_out_segs() const { return out_segs; }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -26,18 +26,18 @@
|
|||
|
||||
|
||||
// Constructor
|
||||
FGContourNode::FGContourNode() {
|
||||
TGContourNode::TGContourNode() {
|
||||
kids.clear();
|
||||
}
|
||||
|
||||
|
||||
// Constructor
|
||||
FGContourNode::FGContourNode( int n ) {
|
||||
TGContourNode::TGContourNode( int n ) {
|
||||
contour_num = n;
|
||||
kids.clear();
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
FGContourNode::~FGContourNode() {
|
||||
TGContourNode::~TGContourNode() {
|
||||
}
|
||||
|
|
|
@ -39,9 +39,9 @@ SG_USING_STD(vector);
|
|||
|
||||
|
||||
// forward declaration
|
||||
class FGContourNode;
|
||||
class TGContourNode;
|
||||
|
||||
typedef vector < FGContourNode * > contour_kids;
|
||||
typedef vector < TGContourNode * > contour_kids;
|
||||
typedef contour_kids::iterator contour_kids_iterator;
|
||||
typedef contour_kids::const_iterator const_contour_kids_iterator;
|
||||
|
||||
|
@ -50,7 +50,7 @@ typedef contour_kids::const_iterator const_contour_kids_iterator;
|
|||
// contour tree shows the hierarchy of which contour is inside which
|
||||
// contour.
|
||||
|
||||
class FGContourNode {
|
||||
class TGContourNode {
|
||||
|
||||
private:
|
||||
|
||||
|
@ -59,17 +59,17 @@ private:
|
|||
|
||||
public:
|
||||
|
||||
FGContourNode();
|
||||
FGContourNode( int n );
|
||||
TGContourNode();
|
||||
TGContourNode( int n );
|
||||
|
||||
~FGContourNode();
|
||||
~TGContourNode();
|
||||
|
||||
inline int get_contour_num() const { return contour_num; }
|
||||
inline void set_contour_num( int n ) { contour_num = n; }
|
||||
|
||||
inline int get_num_kids() const { return kids.size(); }
|
||||
inline FGContourNode *get_kid( int n ) const { return kids[n]; }
|
||||
inline void add_kid( FGContourNode *kid ) { kids.push_back( kid ); }
|
||||
inline TGContourNode *get_kid( int n ) const { return kids[n]; }
|
||||
inline void add_kid( TGContourNode *kid ) { kids.push_back( kid ); }
|
||||
inline void remove_kid( int n ) {
|
||||
// cout << "kids[" << n << "] = " << kids[n] << endl;
|
||||
delete kids[n];
|
||||
|
|
|
@ -107,7 +107,7 @@ static bool intersects( Point3D p0, Point3D p1, double x, Point3D *result ) {
|
|||
// calculate some "arbitrary" point inside the specified contour for
|
||||
// assigning attribute areas
|
||||
Point3D calc_point_inside_old( const FGPolygon& p, const int contour,
|
||||
const FGTriNodes& trinodes ) {
|
||||
const TGTriNodes& trinodes ) {
|
||||
Point3D tmp, min, ln, p1, p2, p3, m, result, inside_pt;
|
||||
int min_node_index = 0;
|
||||
int min_index = 0;
|
||||
|
@ -171,7 +171,7 @@ Point3D calc_point_inside_old( const FGPolygon& p, const int contour,
|
|||
ln = p2;
|
||||
}
|
||||
|
||||
FGTriSeg base_leg( min_index, ln_index, 0 );
|
||||
TGTriSeg base_leg( min_index, ln_index, 0 );
|
||||
|
||||
m.setx( (min.x() + ln.x()) / 2.0 );
|
||||
m.sety( (min.y() + ln.y()) / 2.0 );
|
||||
|
@ -197,7 +197,7 @@ Point3D calc_point_inside_old( const FGPolygon& p, const int contour,
|
|||
cout << "intersection = " << result << endl;
|
||||
if ( ( result.y() < p3.y() ) &&
|
||||
( result.y() > m.y() ) &&
|
||||
!( base_leg == FGTriSeg(p1_index, p2_index, 0) ) ) {
|
||||
!( base_leg == TGTriSeg(p1_index, p2_index, 0) ) ) {
|
||||
p3 = result;
|
||||
}
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ Point3D calc_point_inside_old( const FGPolygon& p, const int contour,
|
|||
cout << "intersection = " << result << endl;
|
||||
if ( ( result.y() < p3.y() ) &&
|
||||
( result.y() > m.y() ) &&
|
||||
!( base_leg == FGTriSeg(p1_index, p2_index, 0) ) ) {
|
||||
!( base_leg == TGTriSeg(p1_index, p2_index, 0) ) ) {
|
||||
p3 = result;
|
||||
}
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ FGPolygon polygon_tesselate_alt( FGPolygon &p ) {
|
|||
|
||||
// basic triangulation of a contour with out adding points or
|
||||
// splitting edges but cuts out any of the specified holes
|
||||
static void contour_tesselate( FGContourNode *node, const FGPolygon &p,
|
||||
static void contour_tesselate( TGContourNode *node, const FGPolygon &p,
|
||||
const FGPolygon &hole_polys,
|
||||
const point_list &hole_pts,
|
||||
triele_list &elelist,
|
||||
|
@ -745,7 +745,7 @@ static Point3D point_inside_hole( point_list contour ) {
|
|||
|
||||
// Find a point inside a specific polygon contour taking holes into
|
||||
// consideration
|
||||
static Point3D point_inside_contour( FGContourNode *node, const FGPolygon &p ) {
|
||||
static Point3D point_inside_contour( TGContourNode *node, const FGPolygon &p ) {
|
||||
int contour_num;
|
||||
int i;
|
||||
|
||||
|
@ -808,7 +808,7 @@ static Point3D point_inside_contour( FGContourNode *node, const FGPolygon &p ) {
|
|||
|
||||
// recurse the contour tree and build up the point inside list for
|
||||
// each contour/hole
|
||||
static void calc_point_inside( FGContourNode *node, FGPolygon &p ) {
|
||||
static void calc_point_inside( TGContourNode *node, FGPolygon &p ) {
|
||||
for ( int i = 0; i < node->get_num_kids(); ++i ) {
|
||||
if ( node->get_kid( i ) != NULL ) {
|
||||
calc_point_inside( node->get_kid( i ), p );
|
||||
|
@ -825,7 +825,7 @@ static void calc_point_inside( FGContourNode *node, FGPolygon &p ) {
|
|||
}
|
||||
|
||||
|
||||
static void print_contour_tree( FGContourNode *node, string indent ) {
|
||||
static void print_contour_tree( TGContourNode *node, string indent ) {
|
||||
cout << indent << node->get_contour_num() << endl;
|
||||
|
||||
indent += " ";
|
||||
|
@ -838,13 +838,13 @@ static void print_contour_tree( FGContourNode *node, string indent ) {
|
|||
|
||||
|
||||
// Build the contour "is inside of" tree
|
||||
static void build_contour_tree( FGContourNode *node,
|
||||
static void build_contour_tree( TGContourNode *node,
|
||||
const FGPolygon &p,
|
||||
int_list &avail )
|
||||
{
|
||||
cout << "working on contour = " << node->get_contour_num() << endl;
|
||||
cout << " total contours = " << p.contours() << endl;
|
||||
FGContourNode *tmp;
|
||||
TGContourNode *tmp;
|
||||
int i;
|
||||
|
||||
// see if we are building on a hole or not
|
||||
|
@ -870,7 +870,7 @@ static void build_contour_tree( FGContourNode *node,
|
|||
// the root, add all available non-holes.
|
||||
cout << " adding contour = " << i << endl;
|
||||
avail[i] = 0;
|
||||
tmp = new FGContourNode( i );
|
||||
tmp = new TGContourNode( i );
|
||||
node->add_kid( tmp );
|
||||
} else {
|
||||
cout << " not inside" << endl;
|
||||
|
@ -936,7 +936,7 @@ void calc_points_inside( FGPolygon& p ) {
|
|||
}
|
||||
|
||||
// create and initialize the root node
|
||||
FGContourNode *ct = new FGContourNode( -1 );
|
||||
TGContourNode *ct = new TGContourNode( -1 );
|
||||
|
||||
// recursively build the tree
|
||||
build_contour_tree( ct, p, avail );
|
||||
|
|
|
@ -68,7 +68,7 @@ FGPolygon polygon_tesselate_alt( FGPolygon &p );
|
|||
// assigning attribute areas. This requires data structures outside
|
||||
// of "FGPolygon" which is why it is living over here in "Lib/Geometry"
|
||||
Point3D calc_point_inside_old( const FGPolygon& p, const int contour,
|
||||
const FGTriNodes& trinodes );
|
||||
const TGTriNodes& trinodes );
|
||||
|
||||
// calculate some "arbitrary" point inside each of the polygons contours
|
||||
void calc_points_inside( FGPolygon& p );
|
||||
|
|
|
@ -25,18 +25,18 @@
|
|||
|
||||
|
||||
// Constructor
|
||||
FGTriNodes::FGTriNodes( void ) {
|
||||
TGTriNodes::TGTriNodes( void ) {
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
FGTriNodes::~FGTriNodes( void ) {
|
||||
TGTriNodes::~TGTriNodes( void ) {
|
||||
}
|
||||
|
||||
|
||||
// Add a point to the point list if it doesn't already exist. Returns
|
||||
// the index (starting at zero) of the point in the list.
|
||||
int FGTriNodes::unique_add( const Point3D& p ) {
|
||||
int TGTriNodes::unique_add( const Point3D& p ) {
|
||||
point_list_iterator current, last;
|
||||
int counter = 0;
|
||||
|
||||
|
@ -64,7 +64,7 @@ int FGTriNodes::unique_add( const Point3D& p ) {
|
|||
// Add a point to the point list if it doesn't already exist (checking
|
||||
// all three dimensions.) Returns the index (starting at zero) of the
|
||||
// point in the list.
|
||||
int FGTriNodes::unique_add_3d( const Point3D& p ) {
|
||||
int TGTriNodes::unique_add_3d( const Point3D& p ) {
|
||||
point_list_iterator current, last;
|
||||
int counter = 0;
|
||||
|
||||
|
@ -90,7 +90,7 @@ int FGTriNodes::unique_add_3d( const Point3D& p ) {
|
|||
|
||||
|
||||
// Add the point with no uniqueness checking
|
||||
int FGTriNodes::simple_add( const Point3D& p ) {
|
||||
int TGTriNodes::simple_add( const Point3D& p ) {
|
||||
node_list.push_back( p );
|
||||
|
||||
return node_list.size() - 1;
|
||||
|
@ -100,7 +100,7 @@ int FGTriNodes::simple_add( const Point3D& p ) {
|
|||
// Add a point to the point list if it doesn't already exist. Returns
|
||||
// the index (starting at zero) of the point in the list. Use a
|
||||
// course proximity check
|
||||
int FGTriNodes::course_add( const Point3D& p ) {
|
||||
int TGTriNodes::course_add( const Point3D& p ) {
|
||||
point_list_iterator current, last;
|
||||
int counter = 0;
|
||||
|
||||
|
@ -127,7 +127,7 @@ int FGTriNodes::course_add( const Point3D& p ) {
|
|||
|
||||
// Find the index of the specified point (compair to the same
|
||||
// tolerance as unique_add(). Returns -1 if not found.
|
||||
int FGTriNodes::find( const Point3D& p ) const {
|
||||
int TGTriNodes::find( const Point3D& p ) const {
|
||||
const_point_list_iterator current, last;
|
||||
int counter = 0;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#define FG_COURSE_EPSILON 0.0003
|
||||
|
||||
|
||||
class FGTriNodes {
|
||||
class TGTriNodes {
|
||||
|
||||
private:
|
||||
|
||||
|
@ -60,8 +60,8 @@ private:
|
|||
public:
|
||||
|
||||
// Constructor and destructor
|
||||
FGTriNodes( void );
|
||||
~FGTriNodes( void );
|
||||
TGTriNodes( void );
|
||||
~TGTriNodes( void );
|
||||
|
||||
// delete all the data out of node_list
|
||||
inline void clear() { node_list.clear(); }
|
||||
|
@ -101,7 +101,7 @@ public:
|
|||
|
||||
// return true of the two points are "close enough" as defined by
|
||||
// FG_PROXIMITY_EPSILON checking just x and y dimensions
|
||||
inline bool FGTriNodes::close_enough_2d( const Point3D& p1, const Point3D& p2 )
|
||||
inline bool TGTriNodes::close_enough_2d( const Point3D& p1, const Point3D& p2 )
|
||||
const
|
||||
{
|
||||
if ( ( fabs(p1.x() - p2.x()) < FG_PROXIMITY_EPSILON ) &&
|
||||
|
@ -115,7 +115,7 @@ inline bool FGTriNodes::close_enough_2d( const Point3D& p1, const Point3D& p2 )
|
|||
|
||||
// return true of the two points are "close enough" as defined by
|
||||
// FG_PROXIMITY_EPSILON check all three dimensions
|
||||
inline bool FGTriNodes::close_enough_3d( const Point3D& p1, const Point3D& p2 )
|
||||
inline bool TGTriNodes::close_enough_3d( const Point3D& p1, const Point3D& p2 )
|
||||
const
|
||||
{
|
||||
if ( ( fabs(p1.x() - p2.x()) < FG_PROXIMITY_EPSILON ) &&
|
||||
|
@ -130,7 +130,7 @@ inline bool FGTriNodes::close_enough_3d( const Point3D& p1, const Point3D& p2 )
|
|||
|
||||
// return true of the two points are "close enough" as defined by
|
||||
// FG_COURSE_EPSILON
|
||||
inline bool FGTriNodes::course_close_enough( const Point3D& p1,
|
||||
inline bool TGTriNodes::course_close_enough( const Point3D& p1,
|
||||
const Point3D& p2 )
|
||||
{
|
||||
if ( ( fabs(p1.x() - p2.x()) < FG_COURSE_EPSILON ) &&
|
||||
|
|
|
@ -33,18 +33,18 @@ SG_USING_STD(endl);
|
|||
|
||||
|
||||
// Constructor
|
||||
FGTriSegments::FGTriSegments( void ) {
|
||||
TGTriSegments::TGTriSegments( void ) {
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
FGTriSegments::~FGTriSegments( void ) {
|
||||
TGTriSegments::~TGTriSegments( void ) {
|
||||
}
|
||||
|
||||
|
||||
// Add a segment to the segment list if it doesn't already exist.
|
||||
// Returns the index (starting at zero) of the segment in the list.
|
||||
int FGTriSegments::unique_add( const FGTriSeg& s )
|
||||
int TGTriSegments::unique_add( const TGTriSeg& s )
|
||||
{
|
||||
triseg_list_iterator current, last;
|
||||
int counter = 0;
|
||||
|
@ -79,8 +79,8 @@ int FGTriSegments::unique_add( const FGTriSeg& s )
|
|||
|
||||
// Divide segment if there are other points on it, return the divided
|
||||
// list of segments
|
||||
void FGTriSegments::unique_divide_and_add( const point_list& nodes,
|
||||
const FGTriSeg& s )
|
||||
void TGTriSegments::unique_divide_and_add( const point_list& nodes,
|
||||
const TGTriSeg& s )
|
||||
{
|
||||
Point3D p0 = nodes[ s.get_n1() ];
|
||||
Point3D p1 = nodes[ s.get_n2() ];
|
||||
|
@ -92,7 +92,7 @@ void FGTriSegments::unique_divide_and_add( const point_list& nodes,
|
|||
const_point_list_iterator current, last;
|
||||
|
||||
// bool temp = false;
|
||||
// if ( s == FGTriSeg( 170, 206 ) ) {
|
||||
// if ( s == TGTriSeg( 170, 206 ) ) {
|
||||
// cout << "this is it!" << endl;
|
||||
// temp = true;
|
||||
// }
|
||||
|
@ -200,9 +200,9 @@ void FGTriSegments::unique_divide_and_add( const point_list& nodes,
|
|||
// recurse with two sub segments
|
||||
cout << "dividing " << s.get_n1() << " " << extra_index
|
||||
<< " " << s.get_n2() << endl;
|
||||
unique_divide_and_add( nodes, FGTriSeg( s.get_n1(), extra_index,
|
||||
unique_divide_and_add( nodes, TGTriSeg( s.get_n1(), extra_index,
|
||||
s.get_boundary_marker() ) );
|
||||
unique_divide_and_add( nodes, FGTriSeg( extra_index, s.get_n2(),
|
||||
unique_divide_and_add( nodes, TGTriSeg( extra_index, s.get_n2(),
|
||||
s.get_boundary_marker() ) );
|
||||
} else {
|
||||
// this segment does not need to be divided, lets add it
|
||||
|
|
|
@ -40,7 +40,7 @@ SG_USING_STD(vector);
|
|||
|
||||
|
||||
// a segment is two integer pointers into the node list
|
||||
class FGTriSeg {
|
||||
class TGTriSeg {
|
||||
int n1, n2; // indices into point list
|
||||
int boundary_marker; // flag if segment is a boundary
|
||||
// (i.e. shouldn't get split)
|
||||
|
@ -48,14 +48,14 @@ class FGTriSeg {
|
|||
public:
|
||||
|
||||
// Constructor and destructor
|
||||
inline FGTriSeg( void ) { };
|
||||
inline FGTriSeg( int i1, int i2, int b ) {
|
||||
inline TGTriSeg( void ) { };
|
||||
inline TGTriSeg( int i1, int i2, int b ) {
|
||||
n1 = i1;
|
||||
n2 = i2;
|
||||
boundary_marker = b;
|
||||
}
|
||||
|
||||
inline ~FGTriSeg( void ) { };
|
||||
inline ~TGTriSeg( void ) { };
|
||||
|
||||
inline int get_n1() const { return n1; }
|
||||
inline void set_n1( int i ) { n1 = i; }
|
||||
|
@ -64,23 +64,23 @@ public:
|
|||
inline int get_boundary_marker() const { return boundary_marker; }
|
||||
inline void set_boundary_marker( int b ) { boundary_marker = b; }
|
||||
|
||||
friend bool operator == (const FGTriSeg& a, const FGTriSeg& b);
|
||||
friend bool operator == (const TGTriSeg& a, const TGTriSeg& b);
|
||||
|
||||
};
|
||||
|
||||
inline bool operator == (const FGTriSeg& a, const FGTriSeg& b)
|
||||
inline bool operator == (const TGTriSeg& a, const TGTriSeg& b)
|
||||
{
|
||||
return ((a.n1 == b.n1) && (a.n2 == b.n2))
|
||||
|| ((a.n1 == b.n2) && (a.n2 == b.n1));
|
||||
}
|
||||
|
||||
|
||||
typedef vector < FGTriSeg > triseg_list;
|
||||
typedef vector < TGTriSeg > triseg_list;
|
||||
typedef triseg_list::iterator triseg_list_iterator;
|
||||
typedef triseg_list::const_iterator const_triseg_list_iterator;
|
||||
|
||||
|
||||
class FGTriSegments {
|
||||
class TGTriSegments {
|
||||
|
||||
private:
|
||||
|
||||
|
@ -89,13 +89,13 @@ private:
|
|||
// Divide segment if there are other points on it, return the
|
||||
// divided list of segments
|
||||
triseg_list divide_segment( const point_list& nodes,
|
||||
const FGTriSeg& s );
|
||||
const TGTriSeg& s );
|
||||
|
||||
public:
|
||||
|
||||
// Constructor and destructor
|
||||
FGTriSegments( void );
|
||||
~FGTriSegments( void );
|
||||
TGTriSegments( void );
|
||||
~TGTriSegments( void );
|
||||
|
||||
// delete all the data out of seg_list
|
||||
inline void clear() { seg_list.clear(); }
|
||||
|
@ -103,18 +103,18 @@ public:
|
|||
// Add a segment to the segment list if it doesn't already exist.
|
||||
// Returns the index (starting at zero) of the segment in the
|
||||
// list.
|
||||
int unique_add( const FGTriSeg& s );
|
||||
int unique_add( const TGTriSeg& s );
|
||||
|
||||
// Add a segment to the segment list if it doesn't already exist.
|
||||
// Returns the index (starting at zero) of the segment in the list.
|
||||
void unique_divide_and_add( const point_list& node_list,
|
||||
const FGTriSeg& s );
|
||||
const TGTriSeg& s );
|
||||
|
||||
// return the master segment list
|
||||
inline triseg_list get_seg_list() const { return seg_list; }
|
||||
|
||||
// return the ith segment
|
||||
inline FGTriSeg get_seg( int i ) const { return seg_list[i]; }
|
||||
inline TGTriSeg get_seg( int i ) const { return seg_list[i]; }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ int main( int argc, char **argv ) {
|
|||
|
||||
// generate vertices
|
||||
|
||||
FGTriNodes nodes; nodes.clear();
|
||||
TGTriNodes nodes; nodes.clear();
|
||||
|
||||
double dx0 = (x3 - x0) / ydiv;
|
||||
double dy0 = (y3 - y0) / ydiv;
|
||||
|
@ -186,7 +186,7 @@ int main( int argc, char **argv ) {
|
|||
point_list geod_nodes = calc_elevations( root, nodes.get_node_list() );
|
||||
|
||||
// texture coordinates
|
||||
FGTriNodes texcoords; texcoords.clear();
|
||||
TGTriNodes texcoords; texcoords.clear();
|
||||
texcoords.simple_add( Point3D( 0.0, 0.0, 0.0 ) );
|
||||
texcoords.simple_add( Point3D( 1.0, 0.0, 0.0 ) );
|
||||
texcoords.simple_add( Point3D( 1.0, 1.0, 0.0 ) );
|
||||
|
|
Loading…
Add table
Reference in a new issue