[vtkusers] re: question about some visualization

Scott J. Pearson scottjp at CLEMSON.EDU
Tue Aug 16 15:05:44 EDT 2005


I am not aware of any way to display connections between two separate point
sets, without creating a third arrangement.

What I would do is to create a third set of points, as shown by the
following pseudo-code (forgive me for not checking this syntactically):

vtkPoints *points3 = vtkPoints::New();
int size = points1->GetNumberOfPoints(); // == points2->GetNumberOfPoints()
points3->Allocate(size*2);
for (int i=0; i<size; i++)
{
   points3->InsertPoint(i, point1->GetPoint(i));
}
for (int i=0; i<size; i++)
{
   points3->InsertPoint(i + size, point2->GetPoint(i));
}

vtkCellArray *cells = vtkCellArray::New();
for (int i=0; i<size; i++)
{
   cells->InsertNextCell(2);
   cells->InsertCellPoint(i);
   cells->InsertCellPoint(i+size);
}

Then send the cells to an appropriate mapper in the form of lines.

Make sense? I'd advise checking me at each step because I just wrote this
off the top of my head.

Scott 

---
Scott J. Pearson
Systems Programmer, Center for the Advanced Engineering of Fibers and Films
Clemson University     864.656.6389     scottjp at clemson.edu
10 Riggs Hall, Clemson, SC  29634
http://www.clemson.edu/caeff/





More information about the vtkusers mailing list