[QGIS Commit] r9130 - trunk/qgis/src/plugins/interpolation

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Aug 23 09:21:39 EDT 2008


Author: jef
Date: 2008-08-23 09:21:39 -0400 (Sat, 23 Aug 2008)
New Revision: 9130

Modified:
   trunk/qgis/src/plugins/interpolation/CMakeLists.txt
   trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc
   trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.h
   trunk/qgis/src/plugins/interpolation/HalfEdge.h
   trunk/qgis/src/plugins/interpolation/LinTriangleInterpolator.cc
   trunk/qgis/src/plugins/interpolation/LinTriangleInterpolator.h
   trunk/qgis/src/plugins/interpolation/Line3D.h
   trunk/qgis/src/plugins/interpolation/MathUtils.cc
   trunk/qgis/src/plugins/interpolation/MathUtils.h
   trunk/qgis/src/plugins/interpolation/Node.h
   trunk/qgis/src/plugins/interpolation/Point3D.cc
   trunk/qgis/src/plugins/interpolation/Point3D.h
   trunk/qgis/src/plugins/interpolation/Vector3D.h
   trunk/qgis/src/plugins/interpolation/mIconInterpolation.xpm
   trunk/qgis/src/plugins/interpolation/qgsidwinterpolator.cpp
   trunk/qgis/src/plugins/interpolation/qgsinterpolator.cpp
Log:
fix warnings in interpolation plugin

Modified: trunk/qgis/src/plugins/interpolation/CMakeLists.txt
===================================================================
--- trunk/qgis/src/plugins/interpolation/CMakeLists.txt	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/CMakeLists.txt	2008-08-23 13:21:39 UTC (rev 9130)
@@ -47,6 +47,7 @@
 
 INCLUDE_DIRECTORIES(
      ${CMAKE_CURRENT_BINARY_DIR}
+     ${GEOS_INCLUDE_DIR}
      ../../core ../../core/raster ../../core/renderer ../../core/symbology
      ../../gui
      ..
@@ -64,4 +65,4 @@
 
 INSTALL(TARGETS interpolationplugin
   RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
-  LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
\ No newline at end of file
+  LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})

Modified: trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc
===================================================================
--- trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc	2008-08-23 13:21:39 UTC (rev 9130)
@@ -17,7 +17,6 @@
 
 #include "DualEdgeTriangulation.h"
 #include <map>
-//#include <multimap>
 
 double leftOfTresh=0.00001;
 
