Skip to content

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11991 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 7, 2009
1 parent 6d6df28 commit 3b3ca67
Show file tree
Hide file tree
Showing 8 changed files with 338 additions and 343 deletions.
20 changes: 10 additions & 10 deletions src/analysis/interpolation/Bezier3D.cc
Expand Up @@ -15,7 +15,7 @@
***************************************************************************/

#include "Bezier3D.h"
#include <iostream>
#include "qgslogger.h"


void Bezier3D::calcFirstDer( float t, Vector3D* v )
Expand All @@ -31,7 +31,7 @@ void Bezier3D::calcFirstDer( float t, Vector3D* v )
return;
}

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

else
{
std::cout << "warning: null pointer in Bezier3D::calcFirstDer" << std::endl << std::flush;
QgsDebugMsg( "warning: null pointer" );
}
}

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

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

else
{
std::cout << "warning: null pointer in Bezier3D::calcPoint" << std::endl << std::flush;
QgsDebugMsg( "warning: null pointer" );
}
}

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

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

else
{
std::cout << "warning: null pointer in Bezier3D::calcSecDer" << std::endl << std::flush;
QgsDebugMsg( "warning: null pointer" );
}
}

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

for ( uint i = 0;i < mControlPoly->count();i++ )
for ( int i = 0; i < mControlPoly->count(); i++ )
{
mControlPoly->insert( i, pointer[( mControlPoly->count()-1 )-i] );
}
}

else
{
std::cout << "warning: null pointer in Bezier3D::changeDirection" << std::endl << std::flush;
QgsDebugMsg( "warning: null pointer" );
}
}

Expand Down
15 changes: 4 additions & 11 deletions src/analysis/interpolation/Bezier3D.h
Expand Up @@ -17,11 +17,10 @@
#ifndef BEZIER3D_H
#define BEZIER3D_H

using namespace std;

#include "ParametricLine.h"
#include "Vector3D.h"
#include "MathUtils.h"
#include "qgslogger.h"

/**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.*/
class ANALYSIS_EXPORT Bezier3D: public ParametricLine
Expand Down Expand Up @@ -86,12 +85,12 @@ inline Bezier3D::~Bezier3D()

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

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

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

#endif






#endif

0 comments on commit 3b3ca67

Please sign in to comment.