Skip to content

Commit

Permalink
Some modif to geomtransformshape
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Boudreault committed Feb 12, 2013
1 parent 5c2bd2e commit b3746cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mapdraw.c
Expand Up @@ -1047,7 +1047,7 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image)


/* Apply GeomTransform */ /* Apply GeomTransform */
if(layer->_geomtransform.type != MS_GEOMTRANSFORM_NONE) { if(layer->_geomtransform.type != MS_GEOMTRANSFORM_NONE) {
msGeomTransformShape(&shape, &layer->_geomtransform); msGeomTransformShape(map, layer, &shape);
} }


if (cache) { if (cache) {
Expand Down
8 changes: 4 additions & 4 deletions mapgeomtransform.c
Expand Up @@ -177,7 +177,6 @@ int msDrawTransformedShape(mapObj *map, symbolSetObj *symbolset, imageObj *image
p.expr = &(style->_geomtransform); p.expr = &(style->_geomtransform);
p.expr->curtoken = p.expr->tokens; /* reset */ p.expr->curtoken = p.expr->tokens; /* reset */
p.type = MS_PARSE_TYPE_SHAPE; p.type = MS_PARSE_TYPE_SHAPE;
p.dblval = map->cellsize/MS_MAX(image->width, image->height);


status = yyparse(&p); status = yyparse(&p);
if (status != 0) { if (status != 0) {
Expand Down Expand Up @@ -215,10 +214,11 @@ int msDrawTransformedShape(mapObj *map, symbolSetObj *symbolset, imageObj *image
* - transform directly the shapeobj * - transform directly the shapeobj
* - Only shape depression supported for layers * - Only shape depression supported for layers
*/ */
int msGeomTransformShape(shapeObj *shape, expressionObj *e) int msGeomTransformShape(mapObj *map, layerObj *layer, shapeObj *shape)
{ {
int i; int i;

expressionObj *e = &layer->_geomtransform;

switch(e->type) { switch(e->type) {
case MS_GEOMTRANSFORM_EXPRESSION: { case MS_GEOMTRANSFORM_EXPRESSION: {
int status; int status;
Expand All @@ -229,7 +229,7 @@ int msGeomTransformShape(shapeObj *shape, expressionObj *e)
p.expr = e; p.expr = e;
p.expr->curtoken = p.expr->tokens; /* reset */ p.expr->curtoken = p.expr->tokens; /* reset */
p.type = MS_PARSE_TYPE_SHAPE; p.type = MS_PARSE_TYPE_SHAPE;
//p.dblval = map->cellsize/MS_MAX(image->width, image->height); p.dblval = map->cellsize * (msInchesPerUnit(map->units,0)/msInchesPerUnit(layer->units,0));


status = yyparse(&p); status = yyparse(&p);
if (status != 0) { if (status != 0) {
Expand Down
2 changes: 1 addition & 1 deletion mapserver.h
Expand Up @@ -2663,7 +2663,7 @@ extern "C" {
MS_DLL_EXPORT void msSetGeomTransform(expressionObj *e, char *transform); MS_DLL_EXPORT void msSetGeomTransform(expressionObj *e, char *transform);
MS_DLL_EXPORT char *msStyleGetGeomTransform(styleObj *style); MS_DLL_EXPORT char *msStyleGetGeomTransform(styleObj *style);


MS_DLL_EXPORT int msGeomTransformShape(shapeObj *shape, expressionObj *e); MS_DLL_EXPORT int msGeomTransformShape(mapObj *map, layerObj *layer, shapeObj *shape);


/* ==================================================================== */ /* ==================================================================== */
/* end of prototypes for functions in mapgeomtransform.c */ /* end of prototypes for functions in mapgeomtransform.c */
Expand Down

0 comments on commit b3746cf

Please sign in to comment.