@@ -26,7 +25,7 @@
   //remove all the points
   if(mPointVector.count()>0)
     {
-      for (unsigned int i=0; i<mPointVector.count();i++)
+      for (int i=0; i<mPointVector.count();i++)
 	{
 	  delete mPointVector[i];
 	}
@@ -35,7 +34,7 @@
   //remove all the HalfEdge
   if(mHalfEdge.count()>0)
     {
-      for (unsigned int i=0; i<mHalfEdge.count();i++)
+      for (int i=0; i<mHalfEdge.count();i++)
 	{
 	  delete mHalfEdge[i];
 	}
@@ -44,7 +43,7 @@
 
 void DualEdgeTriangulation::performConsistencyTest()
 {
-  cout << "performing consistency test" << endl << flush;
+  std::cout << "performing consistency test" << std::endl << std::flush;
 
   for(int i=0;i<mHalfEdge.count();i++)
     {
@@ -52,14 +51,14 @@
       int b=mHalfEdge[mHalfEdge[mHalfEdge[i]->getNext()]->getNext()]->getNext();
       if(i!=a)
 	{
-	  cout << "warning, first test failed" << endl << flush;
+	  std::cout << "warning, first test failed" << std::endl << std::flush;
 	}
       if(i!=b)
 	{
-	  cout << "warning, second test failed" << endl << flush;
+	  std::cout << "warning, second test failed" << std::endl << std::flush;
 	}
     }
-  cout << "consistency test finished" << endl << flush;
+  std::cout << "consistency test finished" << std::endl << std::flush;
 }
 
 void DualEdgeTriangulation::addLine(Line3D* line, bool breakline)
@@ -105,7 +104,7 @@
 {
   if(p)
     {
-	//cout << "inserting point " << mPointVector.count() << "," << p->getX() << "//" << p->getY() << "//" << p->getZ() << endl << flush;
+	//std::cout << "inserting point " << mPointVector.count() << "," << p->getX() << "//" << p->getY() << "//" << p->getZ() << std::endl << std::flush;
 	//first update the bounding box
       if(mPointVector.count()==0)//update bounding box when the first point is inserted
 	{
@@ -154,7 +153,7 @@
 	  //test, if it is the same point as the first point
 	  if(p->getX()==mPointVector[0]->getX()&&p->getY()==mPointVector[0]->getY())
 	    {
-	      cout << "second point is the same as the first point, it thus has not been inserted" << endl << flush;
+	      std::cout << "second point is the same as the first point, it thus has not been inserted" << std::endl << std::flush;
 	      Point3D* p=mPointVector[1];
 	      mPointVector.remove(1);
 	      delete p;
@@ -220,7 +219,7 @@
 	  else//p is in a line with p0 and p1
 	    {
 	      mPointVector.remove(mPointVector.count()-1);
-	      cout << "error in method DualEdgeTriangulation::addPoint, third point is on the same line as the first and the second point. It thus has not been inserted into the triangulation" << endl << flush;
+	      std::cout << "error in method DualEdgeTriangulation::addPoint, third point is on the same line as the first and the second point. It thus has not been inserted into the triangulation" << std::endl << std::flush;
 	      return -100;
 	    }
 	}
@@ -367,7 +366,7 @@
 
 	  else if(number==-100||number==-5)//this means unknown problems or a numerical error occured in 'baseEdgeOfTriangle'
 	    {
-		//cout << "point has not been inserted because of unknown problems" << endl << flush;
+		//std::cout << "point has not been inserted because of unknown problems" << std::endl << std::flush;
 	      Point3D* p=mPointVector[mPointVector.count()-1];
 	      mPointVector.remove(mPointVector.count()-1);
 	      delete p;
@@ -390,7 +389,7 @@
     }
   else
     {
-      cout << "warning: null pointer in DualEdgeTriangulation::addPoint" << endl << flush;
+      std::cout << "warning: null pointer in DualEdgeTriangulation::addPoint" << std::endl << std::flush;
       return -100;
     }
 }
@@ -402,7 +401,7 @@
   if(mPointVector.count()<4||point==-1)//at the beginning, mEdgeInside is not defined yet
     {
       //first find pointingedge(an edge pointing to p1)
-      for(unsigned int i=0;i<mHalfEdge.count();i++)
+      for(int i=0;i<mHalfEdge.count();i++)
 	{
 	  if(mHalfEdge[i]->getPoint()==point)//we found it
 	    {
@@ -418,9 +417,9 @@
       control+=1;
       if(control>1000000)
 	{
-	    //cout << "warning, endless loop in DualEdgeTriangulation::baseEdgeOfPoint" << endl << flush;
+	    //std::cout << "warning, endless loop in DualEdgeTriangulation::baseEdgeOfPoint" << std::endl << std::flush;
 	  //use the secure and slow method
-	  for(unsigned 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
 		{
@@ -434,7 +433,7 @@
 
       if(frompoint==-1||topoint==-1)//this would cause a crash. Therefore we use the slow method in this case
 	{
-	  for(unsigned 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
 		{
@@ -477,7 +476,7 @@
     {
       if(runs>nBaseOfRuns)//prevents endless loops
 	{
-	    //cout << "warning, probable endless loop detected in DualEdgeTriangulation::baseEdgeOfTriangle" << endl << flush;
+	    //std::cout << "warning, probable endless loop detected in DualEdgeTriangulation::baseEdgeOfTriangle" << std::endl << std::flush;
 	  return -100;
 	}
 
@@ -549,7 +548,7 @@
 
   if(numinstabs>0)//we hit an existing point or a numerical instability occured
     {
-	//cout << "numerical instability occured in DualEdgeTriangulation::BaseEdgeOfTriangle" << endl << flush;
+	//std::cout << "numerical instability occured in DualEdgeTriangulation::BaseEdgeOfTriangle" << std::endl << std::flush;
       mUnstableEdge=actedge;
       return -5;
     }
@@ -561,13 +560,13 @@
 	{
 	  //firstendp is the number of the point which has been inserted twice
 	  mTwiceInsPoint=firstendp;
-	  //cout << "point nr " << firstendp << " already inserted" << endl << flush;
+	  //std::cout << "point nr " << firstendp << " already inserted" << std::endl << std::flush;
 	}
       else if(secendp==thendp||secendp==fouendp)
 	{
 	  //secendp is the number of the point which has been inserted twice
 	  mTwiceInsPoint=secendp;
-	  //cout << "point nr " << secendp << " already inserted" << endl << flush;
+	  //std::cout << "point nr " << secendp << " already inserted" << std::endl << std::flush;
 	}
 
       return -25;//return the code for a point that is already contained in the triangulation
@@ -651,7 +650,7 @@
     }
   else
     {
-      cout << "warning, null pointer in DualEdgeTriangulation::calcNormal" << endl << flush;
+      std::cout << "warning, null pointer in DualEdgeTriangulation::calcNormal" << std::endl << std::flush;
       return false;
     }
 }
@@ -666,7 +665,7 @@
     }
   else
     {
-      cout << "warning, null pointer in DualEdgeTriangulation::calcPoint" << endl << flush;
+      std::cout << "warning, null pointer in DualEdgeTriangulation::calcPoint" << std::endl << std::flush;
       return false;
     }
 }
@@ -904,8 +903,8 @@
   
   if(theedge==-10)//there is no edge between p1 and p2
     {
-      cout << "warning, error in DualEdgeTriangulation::getOppositePoint" << endl << flush;
-      cout << "the points are: " << p1 << " and " << p2 << endl << flush;
+      std::cout << "warning, error in DualEdgeTriangulation::getOppositePoint" << std::endl << std::flush;
+      std::cout << "the points are: " << p1 << " and " << p2 << std::endl << std::flush;
       return -10;
     }
 
@@ -959,7 +958,7 @@
       int edge=baseEdgeOfTriangle(&point);
       if(edge==-10)//the point is outside the convex hull
 	{
-	  cout << "DualEdgeTriangulation::getTriangle, edge outside the convex hull" << endl << flush;
+	  std::cout << "DualEdgeTriangulation::getTriangle, edge outside the convex hull" << std::endl << std::flush;
 	  return false;
 	}
 
@@ -1052,14 +1051,14 @@
 	}
       else//problems
       {
-	  cout << "problems in DualEdgeTriangulation::getTriangle, the edge is: " << edge << endl << flush;
+	  std::cout << "problems in DualEdgeTriangulation::getTriangle, the edge is: " << edge << std::endl << std::flush;
 	  return false;
       }
     }
 
   else
     {
-      cout << "warning, null pointer in DualEdgeTriangulation::getTriangle" << endl << flush;
+      std::cout << "warning, null pointer in DualEdgeTriangulation::getTriangle" << std::endl << std::flush;
       return false;
     }
 }
@@ -1072,7 +1071,7 @@
       int edge=baseEdgeOfTriangle(&point);
       if(edge==-10)//the point is outside the convex hull
 	{
-	  cout << "DualEdgeTriangulation::getTriangle, edge outside the convex hull" << endl << flush;
+	  std::cout << "DualEdgeTriangulation::getTriangle, edge outside the convex hull" << std::endl << std::flush;
 	  return false;
 	}
       else if(edge>=0)//the point is inside the convex hull
@@ -1152,14 +1151,14 @@
 	}
       else//problems
 	{
-	  cout << "problems in DualEdgeTriangulation::getTriangle, the edge is: " << edge << endl << flush;
+	  std::cout << "problems in DualEdgeTriangulation::getTriangle, the edge is: " << edge << std::endl << std::flush;
 	  return false;
 	}
     }
 
   else
     {
-      cout << "warning, null pointer in DualEdgeTriangulation::getTriangle" << endl << flush;
+      std::cout << "warning, null pointer in DualEdgeTriangulation::getTriangle" << std::endl << std::flush;
       return false;
     }
 }
@@ -1203,7 +1202,7 @@
       control+=1;
       if(control>17000)
 	{
-	  cout << "warning, endless loop in DualEdgeTriangulation::insertForcedSegment" << endl << flush;
+	  std::cout << "warning, endless loop in DualEdgeTriangulation::insertForcedSegment" << std::endl << std::flush;
 	  return -100;//return an error code
 	}
 
@@ -1568,7 +1567,7 @@
 
 void DualEdgeTriangulation::eliminateHorizontalTriangles()
 {
-  cout << "bin in eliminateHorizontalTriangles" << endl << flush;
+  std::cout << "bin in eliminateHorizontalTriangles" << std::endl << std::flush;
   double minangle=0;//minimum angle for swapped triangles. If triangles generated by a swap would have a minimum angle (in degrees) below that value, the swap will not be done.
 
   while(true)
@@ -1576,13 +1575,13 @@
       bool swaped=false;//flag which allows to exit the loop
       bool* control=new bool[mHalfEdge.count()];//controlarray
   
-      for(unsigned int i=0;i<=mHalfEdge.count()-1;i++)
+      for(int i=0;i<=mHalfEdge.count()-1;i++)
 	{
 	  control[i]=false;
 	}
 
 
-      for(unsigned 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
 	    {
@@ -1652,13 +1651,13 @@
       delete[] control;
     }
   
-  cout << "ende der methode" << endl << flush;
+  std::cout << "ende der methode" << std::endl << std::flush;
   
 }
 
 void DualEdgeTriangulation::ruppertRefinement()
 {
-    cout.precision(9);
+    std::cout.precision(9);
 
     //minimum angle
     double mintol=17;//refinement stops after the minimum angle reached this tolerance
@@ -1691,6 +1690,7 @@
 		    {
 			//split segment
 			int pointno=splitHalfEdge(i,0.5);
+			Q_UNUSED(pointno);
 			stop=false;
 		    }
 		}
@@ -1714,7 +1714,6 @@
 	angle=MathUtils::angle(mPointVector[p1],mPointVector[p2],mPointVector[p3],mPointVector[p2]);
 	
 	bool twoforcededges;//flag to decide, if edges should be added to the maps. Do not add them if true
-	int forcededgecounter=0;
 
 
 	if((mHalfEdge[i]->getForced()==true||edgeOnConvexHull(i))&&(mHalfEdge[mHalfEdge[i]->getNext()]->getForced()==true||edgeOnConvexHull(mHalfEdge[i]->getNext())))
@@ -1762,7 +1761,7 @@
 		//put all three edges to dontexamine and remove them from the other maps
 		dontexamine.insert(minedge);
 		edge_angle.erase(minedge);
-		multimap<double,int>::iterator minedgeiter=angle_edge.find(minangle);
+		std::multimap<double,int>::iterator minedgeiter=angle_edge.find(minangle);
 		while(minedgeiter->second!=minedge)
 		{
 		    ++minedgeiter;
@@ -1777,7 +1776,7 @@
 		std::cout << "put circumcenter " << circumcenter.getX() << "//" << circumcenter.getY() << "on dontexamine list because it is outside the convex hull" << std::endl << std::flush;
 		dontexamine.insert(minedge);
 		edge_angle.erase(minedge);
-		multimap<double,int>::iterator minedgeiter=angle_edge.find(minangle);
+		std::multimap<double,int>::iterator minedgeiter=angle_edge.find(minangle);
 		while(minedgeiter->second!=minedge)
 		{
 		    ++minedgeiter;
@@ -1972,7 +1971,7 @@
 	    {
 		//delete minedge from edge_angle and minangle from angle_edge
 		edge_angle.erase(minedge);
-		multimap<double,int>::iterator minedgeiter=angle_edge.find(minangle);
+		std::multimap<double,int>::iterator minedgeiter=angle_edge.find(minangle);
 		while(minedgeiter->second!=minedge)
 		{
 		    ++minedgeiter;
@@ -1984,7 +1983,7 @@
 	    {
 		//delete minedge from edge_angle and minangle from angle_edge
 		edge_angle.erase(minedge);
-		multimap<double,int>::iterator minedgeiter=angle_edge.find(minangle);
+		std::multimap<double,int>::iterator minedgeiter=angle_edge.find(minangle);
 		while(minedgeiter->second!=minedge)
 		{
 		    ++minedgeiter;
@@ -2207,7 +2206,7 @@
 			}
 			if(flag==false)
 			{
-			    cout << "point is not present in the triangulation" << endl << flush;
+			    std::cout << "point is not present in the triangulation" << std::endl << std::flush;
 			}
 		    }
 		//put all three edges to dontexamine and remove them from the other maps
@@ -2484,7 +2483,7 @@
 	  //print out all the elements of polya for a test
 	  /*for(iterator=polya.begin();iterator!=polya.end();++iterator)
 	    {
-	      cout << (*iterator) << endl << flush;
+	      std::cout << (*iterator) << std::endl << std::flush;
 	      }*/
 
 	  triangulatePolygon(&polya,free,inserta);
@@ -2563,7 +2562,7 @@
 
   else
     {
-      cout << "warning, null pointer in DualEdgeTriangulation::triangulatePolygon" << endl << flush;
+      std::cout << "warning, null pointer in DualEdgeTriangulation::triangulatePolygon" << std::endl << std::flush;
     }
   
 }
@@ -2582,7 +2581,7 @@
     {
       if(runs>nBaseOfRuns)//prevents endless loops
 	{
-	    cout << "warning, instability detected in DualEdgeTriangulation::pointInside. Point coordinates: " << x << "//" << y << endl << flush;
+	    std::cout << "warning, instability detected in DualEdgeTriangulation::pointInside. Point coordinates: " << x << "//" << y << std::endl << std::flush;
 	    return false;
 	}
 
@@ -2641,7 +2640,7 @@
   }
   if(numinstabs>0)//a numerical instability occured
   {
-      cout << "numerical instabilities in DualEdgeTriangulation::pointInside" << endl << flush;
+      std::cout << "numerical instabilities in DualEdgeTriangulation::pointInside" << std::endl << std::flush;
       return true;
   }
 
@@ -2771,7 +2770,7 @@
       hf2->setBreak(break2);
       hf2->setForced(forced2);
 
-      //cout << "inserting half edge pair " << i << endl << flush;
+      //std::cout << "inserting half edge pair " << i << std::endl << std::flush;
       mHalfEdge.insert(nr1,hf1);
       mHalfEdge.insert(nr2,hf2);
      
@@ -2799,12 +2798,12 @@
   while(buff.mid(0,4)!="POIN")
     {
       buff=textstream.readLine();
-      cout << buff << endl << flush;
+      std::cout << buff << std::endl << std::flush;
     }
   while(buff.mid(0,4)!="NPTS")
     {
       buff=textstream.readLine();
-      cout << buff << endl << flush;
+      std::cout << buff << std::endl << std::flush;
     }
   numberofpoints=buff.section(' ',1,1).toInt();
   mPointVector.resize(numberofpoints);
@@ -2836,7 +2835,7 @@
 
       Point3D* p=new Point3D(x,y,z);
       
-      //cout << "inserting point " << i << endl << flush;
+      //std::cout << "inserting point " << i << std::endl << std::flush;
       mPointVector.insert(i,p);
       
       if(i==0)
@@ -2888,9 +2887,9 @@
   outstream.precision(9);
 
   //export the edges. Attention, dual edges must be adjacent in the TAFF-file
-  outstream << "TRIA" << endl << flush;
-  outstream << "NEDG " << mHalfEdge.count() << endl << flush;
-  outstream << "PANO 1" << endl << flush;
+  outstream << "TRIA" << std::endl << std::flush;
+  outstream << "NEDG " << mHalfEdge.count() << std::endl << std::flush;
+  outstream << "PANO 1" << std::endl << std::flush;
   outstream << "DATA ";
 
   bool* cont=new bool[mHalfEdge.count()];
@@ -2912,15 +2911,15 @@
       cont[i]=true;
       cont[dual]=true;
     }
-  outstream << endl << flush;
-  outstream << endl << flush;
+  outstream << std::endl << std::flush;
+  outstream << std::endl << std::flush;
 
   delete[] cont;
 
   //export the points to the file
-  outstream << "POIN" << endl << flush;
-  outstream << "NPTS " << this->getNumberOfPoints() << endl << flush;
-  outstream << "PATT 3" << endl << flush;
+  outstream << "POIN" << std::endl << std::flush;
+  outstream << "NPTS " << this->getNumberOfPoints() << std::endl << std::flush;
+  outstream << "PATT 3" << std::endl << std::flush;
   outstream << "DATA ";
   
   for(int i=0;i<this->getNumberOfPoints();i++)
@@ -2928,8 +2927,8 @@
       Point3D* p=mPointVector[i];
       outstream << p->getX() << " " << p->getY() << " " << p->getZ() << " ";
     }
-  outstream << endl << flush;
-  outstream << endl << flush;
+  outstream << std::endl << std::flush;
+  outstream << std::endl << std::flush;
 
   return true;
 }
@@ -2985,13 +2984,13 @@
 	}
       else
 	{
-	  //cout << "warning: null pointer in DualEdgeTriangulation::swapEdge" << endl << flush;
+	  //std::cout << "warning: null pointer in DualEdgeTriangulation::swapEdge" << std::endl << std::flush;
 	  return false;
 	}
     }
   else
     {
-      //cout << "Edge number negativ in DualEdgeTriangulation::swapEdge" << endl << flush;
+      //std::cout << "Edge number negativ in DualEdgeTriangulation::swapEdge" << std::endl << std::flush;
       return false;
     }
 }
@@ -3048,13 +3047,13 @@
 	}
       else
 	{
-	  cout << "warning: null pointer in DualEdgeTriangulation::swapEdge" << endl << flush;
+	  std::cout << "warning: null pointer in DualEdgeTriangulation::swapEdge" << std::endl << std::flush;
 	  return 0;
 	}
     }
   else
     {
-      cout << "Edge number negativ in DualEdgeTriangulation::swapEdge" << endl << flush;
+      std::cout << "Edge number negativ in DualEdgeTriangulation::swapEdge" << std::endl << std::flush;
       return 0;
     }
 }
