Skip to content

Commit 277605b

Browse files
committedJun 29, 2015
[pal] Remove #ifdef svg debugging code
1 parent 44724f9 commit 277605b

File tree

8 files changed

+75
-267
lines changed

8 files changed

+75
-267
lines changed
 

‎src/core/pal/feature.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,20 +1322,12 @@ namespace pal
13221322

13231323
int FeaturePart::setPosition( double scale, LabelPosition ***lPos,
13241324
double bbox_min[2], double bbox_max[2],
1325-
PointSet *mapShape, RTree<LabelPosition*, double, 2, double> *candidates
1326-
#ifdef _EXPORT_MAP_
1327-
, std::ofstream &svgmap
1328-
#endif
1329-
)
1325+
PointSet *mapShape, RTree<LabelPosition*, double, 2, double> *candidates )
13301326
{
13311327
int nbp = 0;
13321328
int i;
13331329
double bbox[4];
13341330

1335-
#ifdef _EXPORT_MAP_
1336-
int dpi = layer->pal->getDpi();
1337-
#endif
1338-
13391331
bbox[0] = bbox_min[0];
13401332
bbox[1] = bbox_min[1];
13411333
bbox[2] = bbox_max[0];

‎src/core/pal/feature.h

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -127,28 +127,28 @@ namespace pal
127127
//FeaturePart** parts;
128128
};
129129

130-
/**
130+
/**
131131
* \brief Main class to handle feature
132132
*/
133133
class CORE_EXPORT FeaturePart : public PointSet
134134
{
135135

136136
public:
137137

138-
/**
138+
/**
139139
* \brief create a new generic feature
140140
*
141141
* \param feat a pointer for a Feat which contains the spatial entites
142142
* \param geom a pointer to a GEOS geometry
143143
*/
144144
FeaturePart( Feature *feat, const GEOSGeometry* geom );
145145

146-
/**
146+
/**
147147
* \brief Delete the feature
148148
*/
149149
virtual ~FeaturePart();
150150

151-
/**
151+
/**
152152
* \brief generate candidates for point feature
153153
* Generate candidates for point features
154154
* \param x x coordinates of the point
@@ -161,12 +161,12 @@ namespace pal
161161
*/
162162
int setPositionForPoint( double x, double y, double scale, LabelPosition ***lPos, double delta_width, double angle );
163163

164-
/**
164+
/**
165165
* generate one candidate over specified point
166166
*/
167167
int setPositionOverPoint( double x, double y, double scale, LabelPosition ***lPos, double delta_width, double angle );
168168

169-
/**
169+
/**
170170
* \brief generate candidates for line feature
171171
* Generate candidates for line features
172172
* \param scale map scale is 1:scale
@@ -180,12 +180,12 @@ namespace pal
180180
LabelPosition* curvedPlacementAtOffset( PointSet* path_positions, double* path_distances,
181181
int orientation, int index, double distance );
182182

183-
/**
183+
/**
184184
* Generate curved candidates for line features
185185
*/
186186
int setPositionForLineCurved( LabelPosition ***lPos, PointSet* mapShape );
187187

188-
/**
188+
/**
189189
* \brief generate candidates for point feature
190190
* Generate candidates for point features
191191
* \param scale map scale is 1:scale
@@ -196,25 +196,25 @@ namespace pal
196196
*/
197197
int setPositionForPolygon( double scale, LabelPosition ***lPos, PointSet *mapShape, double delta_width );
198198

199-
/**
199+
/**
200200
* \brief return the feature
201201
* \return the feature
202202
*/
203203
Feature* getFeature() { return f; }
204204

205-
/**
205+
/**
206206
* \brief return the geometry
207207
* \return the geometry
208208
*/
209209
const GEOSGeometry* getGeometry() const { return the_geom; }
210210

211-
/**
211+
/**
212212
* \brief return the layer that feature belongs to
213213
* \return the layer of the feature
214214
*/
215215
Layer * getLayer();
216216

217-
/**
217+
/**
218218
* \brief generic method to generate candidates
219219
* This method will call either setPositionFromPoint(), setPositionFromLine or setPositionFromPolygon
220220
* \param scale the map scale is 1:scale
@@ -225,20 +225,16 @@ namespace pal
225225
* \param candidates index for candidates
226226
* \return the number of candidates in *lPos
227227
*/
228-
int setPosition( double scale, LabelPosition ***lPos, double bbox_min[2], double bbox_max[2], PointSet *mapShape, RTree<LabelPosition*, double, 2, double>*candidates
229-
#ifdef _EXPORT_MAP_
230-
, std::ofstream &svgmap
231-
#endif
232-
);
228+
int setPosition( double scale, LabelPosition ***lPos, double bbox_min[2], double bbox_max[2], PointSet *mapShape, RTree<LabelPosition*, double, 2, double>*candidates );
233229

234-
/**
230+
/**
235231
* \brief get the unique id of the feature
236232
* \return the feature unique identifier
237233
*/
238234
const char *getUID();
239235

240236

241-
/**
237+
/**
242238
* \brief Print feature information
243239
* Print feature unique id, geometry type, points, and holes on screen
244240
*/

‎src/core/pal/geomfunction.cpp

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -573,52 +573,6 @@ namespace pal
573573
return c;
574574
}
575575

