[vtkusers] vtkPoints from a triangular vtkPolyData

Tim Hutton T.Hutton at eastman.ucl.ac.uk
Thu Aug 14 08:58:06 EDT 2003


imho,

CopyStructure copies pointers to: Verts, Lines, Polys, Strips, and Points 
(via vtkPointSet)

DeepCopy copies the structures themselves, not just the pointers.

Looking at vtkPointSet::CopyStructure it seems that the points are not 
Register()'d (unless this happens somewhere hidden in vtkSetGet.h), so if 
the filter is since Delete()'d then the points will no longer be valid.

I suggest trying DeepCopy if you can live with the performance and memory hit.

Or make sure the filter is Update()'d before calling CopyStructure. (possibly)

Tim.


At 14:47 14/08/2003 +0200, imho wrote:
>Hi Tim,
>the polydatas here are from a call to CopyStructure from a polydata who is 
>the output of a filter, but updated.
>Can it be the problem?
>
>Thanks
>
>imho
>
>
>Tim Hutton wrote:
>
>>Hi imho,
>>
>>If your polydata is the output of a filter (like vtkTriangleFilter) then 
>>you will need to call Update on it in order to use its output, else 
>>GetNumberOfPoints will return zero and GetPoint won't work.
>>
>>If you've made your own polydata then there must be something wrong with 
>>how the points were assigned. Perhaps if you send us your code for that 
>>bit we might be able to help.
>>
>>Also worth checking that the in and out points are different...
>>
>>Tim
>>
>>At 14:32 14/08/2003 +0200, imho wrote:
>>
>>>Hi all,
>>>I'd like to use the vtkThinPlateSplineTransform, who needs vtkPoints 
>>>structures.
>>>I've tried poly->getPoints()  but it was empty, so here's what I've done:
>>>models are vtkPolyData
>>>TPSTarget and Origine  vtkPoints
>>>
>>>        n1 = modelTarget->GetNumberOfPoints();
>>>        n2 = modelToMove->GetNumberOfPoints();
>>>        if (n1 < n2)
>>>            n=n1;
>>>        else
>>>            n=n2;
>>>
>>>        for (i=0; i<n; i++)
>>>        {
>>>            modelTarget->GetPoint(i,point);
>>>            TPSTarget->InsertNextPoint(point);
>>>        }
>>>
>>>
>>>        for (i=0; i<n; i++)
>>>        {
>>>            modelToMove->GetPoint(i,point);
>>>            TPSOrigine->InsertNextPoint(point);
>>>        }
>>>
>>>
>>>        TPSTr->SetSourceLandmarks(TPSOrigine);
>>>        TPSTr->SetTargetLandmarks(TPSTarget);
>>>
>>>and then :
>>>    tf3 = vtkTransformPolyDataFilter::New();
>>>
>>>    tf3->SetTransform(TPSTr);
>>>    tf3->SetInput(poly);
>>>    tf3->Update();
>>>
>>>    return (tf3->GetOutput());
>>>
>>>but it does nothing, my poly is the same on input and output., for the 
>>>same reason before I guess.
>>>What can I try to have points from my polyData?
>>>
>>>Thanks
>>>
>>>
>>>
>>>_______________________________________________
>>>This is the private VTK discussion list. Please keep messages on-topic. 
>>>Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>>>Follow this link to subscribe/unsubscribe:
>>>http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
>





More information about the vtkusers mailing list