[vtkusers] Picking field data for unstructured points

Joseph_Winston at veritasdgc.com Joseph_Winston at veritasdgc.com
Thu Sep 12 10:46:33 EDT 2002

I have unstructured points, scalars, and field data inside a
vtkPolyData.  A surface is constructed and then displayed by using the
following pipeline:

vtkShepardMethod -> vtkExtractVOI -> vtkGeometryFilter ->
vtkClipPolyData -> vtkWarpScalar -> vtkPolyDataNormals ->
vtkSmoothPolyDataFilter -> vtkCleanPolyData -> vtkTriangleFilter ->
vtkTriangleFilter -> vtkStripper -> vtkDataSetMapper

A vtkPropPicker or a vtkCellPicker is added as an observer on the

In the callback I can see the field data:

   cout << "number of arrays: " << polyData->GetFieldData()
->GetNumberOfArrays() << endl;
   cout << "first array name: " << polyData->GetFieldData()
->GetArrayName(0) << endl;
   cout << "second array name: " << polyData->GetFieldData()
->GetArrayName(1) << endl;

I then construct a vtkFieldDataToAttributeDataFilter, a
vtkDataObjectToDataSetFilter, and a vtkCellLocator.  I do not see how
I am to get the Cell Connectivity for the vtkDataObjectToDataSetFilter.

   vtkFieldDataToAttributeDataFilter *fd2ad =
   fd2ad->SetScalarComponent(0, "Attributes", 0);
   fd2ad->Update();          // Needed???

   vtkDataObjectToDataSetFilter *filter = vtkDataObjectToDataSetFilter::New
   filter->SetCellTypeComponent("Attributes", 0);
//      filter->SetCellConnectivityComponent("???", X);  // how is this
   filter->Update();          // Needed???

   vtkCellLocator *locator = vtkCellLocator::New();

   // ******
   // The "problem" occurs here in BuildLocator since it returns
   // because (numCells = this->DataSet->GetNumberOfCells()) < 1 )
   // ******

   float closestPoint[3];
   vtkIdType cellId = 0;
   int subId = 0;
   float dist2 = 0;

   // ******
   // This call fails since this->NumberOfOctants is not set.
   // ******


Where do I get the Cell Connectivity in my pipeline since I'm starting
with unstructured data?  Or what should I do to pick field data when
I'm starting with unstructured points?


Any  opinions  expressed  in  this  email or its  attachments are those   of the
individual  and not  necessarily  the  Company. The  information  transmitted is
intended only for the person  or entity to which it is addressed and may contain
confidential   and/or   privileged   material.   Any   review,  re-transmission,
dissemination or  other use of, or taking  of any action in  reliance upon, this
information by persons or  entities other than  the intended recipient, without
express  consent from the sender, is prohibited. Internet communications are not
necessarily secure.  No responsibility  is accepted  for changes made after this
information was sent. If you  received this in error, please contact the  sender
and delete the material from any computer.

More information about the vtkusers mailing list