** Function to render an individual shape, the style variable enables/disables the drawing of a single style ** versus a single style. This is necessary when drawing entire layers as proper overlay can only be achived ** through caching. "querymapMode" parameter is used to tell msBindLayerToShape to not override the ** QUERYMAP HILITE color. */
| 1397 | ** QUERYMAP HILITE color. |
| 1398 | */ |
| 1399 | int msDrawShape(mapObj *map, layerObj *layer, shapeObj *shape, imageObj *image, int style, int querymapMode) |
| 1400 | { |
| 1401 | int i,j,c,s; |
| 1402 | rectObj cliprect; |
| 1403 | pointObj annopnt, *point; |
| 1404 | double** angles = NULL, **lengths = NULL; |
| 1405 | int bLabelNoClip = MS_FALSE; |
| 1406 | int annocallret = MS_FAILURE; /* Retvals for find-label-pnt calls */ |
| 1407 | |
| 1408 | int hasGeomTransform = MS_FALSE; |
| 1409 | shapeObj nonClippedShape; |
| 1410 | |
| 1411 | pointObj center; /* circle origin */ |
| 1412 | double r; /* circle radius */ |
| 1413 | int csz; /* clip over size */ |
| 1414 | double buffer; |
| 1415 | int minfeaturesize; |
| 1416 | int numpaths = 1, numpoints = 1, numRegularLines = 0; |
| 1417 | |
| 1418 | labelPathObj **annopaths = NULL; /* Curved label path. Bug #1620 implementation */ |
| 1419 | pointObj **annopoints = NULL; |
| 1420 | int *regularLines = NULL; |
| 1421 | |
| 1422 | /* set clipping rectangle just a bit larger than the map extent */ |
| 1423 | /* Steve's original code |
| 1424 | cliprect.minx = map->extent.minx - 2*map->cellsize; |
| 1425 | cliprect.miny = map->extent.miny - 2*map->cellsize; |
| 1426 | cliprect.maxx = map->extent.maxx + 2*map->cellsize; |
| 1427 | cliprect.maxy = map->extent.maxy + 2*map->cellsize; |
| 1428 | */ |
| 1429 | |
| 1430 | msDrawStartShape(map, layer, image, shape); |
| 1431 | |
| 1432 | c = shape->classindex; |
| 1433 | |
| 1434 | /* Before we do anything else, we will check for a rangeitem. |
| 1435 | If its there, we need to change the style's color to map |
| 1436 | the range to the shape */ |
| 1437 | for(s=0; s<layer->class[c]->numstyles; s++) { |
| 1438 | styleObj *style = layer->class[c]->styles[s]; |
| 1439 | if(style->rangeitem != NULL) |
| 1440 | msShapeToRange((layer->class[c]->styles[s]), shape); |
| 1441 | |
| 1442 | |
| 1443 | } |
| 1444 | |
| 1445 | /* adjust the clipping rectangle so that clipped polygon shapes with thick lines |
| 1446 | * do not enter the image */ |
| 1447 | if(layer->class[c]->numstyles > 0 && layer->class[c]->styles[0] != NULL) { |
| 1448 | double maxsize,maxunscaledsize; |
| 1449 | symbolObj *symbol; |
| 1450 | styleObj *style = layer->class[c]->styles[0]; |
| 1451 | if (!MS_IS_VALID_ARRAY_INDEX(style->symbol, map->symbolset.numsymbols)) { |
| 1452 | msSetError(MS_SYMERR, "Invalid symbol index: %d", "msDrawShape()", style->symbol); |
| 1453 | return MS_FAILURE; |
| 1454 | } |
| 1455 | symbol = map->symbolset.symbol[style->symbol]; |
| 1456 | if(symbol->type == MS_SYMBOL_PIXMAP) { |
no test coverage detected