[QGIS Commit] r9542 - in trunk/qgis: python/core src/app src/core src/gui src/plugins/interpolation

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Oct 24 19:22:44 EDT 2008


Author: timlinux
Date: 2008-10-24 19:22:44 -0400 (Fri, 24 Oct 2008)
New Revision: 9542

Modified:
   trunk/qgis/python/core/qgssnapper.sip
   trunk/qgis/python/core/qgsvectorlayer.sip
   trunk/qgis/src/app/qgsmaptooladdvertex.cpp
   trunk/qgis/src/app/qgsmaptooldeletevertex.cpp
   trunk/qgis/src/app/qgsmaptoolmovevertex.cpp
   trunk/qgis/src/core/qgssnapper.cpp
   trunk/qgis/src/core/qgssnapper.h
   trunk/qgis/src/core/qgsvectorlayer.cpp
   trunk/qgis/src/core/qgsvectorlayer.h
   trunk/qgis/src/gui/qgsmapcanvassnapper.cpp
   trunk/qgis/src/gui/qgsmapcanvassnapper.h
   trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc
   trunk/qgis/src/plugins/interpolation/Triangulation.h
Log:
API tidy ups for qgssnapper

Modified: trunk/qgis/python/core/qgssnapper.sip
===================================================================
--- trunk/qgis/python/core/qgssnapper.sip	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/python/core/qgssnapper.sip	2008-10-24 23:22:44 UTC (rev 9542)
@@ -38,23 +38,23 @@
   
 public:
   /**Snap to vertex, to segment or both*/
-  enum SNAP_TO
+  enum SnappingType
     {
-      SNAP_TO_VERTEX,
-      SNAP_TO_SEGMENT,
+      SnapToVertex,
+      SnapToSegment,
       //snap to vertex and also to segment if no vertex is within the search tolerance
-      SNAP_TO_VERTEX_AND_SEGMENT
+      SnapToVertexAndSegment
     };
   
-  enum SNAP_MODE
+  enum SnappingMode
     {
       /**Only one snapping result is retured*/
-      ONE_RESULT,
+      SnapWithOneResult,
       /**Several snapping results which have the same position are returned. This is usefull for topological
        editing*/
-      SEVERAL_RESULTS_SAME_POSITION,
+      SnapWithResultsForSamePosition,
       /**All results within the given layer tolerances are returned*/
-      ALL_RESULTS_WITHIN_GIVEN_TOLERANCES
+      SnapWithResultsWithinTolerances
     };
 
   QgsSnapper(QgsMapRenderer* mapRender);
@@ -68,7 +68,7 @@
   //setters
   void setLayersToSnap(const QList<QgsVectorLayer*>& layerList);
   void setTolerances(const QList<double>& toleranceList);
-  // TODO wrap void setSnapToList(const QList<QgsSnapper::SNAP_TO>& snapToList);
-  void setSnapMode(QgsSnapper::SNAP_MODE snapMode);
+  // TODO wrap void setSnapToList(const QList<QgsSnapper::SnappingType>& snapToList);
+  void setSnapMode(QgsSnapper::SnappingMode snapMode);
 
 };

