Skip to content

Commit

Permalink
Remove #ifdef USE_PRIOLIST. Change name from panPriolist to layerorder.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/mapserver/trunk@811 7532c77e-422f-0410-93f4-f0b67bdd69e2
  • Loading branch information
Assefa Yewondwossen committed Oct 23, 2001
1 parent 92da6fe commit 8e4392c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 43 deletions.
2 changes: 1 addition & 1 deletion map.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ typedef struct { /* structure for a map */


webObj web; webObj web;


int *panPrioList; int *layerorder;


} mapObj; } mapObj;


Expand Down
27 changes: 10 additions & 17 deletions mapfile.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2934,12 +2934,10 @@ int initMap(mapObj *map)
if(msProcessProjection(&(map->latlon)) == -1) return(-1); if(msProcessProjection(&(map->latlon)) == -1) return(-1);
#endif #endif


//Initialize the priority list (used to modify the order in which the layers //Initialize the layer order list (used to modify the order in
//are drawn). //which the layers are drawn).
map->panPrioList = NULL; map->layerorder = (int *)malloc(sizeof(int)*MS_MAXLAYERS);
#ifdef USE_PRIOLIST
map->panPrioList = (int *)malloc(sizeof(int)*MS_MAXLAYERS);
#endif


return(0); return(0);
} }
Expand Down Expand Up @@ -2985,8 +2983,8 @@ void msFreeMap(mapObj *map) {
freeLayer(&(map->layers[i])); freeLayer(&(map->layers[i]));
msFree(map->layers); msFree(map->layers);


if (map->panPrioList) if (map->layerorder)
free(map->panPrioList); free(map->layerorder);
msFree(map); msFree(map);
} }


Expand Down Expand Up @@ -3041,11 +3039,8 @@ int msSaveMap(mapObj *map, char *filename)


for(i=0; i<map->numlayers; i++) for(i=0; i<map->numlayers; i++)
{ {
#ifdef USE_PRIOLIST writeLayer(map, &(map->layers[map->layerorder[i]]), stream);
writeLayer(map, &(map->layers[map->panPrioList[i]]), stream); //writeLayer(map, &(map->layers[i]), stream);
#else
writeLayer(map, &(map->layers[i]), stream);
#endif
} }


fprintf(stream, "END\n"); fprintf(stream, "END\n");
Expand Down Expand Up @@ -3183,10 +3178,8 @@ mapObj *msLoadMap(char *filename)
} }
if(loadLayer(&(map->layers[map->numlayers]), map) == -1) return(NULL); if(loadLayer(&(map->layers[map->numlayers]), map) == -1) return(NULL);
map->layers[map->numlayers].index = map->numlayers; /* save the index */ map->layers[map->numlayers].index = map->numlayers; /* save the index */
#ifdef USE_PRIOLIST //Update the layer order list with the layer's index.
//Update the priority list with the layer's index. map->layerorder[map->numlayers] = map->numlayers;
map->panPrioList[map->numlayers] = map->numlayers;
#endif
map->numlayers++; map->numlayers++;
break; break;
case(LEGEND): case(LEGEND):
Expand Down
7 changes: 2 additions & 5 deletions maplegend.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -262,11 +262,8 @@ int msEmbedLegend(mapObj *map, gdImagePtr img)
map->layers[l].status = MS_ON; map->layers[l].status = MS_ON;


if(initClass(&(map->layers[l].class[0])) == -1) return(-1); if(initClass(&(map->layers[l].class[0])) == -1) return(-1);
#ifdef USE_PRIOLIST //Update the layer order list with the layer's index.
//Update the priority list with the layer's index. map->layerorder[l] = l;
map->panPrioList[l] = l;
#endif

} }


map->layers[l].class[0].symbol = s; map->layers[l].class[0].symbol = s;
Expand Down
7 changes: 2 additions & 5 deletions mapscale.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -252,11 +252,8 @@ int msEmbedScalebar(mapObj *map, gdImagePtr img)
map->layers[l].status = MS_ON; map->layers[l].status = MS_ON;