@@ -3104,7 +3103,7 @@
     //just a short test if position is between 0 and 1
     if(position<0||position>1)
     {
-	cout << "warning, position is not between 0 and 1 in DualEdgeTriangulation::splitHalfEdge" << endl << flush;
+	std::cout << "warning, position is not between 0 and 1 in DualEdgeTriangulation::splitHalfEdge" << std::endl << std::flush;
     }
 
     //create the new point on the heap
@@ -3120,7 +3119,7 @@
 	{
 	  mPointVector.resize(mPointVector.count()+1);
 	}
-    cout << "inserting point nr. " << mPointVector.count() << ", " << p->getX() << "//" << p->getY() << "//" << p->getZ() << endl << flush;
+    std::cout << "inserting point nr. " << mPointVector.count() << ", " << p->getX() << "//" << p->getY() << "//" << p->getZ() << std::endl << std::flush;
       mPointVector.insert(mPointVector.count(), p);
      
       //insert the six new halfedges

Modified: trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.h
===================================================================
--- trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.h	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.h	2008-08-23 13:21:39 UTC (rev 9130)
@@ -17,8 +17,6 @@
 #ifndef DUALEDGETRIANGULATION_H
 #define DUALEDGETRIANGULATION_H
 
-using namespace std;
-
 #include "Triangulation.h"
 #include "HalfEdge.h"
 #include <QVector>

