@@ -28,7 +28,7 @@ DualEdgeTriangulation::~DualEdgeTriangulation()
28
28
// remove all the points
29
29
if ( mPointVector .count () > 0 )
30
30
{
31
- for ( int i = 0 ; i < mPointVector .count ();i++ )
31
+ for ( int i = 0 ; i < mPointVector .count (); i++ )
32
32
{
33
33
delete mPointVector [i];
34
34
}
@@ -37,7 +37,7 @@ DualEdgeTriangulation::~DualEdgeTriangulation()
37
37
// remove all the HalfEdge
38
38
if ( mHalfEdge .count () > 0 )
39
39
{
40
- for ( int i = 0 ; i < mHalfEdge .count ();i++ )
40
+ for ( int i = 0 ; i < mHalfEdge .count (); i++ )
41
41
{
42
42
delete mHalfEdge [i];
43
43
}
@@ -48,7 +48,7 @@ void DualEdgeTriangulation::performConsistencyTest()
48
48
{
49
49
QgsDebugMsg ( " performing consistency test" );
50
50
51
- for ( int i = 0 ;i < mHalfEdge .count ();i++ )
51
+ for ( int i = 0 ; i < mHalfEdge .count (); i++ )
52
52
{
53
53
int a = mHalfEdge [mHalfEdge [i]->getDual ()]->getDual ();
54
54
int b = mHalfEdge [mHalfEdge [mHalfEdge [i]->getNext ()]->getNext ()]->getNext ();
@@ -74,7 +74,7 @@ void DualEdgeTriangulation::addLine( Line3D* line, bool breakline )
74
74
unsigned int i;
75
75
line->goToBegin ();
76
76
77
- for ( i = 0 ;i < line->getSize ();i++ )
77
+ for ( i = 0 ; i < line->getSize (); i++ )
78
78
{
79
79
line->goToNext ();
80
80
actpoint = mDecorator ->addPoint ( line->getPoint () );
@@ -91,7 +91,7 @@ void DualEdgeTriangulation::addLine( Line3D* line, bool breakline )
91
91
return ;
92
92
}
93
93
94
- for ( ;i < line->getSize ();i++ )
94
+ for ( ; i < line->getSize (); i++ )
95
95
{
96
96
line->goToNext ();
97
97
currentpoint = mDecorator ->addPoint ( line->getPoint () );
@@ -407,7 +407,7 @@ int DualEdgeTriangulation::baseEdgeOfPoint( int point )
407
407
if ( mPointVector .count () < 4 || point == -1 )// at the beginning, mEdgeInside is not defined yet
408
408
{
409
409
// first find pointingedge(an edge pointing to p1)
410
- for ( int i = 0 ;i < mHalfEdge .count ();i++ )
410
+ for ( int i = 0 ; i < mHalfEdge .count (); i++ )
411
411
{
412
412
if ( mHalfEdge [i]->getPoint () == point )// we found it
413
413
{
@@ -427,7 +427,7 @@ int DualEdgeTriangulation::baseEdgeOfPoint( int point )
427
427
428
428
// use the secure and slow method
429
429
// qWarning( "******************warning, using the slow method in baseEdgeOfPoint****************************************" );
430
- for ( int i = 0 ;i < mHalfEdge .count ();i++ )
430
+ for ( int i = 0 ; i < mHalfEdge .count (); i++ )
431
431
{
432
432
if ( mHalfEdge [i]->getPoint () == point && mHalfEdge [mHalfEdge [i]->getNext ()]->getPoint () != -1 )// we found it
433
433
{
@@ -441,7 +441,7 @@ int DualEdgeTriangulation::baseEdgeOfPoint( int point )
441
441
442
442
if ( frompoint == -1 || topoint == -1 )// this would cause a crash. Therefore we use the slow method in this case
443
443
{
444
- for ( int i = 0 ;i < mHalfEdge .count ();i++ )
444
+ for ( int i = 0 ; i < mHalfEdge .count (); i++ )
445
445
{
446
446
if ( mHalfEdge [i]->getPoint () == point && mHalfEdge [mHalfEdge [i]->getNext ()]->getPoint () != -1 )// we found it
447
447
{
@@ -752,7 +752,7 @@ void DualEdgeTriangulation::draw( QPainter* p, double xlowleft, double ylowleft,
752
752
bool* control = new bool[mHalfEdge.count()];//controllarray that no edge is painted twice
753
753
bool* control2 = new bool[mHalfEdge.count()];//controllarray for the flat triangles
754
754
755
- for ( unsigned int i = 0;i <= mHalfEdge.count() - 1;i++ )
755
+ for ( unsigned int i = 0; i <= mHalfEdge.count() - 1; i++ )
756
756
{
757
757
control[i] = false;
758
758
control2[i] = false;
@@ -761,7 +761,7 @@ void DualEdgeTriangulation::draw( QPainter* p, double xlowleft, double ylowleft,
761
761
if ((( xupright - xlowleft ) / width ) > (( yupright - ylowleft ) / height ) )
762
762
{
763
763
double lowerborder = -( height * ( xupright - xlowleft ) / width - yupright );//real world coordinates of the lower widget border. This is useful to know because of the HalfEdge bounding box test
764
- for ( unsigned int i = 0;i < mHalfEdge.count() - 1;i++ )
764
+ for ( unsigned int i = 0; i < mHalfEdge.count() - 1; i++ )
765
765
{
766
766
if ( mHalfEdge[i]->getPoint() == -1 || mHalfEdge[mHalfEdge[i]->getDual()]->getPoint() == -1 )
767
767
{continue;}
@@ -824,7 +824,7 @@ void DualEdgeTriangulation::draw( QPainter* p, double xlowleft, double ylowleft,
824
824
else
825
825
{
826
826
double rightborder = width * ( yupright - ylowleft ) / height + xlowleft;//real world coordinates of the right widget border. This is useful to know because of the HalfEdge bounding box test
827
- for ( unsigned int i = 0;i < mHalfEdge.count() - 1;i++ )
827
+ for ( unsigned int i = 0; i < mHalfEdge.count() - 1; i++ )
828
828
{
829
829
if ( mHalfEdge[i]->getPoint() == -1 || mHalfEdge[mHalfEdge[i]->getDual()]->getPoint() == -1 )
830
830
{continue;}
@@ -1453,7 +1453,7 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
1453
1453
1454
1454
// set the flags 'forced' and 'break' to false for every edge and dualedge of 'crossEdges'
1455
1455
QList<int >::const_iterator iter;
1456
- for ( iter = crossedEdges.constBegin ();iter != crossedEdges.constEnd ();++iter )
1456
+ for ( iter = crossedEdges.constBegin (); iter != crossedEdges.constEnd (); ++iter )
1457
1457
{
1458
1458
mHalfEdge [( *( iter ) )]->setForced ( false );
1459
1459
mHalfEdge [( *( iter ) )]->setBreak ( false );
@@ -1507,7 +1507,7 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
1507
1507
// finish the polygon on the right side
1508
1508
QList<int >::const_iterator rightiter;
1509
1509
int actpointr = p1;
1510
- for ( rightiter = crossedEdges.constBegin ();rightiter != crossedEdges.constEnd ();++rightiter )
1510
+ for ( rightiter = crossedEdges.constBegin (); rightiter != crossedEdges.constEnd (); ++rightiter )
1511
1511
{
1512
1512
int newpoint = mHalfEdge [mHalfEdge [mHalfEdge [( *rightiter )]->getNext ()]->getNext ()]->getPoint ();
1513
1513
if ( newpoint != actpointr )
@@ -1527,7 +1527,7 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
1527
1527
// set the necessary nexts of leftPolygon(exept the first)
1528
1528
int actedgel = leftPolygon[1 ];
1529
1529
leftiter = leftPolygon.constBegin (); leftiter += 2 ;
1530
- for ( ;leftiter != leftPolygon.constEnd ();++leftiter )
1530
+ for ( ; leftiter != leftPolygon.constEnd (); ++leftiter )
1531
1531
{
1532
1532
mHalfEdge [actedgel]->setNext (( *leftiter ) );
1533
1533
actedgel = ( *leftiter );
@@ -1536,7 +1536,7 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
1536
1536
// set all the necessary nexts of rightPolygon
1537
1537
int actedger = rightPolygon[1 ];
1538
1538
rightiter = rightPolygon.constBegin (); rightiter += 2 ;
1539
- for ( ;rightiter != rightPolygon.constEnd ();++rightiter )
1539
+ for ( ; rightiter != rightPolygon.constEnd (); ++rightiter )
1540
1540
{
1541
1541
mHalfEdge [actedger]->setNext (( *rightiter ) );
1542
1542
actedger = ( *( rightiter ) );
@@ -1555,7 +1555,7 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
1555
1555
triangulatePolygon ( &rightPolygon, &freelist, dualfirstedge );
1556
1556
1557
1557
// optimisation of the new edges
1558
- for ( iter = crossedEdges.begin ();iter != crossedEdges.end ();++iter )
1558
+ for ( iter = crossedEdges.begin (); iter != crossedEdges.end (); ++iter )
1559
1559
{
1560
1560
checkSwap (( *( iter ) ) );
1561
1561
}
@@ -1598,13 +1598,13 @@ void DualEdgeTriangulation::eliminateHorizontalTriangles()
1598
1598
bool swaped = false ;// flag which allows to exit the loop
1599
1599
bool * control = new bool [mHalfEdge .count ()];// controlarray
1600
1600
1601
- for ( int i = 0 ;i <= mHalfEdge .count () - 1 ;i++ )
1601
+ for ( int i = 0 ; i <= mHalfEdge .count () - 1 ; i++ )
1602
1602
{
1603
1603
control[i] = false ;
1604
1604
}
1605
1605
1606
1606
1607
- for ( int i = 0 ;i <= mHalfEdge .count () - 1 ;i++ )
1607
+ for ( int i = 0 ; i <= mHalfEdge .count () - 1 ; i++ )
1608
1608
{
1609
1609
if ( control[i] == true )// edge has already been examined
1610
1610
{
@@ -1696,7 +1696,7 @@ void DualEdgeTriangulation::ruppertRefinement()
1696
1696
stop = true ;
1697
1697
int nhalfedges = mHalfEdge .count ();
1698
1698
1699
- for ( int i = 0 ;i < nhalfedges - 1 ;i++ )
1699
+ for ( int i = 0 ; i < nhalfedges - 1 ; i++ )
1700
1700
{
1701
1701
int next = mHalfEdge [i]->getNext ();
1702
1702
int nextnext = mHalfEdge [next]->getNext ();
@@ -1721,7 +1721,7 @@ void DualEdgeTriangulation::ruppertRefinement()
1721
1721
// examine the triangulation for angles below the minimum and insert the edges into angle_edge and edge_angle, except the small angle is between forced segments or convex hull edges
1722
1722
double angle;// angle between edge i and the consecutive edge
1723
1723
int p1, p2, p3;// numbers of the triangle points
1724
- for ( int i = 0 ;i < mHalfEdge .count () - 1 ;i++ )
1724
+ for ( int i = 0 ; i < mHalfEdge .count () - 1 ; i++ )
1725
1725
{
1726
1726
p1 = mHalfEdge [mHalfEdge [i]->getDual ()]->getPoint ();
1727
1727
p2 = mHalfEdge [i]->getPoint ();
@@ -1753,7 +1753,7 @@ void DualEdgeTriangulation::ruppertRefinement()
1753
1753
}
1754
1754
1755
1755
// debugging: print out all the angles below the minimum for a test
1756
- for ( std::multimap<double , int >::const_iterator it = angle_edge.begin ();it != angle_edge.end ();++it )
1756
+ for ( std::multimap<double , int >::const_iterator it = angle_edge.begin (); it != angle_edge.end (); ++it )
1757
1757
{
1758
1758
QgsDebugMsg ( QString ( " angle: %1" ).arg ( it->first ) );
1759
1759
}
@@ -1812,7 +1812,7 @@ void DualEdgeTriangulation::ruppertRefinement()
1812
1812
1813
1813
#if 0 //slow version
1814
1814
int numhalfedges = mHalfEdge.count();//begin slow version
1815
- for ( int i = 0;i < numhalfedges;i++ )
1815
+ for ( int i = 0; i < numhalfedges; i++ )
1816
1816
{
1817
1817
if ( mHalfEdge[i]->getForced() || edgeOnConvexHull( i ) )
1818
1818
{
@@ -2022,7 +2022,7 @@ void DualEdgeTriangulation::ruppertRefinement()
2022
2022
evaluateInfluenceRegion ( &circumcenter, mHalfEdge [baseedge]->getNext (), &influenceedges );
2023
2023
evaluateInfluenceRegion ( &circumcenter, mHalfEdge [mHalfEdge [baseedge]->getNext ()]->getNext (), &influenceedges );
2024
2024
2025
- for ( std::set<int >::iterator it = influenceedges.begin ();it != influenceedges.end ();++it )
2025
+ for ( std::set<int >::iterator it = influenceedges.begin (); it != influenceedges.end (); ++it )
2026
2026
{
2027
2027
if (( mHalfEdge [*it]->getForced () == true || edgeOnConvexHull ( *it ) ) && MathUtils::inDiametral ( mPointVector [mHalfEdge [*it]->getPoint ()], mPointVector [mHalfEdge [mHalfEdge [*it]->getDual ()]->getPoint ()], &circumcenter ) )
2028
2028
{
@@ -2221,7 +2221,7 @@ void DualEdgeTriangulation::ruppertRefinement()
2221
2221
.arg ( circumcenter.getX () ).arg ( circumcenter.getY () ) );
2222
2222
// test, if the point is present in the triangulation
2223
2223
bool flag = false ;
2224
- for ( int i = 0 ;i < mPointVector .count ();i++ )
2224
+ for ( int i = 0 ; i < mPointVector .count (); i++ )
2225
2225
{
2226
2226
if ( mPointVector [i]->getX () == circumcenter.getX () && mPointVector [i]->getY () == circumcenter.getY () )
2227
2227
{
@@ -2413,7 +2413,7 @@ void DualEdgeTriangulation::ruppertRefinement()
2413
2413
2414
2414
#if 0
2415
2415
//debugging: print out all edge of dontexamine
2416
- for ( std::set<int>::iterator it = dontexamine.begin();it != dontexamine.end();++it )
2416
+ for ( std::set<int>::iterator it = dontexamine.begin(); it != dontexamine.end(); ++it )
2417
2417
{
2418
2418
QgsDebugMsg( QString( "edge nr. %1 is in dontexamine" ).arg( *it ) );
2419
2419
}
@@ -2499,15 +2499,15 @@ void DualEdgeTriangulation::triangulatePolygon( QList<int>* poly, QList<int>* fr
2499
2499
mHalfEdge [mainedge]->setNext ( insertb );
2500
2500
2501
2501
QList<int > polya;
2502
- for ( iterator = ( ++( poly->constBegin () ) );( *iterator ) != nextdistedge;++iterator )
2502
+ for ( iterator = ( ++( poly->constBegin () ) ); ( *iterator ) != nextdistedge; ++iterator )
2503
2503
{
2504
2504
polya.append (( *iterator ) );
2505
2505
}
2506
2506
polya.prepend ( inserta );
2507
2507
2508
2508
#if 0
2509
2509
//print out all the elements of polya for a test
2510
- for ( iterator = polya.begin();iterator != polya.end();++iterator )
2510
+ for ( iterator = polya.begin(); iterator != polya.end(); ++iterator )
2511
2511
{
2512
2512
QgsDebugMsg( *iterator );
2513
2513
}
@@ -2568,7 +2568,7 @@ void DualEdgeTriangulation::triangulatePolygon( QList<int>* poly, QList<int>* fr
2568
2568
QList<int > polya;
2569
2569
QList<int > polyb;
2570
2570
2571
- for ( iterator = ++( poly->constBegin () );( *iterator ) != nextdistedge;++iterator )
2571
+ for ( iterator = ++( poly->constBegin () ); ( *iterator ) != nextdistedge; ++iterator )
2572
2572
{
2573
2573
polya.append (( *iterator ) );
2574
2574
}
@@ -2725,7 +2725,7 @@ bool DualEdgeTriangulation::readFromTAFF( QString filename )
2725
2725
edgebar->move( 500, 500 );
2726
2726
edgebar->show();
2727
2727
2728
- for ( int i = 0;i < numberofhalfedges / 2;i++ )
2728
+ for ( int i = 0; i < numberofhalfedges / 2; i++ )
2729
2729
{
2730
2730
if ( i % 1000 == 0 )
2731
2731
{
@@ -2806,7 +2806,7 @@ bool DualEdgeTriangulation::readFromTAFF( QString filename )
2806
2806
delete edgebar;
2807
2807
2808
2808
//set mEdgeInside to a reasonable value
2809
- for ( int i = 0;i < numberofhalfedges;i++ )
2809
+ for ( int i = 0; i < numberofhalfedges; i++ )
2810
2810
{
2811
2811
int a, b, c, d;
2812
2812
a = mHalfEdge[i]->getPoint();
@@ -2848,7 +2848,7 @@ bool DualEdgeTriangulation::readFromTAFF( QString filename )
2848
2848
2849
2849
2850
2850
double x, y, z;
2851
- for ( int i = 0;i < numberofpoints;i++ )
2851
+ for ( int i = 0; i < numberofpoints; i++ )
2852
2852
{
2853
2853
if ( i % 1000 == 0 )
2854
2854
{
@@ -2919,12 +2919,12 @@ bool DualEdgeTriangulation::saveToTAFF( QString filename ) const
2919
2919
outstream << "DATA ";
2920
2920
2921
2921
bool* cont = new bool[mHalfEdge.count()];
2922
- for ( unsigned int i = 0;i <= mHalfEdge.count() - 1;i++ )
2922
+ for ( unsigned int i = 0; i <= mHalfEdge.count() - 1; i++ )
2923
2923
{
2924
2924
cont[i] = false;
2925
2925
}
2926
2926
2927
- for ( unsigned int i = 0;i < mHalfEdge.count();i++ )
2927
+ for ( unsigned int i = 0; i < mHalfEdge.count(); i++ )
2928
2928
{
2929
2929
if ( cont[i] == true )
2930
2930
{
@@ -2948,7 +2948,7 @@ bool DualEdgeTriangulation::saveToTAFF( QString filename ) const
2948
2948
outstream << "PATT 3" << std::endl << std::flush;
2949
2949
outstream << "DATA ";
2950
2950
2951
- for ( int i = 0;i < this->getNumberOfPoints();i++ )
2951
+ for ( int i = 0; i < this->getNumberOfPoints(); i++ )
2952
2952
{
2953
2953
Point3D* p = mPointVector[i];
2954
2954
outstream << p->getX() << " " << p->getY() << " " << p->getZ() << " ";
0 commit comments