Add a third redundancy to it :-). vtkDelaunay2D. <br><br>The class also does an in-house computation of the best fitting plane to project the points onto, prior to triangulation. <br><br>The comments from line 1370 of vtkDelaunay2D.cxx even states :<br>
<br>  "This code was taken from the vtkTextureMapToPlane class and slightly modified."<br><br>So if you do plan to contribute this code David, it would be a good idea to factor all these bits out. We don't want 3 nearly same versions lying around<br>
<br>Thanks<br>--<br>karthik<br><br><br><div class="gmail_quote">On Wed, Nov 4, 2009 at 8:08 AM, Will Schroeder <span dir="ltr"><<a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">David-<br><br>Adding new good code is generally not a problem, but we should all endeavor to remove redundant, obsolete or dead code that results from new additions. Over time the debris accumulates and the code becomes harder to manage. We have the tests in place so that you can rework existing classes with the assurance that what you are replacing still works as expected.<br>
<font color="#888888">

<br>Will</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Wed, Nov 4, 2009 at 7:53 AM, David Doria <span dir="ltr"><<a href="mailto:daviddoria%2Bvtk@gmail.com" target="_blank">daviddoria+vtk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div>On Wed, Nov 4, 2009 at 7:32 AM, Will Schroeder<br>
<<a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a>> wrote:<br>
> David-<br>
><br>
> In the class vtkTextureMapToPlane there is some machinery for fitting a<br>
> plane to a set of points. In the interest of not replicating code, can these<br>
> methods be consolidated?<br>
><br>
> Will<br>
<br>
<br>
</div>Sure - I think it makes more sense to have the plane fitting in the<br>
vtkPlane class though - then the TextureMapping class will only have<br>
code relating to texture mapping and these geometric "helper"<br>
functions will be accessible from elsewhere as well.<br>
<br>
A quick look through vtkTextureMapToPlane looks like all it needs is<br>
the normal of the plane. This is ok - we can just compute the best fit<br>
plane and simply not use the origin that is returned.<br>
vtkTextureMapToPlane also seems to have some extra things such as<br>
using the bounding box to compute the normals - I'm not sure how much<br>
of that can/should be replaced by the more general "best fit plane"<br>
function. I am not familiar with this class though so I'm not sure<br>
it's a good idea to start poking around without a good example so I<br>
can be sure the functionality does not change.<br>
<br>
I'm not sure of the standard practices related to code replication -<br>
but to me it seems bad if you rewrite parts of a good general function<br>
in your new class, but it doesn't seem so bad (like in this case) if<br>
you add a good general function and then slowly replace old code to<br>
use it where possible. Is this not a good plan?<br>
<div><div></div><div><br>
Thanks,<br>
<br>
David<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>
</div></div></blockquote></div><br><br clear="all"><br></div></div><div><div></div><div class="h5">-- <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" target="_blank">will.schroeder@kitware.com</a><br>


<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>(518) 881-4902<br>
</div></div><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>
<br></blockquote></div><br><br clear="all"><br>