Changeset 7597

Show
Ignore:
Timestamp:
05/16/08 04:27:26 (2 months ago)
Author:
tbonfort
Message:

AGG: enable ellipse symbol rotation for POINT/ANNOTATION layers (#2617)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/mapserver/HISTORY.TXT

    r7594 r7597  
    1313Current Version (5.1-dev, SVN trunk): 
    1414------------------------------------- 
     15- AGG: enable ellipse symbol rotation for POINT/ANNOTATION layers (#2617) 
    1516 
    1617- RFC36: add more extensions to support templates (#2576) 
  • trunk/mapserver/mapagg.cpp

    r7581 r7597  
    286286    ///@param outlinecolor the color of the outline, or NULL for no outline 
    287287    ///@param outlinewidth the width of the optional outline 
    288     void renderEllipse(double x, double y, double w, double h, agg::rgba8 &color, 
     288    void renderEllipse(double x, double y, double w, double h, double angle, agg::rgba8 &color, 
    289289            agg::rgba8 &outlinecolor, double outlinewidth=1) { 
    290290        agg::path_storage path; 
    291291        agg::ellipse ellipse(x,y,w/2.,h/2.0); 
    292292        path.concat_path(ellipse); 
     293        if( (fabs(angle)>_EPSILON) || (fabs(MS_2PI-angle)>_EPSILON)) { 
     294            agg::trans_affine mtx; 
     295            mtx *= agg::trans_affine_translation(-x,-y); 
     296            /*agg angles are antitrigonometric*/ 
     297            mtx *= agg::trans_affine_rotation(-angle); 
     298            mtx *= agg::trans_affine_translation(x,y); 
     299            path.transform(mtx); 
     300        } 
    293301        renderPathSolid(path,color,outlinecolor,outlinewidth);       
    294302    } 
     
    12091217    agg_bcolor=getAGGColor(&style->backgroundcolor,style->opacity); 
    12101218    if(style->symbol == 0) { // simply draw a circle of the specified color 
    1211         ren->renderEllipse(p->x+ox,p->y+oy,size,size,agg_color,agg_ocolor,width); 
     1219        ren->renderEllipse(p->x+ox,p->y+oy,size,size,0,agg_color,agg_ocolor,width); 
    12121220        return; 
    12131221    }   
     
    12411249        if(symbol->filled) { 
    12421250            //draw an optionnally filled and/or outlined ellipse 
    1243             ren->renderEllipse(x,y,w,h,agg_color,agg_ocolor,width); 
     1251            ren->renderEllipse(x,y,w,h,angle_radians,agg_color,agg_ocolor,width); 
    12441252        } 
    12451253        else { 
     
    12521260                return; 
    12531261            //draw only the outline 
    1254             ren->renderEllipse(x,y,w,h,AGG_NO_COLOR,*c,width); 
     1262            ren->renderEllipse(x,y,w,h,angle_radians,AGG_NO_COLOR,*c,width); 
    12551263        } 
    12561264    } 
     
    13761384                    if(symbol->filled) { 
    13771385                        //draw an optionnally filled and/or outlined vector symbol 
    1378                         ren->renderEllipse(point.x,point.y,sw,sh,agg_color,agg_ocolor,outlinewidth); 
     1386                        ren->renderEllipse(point.x,point.y,sw,sh,0,agg_color,agg_ocolor,outlinewidth); 
    13791387                    } 
    13801388                    else { 
     
    13871395                            return; 
    13881396                        //draw only the outline 
    1389                         ren->renderEllipse(point.x,point.y,sw,sh,AGG_NO_COLOR,*c,outlinewidth); 
     1397                        ren->renderEllipse(point.x,point.y,sw,sh,0,AGG_NO_COLOR,*c,outlinewidth); 
    13901398                    } 
    13911399                    break;