Changeset 1215 in josm
- Timestamp:
- 2009-01-08T21:39:30+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1208 r1215 767 767 // Shows areas before non-areas 768 768 public void visitAll(DataSet data, Boolean virtual) { 769 770 boolean profiler = Main.pref.getBoolean("mappaint.profiler",false); 771 long profilerStart = java.lang.System.currentTimeMillis(); 772 long profilerLast = profilerStart; 773 int profilerN; 774 if(profiler) 775 { 776 System.out.println("Mappaint Profiler"); 777 } 778 769 779 getSettings(virtual); 770 780 untaggedColor = Main.pref.getColor(marktr("untagged"),Color.GRAY); … … 785 795 selectedCall = false; 786 796 797 if(profiler) 798 { 799 System.out.format("Prepare : %4dms\n", (java.lang.System.currentTimeMillis()-profilerLast)); 800 profilerLast = java.lang.System.currentTimeMillis(); 801 } 802 787 803 if (fillAreas && styles.hasAreas()) { 788 804 Collection<Way> noAreaWays = new LinkedList<Way>(); 789 805 806 /*** RELATIONS ***/ 807 profilerN = 0; 790 808 for (final Relation osm : data.relations) 791 809 { 792 810 if(!osm.deleted && !osm.incomplete) 811 { 793 812 osm.visit(this); 794 } 795 813 profilerN++; 814 } 815 } 816 817 if(profiler) 818 { 819 System.out.format("Relations: %4dms, n=%d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 820 profilerLast = java.lang.System.currentTimeMillis(); 821 } 822 823 /*** AREAS ***/ 824 profilerN = 0; 796 825 for (final Way osm : data.ways) 797 826 { … … 799 828 { 800 829 if(styles.isArea((Way)osm) && !alreadyDrawnAreas.contains(osm)) 830 { 801 831 osm.visit(this); 802 else 832 profilerN++; 833 } else 803 834 noAreaWays.add((Way)osm); 804 835 } 805 836 } 806 837 alreadyDrawnAreas = null; 807 838 839 if(profiler) 840 { 841 System.out.format("Areas : %4dms, n=%d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 842 profilerLast = java.lang.System.currentTimeMillis(); 843 } 844 845 /*** WAYS ***/ 846 profilerN = 0; 808 847 fillAreas = false; 809 848 for (final OsmPrimitive osm : noAreaWays) 849 { 810 850 osm.visit(this); 851 profilerN++; 852 } 853 854 if(profiler) 855 { 856 System.out.format("Ways : %4dms, n=%d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 857 profilerLast = java.lang.System.currentTimeMillis(); 858 } 811 859 } 812 860 else 813 861 { 862 /*** WAYS (filling disabled) ***/ 863 profilerN = 0; 814 864 for (final OsmPrimitive osm : data.ways) 815 865 if (!osm.incomplete && !osm.deleted && !osm.selected) 866 { 816 867 osm.visit(this); 817 } 818 868 profilerN++; 869 } 870 871 if(profiler) 872 { 873 System.out.format("Ways : %4dms, n=%d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 874 profilerLast = java.lang.System.currentTimeMillis(); 875 } 876 } 877 878 /*** SELECTED ***/ 819 879 selectedCall = true; 880 profilerN = 0; 820 881 for (final OsmPrimitive osm : data.getSelected()) { 821 882 if (!osm.incomplete && !osm.deleted 822 883 && !(osm instanceof Node) && !alreadyDrawn.contains(osm)) 884 { 823 885 osm.visit(this); 824 } 825 886 profilerN++; 887 } 888 } 889 890 if(profiler) 891 { 892 System.out.format("Selected : %4dms, n=%d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 893 profilerLast = java.lang.System.currentTimeMillis(); 894 } 895 896 /*** DISPLAY CACHED SEGMENTS (WAYS) NOW ***/ 826 897 displaySegments(); 827 898 /*System.out.println("display segments " + (java.lang.System.currentTimeMillis()-profilerLast) + "ms"); 899 profilerLast = java.lang.System.currentTimeMillis();*/ 900 901 /*** NODES ***/ 902 profilerN = 0; 828 903 for (final OsmPrimitive osm : data.nodes) 829 904 if (!osm.incomplete && !osm.deleted && !alreadyDrawn.contains(osm)) 905 { 830 906 osm.visit(this); 907 profilerN++; 908 } 909 910 if(profiler) 911 { 912 System.out.format("Nodes : %4dms, n=%d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 913 profilerLast = java.lang.System.currentTimeMillis(); 914 } 831 915 832 916 alreadyDrawn = null; 833 917 918 /*** VIRTUAL ***/ 834 919 if (virtualNodeSize != 0) 835 920 { 921 profilerN = 0; 836 922 currentColor = nodeColor; 837 923 for (final OsmPrimitive osm : data.ways) 838 924 if (!osm.incomplete && !osm.deleted) 925 { 839 926 visitVirtual((Way)osm); 840 displaySegments(null); 841 } 927 profilerN++; 928 } 929 930 if(profiler) 931 { 932 System.out.format("Virtual : %4dms, n=%d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 933 profilerLast = java.lang.System.currentTimeMillis(); 934 } 935 936 displaySegments(null); 937 /*System.out.println("display segments virtual " + (java.lang.System.currentTimeMillis()-profilerLast) + "ms"); 938 profilerLast = java.lang.System.currentTimeMillis();*/ 939 } 940 941 if(profiler) 942 { 943 System.out.format("All : %4dms\n", (profilerLast-profilerStart)); 944 } 842 945 } 843 946
Note:
See TracChangeset
for help on using the changeset viewer.