576-
#ifdef _EXPORT_MAP_
577-
void toSVGPath( int nbPoints, int geomType, double *x, double *y,
578-
int dpi, double scale, int xmin, int ymax,
579-
char *layername, char *objectID,
580-
std::ostream &out )
581-
{
582-
int i;
583-
584-
if ( nbPoints > 1 )
585-
{
586-
out << " <path style=\"fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1\" d=\"M " << convert2pt( x[0], scale, dpi ) - xmin << "," << ymax - convert2pt( y[0], scale, dpi ) << " ";
587-
for ( i = 1; i < nbPoints; i++ )
588-
{
589-
out << "L " << convert2pt( x[i], scale, dpi ) - xmin << ", " << ymax - convert2pt( y[i], scale, dpi ) << " ";
590-
}
591-
592-
if ( geomType == GEOS_POLYGON )
593-
{
594-
out << " z ";
595-
}
596-
597-
out << "\" ";
598-
out << "id=\"" << layername << "-" << objectID << "\" ";
599-
out << "inkscape:label=\"#path-" << layername << "-" << objectID << "\"/>\n";
600-
}
601-
else
602-
{
603-
int cx = convert2pt( x[0], scale, dpi ) - xmin;
604-
int cy = ymax - convert2pt( y[0], scale, dpi );
605-
out << " <path ";
606-
out << " sodipodi:type=\"arc\" ";
607-
out << " style=\"opacity:1;fill:#bcbcbc;fill-opacity:l;stroke:#000000;stroke-opacity:1;stroke-width:0.5;stroke-linejoin:miter;stroke-dasharray:none;display:inline\"";
608-
out << " id=\"" << layername << "-" << objectID << "\" ";
609-
out << " sodipodi:cx=\"" << cx << "\" ";
610-
out << " sodipodi:cy=\"" << cy << "\" ";
611-
out << " sodipodi:rx=\"1\" ";
612-
out << " sodipodi:ry=\"1\" ";
613-
out << " d=\"M " << cx + 1 << " " << cy << " A 1 1 0 1 1 "
614-
<< cx - 1 << "," << cy << " A 1 1 0 1 1 "
615-
<< cx + 1 << " " << cy << " z\" ";
616-
out << " inkscape:label=\"#path-" << layername << "-" << objectID << "\" />\n";
617-
}
618-
}
619-
#endif
620-
621-
622576
void findLineCircleIntersection( double cx, double cy, double radius,
623577
double x1, double y1, double x2, double y2,
624578
double& xRes, double& yRes )

‎src/core/pal/geomfunction.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -122,31 +122,6 @@ namespace pal
122122
double x3, double y3, double x4, double y4, // 2nd line segment
123123
double *x, double *y );
124124

