Changeset 3371 for trunk/gui/scripts/vtkstreamlinesviewer.tcl
- Timestamp:
- Feb 27, 2013, 7:45:07 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkstreamlinesviewer.tcl
r3330 r3371 108 108 private method SetColormap { dataobj comp } 109 109 private method ChangeColormap { dataobj comp color } 110 private method ColorsToColormap { color }111 110 private method SetLegendTip { x y } 112 111 private method SetObjectStyle { dataobj comp } … … 1670 1669 } 1671 1670 1672 itcl::body Rappture::VtkStreamlinesViewer::ColorsToColormap { colors } {1673 switch -- $colors {1674 "grey-to-blue" {1675 return {1676 0.0 0.200 0.200 0.2001677 0.14285714285714285 0.400 0.400 0.4001678 0.2857142857142857 0.600 0.600 0.6001679 0.42857142857142855 0.900 0.900 0.9001680 0.5714285714285714 0.800 1.000 1.0001681 0.7142857142857143 0.600 1.000 1.0001682 0.8571428571428571 0.400 0.900 1.0001683 1.0 0.000 0.600 0.8001684 }1685 }1686 "blue-to-grey" {1687 return {1688 0.0 0.000 0.600 0.8001689 0.14285714285714285 0.400 0.900 1.0001690 0.2857142857142857 0.600 1.000 1.0001691 0.42857142857142855 0.800 1.000 1.0001692 0.5714285714285714 0.900 0.900 0.9001693 0.7142857142857143 0.600 0.600 0.6001694 0.8571428571428571 0.400 0.400 0.4001695 1.0 0.200 0.200 0.2001696 }1697 }1698 "blue" {1699 return {1700 0.0 0.900 1.000 1.0001701 0.1111111111111111 0.800 0.983 1.0001702 0.2222222222222222 0.700 0.950 1.0001703 0.3333333333333333 0.600 0.900 1.0001704 0.4444444444444444 0.500 0.833 1.0001705 0.5555555555555556 0.400 0.750 1.0001706 0.6666666666666666 0.300 0.650 1.0001707 0.7777777777777778 0.200 0.533 1.0001708 0.8888888888888888 0.100 0.400 1.0001709 1.0 0.000 0.250 1.0001710 }1711 }1712 "brown-to-blue" {1713 return {1714 0.0 0.200 0.100 0.0001715 0.09090909090909091 0.400 0.187 0.0001716 0.18181818181818182 0.600 0.379 0.2101717 0.2727272727272727 0.800 0.608 0.4801718 0.36363636363636365 0.850 0.688 0.5951719 0.45454545454545453 0.950 0.855 0.8081720 0.5454545454545454 0.800 0.993 1.0001721 0.6363636363636364 0.600 0.973 1.0001722 0.7272727272727273 0.400 0.940 1.0001723 0.8181818181818182 0.200 0.893 1.0001724 0.9090909090909091 0.000 0.667 0.8001725 1.0 0.000 0.480 0.6001726 }1727 }1728 "blue-to-brown" {1729 return {1730 0.0 0.000 0.480 0.6001731 0.09090909090909091 0.000 0.667 0.8001732 0.18181818181818182 0.200 0.893 1.0001733 0.2727272727272727 0.400 0.940 1.0001734 0.36363636363636365 0.600 0.973 1.0001735 0.45454545454545453 0.800 0.993 1.0001736 0.5454545454545454 0.950 0.855 0.8081737 0.6363636363636364 0.850 0.688 0.5951738 0.7272727272727273 0.800 0.608 0.4801739 0.8181818181818182 0.600 0.379 0.2101740 0.9090909090909091 0.400 0.187 0.0001741 1.0 0.200 0.100 0.0001742 }1743 }1744 "blue-to-orange" {1745 return {1746 0.0 0.000 0.167 1.0001747 0.09090909090909091 0.100 0.400 1.0001748 0.18181818181818182 0.200 0.600 1.0001749 0.2727272727272727 0.400 0.800 1.0001750 0.36363636363636365 0.600 0.933 1.0001751 0.45454545454545453 0.800 1.000 1.0001752 0.5454545454545454 1.000 1.000 0.8001753 0.6363636363636364 1.000 0.933 0.6001754 0.7272727272727273 1.000 0.800 0.4001755 0.8181818181818182 1.000 0.600 0.2001756 0.9090909090909091 1.000 0.400 0.1001757 1.0 1.000 0.167 0.0001758 }1759 }1760 "orange-to-blue" {1761 return {1762 0.0 1.000 0.167 0.0001763 0.09090909090909091 1.000 0.400 0.1001764 0.18181818181818182 1.000 0.600 0.2001765 0.2727272727272727 1.000 0.800 0.4001766 0.36363636363636365 1.000 0.933 0.6001767 0.45454545454545453 1.000 1.000 0.8001768 0.5454545454545454 0.800 1.000 1.0001769 0.6363636363636364 0.600 0.933 1.0001770 0.7272727272727273 0.400 0.800 1.0001771 0.8181818181818182 0.200 0.600 1.0001772 0.9090909090909091 0.100 0.400 1.0001773 1.0 0.000 0.167 1.0001774 }1775 }1776 "rainbow" {1777 set clist {1778 "#EE82EE"1779 "#4B0082"1780 "blue"1781 "#008000"1782 "yellow"1783 "#FFA500"1784 "red"1785 }1786 }1787 "BGYOR" {1788 set clist {1789 "blue"1790 "#008000"1791 "yellow"1792 "#FFA500"1793 "red"1794 }1795 }1796 "ROYGB" {1797 set clist {1798 "red"1799 "#FFA500"1800 "yellow"1801 "#008000"1802 "blue"1803 }1804 }1805 "RYGCB" {1806 set clist {1807 "red"1808 "yellow"1809 "green"1810 "cyan"1811 "blue"1812 }1813 }1814 "BCGYR" {1815 set clist {1816 "blue"1817 "cyan"1818 "green"1819 "yellow"1820 "red"1821 }1822 }1823 "spectral" {1824 return {1825 0.0 0.150 0.300 1.0001826 0.1 0.250 0.630 1.0001827 0.2 0.450 0.850 1.0001828 0.3 0.670 0.970 1.0001829 0.4 0.880 1.000 1.0001830 0.5 1.000 1.000 0.7501831 0.6 1.000 0.880 0.6001832 0.7 1.000 0.680 0.4501833 0.8 0.970 0.430 0.3701834 0.9 0.850 0.150 0.1961835 1.0 0.650 0.000 0.1301836 }1837 }1838 "green-to-magenta" {1839 return {1840 0.0 0.000 0.316 0.0001841 0.06666666666666667 0.000 0.526 0.0001842 0.13333333333333333 0.000 0.737 0.0001843 0.2 0.000 0.947 0.0001844 0.26666666666666666 0.316 1.000 0.3161845 0.3333333333333333 0.526 1.000 0.5261846 0.4 0.737 1.000 0.7371847 0.4666666666666667 1.000 1.000 1.0001848 0.5333333333333333 1.000 0.947 1.0001849 0.6 1.000 0.737 1.0001850 0.6666666666666666 1.000 0.526 1.0001851 0.7333333333333333 1.000 0.316 1.0001852 0.8 0.947 0.000 0.9471853 0.8666666666666667 0.737 0.000 0.7371854 0.9333333333333333 0.526 0.000 0.5261855 1.0 0.316 0.000 0.3161856 }1857 }1858 "greyscale" {1859 return {1860 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.01861 }1862 }1863 "nanohub" {1864 set clist "white yellow green cyan blue magenta"1865 }1866 default {1867 set clist $colors1868 }1869 }1870 set cmap {}1871 for {set i 0} {$i < [llength $clist]} {incr i} {1872 set x [expr {double($i)/([llength $clist]-1)}]1873 set color [lindex $clist $i]1874 append cmap "$x [Color2RGB $color] "1875 }1876 return $cmap1877 }1878 1671 1879 1672 #
Note: See TracChangeset
for help on using the changeset viewer.