Modified: trunk/qgis/python/core/qgsvectorlayer.sip
===================================================================
--- trunk/qgis/python/core/qgsvectorlayer.sip	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/python/core/qgsvectorlayer.sip	2008-10-24 23:22:44 UTC (rev 9542)
@@ -288,7 +288,7 @@
      @return 0 in case of success
   */
   int snapWithContext(const QgsPoint& startPoint, double snappingTolerance, QMultiMap<double, QgsSnappingResult>& snappingResults /Out/,
-                      QgsSnapper::SNAP_TO snap_to);
+                      QgsSnapper::SnappingType snap_to);
 
   /** Draws the layer using coordinate transformation
    *  @return FALSE if an error occurred during drawing

Modified: trunk/qgis/src/app/qgsmaptooladdvertex.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptooladdvertex.cpp	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/src/app/qgsmaptooladdvertex.cpp	2008-10-24 23:22:44 UTC (rev 9542)
@@ -51,7 +51,7 @@
   mRubberBand = 0;
 
   //snap to segments of the current layer
-  if ( mSnapper.snapToCurrentLayer( e->pos(), mRecentSnappingResults, QgsSnapper::SNAP_TO_SEGMENT ) != 0 )
+  if ( mSnapper.snapToCurrentLayer( e->pos(), mRecentSnappingResults, QgsSnapper::SnapToSegment ) != 0 )
   {
     //error
   }

Modified: trunk/qgis/src/app/qgsmaptooldeletevertex.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptooldeletevertex.cpp	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/src/app/qgsmaptooldeletevertex.cpp	2008-10-24 23:22:44 UTC (rev 9542)
@@ -43,7 +43,7 @@
 
   mRecentSnappingResults.clear();
   //do snap -> new recent snapping results
-  if ( mSnapper.snapToCurrentLayer( e->pos(), mRecentSnappingResults, QgsSnapper::SNAP_TO_VERTEX ) != 0 )
+  if ( mSnapper.snapToCurrentLayer( e->pos(), mRecentSnappingResults, QgsSnapper::SnapToVertex ) != 0 )
   {
     //error
   }

Modified: trunk/qgis/src/app/qgsmaptoolmovevertex.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolmovevertex.cpp	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/src/app/qgsmaptoolmovevertex.cpp	2008-10-24 23:22:44 UTC (rev 9542)
@@ -79,7 +79,7 @@
   mRubberBandMovingPoints.clear();
 
   //do snap -> new recent snapping results
-  if ( mSnapper.snapToCurrentLayer( e->pos(), mRecentSnappingResults, QgsSnapper::SNAP_TO_VERTEX ) != 0 )
+  if ( mSnapper.snapToCurrentLayer( e->pos(), mRecentSnappingResults, QgsSnapper::SnapToVertex ) != 0 )
   {
     //error
   }

Modified: trunk/qgis/src/core/qgssnapper.cpp
===================================================================
--- trunk/qgis/src/core/qgssnapper.cpp	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/src/core/qgssnapper.cpp	2008-10-24 23:22:44 UTC (rev 9542)
@@ -51,7 +51,7 @@
 
   QList<QgsVectorLayer*>::iterator layerIt = mLayersToSnap.begin();
   QList<double>::const_iterator  toleranceIt = mSnappingTolerances.constBegin();
-  QList<QgsSnapper::SNAP_TO>::const_iterator snapToIt = mSnapToList.constBegin();
+  QList<QgsSnapper::SnappingType>::const_iterator snapToIt = mSnapToList.constBegin();
 
   QMultiMap<double, QgsSnappingResult> snappingResultList;//all snapping results
   QMultiMap<double, QgsSnappingResult> currentResultList; //snapping results of examined layer
@@ -95,12 +95,12 @@
     return 0;
   }
 
-  if ( mSnapMode == QgsSnapper::ONE_RESULT )
+  if ( mSnapMode == QgsSnapper::SnapWithOneResult )
   {
     //return only closest result
     snappingResult.push_back( evalIt.value() );
   }
-  else if ( mSnapMode == QgsSnapper::SEVERAL_RESULTS_SAME_POSITION )
+  else if ( mSnapMode == QgsSnapper::SnapWithResultsForSamePosition )
   {
     //take all snapping Results within a certain tolerance because rounding differences may occur
     double tolerance = 0.000001;
@@ -138,12 +138,12 @@
   mSnappingTolerances = toleranceList;
 }
 
-void QgsSnapper::setSnapToList( const QList<QgsSnapper::SNAP_TO>& snapToList )
+void QgsSnapper::setSnapToList( const QList<QgsSnapper::SnappingType>& snapToList )
 {
   mSnapToList = snapToList;
 }
 
-void QgsSnapper::setSnapMode( QgsSnapper::SNAP_MODE snapMode )
+void QgsSnapper::setSnapMode( QgsSnapper::SnappingMode snapMode )
 {
   mSnapMode = snapMode;
 }

Modified: trunk/qgis/src/core/qgssnapper.h
===================================================================
--- trunk/qgis/src/core/qgssnapper.h	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/src/core/qgssnapper.h	2008-10-24 23:22:44 UTC (rev 9542)
@@ -59,23 +59,23 @@
 {
   public:
     /**Snap to vertex, to segment or both*/
-    enum SNAP_TO
+    enum SnappingType
     {
-      SNAP_TO_VERTEX,
-      SNAP_TO_SEGMENT,
+      SnapToVertex,
+      SnapToSegment,
       //snap to vertex and also to segment if no vertex is within the search tolerance
-      SNAP_TO_VERTEX_AND_SEGMENT
+      SnapToVertexAndSegment
     };
 