125-
#ifdef _EXPORT_MAP_
126-
/**
127-
* \brief generate SVG code for a geometry
128-
*
129-
* @param nbPoints # points in x and y vector
130-
* @param typeID from geos
131-
* @param x x coordinates
132-
* @param y y coordinates
133-
* @param dpi map resolution
134-
* @param scale map scale is 1:scale
135-
* @param xmin minimum x value in mapExtent
136-
* @param ymax maximum y value in mapExtent
137-
* @param layername SVG layer name
138-
* @param objectID SVG ID
139-
* @param out stream to write
140-
*/
141-
void toSVGPath( int nbPoints, int geomType,
142-
double *x, double *y,
143-
int dpi, double scale,
144-
int xmin, int ymax,
145-
char *layername,
146-
char *objectID,
147-
std::ostream &out );
148-
#endif
149-
150125
int reorderPolygon( int nbPoints, double *x, double *y );
151126

152127
} // end namespace

‎src/core/pal/pal.cpp

Lines changed: 4 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
*/
2929

3030
//#define _VERBOSE_
31-
//#define _EXPORT_MAP_
3231
#include <QTime>
3332

3433
#define _CRT_SECURE_NO_DEPRECATE
@@ -211,9 +210,6 @@ namespace pal
211210
double priority;
212211
double bbox_min[2];
213212
double bbox_max[2];
214-
#ifdef _EXPORT_MAP_
215-
std::ofstream *svgmap;
216-
#endif
217213
} FeatCallBackCtx;
218214

219215

@@ -229,12 +225,6 @@ namespace pal
229225

230226
FeatCallBackCtx *context = ( FeatCallBackCtx* ) ctx;
231227

232-
#ifdef _EXPORT_MAP_
233-
bool svged = false; // is the feature has been written into the svg map?
234-
int dpi = context->layer->pal->getDpi();
235-
#endif
236-
237-
238228
#ifdef _DEBUG_FULL_
239229
std::cout << "extract feat : " << ft_ptr->getLayer()->getName() << "/" << ft_ptr->getUID() << std::endl;
240230
#endif
@@ -276,11 +266,7 @@ namespace pal
276266

277267
// generate candidates for the feature part
278268
LabelPosition** lPos = NULL;
279-
int nblp = ft_ptr->setPosition( context->scale, &lPos, context->bbox_min, context->bbox_max, ft_ptr, context->candidates
280-
#ifdef _EXPORT_MAP_
281-
, *context->svgmap
282-
#endif
283-
);
269+
int nblp = ft_ptr->setPosition( context->scale, &lPos, context->bbox_min, context->bbox_max, ft_ptr, context->candidates );
284270

285271
if ( nblp > 0 )
286272
{
@@ -335,23 +321,8 @@ namespace pal
335321
return true;
336322
}
337323

