@@ -37,10 +37,12 @@ namespace pal
37
37
int n = 0 ;
38
38
double dist;
39
39
double distlabel = lp->feature ->getLabelDistance ();
40
- /* unit_convert( double( lp->feature->distlabel ),
41
- pal::PIXEL,
42
- pal->map_unit,
43
- pal->dpi, scale, 1 );*/
40
+ #if 0
41
+ unit_convert( double( lp->feature->distlabel ),
42
+ pal::PIXEL,
43
+ pal->map_unit,
44
+ pal->dpi, scale, 1 );
45
+ #endif
44
46
45
47
switch ( feat->getGeosType () )
46
48
{
@@ -230,7 +232,7 @@ namespace pal
230
232
*/
231
233
232
234
double alpha = lp->getAlpha ();
233
- for ( i = 0 ; i < 8 ; i++, alpha += M_PI / 4 )
235
+ for ( i = 0 ; i < 8 ; i++, alpha += M_PI_4 )
234
236
{
235
237
dist[i] = DBL_MAX;
236
238
ok[i] = false ;
@@ -261,14 +263,12 @@ namespace pal
261
263
{
262
264
double beta = atan2 ( pset->y [0 ] - py, pset->x [0 ] - px ) - lp->getAlpha ();
263
265
264
- while ( beta < 0 )
266
+ while ( beta < 0.0 )
265
267
{
266
268
beta += 2 * M_PI;
267
269
}
268
270
269
- double a45 = M_PI / 4 ;
270
-
271
- int i = ( int )( beta / a45 );
271
+ int i = ( int ) floor ( beta / M_PI_4 ) % 8 ;
272
272
273
273
for ( int j = 0 ; j < 2 ; j++, i = ( i + 1 ) % 8 )
274
274
{
@@ -287,7 +287,7 @@ namespace pal
287
287
}
288
288
else
289
289
{
290
- std::cout << " this shouldn't occurs !!!" << std::endl;
290
+ std::cout << " this shouldn't occur !!!" << std::endl;
291
291
}
292
292
}
293
293
}
@@ -334,14 +334,14 @@ namespace pal
334
334
335
335
for ( i = 0 ; i < 8 ; i++ )
336
336
{
337
- /*
337
+ # if 0
338
338
if ( i == 0 || i == 4 ) // horizontal directions
339
339
dist[i] -= lp->w / 2;
340
- else if (i == 2 || i == 6 ) // vertical directions
340
+ else if ( i == 2 || i == 6 ) // vertical directions
341
341
dist[i] -= lp->h / 2;
342
342
else // other directions
343
- dist[i] -= ( lp->w / 2 ) / cos( M_PI / 4 );
344
- */
343
+ dist[i] -= ( lp->w / 2 ) / cos( M_PI_4 );
344
+ # endif
345
345
346
346
if ( !ok[i] || dist[i] < EPSILON )
347
347
{
@@ -356,8 +356,10 @@ namespace pal
356
356
c = min ( dist[2 ], dist[6 ] );
357
357
d = min ( dist[3 ], dist[7 ] );
358
358
359
- // if (a!=EPSILON || b!=EPSILON || c!=EPSILON || d!=EPSILON)
360
- // std::cout << "res " << (a*b*c*d) << " " << a << " " << b << " " << c << " " << d << std::endl;
359
+ #if 0
360
+ if ( a != EPSILON || b != EPSILON || c != EPSILON || d != EPSILON )
361
+ std::cout << "res " << ( a*b*c*d ) << " " << a << " " << b << " " << c << " " << d << std::endl;
362
+ #endif
361
363
return ( a*b*c*d );
362
364
}
363
365
0 commit comments