-    enum SNAP_MODE
+    enum SnappingMode
     {
       /**Only one snapping result is retured*/
-      ONE_RESULT,
+      SnapWithOneResult,
       /**Several snapping results which have the same position are returned. This is usefull for topological
        editing*/
-      SEVERAL_RESULTS_SAME_POSITION,
+      SnapWithResultsForSamePosition,
       /**All results within the given layer tolerances are returned*/
-      ALL_RESULTS_WITHIN_GIVEN_TOLERANCES
+      SnapWithResultsWithinTolerances
     };
 
     QgsSnapper( QgsMapRenderer* mapRender );
@@ -90,8 +90,8 @@
     //setters
     void setLayersToSnap( const QList<QgsVectorLayer*>& layerList );
     void setTolerances( const QList<double>& toleranceList );
-    void setSnapToList( const QList<QgsSnapper::SNAP_TO>& snapToList );
-    void setSnapMode( QgsSnapper::SNAP_MODE snapMode );
+    void setSnapToList( const QList<QgsSnapper::SnappingType>& snapToList );
+    void setSnapMode( QgsSnapper::SnappingMode snapMode );
 
   private:
     /**Don't use the default constructor*/
@@ -104,14 +104,14 @@
      of the map and about the relationship between pixel space and map space*/
     QgsMapRenderer* mMapRenderer;
     /**Snap mode to apply*/
-    QgsSnapper::SNAP_MODE mSnapMode;
+    QgsSnapper::SnappingMode mSnapMode;
     /**The layers to which snapping is applied*/
     QList<QgsVectorLayer*> mLayersToSnap;
     /**The snapping tolerances for the layers. The order must correspond to the layer list.
      Note that the tolerances are always in source coordinate systems of the layers*/
     QList<double> mSnappingTolerances;
     /**List if snap to segment of to vertex. The order must correspond to the layer list*/
-    QList<QgsSnapper::SNAP_TO> mSnapToList;
+    QList<QgsSnapper::SnappingType> mSnapToList;
 };
 
 #endif

Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp	2008-10-24 23:22:44 UTC (rev 9542)
@@ -1928,7 +1928,7 @@
   }
 
 
-  if ( snapWithContext( p, threshold, snapResults, QgsSnapper::SNAP_TO_SEGMENT ) != 0 )
+  if ( snapWithContext( p, threshold, snapResults, QgsSnapper::SnapToSegment ) != 0 )
   {
     return 2;
   }