338-
339-
/**
340-
* \brief Problem Factory
341-
* Select features from user's choice layers within
342-
* a specific bounding box
343-
* @param nbLayers # wanted layers
344-
* @param layersFactor layers importance
345-
* @param layersName layers in problem
346-
* @param lambda_min west bbox
347-
* @param phi_min south bbox
348-
* @param lambda_max east bbox
349-
* @param phi_max north bbox
350-
* @param scale the scale
351-
*/
352-
Problem* Pal::extract( int nbLayers, char **layersName, double *layersFactor, double lambda_min, double phi_min, double lambda_max, double phi_max, double scale, std::ofstream *svgmap )
324+
Problem* Pal::extract( int nbLayers, char **layersName, double *layersFactor, double lambda_min, double phi_min, double lambda_max, double phi_max, double scale )
353325
{
354-
Q_UNUSED( svgmap );
355326
// to store obstacles
356327
RTree<PointSet*, double, 2, double> *obstacles = new RTree<PointSet*, double, 2, double>();
357328

@@ -392,10 +363,6 @@ namespace pal
392363
context->bbox_max[0] = amax[0];
393364
context->bbox_max[1] = amax[1];
394365

395-
#ifdef _EXPORT_MAP_
396-
context->svgmap = svgmap;
397-
#endif
398-
399366
#ifdef _VERBOSE_
400367
std::cout << nbLayers << "/" << layers->size() << " layers to extract " << std::endl;
401368
std::cout << "scale is 1:" << scale << std::endl << std::endl;
@@ -436,20 +403,10 @@ namespace pal
436403
context->priority = layersFactor[i];
437404
// lookup for feature (and generates candidates list)
438405

439-
#ifdef _EXPORT_MAP_
440-
*svgmap << "<g inkscape:label=\"" << layer->name << "\"" << std::endl
441-
<< " inkscape:groupmode=\"layer\"" << std::endl
442-
<< " id=\"" << layer->name << "\">" << std::endl << std::endl;
443-
#endif
444-
445406
context->layer->mMutex.lock();
446407
context->layer->rtree->Search( amin, amax, extractFeatCallback, ( void* ) context );
447408
context->layer->mMutex.unlock();
448409

449-
#ifdef _EXPORT_MAP_
450-
*svgmap << "</g>" << std::endl << std::endl;
451-
#endif
452-
453410
#ifdef _VERBOSE_
454411
std::cout << "Layer's name: " << layer->getName() << std::endl;
455412
std::cout << " scale range: " << layer->getMinScale() << "->" << layer->getMaxScale() << std::endl;
@@ -708,35 +665,12 @@ namespace pal
708665
std::cout << std::endl << "bbox: " << bbox[0] << " " << bbox[1] << " " << bbox[2] << " " << bbox[3] << std::endl;
709666
#endif
710667

711-
#ifdef _EXPORT_MAP_
712-
// TODO this is not secure
713-
std::ofstream svgmap( "pal-map.svg" );
714-
715-
svgmap << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" << std::endl
716-
<< "<svg" << std::endl
717-
<< "xmlns:dc=\"http://purl.org/dc/elements/1.1/\"" << std::endl
718-
<< "xmlns:cc=\"http://creativecommons.org/ns#\"" << std::endl
719-
<< "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"" << std::endl
720-
<< "xmlns:svg=\"http://www.w3.org/2000/svg\"" << std::endl
721-
<< "xmlns=\"http://www.w3.org/2000/svg\"" << std::endl
722-
<< "xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"" << std::endl
723-
<< "xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"" << std::endl
724-
<< "width=\"" << convert2pt( bbox[2] - bbox[0], scale, dpi ) << "\"" << std::endl
725-
<< "height=\"" << convert2pt( bbox[3] - bbox[1], scale, dpi ) << "\">" << std::endl; // TODO xmax ymax
726-
#endif
727-
728668
QTime t;
729669
t.start();
730670

731671
// First, extract the problem
732672
// TODO which is the minimum scale? (> 0, >= 0, >= 1, >1 )
733-
if ( scale < 1 || ( prob = extract( nbLayers, layersName, layersFactor, bbox[0], bbox[1], bbox[2], bbox[3], scale,
734-
#ifdef _EXPORT_MAP_
735-
& svgmap
736-
#else
737-
NULL
738-
#endif
739-
) ) == NULL )
673+
if ( scale < 1 || ( prob = extract( nbLayers, layersName, layersFactor, bbox[0], bbox[1], bbox[2], bbox[3], scale ) ) == NULL )
740674
{
741675

742676
#ifdef _VERBOSE_
@@ -746,11 +680,6 @@ namespace pal
746680
std::cout << "empty problem... finishing" << std::endl;
747681
#endif
748682

749-
#ifdef _EXPORT_MAP_
750-
svgmap << "</svg>" << std::endl;
751-
svgmap.close();
752-
#endif
753-
754683
// nothing to be done => return an empty result set
755684
if ( stats )
756685
( *stats ) = new PalStat();
@@ -799,12 +728,6 @@ namespace pal
799728
if ( stats )
800729
*stats = prob->getStats();
801730

802-
#ifdef _EXPORT_MAP_
803-
prob->drawLabels( svgmap );
804-
svgmap << "</svg>" << std::endl;
805-
svgmap.close();
806-
#endif
807-
808731
#ifdef _VERBOSE_
809732
clock_t total_time = clock() - start;
810733
std::cout << " Total time: " << double( total_time ) / double( CLOCKS_PER_SEC ) << std::endl;
@@ -847,7 +770,7 @@ namespace pal
847770
}
848771
mMutex.unlock();
849772

850-
Problem* prob = extract( nbLayers, layersName, priorities, bbox[0], bbox[1], bbox[2], bbox[3], scale, NULL );
773+
Problem* prob = extract( nbLayers, layersName, priorities, bbox[0], bbox[1], bbox[2], bbox[3], scale );
851774

852775
delete[] layersName;
853776
delete[] priorities;

‎src/core/pal/pal.h

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
// TODO ${MAJOR} ${MINOR} etc instead of 0.2
4040

41-
/**
41+
/**
4242
*
4343
* \section intro_sec Introduction
4444
*
@@ -110,7 +110,7 @@ namespace pal
110110
FLAG_MAP_ORIENTATION = 8
111111
};
112112

113-
/**
113+
/**
114114
* \brief Pal main class.
115115
*
116116
* A pal object will contains layers and global information such as which search method
@@ -126,17 +126,17 @@ namespace pal
126126

127127
public:
128128

129-
/**
129+
/**
130130
* \brief Create an new pal instance
131131
*/
132132
Pal();
133133

134-
/**
134+
/**
135135
* \brief delete an instance
136136
*/
137137
~Pal();
138138

139-
/**
139+
/**
140140
* \brief add a new layer
141141
*
142142
* @param lyrName layer's name
@@ -156,7 +156,7 @@ namespace pal
156156
*/
157157
Layer * addLayer( const char *lyrName, double min_scale, double max_scale, Arrangement arrangement, Units label_unit, double defaultPriority, bool obstacle, bool active, bool toLabel, bool displayAll = false );
158158

159-
/**
159+
/**
160160
* \brief Look for a layer
161161
*
162162
* @param lyrName name of layer to search
@@ -167,21 +167,21 @@ namespace pal
167167
*/
168168
Layer *getLayer( const char *lyrName );
169169

170-
/**
170+
/**
171171
* \brief get all layers
172172
*
173173
* @return a list of all layers
174174
*/
175175
QList<Layer*> *getLayers();
176176

177-
/**
177+
/**
178178
* \brief remove a layer
179179
*
180180
* @param layer layer to remove
181181
*/
182182
void removeLayer( Layer *layer );
183183

184-
/**
184+
/**
185185
* \brief the labeling machine
186186
* Will extract all active layers
187187
*
@@ -194,7 +194,7 @@ namespace pal
194194
*/
195195
std::list<LabelPosition*> *labeller( double scale, double bbox[4], PalStat **stats, bool displayAll );
196196

197-
/**
197+
/**
198198
* \brief the labeling machine
199199
* Active layers are specifiend through layersName array
200200
* @todo add obstacles and tolabel arrays
@@ -230,84 +230,84 @@ namespace pal
230230

231231
std::list<LabelPosition*>* solveProblem( Problem* prob, bool displayAll );
232232

233-
/**
233+
/**
234234
* \brief Set map resolution
235235
*
236236
* @param dpi map resolution (dot per inch)
237237
*/
238238
void setDpi( int dpi );
239239

240-
/**
240+
/**
241241
* \brief get map resolution
242242
*
243243
* @return map resolution (dot per inch)
244244
*/
245245
int getDpi();
246246

247-
/**
247+
/**
248248
*\brief Set flag show partial label
249249
*
250250
* @param show flag value
251251
*/
252252
void setShowPartial( bool show );
253253

254-
/**
254+
/**
255255
* \brief Get flag show partial label
256256
*
257257
* @return value of flag
258258
*/
259259
bool getShowPartial();
260260

261-
/**
261+
/**
262262
* \brief set # candidates to generate for points features
263263
* Higher the value is, longer Pal::labeller will spend time
264264
*
265265
* @param point_p # candidates for a point
266266
*/
267267
void setPointP( int point_p );
268268

269-
/**
269+
/**
270270
* \brief set maximum # candidates to generate for lines features
271271
* Higher the value is, longer Pal::labeller will spend time
272272
*
273273
* @param line_p maximum # candidates for a line
274274
*/
275275
void setLineP( int line_p );
276276

277-
/**
277+
/**
278278
* \brief set maximum # candidates to generate for polygon features
279279
* Higher the value is, longer Pal::labeller will spend time
280280
*
281281
* @param poly_p maximum # candidate for a polygon
282282
*/
283283
void setPolyP( int poly_p );
284284

285-
/**
285+
/**
286286
* \brief get # candidates to generate for point features
287287
*/
288288
int getPointP();
289289

290-
/**
290+
/**
291291
* \brief get maximum # candidates to generate for line features
292292
*/
293293
int getLineP();
294294

295-
/**
295+
/**
296296
* \brief get maximum # candidates to generate for polygon features
297297
*/
298298
int getPolyP();
299299

300-
/**
300+
/**
301301
* \brief get current map unit
302302
*/
303303
Units getMapUnit();
304304

305-
/**
305+
/**
306306
* \brief set map unit
307307
*/
308308
void setMapUnit( Units map_unit );
309309

310-
/**
310+
/**
311311
* \brief Select the search method to use.
312312
*
313313
* For interactive mapping using CHAIN is a good
@@ -317,7 +317,7 @@ namespace pal
317317
*/
318318
void setSearch( SearchMethod method );
319319

320-
/**
320+
/**
321321
* \brief get the search method in use
322322
*
323323
* @return the search method
@@ -331,17 +331,17 @@ namespace pal
331331

332332
Units map_unit;
333333

334-
/**
334+
/**
335335
* \brief maximum # candidates for a point
336336
*/
337337
int point_p;
338338

339-
/**
339+
/**
340340
* \brief maximum # candidates for a line
341341
*/
342342
int line_p;
343343

344-
/**
344+
/**
345345
* \brief maximum # candidates for a polygon
346346
*/
347347
int poly_p;
@@ -362,7 +362,7 @@ namespace pal
362362
int tenure;
363363
double candListSize;
364364

365-
/**
365+
/**
366366
* \brief show partial labels (cut-off by the map canvas) or not
367367
*/
368368
bool showPartial;
@@ -372,7 +372,7 @@ namespace pal
372372
/** Application-specific context for the cancellation check function */
373373
void* fnIsCancelledContext;
374374

375-
/**
375+
/**
376376
* \brief Problem factory
377377
* Extract features to label and generates candidates for them,
378378
* respects to a bounding box and a map scale
@@ -385,59 +385,58 @@ namespace pal
385385
* @param lambda_max xMax bounding-box
386386
* @param phi_max yMax bounding-box
387387
* @param scale the scale (1:scale)
388-
* @param svgmap stream to wrtie the svg map (need _EXPORT_MAP_ defined to work)
389388
*/
390389
Problem* extract( int nbLayers, char **layersName, double *layersFactor,
391390
double lambda_min, double phi_min,
392391
double lambda_max, double phi_max,
393-
double scale, std::ofstream *svgmap );
392+
double scale );
394393

