30 #ifndef LABELPOSITION_H 31 #define LABELPOSITION_H 90 double alpha,
double cost,
103 bool isIn(
double *bbox );
110 bool isIntersect(
double *bbox );
117 bool isInside(
double *bbox );
128 void getBoundingBox(
double amin[2],
double amax[2] )
const;
131 double getDistanceToPoint(
double xp,
double yp )
const;
134 bool crossesLine(
PointSet* line )
const;
137 bool crossesBoundary(
PointSet* polygon )
const;
142 int polygonIntersectionCost(
PointSet* polygon )
const;
146 bool intersectsWithPolygon(
PointSet* polygon )
const;
149 void offsetPosition(
double xOffset,
double yOffset );
172 if ( nextPart ) nextPart->setProblemIds( probFid, lpId );
178 double cost()
const {
return mCost; }
184 void setCost(
double newCost ) { mCost = newCost; }
191 void setConflictsWithObstacle(
bool conflicts );
205 double getX(
int i = 0 )
const;
210 double getY(
int i = 0 )
const;
219 double getAlpha()
const;
237 void removeFromIndex( RTree<LabelPosition*, double, 2, double> *
index );
238 void insertIntoIndex( RTree<LabelPosition*, double, 2, double> *index );
247 static bool pruneCallback(
LabelPosition *candidatePosition,
void *ctx );
262 static bool countOverlapCallback(
LabelPosition *lp,
void *ctx );
264 static bool countFullOverlapCallback(
LabelPosition *lp,
void *ctx );
266 static bool removeOverlapCallback(
LabelPosition *lp,
void *ctx );
269 static bool polygonObstacleCallback(
pal::FeaturePart *obstacle,
void *ctx );
303 bool mHasObstacleConflict;
304 int mUpsideDownCharCount;
308 int partCount()
const;
313 double polygonIntersectionCostForParts(
PointSet* polygon )
const;
void setCost(double newCost)
Sets the candidate label position's geographical cost.
int incrementUpsideDownCharCount()
Increases the count of upside down characters for this label position.
Main Pal labelling class.
int getProblemFeatureId() const
double cost() const
Returns the candidate label position's geographical cost.
LabelPosition * getNextPart() const
Quadrant getQuadrant() const
Main class to handle feature.
int upsideDownCharCount() const
Returns the number of upside down characters for this label position.
void setNextPart(LabelPosition *next)
bool conflictsWithObstacle() const
Returns whether the position is marked as conflicting with an obstacle feature.
int getNumOverlaps() const
LabelPosition is a candidate feature label position.
Quadrant
Position of label candidate relative to feature.
bool getUpsideDown() const
void setProblemIds(int probFid, int lpId)
Set problem feature ID and assigned label candidate ID.
Data structure to compute polygon's candidates costs.
LabelPosition::Quadrant quadrant