[vtkusers] Lost of PointData and CellData of vtkAppendPolyData object when passing it through another filters
BS
odwbrodwbr at gmail.com
Thu Jun 18 19:01:14 EDT 2009
Hi,
I'm running through a problem which I hope that someone can help me to solve
it.
I've appended many vtkPolyData objects in one vtkAppendPolyData*
append object.
Each vtkPolyData object has PointData and CellData contains scalars with
three components (RGB) for each point and cell.
I can successfully draw append with its PointData and CellData
vtkPolyDataMapper* mapper =mapper->SetInputConnection(append->
GetOutputPort());
vtkActor* actor = vtkActor::New();
actor->SetMapper(mapper);
vtkRenderer* ren = vtkRenderer::New();
ren->AddActor(actor);
vtkRenderWindow* renWin = vtkRenderWindow::New();
renWin->AddRenderer(ren);
renWin->SetSize(300,300);
renWin->Render();
which means that append contains the color data for each point and cell.
I tried to get vtkImageData object from append, so this image will contain
the color components as well.
vtkTransformPolyDataFilter* polyDataTransfer =
vtkTransformPolyDataFilter::New();
polyDataTransfer->SetInputConnection(append->GetOutputPort());
vtkImplicitModeller* implicitModeller = vtkImplicitModeller::New();
implicitModeller->SetMaximumDistance(0.25);
polyDataTransfer->Update();
implicitModeller->SetInputConnection(polyDataTransfer->GetOutputPort());
implicitModeller->Update();
vtkImageData* ima=implicitModeller->GetOutput();
int comp = ima->GetNumberOfScalarComponents();
The problem here is that comp is 1 insted of 3, that means the color
components are not passed through these filters..
Does anyone knowes how can I pass the PointData and CellData of append
through these filters (vtkTransformPolyDataFilter and vtkImplicitModeller)?
(So I'll get a color image which represent the cutting plane through
append).
Waiting for your reply and thanks in advance.
BS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090618/57eb38a7/attachment.htm>
More information about the vtkusers
mailing list