395394

396-
/**
395+
/**
397396
* \brief Choose the size of popmusic subpart's
398397
* @param r subpart size
399398
*/
400399
void setPopmusicR( int r );
401400

402401

403402

404-
/**
403+
/**
405404
* \brief minimum # of iteration for search method POPMUSIC_TABU, POPMUSIC_CHAIN and POPMUSIC_TABU_CHAIN
406405
* @param min_it Sub part optimization min # of iteration
407406
*/
408407
void setMinIt( int min_it );
409408

410-
/**
409+
/**
411410
* \brief maximum \# of iteration for search method POPMUSIC_TABU, POPMUSIC_CHAIN and POPMUSIC_TABU_CHAIN
412411
* @param max_it Sub part optimization max # of iteration
413412
*/
414413
void setMaxIt( int max_it );
415414

416-
/**
415+
/**
417416
* \brief For tabu search : how many iteration a feature will be tabu
418417
* @param tenure consiser a feature as tabu for tenure iteration after updating feature in solution
419418
*/
420419
void setTenure( int tenure );
421420

422-
/**
421+
/**
423422
* \brief For *CHAIN, select the max size of a transformation chain
424423
* @param degree maximum soze of a transformation chain
425424
*/
426425
void setEjChainDeg( int degree );
427426

428-
/**
427+
/**
429428
* \brief How many candidates will be tested by a tabu iteration
430429
* @param fact the ration (0..1) of candidates to test
431430
*/
432431
void setCandListSize( double fact );
433432

