[vtk-developers] BestFitPlane function for vtkPlane

Bill Lorensen bill.lorensen at gmail.com
Tue Nov 10 19:41:02 EST 2009


I think it's static so that you can use it in your code without having
to create a vtkPlane.

It is used in that form in several places:
 find . -exec grep vtkPlane::ProjectPoint /dev/null {} \;
./Filtering/vtkPolygon.cxx:  vtkPlane::ProjectPoint(x,p0,n,cp);
./Filtering/vtkPixel.cxx:  vtkPlane::ProjectPoint(x,pt1,n,cp);
./Filtering/vtkImplicitSelectionLoop.cxx:    vtkPlane::ProjectPoint(x,
this->Origin, this->Normal, xProj);
./Filtering/vtkImplicitSelectionLoop.cxx:  vtkPlane::ProjectPoint(x,
this->Origin, this->Normal, xProj);
./Filtering/vtkQuad.cxx:  vtkPlane::ProjectPoint(x,pt1,n,cp);
./Common/vtkPlane.cxx:void vtkPlane::ProjectPoint(double x[3], double
origin[3],
./Hybrid/vtkArcPlotter.cxx:      vtkPlane::ProjectPoint(x, point,
normal, xProj);
./Widgets/vtkImplicitPlaneRepresentation.cxx:
vtkPlane::ProjectPoint(newOrigin,o,n,newOrigin);
./Widgets/vtkBoundedPlanePointPlacer.cxx:  vtkPlane::ProjectPoint(
pos, minPlane->GetOrigin(),
./Widgets/vtkClosedSurfacePointPlacer.cxx:  vtkPlane::ProjectPoint(
pos, minPlane->GetOrigin(),
./Widgets/vtkImplicitPlaneWidget.cxx:
vtkPlane::ProjectPoint(newOrigin,o,n,newOrigin);


On Tue, Nov 10, 2009 at 5:15 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> On Wed, Nov 4, 2009 at 2:21 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
>> On Wed, Nov 4, 2009 at 12:20 PM, Karthik Krishnan
>> <karthik.krishnan at kitware.com> wrote:
>>> Thanks
>>
>>
>> These tests failed before my changes and after:
>> The following tests FAILED:
>>         93 - SurfacePlusEdges (Failed)
>>        105 - TestLabelPlacementMapper (SEGFAULT)
>>
>> but everything else passes with the changes. Here are the files:
>> http://www.rpi.edu/~doriad/VTK_List/vtkPlane/
>>
>> I wasn't sure how to get a vtkPoints from a vtkDataSet, so I did this:
>>
>> void vtkTextureMapToPlane::ComputeNormal(vtkDataSet *input)
>> {
>>  vtkSmartPointer<vtkPoints> Points = vtkSmartPointer<vtkPoints>::New();
>>  for(unsigned int i = 0; i < input->GetNumberOfPoints(); i++)
>>    {
>>    double p[3];
>>    input->GetPoint(i, p);
>>    Points->InsertNextPoint(p);
>>    }
>>
>> which surely can be replaced.
>>
>> Thoughts?
>>
>> Thanks,
>>
>> David
>>
>
> Any other comments? What else needs to be done before this can be committed?
>
> Also, what is the reason for the static functions, e.g.
> static void ProjectPoint(double x[3], double origin[3], double normal[3])
>
> Wouldn't it be easier to do
> MyPlane->ProjectPoint(x[3])
>
> instead of
>
> double n[3];
> MyPlane->GetNormal(n);
> double o[3];
> MyPlane->GetOrigin(o);
> vtkPlane::ProjectPoint(x[3], o[3], n[3])
>
> 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
>
>



More information about the vtk-developers mailing list