Skip to content
Permalink
Browse files
fix various warnings
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10535 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Apr 11, 2009
1 parent 9d78de2 commit ad1607e78b4388aaf4102e668842b2313b5a4bcf
@@ -558,7 +558,7 @@ namespace pal
int it;

double dlx, dly; // delta from label center and bottom-left corner
double alpha; // rotation for the label
double alpha = 0.0; // rotation for the label
double px, py;
double dx;
double dy;
@@ -347,7 +347,7 @@ namespace pal
double startX, startY;
double stopX, stopY;

bool seg_complete;
bool seg_complete = false;

Crossing *crossing;
startX = x[0];
@@ -712,7 +712,8 @@ namespace pal
b = tmp;
}
// split shape into two new shape
if (( newShape = shape->extractPath( path_a, nbPtPathA, nbBboxPoint, bbx, bby, b, a, ( b->pt + 1 ) % shape->nbPoints ) ) )
newShape = shape->extractPath( path_a, nbPtPathA, nbBboxPoint, bbx, bby, b, a, ( b->pt + 1 ) % shape->nbPoints );
if ( newShape )
{
if ( path_a == -1 ) // new shape inside => push into shapes_final
{
@@ -724,7 +725,8 @@ namespace pal
}
}

if (( newShape = shape->extractPath( path_b, nbPtPathB, nbBboxPoint, bbx, bby, a, b, ( a->pt + 1 ) % shape->nbPoints ) ) )
newShape = shape->extractPath( path_b, nbPtPathB, nbBboxPoint, bbx, bby, a, b, ( a->pt + 1 ) % shape->nbPoints );
if ( newShape )
{
if ( path_b == -1 )
{
@@ -1052,7 +1054,7 @@ namespace pal
// retainedPt = deppest point in hole
// bestArea = area of triangle HoleS->holeE->retainedPoint
bestArea = sqrt( bestArea );
double cx, cy, dx, dy, ex, ey, fx, fy, seg_length, ptx, pty, fptx = 0, fpty = 0;
double cx, cy, dx, dy, ex, ey, fx, fy, seg_length, ptx = 0, pty = 0, fptx = 0, fpty = 0;
int ps = -1, pe = -1, fps = -1, fpe = -1;
if ( retainedPt >= 0 && bestArea > labelArea ) // there is a hole so we'll cut the shape in two new shape (only if hole area is bigger than twice labelArea)
{
@@ -59,7 +59,7 @@
#include "util.h"
#include "priorityqueue.h"


#define UNUSED(x) (void)x;

namespace pal
{
@@ -720,7 +720,6 @@ namespace pal

bool subPartCallback( LabelPosition *lp, void *ctx )
{
int lpid = lp->id;
int *isIn = (( SubPartContext* ) ctx )->isIn;
LinkedList<int> *queue = (( SubPartContext* ) ctx )->queue;

@@ -1749,7 +1748,7 @@ namespace pal
#ifdef _DEBUG_FULL_
std::cout << "catch int " << i << std::endl;
#else
i;
UNUSED(i);
#endif
while ( conflicts->size() > 0 )
conflicts->pop_front();
@@ -2053,7 +2052,7 @@ namespace pal
#ifdef _DEBUG_FULL_
std::cout << "catch Cycle in chain" << std::endl;
#else
i;
UNUSED(i);
#endif
while ( conflicts->size() > 0 )
conflicts->pop_front();
@@ -2197,7 +2196,8 @@ namespace pal
{
seed = ( it % probSize ) + borderSize;

if (( current_chain = chain( part, seed ) ) )
current_chain = chain( part, seed );
if ( current_chain )
{

/* we accept a modification only if the seed is not tabu or
@@ -1355,7 +1355,7 @@ namespace pal {

// Search in an index tree or subtree for all data retangles that overlap the argument rectangle.
RTREE_TEMPLATE
bool RTREE_QUAL::Search (Node* a_node, Rect* a_rect, int& a_foundCount, bool a_resultCallback (DATATYPE a_data, void* a_context), void* a_context) {
bool RTREE_QUAL::Search (Node* a_node, Rect* a_rect, int& a_foundCount, bool (*a_resultCallback)(DATATYPE a_data, void* a_context), void* a_context) {
ASSERT (a_node);
ASSERT (a_node->m_level >= 0);
ASSERT (a_rect);
@@ -1374,7 +1374,7 @@ namespace pal {
DATATYPE& id = a_node->m_branch[index].m_data;

// NOTE: There are different ways to return results. Here's where to modify
if (&a_resultCallback) {
if (a_resultCallback) {
++a_foundCount;
if (!a_resultCallback (id, a_context)) {
return false; // Don't continue searching
@@ -157,8 +157,13 @@ namespace pal
case pal::FOOT:
return (( x / double( dpi ) )*12 ) * scale;
case pal::DEGREE:
double iw = degree2meter( delta_canvas_width ) * 39.3700787;
return ( x * delta_canvas_width * scale ) / ( iw * dpi );
{
double iw = degree2meter( delta_canvas_width ) * 39.3700787;
return ( x * delta_canvas_width * scale ) / ( iw * dpi );
}
default:
fprintf( stderr, "Target unit undefined\n" );
return 0.0;
}
break;
case pal::METER:
@@ -169,8 +174,13 @@ namespace pal
case pal::FOOT:
return x / 0.3048;
case pal::DEGREE:
double mw = degree2meter( delta_canvas_width );
return ( x * delta_canvas_width ) / mw;
{
double mw = degree2meter( delta_canvas_width );
return ( x * delta_canvas_width ) / mw;
}
default:
fprintf( stderr, "Target unit undefined\n" );
return 0.0;
}
break;
case pal::FOOT:
@@ -181,27 +191,39 @@ namespace pal
case pal::METER:
return x*0.3048;
case pal::DEGREE:
double iw = degree2meter( delta_canvas_width ) * 39.3700787;
return ( x * delta_canvas_width ) / iw;
{
double iw = degree2meter( delta_canvas_width ) * 39.3700787;
return ( x * delta_canvas_width ) / iw;
}
default:
fprintf( stderr, "Target unit undefined\n" );
return 0.0;
}
break;
case pal::DEGREE:
switch ( to )
{
case pal::PIXEL:
fprintf( stderr, "Degree to pixel not yet implemented" );
fprintf( stderr, "Degree to pixel not yet implemented\n" );
break;
case pal::METER:
fprintf( stderr, "Degree to meter not yet implemented" );
fprintf( stderr, "Degree to meter not yet implemented\n" );
break;
case pal::FOOT:
fprintf( stderr, "Degree to foot not yet implemented" );
fprintf( stderr, "Degree to foot not yet implemented\n" );
break;
default:
fprintf( stderr, "Target unit undefined\n" );
return 0.0;
}
break;
default:
fprintf( stderr, "Source unit undefined" );
return 0.0;

}

fprintf( stderr, "Unable to convert. Unknown units" );
fprintf( stderr, "Unable to convert. Unknown units\n" );
return 0.0;
}

@@ -67,7 +67,6 @@ void QgsPALObjectPositionManager::addLayer( QgsVectorLayer* vl, QList<QgsVectorO
}

//register the labeling objects in the layer
QgsVectorOverlay* currentOverlay = 0;
int objectNr = 0;
QList<QgsVectorOverlay*>::const_iterator overlayIt = overlays.begin();
for ( ; overlayIt != overlays.end(); ++overlayIt )
@@ -114,6 +113,8 @@ void QgsPALObjectPositionManager::findObjectPositions( const QgsRenderContext& r
case QGis::Degrees:
mapUnits = pal::DEGREE;
break;
default:
return;
}
mPositionEngine.setMapUnit( mapUnits );
std::list<pal::Label*>* resultLabelList = mPositionEngine.labeller( renderContext.rendererScale(), bbox, &stat, true );

0 comments on commit ad1607e

Please sign in to comment.