<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Thank you David for your help.</DIV>
<DIV>Can you make me a favour and tell me what does 'Mean_Curvature' means in this line?</DIV>
<DIV>vtkDoubleArray *myArray = newPolyData->GetPointData()->GetArray("Mean_Curvature");</DIV>
<DIV> </DIV>
<DIV>- 'myArray' in this case, what does it contain exactly? the mean curvatures?</DIV>
<DIV>- If i want to store the maximum curvatures of the points, should i do? </DIV>
<DIV><BR><BR><BR>--- En date de : <B>Mar 28.10.08, David E DeMarle <I><dave.demarle@kitware.com></I></B> a écrit :<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">De: David E DeMarle <dave.demarle@kitware.com><BR>Objet: Re: [vtkusers] What the array contains in this case?<BR>À: butterfly.1688@yahoo.fr<BR>Cc: vtkusers@vtk.org<BR>Date: Mardi 28 Octobre 2008, 12h44<BR><BR><PRE>On Tue, Oct 28, 2008 at 7:47 AM, B. C. <butterfly.1688@yahoo.fr> wrote:
> Hi everyone,
> Please, i need help.
> I have a polydata, i used vtkCurvatures to compute the maximum curavtures.
I
> did this:
> vtkCurvatures *curve = vtkCurvatures::New();
> curve->SetInput(myPolyData);
> curve->SetCurvatureTypeToMaximum();
>
You need to call:
curve->Update();
here, to tell the filter to go ahead and run.
> vtkPolyData *newPolyData = vtkPolyData::New();
You don't have to create a new poly data structure above.
Instead, the above line can be:
vtkPolyData *newPolyData;
since you are setting the pointer below to something else.
> newPolyData = curve->GetOutput();
>
> Then, i used a double aray to store the values of the curvatures and i did
> this:
> vtkDoubleArray *myArray =
> vtkDoubleArray::SafeDownCast(objetRes->GetPoints());
>
objectRes should be newPolyData above. And you are getting the spatial
coordinates, not the data values. Instead you need call:
vtkDoubleArray *myArray =
newPolyData->GetPointData()->GetArray("Mean_Curvature");
The difference is that you are getting a point associated array call
Mean_Curvature.
> To access to the curves values stored in the array, i used this:
> double curveValue;
> vtkIdType nPoints = myArray->GetNumberOfTuples();
> for (vtkIdType i=0; i<nPoints; i++)
> curveValue = myArray->GetValue(i);
>
> Can you tell me if what i did is right?
> - 'newPolyData' is it 'myPolyData' with maximum
curvatures?
> - What the array 'myArray' really contanis?
> - To access to the curev values, is is right to use the finction
> 'GetValue(i)'?
>
> Thank you
>
>
Read the VTK Users guide chapter 11 to learn the layout of vtk's data
structures. Also, pease read some of the Examples that come with code
to get a feel for how to use and manipulate filters and finally read
the vtkCurvatures.cxx class to see exactly what it does.
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
cheers,
--
David E DeMarle
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x109
</PRE></BLOCKQUOTE></td></tr></table><br>