Modified: trunk/qgis/src/plugins/interpolation/HalfEdge.h
===================================================================
--- trunk/qgis/src/plugins/interpolation/HalfEdge.h	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/HalfEdge.h	2008-08-23 13:21:39 UTC (rev 9130)
@@ -17,8 +17,6 @@
 #ifndef HALFEDGE_H
 #define HALFEDGE_H
 
-using namespace std;
-
 class HalfEdge
 {
  protected:

Modified: trunk/qgis/src/plugins/interpolation/LinTriangleInterpolator.cc
===================================================================
--- trunk/qgis/src/plugins/interpolation/LinTriangleInterpolator.cc	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/LinTriangleInterpolator.cc	2008-08-23 13:21:39 UTC (rev 9130)
@@ -39,7 +39,7 @@
 
   else
     {
-      cout << "warning, null pointer in LinTriangleInterpolator::calcFirstDerX" << endl << flush;
+      std::cout << "warning, null pointer in LinTriangleInterpolator::calcFirstDerX" << std::endl << std::flush;
       return false;
     }
 }
@@ -65,7 +65,7 @@
   
   else
     {
-      cout << "warning, null pointer in LinTriangleInterpolator::calcFirstDerY" << endl << flush;
+      std::cout << "warning, null pointer in LinTriangleInterpolator::calcFirstDerY" << std::endl << std::flush;
       return false;
     }
 }
