| 787 | } |
| 788 | |
| 789 | int vtkLabeledTreeMapDataMapper::ApplyMasks(int level, float flimits[4], float blimits[4]) |
| 790 | { |
| 791 | // Note that all limits and mask information is in Device Coordinates |
| 792 | |
| 793 | float dy = 0.0; |
| 794 | int changed = 1, dir = 0, l; |
| 795 | int status = 1; |
| 796 | if (!this->ChildMotion) |
| 797 | { |
| 798 | // If any of the masks intersect the label don't display it |
| 799 | for (l = 0; l < level; l++) |
| 800 | { |
| 801 | // Skip all masks that refer to labels that are not displayed |
| 802 | // (i.e. that the first component < 0) |
| 803 | if (this->LabelMasks[l][0] < 0.0) |
| 804 | { |
| 805 | continue; |
| 806 | } |
| 807 | if (this->LabelMasks[l][0] > flimits[1]) |
| 808 | { |
| 809 | continue; |
| 810 | } |
| 811 | if (this->LabelMasks[l][1] < flimits[0]) |
| 812 | { |
| 813 | continue; |
| 814 | } |
| 815 | if (this->LabelMasks[l][2] > flimits[3]) |
| 816 | { |
| 817 | continue; |
| 818 | } |
| 819 | if (this->LabelMasks[l][3] < flimits[2]) |
| 820 | { |
| 821 | continue; |
| 822 | } |
| 823 | // If we are here the label intersects the mask |
| 824 | return 1; |
| 825 | } |
| 826 | return 0; |
| 827 | } |
| 828 | |
| 829 | // dir == 0 indicates we are dropping the label and 1 means we are raising it |
| 830 | while (changed) |
| 831 | { |
| 832 | changed = 0; |
| 833 | for (l = 0; l < level; l++) |
| 834 | { |
| 835 | // Skip all masks that refer to labels that are not displayed |
| 836 | // (i.e. that the first component < 0) |
| 837 | // or do not interfere in the y-direction |
| 838 | // (i.e. the second component < 0) |
| 839 | // or has been already fixed in the y-direction |
| 840 | // (.i.e the third component < 0) |
| 841 | if ((this->LabelMasks[l][0] < 0.0) || (this->LabelMasks[l][1] < 0.0) || |
| 842 | (this->LabelMasks[l][2] < 0.0)) |
| 843 | { |
| 844 | continue; |
| 845 | } |
| 846 | |