Skip to content

Commit

Permalink
another semi-automatic indentation update
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12276 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 28, 2009
1 parent 1712e42 commit 7a0c0d8
Show file tree
Hide file tree
Showing 61 changed files with 1,472 additions and 1,468 deletions.
File renamed without changes.
68 changes: 34 additions & 34 deletions src/analysis/interpolation/DualEdgeTriangulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ DualEdgeTriangulation::~DualEdgeTriangulation()
//remove all the points
if ( mPointVector.count() > 0 )
{
for ( int i = 0; i < mPointVector.count();i++ )
for ( int i = 0; i < mPointVector.count(); i++ )
{
delete mPointVector[i];
}
Expand All @@ -37,7 +37,7 @@ DualEdgeTriangulation::~DualEdgeTriangulation()
//remove all the HalfEdge
if ( mHalfEdge.count() > 0 )
{
for ( int i = 0; i < mHalfEdge.count();i++ )
for ( int i = 0; i < mHalfEdge.count(); i++ )
{
delete mHalfEdge[i];
}
Expand All @@ -48,7 +48,7 @@ void DualEdgeTriangulation::performConsistencyTest()
{
QgsDebugMsg( "performing consistency test" );

for ( int i = 0;i < mHalfEdge.count();i++ )
for ( int i = 0; i < mHalfEdge.count(); i++ )
{
int a = mHalfEdge[mHalfEdge[i]->getDual()]->getDual();
int b = mHalfEdge[mHalfEdge[mHalfEdge[i]->getNext()]->getNext()]->getNext();
Expand All @@ -74,7 +74,7 @@ void DualEdgeTriangulation::addLine( Line3D* line, bool breakline )
unsigned int i;
line->goToBegin();

for ( i = 0;i < line->getSize();i++ )
for ( i = 0; i < line->getSize(); i++ )
{
line->goToNext();
actpoint = mDecorator->addPoint( line->getPoint() );
Expand All @@ -91,7 +91,7 @@ void DualEdgeTriangulation::addLine( Line3D* line, bool breakline )
return;
}

for ( ;i < line->getSize();i++ )
for ( ; i < line->getSize(); i++ )
{
line->goToNext();
currentpoint = mDecorator->addPoint( line->getPoint() );
Expand Down Expand Up @@ -407,7 +407,7 @@ int DualEdgeTriangulation::baseEdgeOfPoint( int point )
if ( mPointVector.count() < 4 || point == -1 )//at the beginning, mEdgeInside is not defined yet
{
//first find pointingedge(an edge pointing to p1)
for ( int i = 0;i < mHalfEdge.count();i++ )
for ( int i = 0; i < mHalfEdge.count(); i++ )
{
if ( mHalfEdge[i]->getPoint() == point )//we found it
{
Expand All @@ -427,7 +427,7 @@ int DualEdgeTriangulation::baseEdgeOfPoint( int point )

//use the secure and slow method
//qWarning( "******************warning, using the slow method in baseEdgeOfPoint****************************************" );
for ( int i = 0;i < mHalfEdge.count();i++ )
for ( int i = 0; i < mHalfEdge.count(); i++ )
{
if ( mHalfEdge[i]->getPoint() == point && mHalfEdge[mHalfEdge[i]->getNext()]->getPoint() != -1 )//we found it
{
Expand All @@ -441,7 +441,7 @@ int DualEdgeTriangulation::baseEdgeOfPoint( int point )

if ( frompoint == -1 || topoint == -1 )//this would cause a crash. Therefore we use the slow method in this case
{
for ( int i = 0;i < mHalfEdge.count();i++ )
for ( int i = 0; i < mHalfEdge.count(); i++ )
{
if ( mHalfEdge[i]->getPoint() == point && mHalfEdge[mHalfEdge[i]->getNext()]->getPoint() != -1 )//we found it
{
Expand Down Expand Up @@ -752,7 +752,7 @@ void DualEdgeTriangulation::draw( QPainter* p, double xlowleft, double ylowleft,
bool* control = new bool[mHalfEdge.count()];//controllarray that no edge is painted twice
bool* control2 = new bool[mHalfEdge.count()];//controllarray for the flat triangles

for ( unsigned int i = 0;i <= mHalfEdge.count() - 1;i++ )
for ( unsigned int i = 0; i <= mHalfEdge.count() - 1; i++ )
{
control[i] = false;
control2[i] = false;
Expand All @@ -761,7 +761,7 @@ void DualEdgeTriangulation::draw( QPainter* p, double xlowleft, double ylowleft,
if ((( xupright - xlowleft ) / width ) > (( yupright - ylowleft ) / height ) )
{
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
for ( unsigned int i = 0;i < mHalfEdge.count() - 1;i++ )
for ( unsigned int i = 0; i < mHalfEdge.count() - 1; i++ )
{
if ( mHalfEdge[i]->getPoint() == -1 || mHalfEdge[mHalfEdge[i]->getDual()]->getPoint() == -1 )
{continue;}
Expand Down Expand Up @@ -824,7 +824,7 @@ void DualEdgeTriangulation::draw( QPainter* p, double xlowleft, double ylowleft,
else
{
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
for ( unsigned int i = 0;i < mHalfEdge.count() - 1;i++ )
for ( unsigned int i = 0; i < mHalfEdge.count() - 1; i++ )
{
if ( mHalfEdge[i]->getPoint() == -1 || mHalfEdge[mHalfEdge[i]->getDual()]->getPoint() == -1 )
{continue;}
Expand Down Expand Up @@ -1453,7 +1453,7 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )

//set the flags 'forced' and 'break' to false for every edge and dualedge of 'crossEdges'
QList<int>::const_iterator iter;
for ( iter = crossedEdges.constBegin();iter != crossedEdges.constEnd();++iter )
for ( iter = crossedEdges.constBegin(); iter != crossedEdges.constEnd(); ++iter )
{
mHalfEdge[( *( iter ) )]->setForced( false );
mHalfEdge[( *( iter ) )]->setBreak( false );
Expand Down Expand Up @@ -1507,7 +1507,7 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
//finish the polygon on the right side
QList<int>::const_iterator rightiter;
int actpointr = p1;
for ( rightiter = crossedEdges.constBegin();rightiter != crossedEdges.constEnd();++rightiter )
for ( rightiter = crossedEdges.constBegin(); rightiter != crossedEdges.constEnd(); ++rightiter )
{
int newpoint = mHalfEdge[mHalfEdge[mHalfEdge[( *rightiter )]->getNext()]->getNext()]->getPoint();
if ( newpoint != actpointr )
Expand All @@ -1527,7 +1527,7 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
//set the necessary nexts of leftPolygon(exept the first)
int actedgel = leftPolygon[1];
leftiter = leftPolygon.constBegin(); leftiter += 2;
for ( ;leftiter != leftPolygon.constEnd();++leftiter )
for ( ; leftiter != leftPolygon.constEnd(); ++leftiter )
{
mHalfEdge[actedgel]->setNext(( *leftiter ) );
actedgel = ( *leftiter );
Expand All @@ -1536,7 +1536,7 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
//set all the necessary nexts of rightPolygon
int actedger = rightPolygon[1];
rightiter = rightPolygon.constBegin(); rightiter += 2;
for ( ;rightiter != rightPolygon.constEnd();++rightiter )
for ( ; rightiter != rightPolygon.constEnd(); ++rightiter )
{
mHalfEdge[actedger]->setNext(( *rightiter ) );
actedger = ( *( rightiter ) );
Expand All @@ -1555,7 +1555,7 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
triangulatePolygon( &rightPolygon, &freelist, dualfirstedge );

//optimisation of the new edges
for ( iter = crossedEdges.begin();iter != crossedEdges.end();++iter )
for ( iter = crossedEdges.begin(); iter != crossedEdges.end(); ++iter )
{
checkSwap(( *( iter ) ) );
}
Expand Down Expand Up @@ -1598,13 +1598,13 @@ void DualEdgeTriangulation::eliminateHorizontalTriangles()
bool swaped = false;//flag which allows to exit the loop
bool* control = new bool[mHalfEdge.count()];//controlarray

for ( int i = 0;i <= mHalfEdge.count() - 1;i++ )
for ( int i = 0; i <= mHalfEdge.count() - 1; i++ )
{
control[i] = false;
}


for ( int i = 0;i <= mHalfEdge.count() - 1;i++ )
for ( int i = 0; i <= mHalfEdge.count() - 1; i++ )
{
if ( control[i] == true )//edge has already been examined
{
Expand Down Expand Up @@ -1696,7 +1696,7 @@ void DualEdgeTriangulation::ruppertRefinement()
stop = true;
int nhalfedges = mHalfEdge.count();

for ( int i = 0;i < nhalfedges - 1;i++ )
for ( int i = 0; i < nhalfedges - 1; i++ )
{
int next = mHalfEdge[i]->getNext();
int nextnext = mHalfEdge[next]->getNext();
Expand All @@ -1721,7 +1721,7 @@ void DualEdgeTriangulation::ruppertRefinement()
//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
double angle;//angle between edge i and the consecutive edge
int p1, p2, p3;//numbers of the triangle points
for ( int i = 0;i < mHalfEdge.count() - 1;i++ )
for ( int i = 0; i < mHalfEdge.count() - 1; i++ )
{
p1 = mHalfEdge[mHalfEdge[i]->getDual()]->getPoint();
p2 = mHalfEdge[i]->getPoint();
Expand Down Expand Up @@ -1753,7 +1753,7 @@ void DualEdgeTriangulation::ruppertRefinement()
}

//debugging: print out all the angles below the minimum for a test
for ( std::multimap<double, int>::const_iterator it = angle_edge.begin();it != angle_edge.end();++it )
for ( std::multimap<double, int>::const_iterator it = angle_edge.begin(); it != angle_edge.end(); ++it )
{
QgsDebugMsg( QString( "angle: %1" ).arg( it->first ) );
}
Expand Down Expand Up @@ -1812,7 +1812,7 @@ void DualEdgeTriangulation::ruppertRefinement()

#if 0 //slow version
int numhalfedges = mHalfEdge.count();//begin slow version
for ( int i = 0;i < numhalfedges;i++ )
for ( int i = 0; i < numhalfedges; i++ )
{
if ( mHalfEdge[i]->getForced() || edgeOnConvexHull( i ) )
{
Expand Down Expand Up @@ -2022,7 +2022,7 @@ void DualEdgeTriangulation::ruppertRefinement()
evaluateInfluenceRegion( &circumcenter, mHalfEdge[baseedge]->getNext(), &influenceedges );
evaluateInfluenceRegion( &circumcenter, mHalfEdge[mHalfEdge[baseedge]->getNext()]->getNext(), &influenceedges );

for ( std::set<int>::iterator it = influenceedges.begin();it != influenceedges.end();++it )
for ( std::set<int>::iterator it = influenceedges.begin(); it != influenceedges.end(); ++it )
{
if (( mHalfEdge[*it]->getForced() == true || edgeOnConvexHull( *it ) ) && MathUtils::inDiametral( mPointVector[mHalfEdge[*it]->getPoint()], mPointVector[mHalfEdge[mHalfEdge[*it]->getDual()]->getPoint()], &circumcenter ) )
{
Expand Down Expand Up @@ -2221,7 +2221,7 @@ void DualEdgeTriangulation::ruppertRefinement()
.arg( circumcenter.getX() ).arg( circumcenter.getY() ) );
//test, if the point is present in the triangulation
bool flag = false;
for ( int i = 0;i < mPointVector.count();i++ )
for ( int i = 0; i < mPointVector.count(); i++ )
{
if ( mPointVector[i]->getX() == circumcenter.getX() && mPointVector[i]->getY() == circumcenter.getY() )
{
Expand Down Expand Up @@ -2413,7 +2413,7 @@ void DualEdgeTriangulation::ruppertRefinement()

#if 0
//debugging: print out all edge of dontexamine
for ( std::set<int>::iterator it = dontexamine.begin();it != dontexamine.end();++it )
for ( std::set<int>::iterator it = dontexamine.begin(); it != dontexamine.end(); ++it )
{
QgsDebugMsg( QString( "edge nr. %1 is in dontexamine" ).arg( *it ) );
}
Expand Down Expand Up @@ -2499,15 +2499,15 @@ void DualEdgeTriangulation::triangulatePolygon( QList<int>* poly, QList<int>* fr
mHalfEdge[mainedge]->setNext( insertb );

QList<int> polya;
for ( iterator = ( ++( poly->constBegin() ) );( *iterator ) != nextdistedge;++iterator )
for ( iterator = ( ++( poly->constBegin() ) ); ( *iterator ) != nextdistedge; ++iterator )
{
polya.append(( *iterator ) );
}
polya.prepend( inserta );

#if 0
//print out all the elements of polya for a test
for ( iterator = polya.begin();iterator != polya.end();++iterator )
for ( iterator = polya.begin(); iterator != polya.end(); ++iterator )
{
QgsDebugMsg( *iterator );
}
Expand Down Expand Up @@ -2568,7 +2568,7 @@ void DualEdgeTriangulation::triangulatePolygon( QList<int>* poly, QList<int>* fr
QList<int> polya;
QList<int> polyb;

for ( iterator = ++( poly->constBegin() );( *iterator ) != nextdistedge;++iterator )
for ( iterator = ++( poly->constBegin() ); ( *iterator ) != nextdistedge; ++iterator )
{
polya.append(( *iterator ) );
}
Expand Down Expand Up @@ -2725,7 +2725,7 @@ bool DualEdgeTriangulation::readFromTAFF( QString filename )
edgebar->move( 500, 500 );
edgebar->show();

for ( int i = 0;i < numberofhalfedges / 2;i++ )
for ( int i = 0; i < numberofhalfedges / 2; i++ )
{
if ( i % 1000 == 0 )
{
Expand Down Expand Up @@ -2806,7 +2806,7 @@ bool DualEdgeTriangulation::readFromTAFF( QString filename )
delete edgebar;

//set mEdgeInside to a reasonable value
for ( int i = 0;i < numberofhalfedges;i++ )
for ( int i = 0; i < numberofhalfedges; i++ )
{
int a, b, c, d;
a = mHalfEdge[i]->getPoint();
Expand Down Expand Up @@ -2848,7 +2848,7 @@ bool DualEdgeTriangulation::readFromTAFF( QString filename )


double x, y, z;
for ( int i = 0;i < numberofpoints;i++ )
for ( int i = 0; i < numberofpoints; i++ )
{
if ( i % 1000 == 0 )
{
Expand Down Expand Up @@ -2919,12 +2919,12 @@ bool DualEdgeTriangulation::saveToTAFF( QString filename ) const
outstream << "DATA ";

bool* cont = new bool[mHalfEdge.count()];
for ( unsigned int i = 0;i <= mHalfEdge.count() - 1;i++ )
for ( unsigned int i = 0; i <= mHalfEdge.count() - 1; i++ )
{
cont[i] = false;
}

for ( unsigned int i = 0;i < mHalfEdge.count();i++ )
for ( unsigned int i = 0; i < mHalfEdge.count(); i++ )
{
if ( cont[i] == true )
{
Expand All @@ -2948,7 +2948,7 @@ bool DualEdgeTriangulation::saveToTAFF( QString filename ) const
outstream << "PATT 3" << std::endl << std::flush;
outstream << "DATA ";

for ( int i = 0;i < this->getNumberOfPoints();i++ )
for ( int i = 0; i < this->getNumberOfPoints(); i++ )
{
Point3D* p = mPointVector[i];
outstream << p->getX() << " " << p->getY() << " " << p->getZ() << " ";
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/interpolation/Line3D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Line3D::~Line3D()
//First remove all the content
goToBegin();
unsigned int s = size;
for ( unsigned int i = 1;i <= s;i++ )
for ( unsigned int i = 1; i <= s; i++ )
{
removePoint();
}
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/interpolation/MathUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ int MathUtils::faculty( int n )
if ( n == 0 || n == 1 )
{return 1;}//faculty of 0 is 1!

for ( i = n - 1;i >= 2;i-- )
for ( i = n - 1; i >= 2; i-- )
{
result *= i;
}
Expand Down Expand Up @@ -479,7 +479,7 @@ double MathUtils::power( double a, int b )
return 1;
}
double tmp = a;
for ( int i = 2;i <= fabs(( double )b );i++ )
for ( int i = 2; i <= fabs(( double )b ); i++ )
{

a *= tmp;
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/interpolation/ParametricLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <QVector>

class ANALYSIS_EXPORT ParametricLine
/**ParametricLine is an Interface for parametric lines. It is possible, that a parametric line is composed of several parametric lines (see the composite pattern in Gamma et al. 'Design Patterns'). Do not build instances of it since it is an abstract class.*/
/**ParametricLine is an Interface for parametric lines. It is possible, that a parametric line is composed of several parametric lines (see the composite pattern in Gamma et al. 'Design Patterns'). Do not build instances of it since it is an abstract class.*/
{
protected:
/**Degree of the parametric Line*/
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/interpolation/Vector3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#endif

class ANALYSIS_EXPORT Vector3D
/**
/**
Class Vector3D represents a 3D-Vector, capable to store x-,y- and z-coordinates in double values. In fact, the class is the same as Point3D. The name 'vector' makes it easier to understand the programms.
*/

Expand Down
Loading

0 comments on commit 7a0c0d8

Please sign in to comment.