if(initClass(&(map->layers[l].class[0])) == -1) return(-1); if(initClass(&(map->layers[l].class[0])) == -1) return(-1);
#ifdef USE_PRIOLIST //Update the layer order list with the layer's index.
//Update the priority list with the layer's index. map->layerorder[l] = l;
map->panPrioList[l] = l;
#endif

} }


map->layers[l].class[0].symbol = s; map->layers[l].class[0].symbol = s;
Expand Down
26 changes: 11 additions & 15 deletions maputil.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -229,11 +229,9 @@ gdImagePtr msDrawMap(mapObj *map)


for(i=0; i<map->numlayers; i++) { for(i=0; i<map->numlayers; i++) {


#ifdef USE_PRIOLIST lp = &(map->layers[ map->layerorder[i]]);
lp = &(map->layers[ map->panPrioList[i]]); //lp = &(map->layers[i]);
#else
lp = &(map->layers[i]);
#endif
if(lp->postlabelcache) // wait to draw if(lp->postlabelcache) // wait to draw
continue; continue;


Expand Down Expand Up @@ -1095,14 +1093,13 @@ int *msGetLayersIndexByGroup(mapObj *map, char *groupname, int *pnCount)
*/ */
int msMoveLayerUp(mapObj *map, int nLayerIndex) int msMoveLayerUp(mapObj *map, int nLayerIndex)
{ {
#ifdef USE_PRIOLIST
int iCurrentIndex = -1; int iCurrentIndex = -1;
int i = 0; int i = 0;
if (map && nLayerIndex < map->numlayers-1 && nLayerIndex >=0) if (map && nLayerIndex < map->numlayers-1 && nLayerIndex >=0)
{ {
for (i=0; i<map->numlayers; i++) for (i=0; i<map->numlayers; i++)
{ {
if ( map->panPrioList[i] == nLayerIndex) if ( map->layerorder[i] == nLayerIndex)
{ {
iCurrentIndex = i; iCurrentIndex = i;
break; break;
Expand All @@ -1114,13 +1111,13 @@ int msMoveLayerUp(mapObj *map, int nLayerIndex)
if (iCurrentIndex == 0) if (iCurrentIndex == 0)
return 0; return 0;


map->panPrioList[iCurrentIndex] = map->panPrioList[iCurrentIndex-1]; map->layerorder[iCurrentIndex] =
map->panPrioList[iCurrentIndex-1] = nLayerIndex; map->layerorder[iCurrentIndex-1];
map->layerorder[iCurrentIndex-1] = nLayerIndex;


return 0; return 0;
} }
} }
#endif
return -1; return -1;
} }


Expand All @@ -1130,14 +1127,13 @@ int msMoveLayerUp(mapObj *map, int nLayerIndex)
*/ */
int msMoveLayerDown(mapObj *map, int nLayerIndex) int msMoveLayerDown(mapObj *map, int nLayerIndex)
{ {
#ifdef USE_PRIOLIST
int iCurrentIndex = -1; int iCurrentIndex = -1;
int i = 0; int i = 0;
if (map && nLayerIndex < map->numlayers-1 && nLayerIndex >=0) if (map && nLayerIndex < map->numlayers-1 && nLayerIndex >=0)
{ {
for (i=0; i<map->numlayers; i++) for (i=0; i<map->numlayers; i++)
{ {
if ( map->panPrioList[i] == nLayerIndex) if ( map->layerorder[i] == nLayerIndex)
{ {
iCurrentIndex = i; iCurrentIndex = i;
break; break;
Expand All @@ -1149,13 +1145,13 @@ int msMoveLayerDown(mapObj *map, int nLayerIndex)
if (iCurrentIndex == map->numlayers-1) if (iCurrentIndex == map->numlayers-1)
return 0; return 0;


map->panPrioList[iCurrentIndex] = map->panPrioList[iCurrentIndex+1]; map->layerorder[iCurrentIndex] =
map->panPrioList[iCurrentIndex+1] = nLayerIndex; map->layerorder[iCurrentIndex+1];
map->layerorder[iCurrentIndex+1] = nLayerIndex;


return 0; return 0;
} }
} }
#endif
return -1; return -1;
} }


Expand Down

0 comments on commit 8e4392c

Please sign in to comment.