[vtkusers] What the array contains in this case?

B. C. butterfly.1688 at yahoo.fr
Tue Oct 28 13:07:17 EDT 2008


Thank you David for your help.
Can you make me a favour and tell me what does 'Mean_Curvature' means in this line?
vtkDoubleArray *myArray = newPolyData->GetPointData()->GetArray("Mean_Curvature");
 
- 'myArray' in this case, what does it contain exactly? the mean curvatures?
- If i want to store the maximum curvatures of the points, should i do? 



--- En date de : Mar 28.10.08, David E DeMarle <dave.demarle at kitware.com> a écrit :

De: David E DeMarle <dave.demarle at kitware.com>
Objet: Re: [vtkusers] What the array contains in this case?
À: butterfly.1688 at yahoo.fr
Cc: vtkusers at vtk.org
Date: Mardi 28 Octobre 2008, 12h44

On Tue, Oct 28, 2008 at 7:47 AM, B. C. <butterfly.1688 at 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



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081028/c7d3acdf/attachment.htm>


More information about the vtkusers mailing list