collecting the cluster shapes, returns true if this subnode must be removed */
| 744 | |
| 745 | /* collecting the cluster shapes, returns true if this subnode must be removed */ |
| 746 | static int collectClusterShapes(msClusterLayerInfo* layerinfo, clusterTreeNode *node, clusterInfo* current) |
| 747 | { |
| 748 | int i; |
| 749 | clusterInfo* prev = NULL; |
| 750 | clusterInfo* s = node->shapes; |
| 751 | |
| 752 | if(!msRectOverlap(&node->rect, ¤t->bounds)) |
| 753 | return (!node->shapes && !node->subnode[0] && !node->subnode[1] |
| 754 | && !node->subnode[2] && !node->subnode[3]); |
| 755 | |
| 756 | /* removing the shapes from this node if overlap with the cluster */ |
| 757 | while (s) |
| 758 | { |
| 759 | if (layerinfo->fnCompare(current, s)) |
| 760 | { |
| 761 | if (s != current && current->filter == 0) |
| 762 | { |
| 763 | /* skip siblings of the filtered shapes */ |
| 764 | prev = s; |
| 765 | s = prev->next; |
| 766 | continue; |
| 767 | } |
| 768 | |
| 769 | /* removing from the list */ |
| 770 | if (!prev) |
| 771 | node->shapes = s->next; |
| 772 | else |
| 773 | prev->next = s->next; |
| 774 | |
| 775 | ++current->numcollected; |
| 776 | |
| 777 | /* adding the shape to the finalization list */ |
| 778 | if (s == current) |
| 779 | { |
| 780 | if (s->filter) |
| 781 | { |
| 782 | s->next = layerinfo->finalized; |
| 783 | layerinfo->finalized = s; |
| 784 | ++layerinfo->numFinalized; |
| 785 | } |
| 786 | else |
| 787 | { |
| 788 | /* this shape is filtered */ |
| 789 | s->next = layerinfo->filtered; |
| 790 | layerinfo->filtered = s; |
| 791 | ++layerinfo->numFiltered; |
| 792 | } |
| 793 | } |
| 794 | else |
| 795 | { |
| 796 | s->next = layerinfo->finalizedSiblings; |
| 797 | layerinfo->finalizedSiblings = s; |
| 798 | ++layerinfo->numFinalizedSiblings; |
| 799 | } |
| 800 | |
| 801 | if (!prev) |
| 802 | s = node->shapes; |
| 803 | else |
no test coverage detected