Skip to content

Commit

Permalink
More PAL variable renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 28, 2019
1 parent 077c507 commit 932fd20
Show file tree
Hide file tree
Showing 11 changed files with 237 additions and 240 deletions.
8 changes: 4 additions & 4 deletions src/app/qgslabelengineconfigdialog.cpp
Expand Up @@ -101,12 +101,12 @@ void QgsLabelEngineConfigDialog::onOK()
void QgsLabelEngineConfigDialog::setDefaults()
{
pal::Pal p;
spinCandPoint->setValue( p.getPointP() );
spinCandLine->setValue( p.getLineP() );
spinCandPolygon->setValue( p.getPolyP() );
spinCandPoint->setValue( p.maximumNumberOfPointCandidates() );
spinCandLine->setValue( p.maximumNumberOfLineCandidates() );
spinCandPolygon->setValue( p.maximumNumberOfPolygonCandidates() );
chkShowCandidates->setChecked( false );
chkShowAllLabels->setChecked( false );
chkShowPartialsLabels->setChecked( p.getShowPartial() );
chkShowPartialsLabels->setChecked( p.showPartialLabels() );
mTextRenderFormatComboBox->setCurrentIndex( mTextRenderFormatComboBox->findData( QgsRenderContext::TextFormatAlwaysOutlines ) );
mPlacementVersionComboBox->setCurrentIndex( mPlacementVersionComboBox->findData( QgsLabelingEngineSettings::PlacementEngineVersion2 ) );
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/pal/feature.h
Expand Up @@ -55,10 +55,10 @@ namespace pal
class CORE_EXPORT LabelInfo
{
public:
typedef struct
struct CharacterInfo
{
double width;
} CharacterInfo;
};

LabelInfo( int num, double height, double maxinangle = 20.0, double maxoutangle = -20.0 )
{
Expand Down
8 changes: 4 additions & 4 deletions src/core/pal/labelposition.h
Expand Up @@ -259,24 +259,24 @@ namespace pal
void removeFromIndex( RTree<LabelPosition *, double, 2, double> *index );
void insertIntoIndex( RTree<LabelPosition *, double, 2, double> *index );

typedef struct
struct PruneCtx
{
Pal *pal = nullptr;
FeaturePart *obstacle = nullptr;
} PruneCtx;
};

//! Check whether the candidate in ctx overlap with obstacle feat
static bool pruneCallback( LabelPosition *candidatePosition, void *ctx );

// for counting number of overlaps
typedef struct
struct CountContext
{
LabelPosition *lp = nullptr;
int *nbOv = nullptr;
double *cost = nullptr;
double *inactiveCost = nullptr;
//int *feat;
} CountContext;
};

/*
* count overlap, ctx = p_lp
Expand Down
30 changes: 15 additions & 15 deletions src/core/pal/layer.h
Expand Up @@ -96,15 +96,15 @@ namespace pal
// to avoid the engine processing endlessly...
const int size = mHashtable.size();
if ( size > 1000 )
return std::min( pal->point_p, 4 );
return std::min( pal->mMaxPointCandidates, 4 );
else if ( size > 500 )
return std::min( pal->point_p, 6 );
return std::min( pal->mMaxPointCandidates, 6 );
else if ( size > 200 )
return std::min( pal->point_p, 8 );
return std::min( pal->mMaxPointCandidates, 8 );
else if ( size > 100 )
return std::min( pal->point_p, 12 );
return std::min( pal->mMaxPointCandidates, 12 );
else
return pal->point_p;
return pal->mMaxPointCandidates;
}

/**
Expand All @@ -117,15 +117,15 @@ namespace pal
// to avoid the engine processing endlessly...
const int size = mHashtable.size();
if ( size > 1000 )
return std::min( pal->line_p, 5 );
return std::min( pal->mMaxLineCandidates, 5 );
else if ( size > 500 )
return std::min( pal->line_p, 10 );
return std::min( pal->mMaxLineCandidates, 10 );
else if ( size > 200 )
return std::min( pal->line_p, 20 );
return std::min( pal->mMaxLineCandidates, 20 );
else if ( size > 100 )
return std::min( pal->line_p, 40 );
return std::min( pal->mMaxLineCandidates, 40 );
else
return pal->line_p;
return pal->mMaxLineCandidates;
}

/**
Expand All @@ -138,15 +138,15 @@ namespace pal
// to avoid the engine processing endlessly...
const int size = mHashtable.size();
if ( size > 1000 )
return std::min( pal->poly_p, 5 );
return std::min( pal->mMaxPolyCandidates, 5 );
else if ( size > 500 )
return std::min( pal->poly_p, 15 );
return std::min( pal->mMaxPolyCandidates, 15 );
else if ( size > 200 )
return std::min( pal->poly_p, 20 );
return std::min( pal->mMaxPolyCandidates, 20 );
else if ( size > 100 )
return std::min( pal->poly_p, 25 );
return std::min( pal->mMaxPolyCandidates, 25 );
else
return pal->poly_p;
return pal->mMaxPolyCandidates;
}

//! Returns pointer to the associated provider
Expand Down

0 comments on commit 932fd20

Please sign in to comment.