Skip to content

Commit

Permalink
Drop an unused messy pal function
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 18, 2018
1 parent d8402ac commit 623fd6f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 67 deletions.
55 changes: 0 additions & 55 deletions src/core/pal/pal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 0 additions & 12 deletions src/core/pal/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 623fd6f

Please sign in to comment.