@@ -1939,7 +1939,7 @@
   {
     //test if p is already a vertex of this geometry. If yes, don't insert it
     bool vertexAlreadyExists = false;
-    if ( snapWithContext( p, threshold, vertexSnapResults, QgsSnapper::SNAP_TO_VERTEX ) != 0 )
+    if ( snapWithContext( p, threshold, vertexSnapResults, QgsSnapper::SnapToVertex ) != 0 )
     {
       continue;
     }
@@ -3107,7 +3107,7 @@
 bool QgsVectorLayer::snapPoint( QgsPoint& point, double tolerance )
 {
   QMultiMap<double, QgsSnappingResult> snapResults;
-  int result = snapWithContext( point, tolerance, snapResults, QgsSnapper::SNAP_TO_VERTEX );
+  int result = snapWithContext( point, tolerance, snapResults, QgsSnapper::SnapToVertex );
 
   if ( result != 0 )
   {
@@ -3128,7 +3128,7 @@
 
 int QgsVectorLayer::snapWithContext( const QgsPoint& startPoint, double snappingTolerance,
                                      QMultiMap<double, QgsSnappingResult>& snappingResults,
-                                     QgsSnapper::SNAP_TO snap_to )
+                                     QgsSnapper::SnappingType snap_to )
 {
   if ( snappingTolerance <= 0 || !mDataProvider )
   {
@@ -3154,7 +3154,7 @@
 }
 
 void QgsVectorLayer::snapToGeometry( const QgsPoint& startPoint, int featureId, QgsGeometry* geom, double sqrSnappingTolerance,
-                                     QMultiMap<double, QgsSnappingResult>& snappingResults, QgsSnapper::SNAP_TO snap_to ) const
+                                     QMultiMap<double, QgsSnappingResult>& snappingResults, QgsSnapper::SnappingType snap_to ) const
 {
   if ( !geom )
   {
@@ -3167,7 +3167,7 @@
   QgsSnappingResult snappingResultVertex;
   QgsSnappingResult snappingResultSegment;
 
-  if ( snap_to == QgsSnapper::SNAP_TO_VERTEX || snap_to == QgsSnapper::SNAP_TO_VERTEX_AND_SEGMENT )
+  if ( snap_to == QgsSnapper::SnapToVertex || snap_to == QgsSnapper::SnapToVertexAndSegment )
   {
     snappedPoint = geom->closestVertex( startPoint, atVertex, beforeVertex, afterVertex, sqrDistVertexSnap );
     if ( sqrDistVertexSnap < sqrSnappingTolerance )
@@ -3190,7 +3190,7 @@
       return;
     }
   }
-  if ( snap_to == QgsSnapper::SNAP_TO_SEGMENT || snap_to == QgsSnapper::SNAP_TO_VERTEX_AND_SEGMENT ) // snap to segment
+  if ( snap_to == QgsSnapper::SnapToSegment || snap_to == QgsSnapper::SnapToVertexAndSegment ) // snap to segment
   {
     if ( geometryType() != QGis::Point ) // cannot snap to segment for points/multipoints
     {

Modified: trunk/qgis/src/core/qgsvectorlayer.h
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.h	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/src/core/qgsvectorlayer.h	2008-10-24 23:22:44 UTC (rev 9542)
@@ -347,7 +347,7 @@
                          double snappingTolerance,
                          QMultiMap < double,
                          QgsSnappingResult > & snappingResults,
-                         QgsSnapper::SNAP_TO snap_to );
+                         QgsSnapper::SnappingType snap_to );
 
     /** Draws the layer
      *  @return FALSE if an error occurred during drawing
@@ -534,7 +534,7 @@
      @param snap_to snap to vertex or to segment
     */
     void snapToGeometry( const QgsPoint& startPoint, int featureId, QgsGeometry* geom, double sqrSnappingTolerance,
-                         QMultiMap<double, QgsSnappingResult>& snappingResults, QgsSnapper::SNAP_TO snap_to ) const;
+                         QMultiMap<double, QgsSnappingResult>& snappingResults, QgsSnapper::SnappingType snap_to ) const;
 
     /**Little helper function that gives bounding box from a list of points.
     @return 0 in case of success*/

Modified: trunk/qgis/src/gui/qgsmapcanvassnapper.cpp
===================================================================
--- trunk/qgis/src/gui/qgsmapcanvassnapper.cpp	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/src/gui/qgsmapcanvassnapper.cpp	2008-10-24 23:22:44 UTC (rev 9542)
@@ -59,7 +59,7 @@
   }
 }
 
-int QgsMapCanvasSnapper::snapToCurrentLayer( const QPoint& p, QList<QgsSnappingResult>& results, QgsSnapper::SNAP_TO snap_to, double snappingTol, const QList<QgsPoint>& excludePoints )
+int QgsMapCanvasSnapper::snapToCurrentLayer( const QPoint& p, QList<QgsSnappingResult>& results, QgsSnapper::SnappingType snap_to, double snappingTol, const QList<QgsPoint>& excludePoints )
 {
   results.clear();
 
@@ -70,11 +70,11 @@
     int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
     if ( topologicalEditing == 0 )
     {
-      mSnapper->setSnapMode( QgsSnapper::ONE_RESULT );
+      mSnapper->setSnapMode( QgsSnapper::SnapWithOneResult );
     }
     else
     {
-      mSnapper->setSnapMode( QgsSnapper::SEVERAL_RESULTS_SAME_POSITION );
+      mSnapper->setSnapMode( QgsSnapper::SnapWithResultsForSamePosition );
     }
 
     //current vector layer
@@ -91,7 +91,7 @@
 
     QList<QgsVectorLayer*> layerList;
     QList<double> toleranceList;
-    QList<QgsSnapper::SNAP_TO> snapToList;
+    QList<QgsSnapper::SnappingType> snapToList;
 
     layerList.push_back( vlayer );
     snapToList.push_back( snap_to );
@@ -136,11 +136,11 @@
     int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
     if ( topologicalEditing == 0 )
     {
-      mSnapper->setSnapMode( QgsSnapper::ONE_RESULT );
+      mSnapper->setSnapMode( QgsSnapper::SnapWithOneResult );
     }
     else
     {
-      mSnapper->setSnapMode( QgsSnapper::SEVERAL_RESULTS_SAME_POSITION );
+      mSnapper->setSnapMode( QgsSnapper::SnapWithResultsForSamePosition );
     }
 
     //read snapping settings from project
@@ -162,7 +162,7 @@
 
     QList<QgsVectorLayer*> vectorLayerList;
     QList<double> toleranceDoubleList;
-    QList<QgsSnapper::SNAP_TO> snapTo;
+    QList<QgsSnapper::SnappingType> snapTo;
 
     //Use snapping information from the project
     if ( snappingDefinedInProject )
@@ -200,15 +200,15 @@
         //segment or vertex
         if (( *snapIt ) == "to_vertex" )
         {
-          snapTo.push_back( QgsSnapper::SNAP_TO_VERTEX );
+          snapTo.push_back( QgsSnapper::SnapToVertex );
         }
         else if (( *snapIt ) == "to_segment" )
         {
-          snapTo.push_back( QgsSnapper::SNAP_TO_SEGMENT );
+          snapTo.push_back( QgsSnapper::SnapToSegment );
         }
         else //to vertex and segment
         {
-          snapTo.push_back( QgsSnapper::SNAP_TO_VERTEX_AND_SEGMENT );
+          snapTo.push_back( QgsSnapper::SnapToVertexAndSegment );
         }
 
       }
