30 #ifndef LABELPOSITION_H 31 #define LABELPOSITION_H 89 double alpha,
double cost,
102 bool isIn(
double *bbox );
109 bool isIntersect(
double *bbox );
116 bool isInside(
double *bbox );
127 void getBoundingBox(
double amin[2],
double amax[2] )
const;
130 double getDistanceToPoint(
double xp,
double yp )
const;
133 bool crossesLine(
PointSet* line )
const;
136 bool crossesBoundary(
PointSet* polygon )
const;
141 int polygonIntersectionCost(
PointSet* polygon )
const;
145 bool intersectsWithPolygon(
PointSet* polygon )
const;
148 void offsetPosition(
double xOffset,
double yOffset );
171 if ( nextPart ) nextPart->setProblemIds( probFid, lpId );
177 double cost()
const {
return mCost; }
183 void setCost(
double newCost ) { mCost = newCost; }
190 void setConflictsWithObstacle(
bool conflicts );
204 double getX(
int i = 0 )
const;
209 double getY(
int i = 0 )
const;
218 double getAlpha()
const;
241 static bool pruneCallback(
LabelPosition *candidatePosition,
void *ctx );
256 static bool countOverlapCallback(
LabelPosition *lp,
void *ctx );
258 static bool countFullOverlapCallback(
LabelPosition *lp,
void *ctx );
260 static bool removeOverlapCallback(
LabelPosition *lp,
void *ctx );
263 static bool polygonObstacleCallback(
pal::FeaturePart *obstacle,
void *ctx );
297 bool mHasObstacleConflict;
301 int partCount()
const;
306 double polygonIntersectionCostForParts(
PointSet* polygon )
const;
void setCost(double newCost)
Sets the candidate label position's geographical cost.
double cost() const
Returns the candidate label position's geographical cost.
Main Pal labelling class.
bool conflictsWithObstacle() const
Returns whether the position is marked as conflicting with an obstacle feature.
int getProblemFeatureId() const
Quadrant getQuadrant() const
LabelPosition * getNextPart() const
Main class to handle feature.
bool getUpsideDown() const
void setNextPart(LabelPosition *next)
LabelPosition is a candidate feature label position.
int getNumOverlaps() const
Quadrant
Position of label candidate relative to feature.
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