+1<br><br><div class="gmail_quote">On Fri, Aug 31, 2012 at 5:14 AM, Andrew Maclean <span dir="ltr"><<a href="mailto:andrew.amaclean@gmail.com" target="_blank">andrew.amaclean@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi Nikhil, Berk,<br>
I was able to easily rewrite contour2D.tcl and contour3D.tcl to<br>
Python, however in doing this I have a question.<br>
<br>
With respect to contour3D.tcl it uses colour names to specify the<br>
colours. In converting I have used the existing file colors.py.<br>
However this means that you pollute the Python functions with a large<br>
number of variables defined e.g as:<br>
antique_white = (0.9804, 0.9216, 0.8431)<br>
<br>
To me this can be more simply done as a dictionary in Python.<br>
<br>
However in considering this approach a second thought has occurred to<br>
me in that it would be nice to have in VTK 6 a class of colors and<br>
their names.<br>
What do people think of creating a class called say vtkNamedColors<br>
where the underlying structure would be a std::map<std::string,<br>
std::vector> with this map prefilled with the colours defined in<br>
colors.py or colors.tcl?<br>
There would be only two functions e.g GetColor(std::string) returning<br>
a std::vector and SetColor(std::string, std::vector) - this function<br>
would allow the user to add new colours.<br>
<br>
Hopefully this would be wrapped and easy to use in Python etc. thus<br>
removing the need for colors.py.<br>
<br>
Regards<br>
<span class="HOEnZb"><font color="#888888">   Andrew<br>
<br>
--<br>
___________________________________________<br>
Andrew J. P. Maclean<br>
<br>
___________________________________________<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>William J. Schroeder, PhD<br>Kitware, Inc.<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a><br>

<a href="http://www.kitware.com">http://www.kitware.com</a><br>(518) 881-4902<br>