Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:qgis/Quantum-GIS

  • Loading branch information
g-sherman committed Jun 9, 2012
2 parents 23c0f25 + 12ef68e commit ed801a47fa2969fac486835b46ab5c591acd7cf0
Showing with 6 additions and 8 deletions.
  1. +1 −2 src/core/pal/costcalculator.cpp
  2. +1 −2 src/core/pal/feature.cpp
  3. +4 −4 src/core/pal/pal.cpp
@@ -159,7 +159,6 @@ namespace pal
delete pCost;
}


int CostCalculator::finalizeCandidatesCosts( Feats* feat, int max_p, RTree <PointSet*, double, 2, double> *obstacles, double bbx[4], double bby[4] )
{
// If candidates list is smaller than expected
@@ -191,7 +190,7 @@ namespace pal
max_p = stop;

#ifdef _DEBUG_FULL_
std::cout << "Nblabel kept for feat " << feat->feature->uid << "/" << feat->feature->layer->name << ": " << max_p << "/" << feat->nblp << std::endl;
std::cout << "Nblabel kept for feat " << feat->feature->getUID() << "/" << feat->feature->getLayer()->getName() << ": " << max_p << "/" << feat->nblp << std::endl;
#endif

// Sets costs for candidates of polygon
@@ -887,7 +887,6 @@ namespace pal
flags = FLAG_ON_LINE; // default flag

// generate curved labels
std::cerr << "------" << std::endl;
for ( int i = 0; i*delta < total_distance; i++ )
{
LabelPosition* slp = curvedPlacementAtOffset( mapShape, path_distances, 0, 1, i * delta );
@@ -914,7 +913,7 @@ namespace pal
tmp = tmp->getNextPart();
}

double angle_diff_avg = angle_diff / ( f->labelInfo->char_num - 1 ); // <0, pi> but pi/8 is much already
double angle_diff_avg = f->labelInfo->char_num > 1 ? (angle_diff / ( f->labelInfo->char_num - 1 )) : 0; // <0, pi> but pi/8 is much already
double cost = angle_diff_avg / 100; // <0, 0.031 > but usually <0, 0.003 >
if ( cost < 0.0001 ) cost = 0.0001;

@@ -231,7 +231,7 @@ namespace pal


#ifdef _DEBUG_FULL_
std::cout << "extract feat : " << ft_ptr->layer->name << "/" << ft_ptr->uid << std::endl;
std::cout << "extract feat : " << ft_ptr->getLayer()->getName() << "/" << ft_ptr->getUID() << std::endl;
#endif

// all feature which are obstacle will be inserted into obstacles
@@ -513,7 +513,7 @@ namespace pal
{
feat = fFeats->pop_front();
#ifdef _DEBUG_FULL_
std::cout << "Feature:" << feat->feature->layer->name << "/" << feat->feature->uid << std::endl;
std::cout << "Feature:" << feat->feature->getLayer()->getName() << "/" << feat->feature->getUID() << " candidates " << feat->nblp << std::endl;
#endif
prob->featStartId[i] = idlp;
prob->inactiveCost[i] = pow( 2, 10 - 10 * feat->priority );
@@ -535,7 +535,7 @@ namespace pal
max_p = CostCalculator::finalizeCandidatesCosts( feat, max_p, obstacles, bbx, bby );

#ifdef _DEBUG_FULL_
std::cout << "All Cost are setted" << std::endl;
std::cout << "All costs are set" << std::endl;
#endif
// only keep the 'max_p' best candidates
for ( j = max_p; j < feat->nblp; j++ )
@@ -597,7 +597,7 @@ namespace pal

nbOverlaps += lp->getNumOverlaps();
#ifdef _DEBUG_FULL_
std::cout << "Nb overlap for " << idlp << "/" << prob->nblp - 1 << " : " << lp->nbOverlap << std::endl;
std::cout << "Nb overlap for " << idlp << "/" << prob->nblp - 1 << " : " << lp->getNumOverlaps() << std::endl;
#endif
}
j++;

0 comments on commit ed801a4

Please sign in to comment.
You can’t perform that action at this time.