434433

435-
/**
434+
/**
436435
* \brief Get the minimum # of iteration doing in POPMUSIC_TABU, POPMUSIC_CHAIN and POPMUSIC_TABU_CHAIN
437436
* @return minimum # of iteration
438437
*/
439438
int getMinIt();
440-
/**
439+
/**
441440
* \brief Get the maximum # of iteration doing in POPMUSIC_TABU, POPMUSIC_CHAIN and POPMUSIC_TABU_CHAIN
442441
* @return maximum # of iteration
443442
*/

‎src/core/pal/problem.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929

3030
#define _CRT_SECURE_NO_DEPRECATE
3131

32-
#ifdef _EXPORT_MAP_
33-
#include <cstdlib>
34-
#endif
35-
3632
#include <iostream>
3733
#include <fstream>
3834
#include <cstring>
@@ -2790,27 +2786,4 @@ namespace pal
27902786
#endif
27912787
}
27922788

2793-
2794-
#ifdef _EXPORT_MAP_
2795-
void Problem::drawLabels( std::ofstream &svgmap )
2796-
{
2797-
int i;
2798-
2799-
svgmap << "<g inkscape:label=\"labels\"" << std::endl
2800-
<< "inkscape:groupmode=\"layer\"" << std::endl
2801-
<< "id=\"label_layer\">" << std::endl << std::endl;
2802-
2803-
for ( i = 0; i < nbft; i++ )
2804-
{
2805-
if ( sol->s[i] >= 0 )
2806-
{
2807-
LabelPosition *lp = labelpositions[sol->s[i]];
2808-
toSVGPath( 4, 3, lp->x, lp->y, pal->getDpi(), scale, convert2pt( bbox[0], scale, pal->getDpi() ), convert2pt( bbox[3], scale, pal->getDpi() ), "label", lp->feature->uid, svgmap );
2809-
}
2810-
}
2811-
2812-
svgmap << "</g>" << std::endl;
2813-
}
2814-
#endif
2815-
28162789
} // namespace