@@ -91,7 +91,7 @@
 
   else
     {
-      cout << "warning, null pointer in LinTriangleInterpolator::calcFirstDerY" << endl << flush;
+      std::cout << "warning, null pointer in LinTriangleInterpolator::calcFirstDerY" << std::endl << std::flush;
       return false;
     }
   
@@ -122,7 +122,7 @@
     }
   else
     {
-      cout << "warning, null pointer in LinTriangleInterpolator::calcPoint" << endl << flush;
+      std::cout << "warning, null pointer in LinTriangleInterpolator::calcPoint" << std::endl << std::flush;
       return false;
     }
   

Modified: trunk/qgis/src/plugins/interpolation/LinTriangleInterpolator.h
===================================================================
--- trunk/qgis/src/plugins/interpolation/LinTriangleInterpolator.h	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/LinTriangleInterpolator.h	2008-08-23 13:21:39 UTC (rev 9130)
@@ -17,8 +17,6 @@
 #ifndef LINTRIANGLEINTERPOLATOR_H
 #define LINTRIANGLEINTERPOLATOR_H
 
-using namespace std;
-
 #include "TriangleInterpolator.h"
 #include "DualEdgeTriangulation.h"
 

Modified: trunk/qgis/src/plugins/interpolation/Line3D.h
===================================================================
--- trunk/qgis/src/plugins/interpolation/Line3D.h	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/Line3D.h	2008-08-23 13:21:39 UTC (rev 9130)
@@ -17,8 +17,6 @@
 #ifndef LINE3D_H
 #define LINE3D_H
 
-using namespace std;
-
 #include "Point3D.h"
 #include "Node.h"
 

Modified: trunk/qgis/src/plugins/interpolation/MathUtils.cc
===================================================================
--- trunk/qgis/src/plugins/interpolation/MathUtils.cc	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/MathUtils.cc	2008-08-23 13:21:39 UTC (rev 9130)
@@ -25,7 +25,7 @@
       double area=triArea(p1,p2,p3);
       if(area==0)//p1, p2, p3 are in a line
 	{
-	  cout << "warning, triangle area should not be 0 in MathUtils::calcBarycentricCoordinates" << endl << flush;
+    std::cout << "warning, triangle area should not be 0 in MathUtils::calcBarycentricCoordinates" << std::endl << std::flush;
 	  return false;
 	}
       double area1=triArea(&p,p2,p3);
@@ -41,7 +41,7 @@
     }
   else//null pointer
     {
-      cout << "warning, null pointer in MathUtils::calcBarycentricCoordinates" << endl << flush;
+      std::cout << "warning, null pointer in MathUtils::calcBarycentricCoordinates" << std::endl << std::flush;
       return false;
     }
 }
@@ -55,7 +55,7 @@
       
       if(area==0)
 	{
-	  cout << "warning, p1, p2 and p3 are in a line in MathUtils::BarycentricToXY" << endl << flush;
+    std::cout << "warning, p1, p2 and p3 are in a line in MathUtils::BarycentricToXY" << std::endl << std::flush;
 	  return false;
 	}
       
