MCPcopy Index your code
hub / github.com/MapServer/MapServer / msDrawLineSymbol

Function msDrawLineSymbol

maprendering.c:395–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395int msDrawLineSymbol(symbolSetObj *symbolset, imageObj *image, shapeObj *p,
396 styleObj *style, double scalefactor)
397{
398 if (image)
399 {
400 if (MS_RENDERER_PLUGIN(image->format)) {
401 rendererVTableObj *renderer = image->format->vtable;
402 symbolObj *symbol;
403 shapeObj *offsetLine = p;
404 int i;
405 double width;
406
407 if (p->numlines == 0)
408 return MS_SUCCESS;
409
410 if (style->symbol >= symbolset->numsymbols || style->symbol < 0)
411 return MS_SUCCESS; /* no such symbol, 0 is OK */
412
413 symbol = symbolset->symbol[style->symbol];
414 /* store a reference to the renderer to be used for freeing */
415 symbol->renderer = renderer;
416
417 width = style->width * scalefactor;
418 width = MS_MIN(width,style->maxwidth);
419 width = MS_MAX(width,style->minwidth);
420
421 if(style->offsety==-99) {
422 offsetLine = msOffsetPolyline(p,style->offsetx * width/style->width,-99);
423 } else if(style->offsetx!=0 || style->offsety!=0) {
424 offsetLine = msOffsetPolyline(p, style->offsetx * width/style->width,
425 style->offsety * width/style->width);
426 }
427 if(style->symbol == 0 || (symbol->type==MS_SYMBOL_SIMPLE)) {
428 strokeStyleObj s;
429 s.linecap = style->linecap;
430 s.linejoin = style->linejoin;
431 s.linejoinmaxsize = style->linejoinmaxsize;
432 s.width = width;
433 s.patternlength = style->patternlength;
434 for(i=0; i<s.patternlength; i++)
435 s.pattern[i] = style->pattern[i]*s.width/style->width;
436
437 if(MS_VALID_COLOR(style->color))
438 s.color = &style->color;
439 else if(MS_VALID_COLOR(style->outlinecolor))
440 s.color = &style->outlinecolor;
441 else {
442 /* msSetError(MS_MISCERR,"no color defined for line styling","msDrawLineSymbol()");
443 * not really an error */
444 return MS_SUCCESS;
445 }
446 renderer->renderLine(image,offsetLine,&s);
447 }
448 else {
449 symbolStyleObj s;
450 switch (symbol->type) {
451 case (MS_SYMBOL_TRUETYPE): {
452 if(!symbol->full_font_path)

Callers 8

msDrawVectorLayerFunction · 0.85
msDrawQueryLayerFunction · 0.85
msDrawShapeFunction · 0.85
msDrawShadeSymbolFunction · 0.85
msCircleDrawLineSymbolFunction · 0.85
msDrawLegendIconFunction · 0.85
mainFunction · 0.85
msDrawReferenceMapFunction · 0.85

Calls 13

msOffsetPolylineFunction · 0.85
msStrdupFunction · 0.85
msLookupHashTableFunction · 0.85
msSetErrorFunction · 0.85
msPreloadImageSymbolFunction · 0.85
computeSymbolStyleFunction · 0.85
msImagePolylineMarkersFunction · 0.85
MS_NINTFunction · 0.85
getTileFunction · 0.85
msFreeShapeFunction · 0.85
msFreeFunction · 0.85
msDrawLineSymbolIMFunction · 0.85

Tested by

no test coverage detected