Skip to content

Commit 0b1d658

Browse files
committed
[pal] Reformat headers to match QGIS standards
1 parent ab86897 commit 0b1d658

File tree

9 files changed

+471
-476
lines changed

9 files changed

+471
-476
lines changed

src/core/pal/costcalculator.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ namespace pal
2424
class CostCalculator
2525
{
2626
public:
27-
/** increase candidate's cost according to its collision with passed feature */
27+
/** Increase candidate's cost according to its collision with passed feature */
2828
static void addObstacleCostPenalty( LabelPosition* lp, PointSet* feat );
2929

3030
static void setPolygonCandidatesCost( int nblp, LabelPosition **lPos, int max_p, RTree<PointSet*, double, 2, double> *obstacles, double bbx[4], double bby[4] );
3131

3232
/** Set cost to the smallest distance between lPos's centroid and a polygon stored in geoetry field */
3333
static void setCandidateCostFromPolygon( LabelPosition* lp, RTree <PointSet*, double, 2, double> *obstacles, double bbx[4], double bby[4] );
3434

35-
/** sort candidates by costs, skip the worse ones, evaluate polygon candidates */
35+
/** Sort candidates by costs, skip the worse ones, evaluate polygon candidates */
3636
static int finalizeCandidatesCosts( Feats* feat, int max_p, RTree <PointSet*, double, 2, double> *obstacles, double bbx[4], double bby[4] );
3737
};
3838

39-
/**
39+
/**
4040
* \brief Data structure to compute polygon's candidates costs
4141
*
4242
* eight segment from center of candidat to (rpx,rpy) points (0°, 45°, 90°, ..., 315°)
@@ -45,10 +45,6 @@ namespace pal
4545
*/
4646
class PolygonCostCalculator
4747
{
48-
LabelPosition *lp;
49-
double px, py;
50-
double dist;
51-
bool ok;
5248

5349
public:
5450
PolygonCostCalculator( LabelPosition *lp );
@@ -58,6 +54,13 @@ namespace pal
5854
double getCost();
5955

6056
LabelPosition *getLabel();
57+
58+
private:
59+
60+
LabelPosition *lp;
61+
double px, py;
62+
double dist;
63+
bool ok;
6164
};
6265
}
6366

src/core/pal/feature.h

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
namespace pal
5050
{
51-
/** optional additional info about label (for curved labels) */
51+
/** Optional additional info about label (for curved labels) */
5252
class CORE_EXPORT LabelInfo
5353
{
5454
public:
@@ -132,45 +132,28 @@ namespace pal
132132
//FeaturePart** parts;
133133
};
134134

135-
/**
135+
/**
136136
* \brief Main class to handle feature
137137
*/
138138
class CORE_EXPORT FeaturePart : public PointSet
139139
{
140140

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-
158141
public:
159142

160-
/**
143+
/**
161144
* \brief create a new generic feature
162145
*
163146
* \param feat a pointer for a Feat which contains the spatial entites
164147
* \param geom a pointer to a GEOS geometry
165148
*/
166149
FeaturePart( Feature *feat, const GEOSGeometry* geom );
167150

168-
/**
151+
/**
169152
* \brief Delete the feature
170153
*/
171154
virtual ~FeaturePart();
172155

173-
/**
156+
/**
174157
* \brief generate candidates for point feature
175158
* Generate candidates for point features
176159
* \param x x coordinates of the point
@@ -183,12 +166,12 @@ namespace pal
183166
*/
184167
int setPositionForPoint( double x, double y, double scale, LabelPosition ***lPos, double delta_width, double angle );
185168

186-
/**
169+
/**
187170
* generate one candidate over specified point
188171
*/
189172
int setPositionOverPoint( double x, double y, double scale, LabelPosition ***lPos, double delta_width, double angle );
190173

191-
/**
174+
/**
192175
* \brief generate candidates for line feature
193176
* Generate candidates for line features
194177
* \param scale map scale is 1:scale
@@ -202,12 +185,12 @@ namespace pal
202185
LabelPosition* curvedPlacementAtOffset( PointSet* path_positions, double* path_distances,
203186
int orientation, int index, double distance );
204187

205-
/**
188+
/**
206189
* Generate curved candidates for line features
207190
*/
208191
int setPositionForLineCurved( LabelPosition ***lPos, PointSet* mapShape );
209192

210-
/**
193+
/**
211194
* \brief generate candidates for point feature
212195
* Generate candidates for point features
213196
* \param scale map scale is 1:scale
@@ -219,7 +202,7 @@ namespace pal
219202
int setPositionForPolygon( double scale, LabelPosition ***lPos, PointSet *mapShape, double delta_width );
220203

221204
#if 0
222-
/**
205+
/**
223206
* \brief Feature against problem bbox
224207
* \param bbox[0] problem x min
225208
* \param bbox[1] problem x max
@@ -230,41 +213,41 @@ namespace pal
230213
LinkedList<Feature*> *splitFeature( double bbox[4] );
231214

232215

233-
/**
216+
/**
234217
* \brief return the feature id
235218
* \return the feature id
236219
*/
237220
int getId();
238221
#endif
239222

240-
/**
223+
/**
241224
* \brief return the feature
242225
* \return the feature
243226
*/
244227
Feature* getFeature() { return f; }
245228

246-
/**
229+
/**
247230
* \brief return the geometry
248231
* \return the geometry
249232
*/
250233
const GEOSGeometry* getGeometry() const { return the_geom; }
251234

252-
/**
235+
/**
253236
* \brief return the layer that feature belongs to
254237
* \return the layer of the feature
255238
*/
256239
Layer * getLayer();
257240

258241
#if 0
259-
/**
242+
/**
260243
* \brief save the feature into file
261244
* Called by Pal::save()
262245
* \param file the file to write
263246
*/
264247
void save( std::ofstream *file );
265248
#endif
266249

267-
/**
250+
/**
268251
* \brief generic method to generate candidates
269252
* This method will call either setPositionFromPoint(), setPositionFromLine or setPositionFromPolygon
270253
* \param scale the map scale is 1:scale
@@ -281,14 +264,14 @@ namespace pal
281264
#endif
282265
);
283266

284-
/**
267+
/**
285268
* \brief get the unique id of the feature
286269
* \return the feature unique identifier
287270
*/
288271
const char *getUID();
289272

290273

291-
/**
274+
/**
292275
* \brief Print feature information
293276
* Print feature unique id, geometry type, points, and holes on screen
294277
*/
@@ -312,15 +295,32 @@ namespace pal
312295
int getNumSelfObstacles() const { return nbHoles; }
313296
PointSet* getSelfObstacle( int i ) { return holes[i]; }
314297

315-
/** check whether this part is connected with some other part */
298+
/** Check whether this part is connected with some other part */
316299
bool isConnected( FeaturePart* p2 );
317300

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).
319302
* Return true on success, false if the feature wasn't modified */
320303
bool mergeWithFeaturePart( FeaturePart* other );
321304

322305
void addSizePenalty( int nbp, LabelPosition** lPos, double bbx[4], double bby[4] );
323306

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+
324324
private:
325325

326326
LabelPosition::Quadrant quadrantFromOffset() const;

0 commit comments

Comments
 (0)