Skip to content

Commit 3b3ca67

Browse files
author
jef
committedNov 7, 2009
fix windows build
git-svn-id: http://svn.osgeo.org/qgis/trunk@11991 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6d6df28 commit 3b3ca67

File tree

8 files changed

+338
-343
lines changed

8 files changed

+338
-343
lines changed
 

‎src/analysis/interpolation/Bezier3D.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
***************************************************************************/
1616

1717
#include "Bezier3D.h"
18-
#include <iostream>
18+
#include "qgslogger.h"
1919

2020

2121
void Bezier3D::calcFirstDer( float t, Vector3D* v )
@@ -31,7 +31,7 @@ void Bezier3D::calcFirstDer( float t, Vector3D* v )
3131
return;
3232
}
3333

34-
for ( int n = 1;n <= int( mControlPoly->count() - 1 );n++ )
34+
for ( int n = 1; n <= int( mControlPoly->count() - 1 ); n++ )
3535
{
3636
double bernst = MathUtils::calcBernsteinPoly( mControlPoly->count() - 2, n - 1, t );
3737
v->setX( v->getX() + (( *mControlPoly )[n]->getX() - ( *mControlPoly )[n-1]->getX() )*bernst );
@@ -45,7 +45,7 @@ void Bezier3D::calcFirstDer( float t, Vector3D* v )
4545

4646
else
4747
{
48-
std::cout << "warning: null pointer in Bezier3D::calcFirstDer" << std::endl << std::flush;
48+
QgsDebugMsg( "warning: null pointer" );
4949
}
5050
}
5151

@@ -58,7 +58,7 @@ void Bezier3D::calcPoint( float t, Point3D* p )
5858
p->setY( 0 );
5959
p->setZ( 0 );
6060

61-
for ( int n = 1;n <= int( mControlPoly->count() );n++ )
61+
for ( int n = 1; n <= int( mControlPoly->count() ); n++ )
6262
{
6363
double bernst = MathUtils::calcBernsteinPoly( mControlPoly->count() - 1, n - 1, t );
6464
p->setX( p->getX() + ( *mControlPoly )[n-1]->getX()*bernst );
@@ -69,7 +69,7 @@ void Bezier3D::calcPoint( float t, Point3D* p )
6969

7070
else
7171
{
72-
std::cout << "warning: null pointer in Bezier3D::calcPoint" << std::endl << std::flush;
72+
QgsDebugMsg( "warning: null pointer" );
7373
}
7474
}
7575

@@ -86,7 +86,7 @@ void Bezier3D::calcSecDer( float t, Vector3D* v )
8686
return;
8787
}
8888

89-
for ( int n = 1;n <= int( mControlPoly->count() - 2 );n++ )
89+
for ( int n = 1; n <= int( mControlPoly->count() - 2 ); n++ )
9090
{
9191
double bernst = MathUtils::calcBernsteinPoly( mControlPoly->count() - 3, n - 1, t );
9292
v->setX( v->getX() + (( *mControlPoly )[n+1]->getX() - 2*( *mControlPoly )[n]->getX() + ( *mControlPoly )[n-1]->getX() )*bernst );
@@ -100,7 +100,7 @@ void Bezier3D::calcSecDer( float t, Vector3D* v )
100100

101101
else
102102
{
103-
std::cout << "warning: null pointer in Bezier3D::calcSecDer" << std::endl << std::flush;
103+
QgsDebugMsg( "warning: null pointer" );
104104
}
105105
}
106106

@@ -110,20 +110,20 @@ void Bezier3D::changeDirection()//does this work correctli? more testing is need
110110
if ( mControlPoly )
111111
{
112112
Point3D** pointer = new Point3D*[mControlPoly->count()];//create an array to temporarily store pointer to the control points
113-
for ( uint i = 0;i < mControlPoly->count();i++ )//store the points
113+
for ( int i = 0; i < mControlPoly->count(); i++ )//store the points
114114
{
115115
pointer[i] = ( *mControlPoly )[i];
116116
}
117117

118-
for ( uint i = 0;i < mControlPoly->count();i++ )
118+
for ( int i = 0; i < mControlPoly->count(); i++ )
119119
{
120120
mControlPoly->insert( i, pointer[( mControlPoly->count()-1 )-i] );
121121
}
122122
}
123123

124124
else
125125
{
126-
std::cout << "warning: null pointer in Bezier3D::changeDirection" << std::endl << std::flush;
126+
QgsDebugMsg( "warning: null pointer" );
127127
}
128128
}
129129

‎src/analysis/interpolation/Bezier3D.h

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
#ifndef BEZIER3D_H
1818
#define BEZIER3D_H
1919

20-
using namespace std;
21-
2220
#include "ParametricLine.h"
2321
#include "Vector3D.h"
2422
#include "MathUtils.h"
23+
#include "qgslogger.h"
2524

2625
/**Class Bezier3D represents a bezier curve, represented by control points. Parameter t is running from 0 to 1. The class is capable to calculate the curve point and the first two derivatives belonging to t.*/
2726
class ANALYSIS_EXPORT Bezier3D: public ParametricLine
@@ -86,12 +85,12 @@ inline Bezier3D::~Bezier3D()
8685

8786
inline void Bezier3D::add( ParametricLine* pl )
8887
{
89-
cout << "Error!!!!! A Bezier-curve can not be parent of a ParametricLine." << endl;
88+
QgsDebugMsg( "Error!!!!! A Bezier-curve can not be parent of a ParametricLine." );
9089
}
9190

9291
inline void Bezier3D::remove( int i )
9392
{
94-
cout << "Error!!!!! A Bezier-curve has no Childs to remove." << endl;
93+
QgsDebugMsg( "Error!!!!! A Bezier-curve has no Childs to remove." );
9594
}
9695

9796
//-----------------------------------------------setters and getters---------------------------------------------------------------
@@ -127,10 +126,4 @@ inline void Bezier3D::setControlPoly( QVector<Point3D*>* cp )
127126
mDegree = mControlPoly->count() - 1;
128127
}
129128

130-
#endif
131-
132-
133-
134-
135-
136-
129+
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.