Skip to content
Permalink
Browse files

Drop an unused messy pal function

  • Loading branch information
nyalldawson committed Jan 17, 2018
1 parent d8402ac commit 623fd6fa460b87bd73ff32e39e3e502450fb1320
Showing with 0 additions and 67 deletions.
  1. +0 −55 src/core/pal/pal.cpp
  2. +0 −12 src/core/pal/pal.h
@@ -448,61 +448,6 @@ Problem *Pal::extract( double lambda_min, double phi_min, double lambda_max, dou
return prob;
}

/*
* BIG MACHINE
*/
QList<LabelPosition *> *Pal::labeller( double bbox[4], PalStat **stats, bool displayAll )
{
Problem *prob = nullptr;

SearchMethod old_searchMethod = searchMethod;

if ( displayAll )
{
setSearch( POPMUSIC_TABU );
}

// First, extract the problem
if ( !( prob = extract( bbox[0], bbox[1], bbox[2], bbox[3] ) ) )
{
// nothing to be done => return an empty result set
if ( stats )
( *stats ) = new PalStat();
return new QList<LabelPosition *>();
}

// reduce number of candidates
// (remove candidates which surely won't be used)
prob->reduce();
prob->displayAll = displayAll;

// search a solution
if ( searchMethod == FALP )
prob->init_sol_falp();
else if ( searchMethod == CHAIN )
prob->chain_search();
else
prob->popmusic();

// Post-Optimization
//prob->post_optimization();


QList<LabelPosition *> *solution = prob->getSolution( displayAll );

if ( stats )
*stats = prob->getStats();

delete prob;

if ( displayAll )
{
setSearch( old_searchMethod );
}

return solution;
}

void Pal::registerCancelationCallback( Pal::FnIsCanceled fnCanceled, void *context )
{
fnIsCanceled = fnCanceled;
@@ -130,18 +130,6 @@ namespace pal
*/
void removeLayer( Layer *layer );

/**
* \brief the labeling machine
* Will extract all active layers
*
* \param bbox map extent
* \param stats A PalStat object (can be NULL)
* \param displayAll if true, all feature will be labelled even though overlaps occur
*
* \returns A list of label to display on map
*/
QList<LabelPosition *> *labeller( double bbox[4], PalStat **stats, bool displayAll );

typedef bool ( *FnIsCanceled )( void *ctx );

//! Register a function that returns whether this job has been canceled - PAL calls it during the computation

0 comments on commit 623fd6f

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