‎src/core/pal/problem.h

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,30 @@ namespace pal
4949

5050
typedef struct _subpart
5151
{
52-
/**
52+
/**
5353
* # of features in problem
5454
*/
5555
int probSize;
5656

57-
/**
57+
/**
5858
* # of features bounding the problem
5959
*/
6060
int borderSize;
6161

62-
/**
62+
/**
6363
* total # features (prob + border)
6464
*/
6565
int subSize;
6666

67-
/**
67+
/**
6868
* wrap bw sub feat and main feat
6969
*/
7070
int *sub;
71-
/**
71+
/**
7272
* sub solution
7373
*/
7474
int *sol;
75-
/**
75+
/**
7676
* first feat in sub part
7777
*/
7878
int seed;
@@ -86,7 +86,7 @@ namespace pal
8686
int *label;
8787
} Chain;
8888

89-
/**
89+
/**
9090
* \brief Represent a problem
9191
*/
9292
class CORE_EXPORT Problem
@@ -113,12 +113,12 @@ namespace pal
113113

114114
void reduce();
115115

116-
/**
116+
/**
117117
* \brief popmusic framework
118118
*/
119119
void popmusic();
120120

121-
/**
121+
/**
122122
* \brief Test with very-large scale neighborhood
123123
*/
124124
void chain_search();
@@ -147,48 +147,44 @@ namespace pal
147147

148148
static bool compareLabelArea( pal::LabelPosition* l1, pal::LabelPosition* l2 );
149149

150-
#ifdef _EXPORT_MAP_
151-
void drawLabels( std::ofstream &svgmap );
152-
#endif
153-
154150
private:
155151

156-
/**
152+
/**
157153
* How many layers are labelled ?
158154
*/
159155
int nbLabelledLayers;
160156

161-
/**
157+
/**
162158
* Names of the labelled layers
163159
*/
164160
char **labelledLayersName;
165161

166-
/**
162+
/**
167163
* # active candidates (remaining after reduce())
168164
*/
169165
int nblp;
170-
/**
166+
/**
171167
* # candidates (all, including)
172168
*/
173169
int all_nblp;
174170

175-
/**
171+
/**
176172
* # feature to label
177173
*/
178174
int nbft;
179175

180176

181-
/**
177+
/**
182178
* if true, special value -1 is prohibited
183179
*/
184180
bool displayAll;
185181

186-
/**
182+
/**
187183
* Map extent (xmin, ymin, xmax, ymax)
188184
*/
189185
double bbox[4];
190186

191-
/**
187+
/**
192188
* map scale is 1:scale
193189
*/
194190
double scale;

0 commit comments

Comments
 (0)
Please sign in to comment.