Skip to content

Commit e804a87

Browse files
committedJun 29, 2015
[pal] Remove old ifdefed code
1 parent 5c88c75 commit e804a87

File tree

7 files changed

+3
-567
lines changed

7 files changed

+3
-567
lines changed
 

‎src/core/pal/costcalculator.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ namespace pal
3737
int n = 0;
3838
double dist;
3939
double distlabel = lp->feature->getLabelDistance();
40-
#if 0
41-
unit_convert( double( lp->feature->distlabel ),
42-
pal::PIXEL,
43-
pal->map_unit,
44-
pal->dpi, scale, 1 );
45-
#endif
4640

4741
switch ( feat->getGeosType() )
4842
{

‎src/core/pal/feature.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include "geomfunction.h"
4949
#include "labelposition.h"
5050
#include "pointset.h"
51-
#include "simplemutex.h"
5251
#include "util.h"
5352

5453
#ifndef M_PI
@@ -414,17 +413,6 @@ namespace pal
414413
double alpha;
415414
double beta = 2 * M_PI / nbp; /* angle bw 2 pos */
416415

417-
// uncomment for Wolff 2 position model test on RailwayStation
418-
//if (nbp==2)
419-
// beta = M_PI/2;
420-
421-
#if 0
422-
double distlabel = unit_convert( this->distlabel,
423-
pal::PIXEL,
424-
layer->pal->map_unit,
425-
dpi, scale, delta_width );
426-
#endif
427-
428416
double lx, ly; /* label pos */
429417

430418
/* various alpha */
@@ -577,15 +565,6 @@ namespace pal
577565
f->layer->pal->map_unit,
578566
dpi, scale, delta_width );
579567

580-
581-
#if 0
582-
double distlabel = unit_convert( this->distlabel,
583-
pal::PIXEL,
584-
layer->pal->map_unit,
585-
dpi, scale, delta_width );
586-
#endif
587-
588-
589568
double *d; // segments lengths distance bw pt[i] && pt[i+1]
590569
double *ad; // absolute distance bw pt[0] and pt[i] along the line
591570
double ll; // line length

‎src/core/pal/feature.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -197,25 +197,6 @@ namespace pal
197197
*/
198198
int setPositionForPolygon( double scale, LabelPosition ***lPos, PointSet *mapShape, double delta_width );
199199

200-
#if 0
201-
/**
202-
* \brief Feature against problem bbox
203-
* \param bbox[0] problem x min
204-
* \param bbox[1] problem x max
205-
* \param bbox[2] problem y min
206-
* \param bbox[3] problem y max
207-
* return A set of feature which are in the bbox or null if the feature is in the bbox
208-
*/
209-
LinkedList<Feature*> *splitFeature( double bbox[4] );
210-
211-
212-
/**
213-
* \brief return the feature id
214-
* \return the feature id
215-
*/
216-
int getId();
217-
#endif
218-
219200
/**
220201
* \brief return the feature
221202
* \return the feature
@@ -234,15 +215,6 @@ namespace pal
234215
*/
235216
Layer * getLayer();
236217

237-
#if 0
238-
/**
239-
* \brief save the feature into file
240-
* Called by Pal::save()
241-
* \param file the file to write
242-
*/
243-
void save( std::ofstream *file );
244-
#endif
245-
246218
/**
247219
* \brief generic method to generate candidates
248220
* This method will call either setPositionFromPoint(), setPositionFromLine or setPositionFromPolygon

‎src/core/pal/layer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include <pal/pal.h>
3636
#include <pal/palgeometry.h>
3737

38-
3938
namespace pal
4039
{
4140

‎src/core/pal/pointset.cpp

Lines changed: 0 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -778,131 +778,6 @@ namespace pal
778778
return finalBb;
779779
}
780780

781-
#if 0
782-
double PointSet::getDistInside( double px, double py )
783-
{
784-
785-
double dist[8];
786-
double rpx[8];
787-
double rpy[8];
788-
bool ok[8];
789-
790-
if ( !isPointInPolygon( nbPoints, x, y, px, py ) )
791-
{
792-
double d = getDist( px, py );
793-
//std::cout << "Outside : " << d << std::endl;
794-
if ( d < 0 )
795-
{
796-
d = -( d * d * d * d );
797-
}
798-
else
799-
{
800-
d = d * d * d * d;
801-
}
802-
return d;
803-
}
804-
805-
int i;
806-
807-
double width = ( xmax - xmin ) * 2;
808-
double height = ( ymax - ymin ) * 2;
809-
810-
/*
811-
1 0 7
812-
\ | /
813-
2 --x -- 6
814-
/ | \
815-
3 4 5
816-
*/
817-
818-
// Compute references points
819-
for ( i = 0; i < 8; i++ )
820-
{
821-
dist[i] = DBL_MAX;
822-
ok[i] = false;
823-
rpx[i] = px;
824-
rpy[i] = py;
825-
}
826-
827-
rpx[0] += 0;
828-
rpy[0] += height;
829-
830-
rpx[1] -= width;
831-
rpy[1] += height;
832-
833-
rpx[2] -= width;
834-
rpy[2] += 0;
835-
836-
rpx[3] -= width;
837-
rpy[3] -= height;
838-
839-
rpx[4] += 0;
840-
rpy[4] -= height;
841-
842-
rpx[5] += width;
843-
rpy[5] -= height;
844-
845-
rpx[6] += width;
846-
rpy[6] += 0;
847-
848-
rpx[7] += width;
849-
rpy[7] += height;
850-
851-
int j, k;
852-
for ( i = 0; i < nbPoints; i++ )
853-
{
854-
j = ( i + 1 ) % nbPoints;
855-
856-
for ( k = 0; k < 8; k++ )
857-
{
858-
double ix, iy;
859-
if ( computeSegIntersection( px, py, rpx[k], rpy[k], x[i], y[i], x[j], y[j], &ix, &iy ) )
860-
{
861-
double d = dist_euc2d_sq( px, py, ix, iy );
862-
if ( dist[k] > d )
863-
{
864-
dist[k] = d;
865-
ok[k] = true;
866-
//std::cout << "new dist for " << k << ": " << dist[k] << std::endl;
867-
}
868-
}
869-
}
870-
}
871-
872-
double a, b, c, d;
873-
874-
875-
for ( i = 0; i < 8; i++ )
876-
{
877-
if ( !ok[i] )
878-
{
879-
std::cout << "ERROR!!!!!!!!!!!!!!!!!" << std::endl;
880-
dist[i] = 0;
881-
}
882-
//std::cout << "dist[" << i << "]: " << dist[i] << std::endl;
883-
}
884-
885-
a = min( dist[0], dist[4] );
886-
b = min( dist[1], dist[5] );
887-
c = min( dist[2], dist[6] );
888-
d = min( dist[3], dist[7] );
889-
/*
890-
std::cout << "a: " << a << std::endl;
891-
std::cout << "b: " << b << std::endl;
892-
std::cout << "c: " << c << std::endl;
893-
std::cout << "d: " << d << std::endl;
894-
*/
895-
//a = (a+b+c+d)/4.0;
896-
897-
//a = min(a,b);
898-
//c = min(c,d);
899-
//return min(a,c);
900-
901-
902-
return ( a*b*c*d );
903-
}
904-
#endif
905-
906781
double PointSet::getDist( double px, double py, double *rx, double *ry )
907782
{
908783
if ( nbPoints == 1 || type == GEOS_POINT )

0 commit comments

Comments
 (0)
Please sign in to comment.