@@ -90,7 +90,7 @@
     }
   else//null pointer
     {
-      cout << "warning, null pointer in MathUtils::BarycentricToXY" << endl << flush;
+      std::cout << "warning, null pointer in MathUtils::BarycentricToXY" << std::endl << std::flush;
       return false;
     }
 }
@@ -127,7 +127,7 @@
 	//if one of the denominator is zero we will have problems
 	if(denominator==0)
 	{
-	  cout << "error in MathUtils::circumcenter, the three points are in a line" << endl << flush;
+    std::cout << "error in MathUtils::circumcenter, the three points are in a line" << std::endl << std::flush;
 	  return false;
 	}
       else
@@ -135,6 +135,7 @@
 	  result->setX(0.5*(p1->getX()*p1->getX()*p2->getY()-p1->getX()*p1->getX()*p3->getY()-p3->getX()*p3->getX()*p2->getY()-p1->getY()*p2->getX()*p2->getX()-p1->getY()*p1->getY()*p3->getY()-p3->getY()*p3->getY()*p2->getY()+p1->getY()*p1->getY()*p2->getY()+p3->getY()*p2->getX()*p2->getX()-p1->getY()*p2->getY()*p2->getY()+p1->getY()*p3->getY()*p3->getY()+p1->getY()*p3->getX()*p3->getX()+p3->getY()*p2->getY()*p2->getY())/denominator);
 	  result->setY(-0.5*(p3->getX()*p2->getX()*p2->getX()+p2->getX()*p1->getY()*p1->getY()+p3->getX()*p2->getY()*p2->getY()-p3->getX()*p1->getX()*p1->getX()+p1->getX()*p3->getY()*p3->getY()-p3->getX()*p1->getY()*p1->getY()-p1->getX()*p2->getX()*p2->getX()-p2->getX()*p3->getY()*p3->getY()-p1->getX()*p2->getY()*p2->getY()-p2->getX()*p3->getX()*p3->getX()+p1->getX()*p3->getX()*p3->getX()+p2->getX()*p1->getX()*p1->getX())/denominator);
 
+#if 0
 	  //debugging: test, if the distances from p1, p2, p3 to result are equal
 	  double dist1=sqrt((p1->getX()-result->getX())*(p1->getX()-result->getX())+(p1->getY()-result->getY())*(p1->getY()-result->getY()));
 	  double dist2=sqrt((p2->getX()-result->getX())*(p2->getX()-result->getX())+(p2->getY()-result->getY())*(p2->getY()-result->getY()));
@@ -144,13 +145,14 @@
 	  {
 	      bool debug=true;
 	  }
+#endif
 
 	  return true;
 	}
     }
   else
     {
-      cout << "null pointer in method MathUtils::circumcenter" << endl << flush;
+      std::cout << "null pointer in method MathUtils::circumcenter" << std::endl << std::flush;
       return false;
     }
 }
@@ -206,7 +208,7 @@
     }     
   else
     {
-      cout << "null pointer in method MathUtils::distPointFromLine" << endl << flush;
+      std::cout << "null pointer in method MathUtils::distPointFromLine" << std::endl << std::flush;
       return 0;
     }
 }
@@ -215,7 +217,7 @@
 {
   if(n<0)//Is faculty also defined for negative integers?
     {
-      cout << "Error, faculty of a negativ integer requested!" << endl;
+      std::cout << "Error, faculty of a negativ integer requested!" << std::endl;
       return 0;
     }
   int i;
@@ -279,7 +281,7 @@
     }
   else
     {
-      cout << "null pointer in MathUtils::inCircle" << endl << flush;
+      std::cout << "null pointer in MathUtils::inCircle" << std::endl << std::flush;
       return false;
     }
 }
@@ -322,7 +324,7 @@
     } 
   else
     {
-      cout << "Null pointer in MathUtils::leftOf" << endl << flush;
+      std::cout << "Null pointer in MathUtils::leftOf" << std::endl << std::flush;
       return 0;
     }
 }
@@ -365,7 +367,7 @@
   
   else
     {
-      cout << "null pointer in MathUtils::lineIntersection" << endl << flush;
+      std::cout << "null pointer in MathUtils::lineIntersection" << std::endl << std::flush;
       return false;
     }
 }
@@ -418,7 +420,7 @@
   
   else
     {
-      cout << "null pointer in MathUtils::lineIntersection" << endl << flush;
+      std::cout << "null pointer in MathUtils::lineIntersection" << std::endl << std::flush;
       return false;
     }
 }
@@ -497,7 +499,7 @@
     }
   else//null pointer
     {
-      cout << "Null pointer in MathUtils::triArea" << endl << flush;
+      std::cout << "Null pointer in MathUtils::triArea" << std::endl << std::flush;
       return 0;
     }
 }
@@ -506,7 +508,7 @@
 {
   if(n!=3||i>n)
     {
-      cout << "error, can't calculate hermite polynom" << endl;
+      std::cout << "error, can't calculate hermite polynom" << std::endl;
     }
 
   if(n==3&&i==0)
@@ -530,7 +532,7 @@
     }
   else//somthing went wrong
     {
-      cout << "Error in MathUtils::calcCubicHermitePoly" << endl << flush;
+      std::cout << "Error in MathUtils::calcCubicHermitePoly" << std::endl << std::flush;
       return 0;
     }
 }
