[vtk-developers] Adding ComputeArea() to vtkTriangle
Mathieu Malaterre
mathieu.malaterre at gmail.com
Fri Dec 18 10:51:08 EST 2009
Hi David,
I do not have a strong opinion on this particular case.
However here is a couple of thoughts, I have from my modest
understanding of VTK.
1. I would really separate source/sink from filter. You are writing a
partial filter (aka algorithm) in a data object.
2. You are duplicating (possibly) code from vtkMeshQuality.
2cts
-Mathieu
On Fri, Dec 18, 2009 at 2:05 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> Would there be any complaints if I add this function?
> // Description:
> // Compute the area of the triangle.
> double ComputeArea();
> //----------------------------------------------------------------------------
> double vtkTriangle::ComputeArea()
> {
> double p0[3];
> double p1[3];
> double p2[3];
> this->GetPoints()->GetPoint(0, p0);
> this->GetPoints()->GetPoint(1, p1);
> this->GetPoints()->GetPoint(2, p2);
> return vtkTriangle::TriangleArea(p0, p1, p2);
> }
> Thanks,
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>
--
Mathieu
More information about the vtk-developers
mailing list