30 #ifndef _LABELPOSITION_H
31 #define _LABELPOSITION_H
87 double alpha,
double cost,
88 FeaturePart *feature,
bool isReversed =
false, Quadrant quadrant = QuadrantOver );
100 bool isIn(
double *bbox );
107 bool isIntersect(
double *bbox );
114 bool isInside(
double *bbox );
125 void getBoundingBox(
double amin[2],
double amax[2] )
const;
128 double getDistanceToPoint(
double xp,
double yp )
const;
131 bool crossesLine(
PointSet* line )
const;
134 bool crossesBoundary(
PointSet* polygon )
const;
139 int polygonIntersectionCost(
PointSet* polygon )
const;
142 void offsetPosition(
double xOffset,
double yOffset );
163 probFeat = probFid;
id = lpId;
164 if ( nextPart ) nextPart->setProblemIds( probFid, lpId );
170 double cost()
const {
return mCost; }
176 void setCost(
double newCost ) { mCost = newCost; }
183 void setConflictsWithObstacle(
bool conflicts );
197 double getX(
int i = 0 )
const;
202 double getY(
int i = 0 )
const;
211 double getAlpha()
const;
240 static bool costShrink(
void *l,
void *r );
241 static bool costGrow(
void *l,
void *r );
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.
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.
Quadrant
Position of label candidate relative to feature.
double getNumOverlaps() 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