@@ -539,7 +541,7 @@
 {
   if(n!=3||i>n)
     {
-      cout << "error, can't calculate hermite polynom" << endl;
+      std::cout << "error, can't calculate hermite polynom" << std::endl;
     }
 
   if(n==3&&i==0)
@@ -569,7 +571,7 @@
     }
   else
     {
-      cout << "Error in MathUtils::cFDerCubicHermitePoly" << endl << flush;
+      std::cout << "Error in MathUtils::cFDerCubicHermitePoly" << std::endl << std::flush;
       return 0;
     }
 }
@@ -617,7 +619,7 @@
 
       if(d<0)//no solution in R
 	{
-	  cout << "Determinant Error in MathUtils::normalLeft" << endl;
+	  std::cout << "Determinant Error in MathUtils::normalLeft" << std::endl;
 	  return false;
 	}
 
@@ -674,7 +676,7 @@
 
       if(d<0)//no solution in R
 	{
-	  cout << "Determinant Error in MathUtils::normalLeft" << endl;
+	  std::cout << "Determinant Error in MathUtils::normalLeft" << std::endl;
 	  return false;
 	}
 
@@ -736,7 +738,7 @@
 	}
       else//if a division through zero would occur
 	{
-	  cout << "warning in MathUtils::crossVec(...): vectors parallel to each other" << endl << flush;
+	  std::cout << "warning in MathUtils::crossVec(...): vectors parallel to each other" << std::endl << std::flush;
 	  return 0;
 	}
     }
@@ -744,7 +746,7 @@
 
   else//null pointer
     {
-      cout << "warning in MathUtils::crossVec(...): null pointer" << endl << flush;
+      std::cout << "warning in MathUtils::crossVec(...): null pointer" << std::endl << std::flush;
       return 0;
     }
 }
@@ -786,7 +788,7 @@
       double xgalpha1=1/(2*xt*xt*yw*yw*zt*zt-2*zt*zt*zt*xt*zw*xw+yt*yt*yt*yt*zw*zw+yt*yt*zw*zw*zt*zt+xt*xt*yt*yt*xw*xw+xt*xt*yw*yw*yt*yt-2*xt*xt*xt*zt*zw*xw+yt*yt*yt*yt*xw*xw+yt*yt*yw*yw*zt*zt+2*xt*xt*yt*yt*zw*zw-2*yt*yt*yt*yw*zt*zw+zt*zt*xt*xt*zw*zw+zt*zt*zt*zt*xw*xw+xt*xt*zt*zt*xw*xw+2*zt*zt*xw*xw*yt*yt-2*xt*xt*yw*zt*yt*zw-2*xt*yt*yt*yt*xw*yw-2*xt*xt*xt*yw*yt*xw-2*xt*zt*zt*xw*yt*yw-2*xt*zt*xw*yt*yt*zw-2*yw*zt*zt*zt*yt*zw+xt*xt*xt*xt*yw*yw+yw*yw*zt*zt*zt*zt+xt*xt*xt*xt*zw*zw);
       if(xgalpha1<0)
 	{
-	  cout << "warning, only complex solution of xg in MathUtils::normalMinDistance" << endl << flush;
+	  std::cout << "warning, only complex solution of xg in MathUtils::normalMinDistance" << std::endl << std::flush;
 	  return false;
 	}
       xg1=sqrt(xgalpha1)*(-yt*yw*xt+yt*yt*xw+xw*zt*zt-zt*xt*zw);
@@ -796,7 +798,7 @@
       double ygalpha1=1/(2*xt*xt*yw*yw*zt*zt-2*zt*zt*zt*xt*zw*xw+yt*yt*yt*yt*zw*zw+yt*yt*zw*zw*zt*zt+xt*xt*yt*yt*xw*xw+xt*xt*yw*yw*yt*yt-2*xt*xt*xt*zt*zw*xw+yt*yt*yt*yt*xw*xw+yt*yt*yw*yw*zt*zt+2*xt*xt*yt*yt*zw*zw-2*yt*yt*yt*yw*zt*zw+zt*zt*xt*xt*zw*zw+zt*zt*zt*zt*xw*xw+xt*xt*zt*zt*xw*xw+2*zt*zt*xw*xw*yt*yt-2*xt*xt*yw*zt*yt*zw-2*xt*yt*yt*yt*xw*yw-2*xt*xt*xt*yw*yt*xw-2*xt*zt*zt*xw*yt*yw-2*xt*zt*xw*yt*yt*zw-2*yw*zt*zt*zt*yt*zw+xt*xt*xt*xt*yw*yw+yw*yw*zt*zt*zt*zt+xt*xt*xt*xt*zw*zw);
       if(ygalpha1<0)
 	{
-	  cout << "warning, only complex solution of yg in MathUtils::normalMinDistance" << endl << flush;
+	  std::cout << "warning, only complex solution of yg in MathUtils::normalMinDistance" << std::endl << std::flush;
 	  return false;
 	}
       yg1=-sqrt(ygalpha1)*(-yw*xt*xt-zt*zt*yw+zt*yt*zw+yt*xw*xt);
@@ -806,7 +808,7 @@
       double zgalpha1=1/(2*xt*xt*yw*yw*zt*zt-2*zt*zt*zt*xt*zw*xw+yt*yt*yt*yt*zw*zw+yt*yt*zw*zw*zt*zt+xt*xt*yt*yt*xw*xw+xt*xt*yw*yw*yt*yt-2*xt*xt*xt*zt*zw*xw+yt*yt*yt*yt*xw*xw+yt*yt*yw*yw*zt*zt+2*xt*xt*yt*yt*zw*zw-2*yt*yt*yt*yw*zt*zw+zt*zt*xt*xt*zw*zw+zt*zt*zt*zt*xw*xw+xt*xt*zt*zt*xw*xw+2*zt*zt*xw*xw*yt*yt-2*xt*xt*yw*zt*yt*zw-2*xt*yt*yt*yt*xw*yw-2*xt*xt*xt*yw*yt*xw-2*xt*zt*zt*xw*yt*yw-2*xt*zt*xw*yt*yt*zw-2*yw*zt*zt*zt*yt*zw+xt*xt*xt*xt*yw*yw+yw*yw*zt*zt*zt*zt+xt*xt*xt*xt*zw*zw);
       if(zgalpha1<0)
 	{
-	  cout << "warning, only complex solution of zg in MathUtils::normalMinDistance" << endl << flush;
+	  std::cout << "warning, only complex solution of zg in MathUtils::normalMinDistance" << std::endl << std::flush;
 	  return false;
 	}
       zg1=-sqrt(zgalpha1)*(yt*yw*zt-yt*yt*zw+xw*zt*xt-xt*xt*zw);
