[vtkusers] Re: surface plot/ wire frame plot
Sergios Goudanis
sergios at mail.ntua.gr
Thu Mar 18 08:25:16 EST 2004
Many people do not like pressing keys "w" or "s" so i disabled
these buttons in my application.
A solution is to have two actors having the same input
one of them with representation to surface and the other
to wireframe.
Sample goes like this:
vtkPolyData *pl = ....
vtkPolyDataMapper *map1 = vtkPolyDataMapper::New()
map1->SetInput(pl);
vtkActor *ac1 = vtkActor::New();
ac1->SetMapper(map1);
vtkPolyDataMapper *map2 = vtkPolyDataMapper::New()
map2->SetInput(pl);
vtkActor *ac2 = vtkActor::New();
ac2->SetMapper(map1);
pl->Delete();
map1->Delete();
map2->Delete();
ac1->GetProperty()->SetRepresentationToSurface();
ac2->GetProperty()->SetRepresentationToWireframe();
....
You may give the solid actor a little bit of transparency and choose two good
colors for the actors.
If you do not have too many cells you can extract geometry
as lines and use a tube filter for these lines instead of
the wireframe actor
More information about the vtkusers
mailing list