48
48
49
49
namespace pal
50
50
{
51
- /* * optional additional info about label (for curved labels) */
51
+ /* * Optional additional info about label (for curved labels) */
52
52
class CORE_EXPORT LabelInfo
53
53
{
54
54
public:
@@ -132,45 +132,28 @@ namespace pal
132
132
// FeaturePart** parts;
133
133
};
134
134
135
- /* *
135
+ /* *
136
136
* \brief Main class to handle feature
137
137
*/
138
138
class CORE_EXPORT FeaturePart : public PointSet
139
139
{
140
140
141
- protected:
142
- Feature* f;
143
-
144
- int nbHoles;
145
- PointSet **holes;
146
-
147
- GEOSGeometry *the_geom;
148
- bool ownsGeom;
149
-
150
- /* * \brief read coordinates from a GEOS geom */
151
- void extractCoords ( const GEOSGeometry* geom );
152
-
153
- /* * find duplicate (or nearly duplicate points) and remove them.
154
- * Probably to avoid numerical errors in geometry algorithms.
155
- */
156
- void removeDuplicatePoints ();
157
-
158
141
public:
159
142
160
- /* *
143
+ /* *
161
144
* \brief create a new generic feature
162
145
*
163
146
* \param feat a pointer for a Feat which contains the spatial entites
164
147
* \param geom a pointer to a GEOS geometry
165
148
*/
166
149
FeaturePart ( Feature *feat, const GEOSGeometry* geom );
167
150
168
- /* *
151
+ /* *
169
152
* \brief Delete the feature
170
153
*/
171
154
virtual ~FeaturePart ();
172
155
173
- /* *
156
+ /* *
174
157
* \brief generate candidates for point feature
175
158
* Generate candidates for point features
176
159
* \param x x coordinates of the point
@@ -183,12 +166,12 @@ namespace pal
183
166
*/
184
167
int setPositionForPoint ( double x, double y, double scale, LabelPosition ***lPos, double delta_width, double angle );
185
168
186
- /* *
169
+ /* *
187
170
* generate one candidate over specified point
188
171
*/
189
172
int setPositionOverPoint ( double x, double y, double scale, LabelPosition ***lPos, double delta_width, double angle );
190
173
191
- /* *
174
+ /* *
192
175
* \brief generate candidates for line feature
193
176
* Generate candidates for line features
194
177
* \param scale map scale is 1:scale
@@ -202,12 +185,12 @@ namespace pal
202
185
LabelPosition* curvedPlacementAtOffset ( PointSet* path_positions, double * path_distances,
203
186
int orientation, int index, double distance );
204
187
205
- /* *
188
+ /* *
206
189
* Generate curved candidates for line features
207
190
*/
208
191
int setPositionForLineCurved ( LabelPosition ***lPos, PointSet* mapShape );
209
192
210
- /* *
193
+ /* *
211
194
* \brief generate candidates for point feature
212
195
* Generate candidates for point features
213
196
* \param scale map scale is 1:scale
@@ -219,7 +202,7 @@ namespace pal
219
202
int setPositionForPolygon ( double scale, LabelPosition ***lPos, PointSet *mapShape, double delta_width );
220
203
221
204
#if 0
222
- /**
205
+ /**
223
206
* \brief Feature against problem bbox
224
207
* \param bbox[0] problem x min
225
208
* \param bbox[1] problem x max
@@ -230,41 +213,41 @@ namespace pal
230
213
LinkedList<Feature*> *splitFeature( double bbox[4] );
231
214
232
215
233
- /**
216
+ /**
234
217
* \brief return the feature id
235
218
* \return the feature id
236
219
*/
237
220
int getId();
238
221
#endif
239
222
240
- /* *
223
+ /* *
241
224
* \brief return the feature
242
225
* \return the feature
243
226
*/
244
227
Feature* getFeature () { return f; }
245
228
246
- /* *
229
+ /* *
247
230
* \brief return the geometry
248
231
* \return the geometry
249
232
*/
250
233
const GEOSGeometry* getGeometry () const { return the_geom; }
251
234
252
- /* *
235
+ /* *
253
236
* \brief return the layer that feature belongs to
254
237
* \return the layer of the feature
255
238
*/
256
239
Layer * getLayer ();
257
240
258
241
#if 0
259
- /**
242
+ /**
260
243
* \brief save the feature into file
261
244
* Called by Pal::save()
262
245
* \param file the file to write
263
246
*/
264
247
void save( std::ofstream *file );
265
248
#endif
266
249
267
- /* *
250
+ /* *
268
251
* \brief generic method to generate candidates
269
252
* This method will call either setPositionFromPoint(), setPositionFromLine or setPositionFromPolygon
270
253
* \param scale the map scale is 1:scale
@@ -281,14 +264,14 @@ namespace pal
281
264
#endif
282
265
);
283
266
284
- /* *
267
+ /* *
285
268
* \brief get the unique id of the feature
286
269
* \return the feature unique identifier
287
270
*/
288
271
const char *getUID ();
289
272
290
273
291
- /* *
274
+ /* *
292
275
* \brief Print feature information
293
276
* Print feature unique id, geometry type, points, and holes on screen
294
277
*/
@@ -312,15 +295,32 @@ namespace pal
312
295
int getNumSelfObstacles () const { return nbHoles; }
313
296
PointSet* getSelfObstacle ( int i ) { return holes[i]; }
314
297
315
- /* * check whether this part is connected with some other part */
298
+ /* * Check whether this part is connected with some other part */
316
299
bool isConnected ( FeaturePart* p2 );
317
300
318
- /* * merge other (connected) part with this one and save the result in this part (other is unchanged).
301
+ /* * Merge other (connected) part with this one and save the result in this part (other is unchanged).
319
302
* Return true on success, false if the feature wasn't modified */
320
303
bool mergeWithFeaturePart ( FeaturePart* other );
321
304
322
305
void addSizePenalty ( int nbp, LabelPosition** lPos, double bbx[4 ], double bby[4 ] );
323
306
307
+ protected:
308
+ Feature* f;
309
+
310
+ int nbHoles;
311
+ PointSet **holes;
312
+
313
+ GEOSGeometry *the_geom;
314
+ bool ownsGeom;
315
+
316
+ /* * \brief read coordinates from a GEOS geom */
317
+ void extractCoords ( const GEOSGeometry* geom );
318
+
319
+ /* * Find duplicate (or nearly duplicate points) and remove them.
320
+ * Probably to avoid numerical errors in geometry algorithms.
321
+ */
322
+ void removeDuplicatePoints ();
323
+
324
324
private:
325
325
326
326
LabelPosition::Quadrant quadrantFromOffset () const ;
0 commit comments