@@ -832,7 +834,7 @@
 
   else
     {
-      cout << "warning, null pointer in MathUtils::normalMinDistance" << endl << flush;
+      std::cout << "warning, null pointer in MathUtils::normalMinDistance" << std::endl << std::flush;
       return false;
     }
 }
@@ -850,7 +852,7 @@
     }
   else
     {
-      cout << "warning, null pointer in MathUtils::planeTest" << endl << flush;
+      std::cout << "warning, null pointer in MathUtils::planeTest" << std::endl << std::flush;
       return 0;
     }
 }
@@ -866,7 +868,7 @@
     }
   else
     {
-      cout << "warning, null pointer in MathUtils::angle" << endl << flush;
+      std::cout << "warning, null pointer in MathUtils::angle" << std::endl << std::flush;
       return 0;
     }
 }

Modified: trunk/qgis/src/plugins/interpolation/MathUtils.h
===================================================================
--- trunk/qgis/src/plugins/interpolation/MathUtils.h	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/MathUtils.h	2008-08-23 13:21:39 UTC (rev 9130)
@@ -17,8 +17,6 @@
 #ifndef MATHUTILS_H
 #define MATHUTILS_H
 
-using namespace std;
-
 #include <cmath>
 #include "Vector3D.h"
 #include "Point3D.h"

Modified: trunk/qgis/src/plugins/interpolation/Node.h
===================================================================
--- trunk/qgis/src/plugins/interpolation/Node.h	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/Node.h	2008-08-23 13:21:39 UTC (rev 9130)
@@ -17,8 +17,6 @@
 #ifndef NODE_H
 #define NODE_H
 
-using namespace std;
-
 #include "Point3D.h"
 #include <iostream>
 

Modified: trunk/qgis/src/plugins/interpolation/Point3D.cc
===================================================================
--- trunk/qgis/src/plugins/interpolation/Point3D.cc	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/Point3D.cc	2008-08-23 13:21:39 UTC (rev 9130)
@@ -46,7 +46,7 @@
     }
   else
     {
-      cout << "warning, null pointer in Point3D::dist3D" << endl << flush;
+      std::cout << "warning, null pointer in Point3D::dist3D" << std::endl << std::flush;
       return 0;
     }
 }

Modified: trunk/qgis/src/plugins/interpolation/Point3D.h
===================================================================
--- trunk/qgis/src/plugins/interpolation/Point3D.h	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/Point3D.h	2008-08-23 13:21:39 UTC (rev 9130)
@@ -17,8 +17,6 @@
 #ifndef POINT3D_H
 #define POINT3D_H
 
-using namespace std;
-
 #include <cmath>
 #include <iostream>
 

Modified: trunk/qgis/src/plugins/interpolation/Vector3D.h
===================================================================
--- trunk/qgis/src/plugins/interpolation/Vector3D.h	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/Vector3D.h	2008-08-23 13:21:39 UTC (rev 9130)
@@ -17,8 +17,6 @@
 #ifndef VECTOR3D_H
 #define VECTOR3D_H
 
-using namespace std;
-
 #include <cmath>
 
 class Vector3D

Modified: trunk/qgis/src/plugins/interpolation/mIconInterpolation.xpm
===================================================================
--- trunk/qgis/src/plugins/interpolation/mIconInterpolation.xpm	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/mIconInterpolation.xpm	2008-08-23 13:21:39 UTC (rev 9130)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *mIconInterpolation[]={
+static const char *mIconInterpolation[]={
 "32 28 2 1",
 ". c None",
 "# c #000000",

Modified: trunk/qgis/src/plugins/interpolation/qgsidwinterpolator.cpp
===================================================================
--- trunk/qgis/src/plugins/interpolation/qgsidwinterpolator.cpp	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/qgsidwinterpolator.cpp	2008-08-23 13:21:39 UTC (rev 9130)
@@ -17,6 +17,7 @@
 
 #include "qgsidwinterpolator.h"
 #include <cmath>
+#include <limits>
 
 QgsIDWInterpolator::QgsIDWInterpolator(const QList<QgsVectorLayer*>& vlayers): QgsInterpolator(vlayers), mDistanceCoefficient(2.0)
 {

Modified: trunk/qgis/src/plugins/interpolation/qgsinterpolator.cpp
===================================================================
--- trunk/qgis/src/plugins/interpolation/qgsinterpolator.cpp	2008-08-23 12:41:56 UTC (rev 9129)
+++ trunk/qgis/src/plugins/interpolation/qgsinterpolator.cpp	2008-08-23 13:21:39 UTC (rev 9130)
@@ -75,7 +75,7 @@
       provider->select(attList);
 
       QgsFeature theFeature;
-      double attributeValue;
+      double attributeValue = 0.0;
       while(provider->getNextFeature(theFeature))
 	{
 	  if(!zCoordInterpolation)



More information about the QGIS-commit mailing list