@@ -234,15 +234,15 @@
       QString defaultSnapString = settings.value( "/qgis/digitizing/default_snap_mode", "to vertex" ).toString();
       if ( defaultSnapString == "to segment" )
       {
-        snapTo.push_back( QgsSnapper::SNAP_TO_SEGMENT );
+        snapTo.push_back( QgsSnapper::SnapToSegment );
       }
       else if ( defaultSnapString == "to vertex and segment" )
       {
-        snapTo.push_back( QgsSnapper::SNAP_TO_VERTEX_AND_SEGMENT );
+        snapTo.push_back( QgsSnapper::SnapToVertexAndSegment );
       }
       else
       {
-        snapTo.push_back( QgsSnapper::SNAP_TO_VERTEX );
+        snapTo.push_back( QgsSnapper::SnapToVertex );
       }
 
       //default snapping tolerance

Modified: trunk/qgis/src/gui/qgsmapcanvassnapper.h
===================================================================
--- trunk/qgis/src/gui/qgsmapcanvassnapper.h	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/src/gui/qgsmapcanvassnapper.h	2008-10-24 23:22:44 UTC (rev 9542)
@@ -43,8 +43,8 @@
     ~QgsMapCanvasSnapper();
 
     /**Does a snap to the current layer. Uses snap mode
-       QgsSnapper::SEVERAL_RESULTS_SAME_POSITION if topological editing is enabled
-       and QgsSnapper::ONE_RESULT_BY_SEGMENT if not. As this method is usually used to
+       QgsSnapper::SnapWithResultsForSamePosition if topological editing is enabled
+       and QgsSnapper::SnapWithOneResult_BY_SEGMENT if not. As this method is usually used to
        find vertices/segments for editing operations, it uses the search radius for vertex
        editing from the qgis options.
        @param p start point of the snap (in pixel coordinates)
@@ -52,10 +52,10 @@
        @param snap_to snap to vertex or to segment
        @param snappingTol snapping tolerance. -1 means that the search radius for vertex edits is taken
        @param excludePoints a list with (map coordinate) points that should be excluded in the snapping result. Useful e.g. for vertex moves where a vertex should not be snapped to its original position*/
-    int snapToCurrentLayer( const QPoint& p, QList<QgsSnappingResult>& results, QgsSnapper::SNAP_TO snap_to, double snappingTol = -1, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
+    int snapToCurrentLayer( const QPoint& p, QList<QgsSnappingResult>& results, QgsSnapper::SnappingType snap_to, double snappingTol = -1, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
     /**Snaps to the background layers. This method is usefull to align the features of the
        edited layers to those of other layers (as described in the project properties).
-       Uses snap mode QgsSnapper::ONE_RESULT. Therefore, only the
+       Uses snap mode QgsSnapper::SnapWithOneResult. Therefore, only the
        closest result is returned.
        @param p start point of the snap (in pixel coordinates)
        @param result snapped point

Modified: trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc
===================================================================
--- trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc	2008-10-24 23:22:44 UTC (rev 9542)
@@ -1245,7 +1245,7 @@
     }
     else if ( MathUtils::lineIntersection( mPointVector[p1], mPointVector[p2], mPointVector[mHalfEdge[mHalfEdge[actedge]->getNext()]->getPoint()], mPointVector[mHalfEdge[mHalfEdge[mHalfEdge[actedge]->getNext()]->getDual()]->getPoint()] ) )
     {
-      if ( mHalfEdge[mHalfEdge[actedge]->getNext()]->getForced() && mForcedCrossBehaviour == Triangulation::SNAP_TO_VERTICE )//if the crossed edge is a forced edge, we have to snap the forced line to the next node
+      if ( mHalfEdge[mHalfEdge[actedge]->getNext()]->getForced() && mForcedCrossBehaviour == Triangulation::SnappingType_VERTICE )//if the crossed edge is a forced edge, we have to snap the forced line to the next node
       {
         Point3D crosspoint;
         int p3, p4;
@@ -1333,7 +1333,7 @@
   {
     if ( MathUtils::lineIntersection( mPointVector[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getPoint()], mPointVector[mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getPoint()], mPointVector[p1], mPointVector[p2] ) )
     {
-      if ( mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getForced() && mForcedCrossBehaviour == Triangulation::SNAP_TO_VERTICE )//if the crossed edge is a forced edge and mForcedCrossBehaviour is SNAP_TO_VERTICE, we have to snap the forced line to the next node
+      if ( mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getForced() && mForcedCrossBehaviour == Triangulation::SnappingType_VERTICE )//if the crossed edge is a forced edge and mForcedCrossBehaviour is SnappingType_VERTICE, we have to snap the forced line to the next node
       {
         Point3D crosspoint;
         int p3, p4;
@@ -1380,7 +1380,7 @@
     }
     else if ( MathUtils::lineIntersection( mPointVector[mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getPoint()], mPointVector[mHalfEdge[mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getNext()]->getPoint()], mPointVector[p1], mPointVector[p2] ) )
     {
-      if ( mHalfEdge[mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getNext()]->getForced() && mForcedCrossBehaviour == Triangulation::SNAP_TO_VERTICE )//if the crossed edge is a forced edge and mForcedCrossBehaviour is SNAP_TO_VERTICE, we have to snap the forced line to the next node
+      if ( mHalfEdge[mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getNext()]->getForced() && mForcedCrossBehaviour == Triangulation::SnappingType_VERTICE )//if the crossed edge is a forced edge and mForcedCrossBehaviour is SnappingType_VERTICE, we have to snap the forced line to the next node
       {
         Point3D crosspoint;
         int p3, p4;

Modified: trunk/qgis/src/plugins/interpolation/Triangulation.h
===================================================================
--- trunk/qgis/src/plugins/interpolation/Triangulation.h	2008-10-24 22:53:53 UTC (rev 9541)
+++ trunk/qgis/src/plugins/interpolation/Triangulation.h	2008-10-24 23:22:44 UTC (rev 9542)
@@ -28,8 +28,8 @@
 class Triangulation
 {
   public:
-    /**Enumeration describing the behaviour, if two forced lines cross. SNAP_TO_VERTICE means, that the second inserted forced line is snapped to the closest vertice of the first inserted forced line. DELETE_FIRST means, that the status of the first inserted forced line is reset to that of a normal edge (so that the second inserted forced line remain and the first not*/
-    enum forcedCrossBehaviour {SNAP_TO_VERTICE, DELETE_FIRST, INSERT_VERTICE};
+    /**Enumeration describing the behaviour, if two forced lines cross. SnappingType_VERTICE means, that the second inserted forced line is snapped to the closest vertice of the first inserted forced line. DELETE_FIRST means, that the status of the first inserted forced line is reset to that of a normal edge (so that the second inserted forced line remain and the first not*/
+    enum forcedCrossBehaviour {SnappingType_VERTICE, DELETE_FIRST, INSERT_VERTICE};
     virtual ~Triangulation();
     /**Adds a line (e.g. a break-, structure- or an isoline) to the triangulation*/
     virtual void addLine( Line3D* line, bool breakline ) = 0;



More information about the QGIS-commit mailing list