[vtkusers] vtkAssembly, vtkPropAssembly

Nathanaël G. nathanael.geng at etudes-ng.net
Fri Apr 4 05:15:40 EDT 2014


I want display a combination of vtkPolyData. Some of theses
are vtkCellArray and some other are vtkPolyLine.
As I want individual selection I create a mapper and an actor by
vtkPolyData, example for vtkPolyLine:
// Create a cell array to store the lines in and add the lines
    vtkSmartPointer<vtkCellArray> edgeCellData;
    edgeCellData = vtkSmartPointer<vtkCellArray>::New();
    edgeCellData->InsertNextCell(polyLine);

    // Create a polydata to store everything in
    vtkSmartPointer<vtkPolyData> edgePolyData;
    edgePolyData = vtkSmartPointer<vtkPolyData>::New();
    edgePolyData->SetPoints(edgePts);
    edgePolyData->SetLines(edgeCellData);

    // Setup actor and mapper
    vtkSmartPointer<vtkPolyDataMapper> edgeMapper;
    edgeMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
    edgeMapper->SetInput(edgePolyData);
    edgeMapper->ScalarVisibilityOff();
    edgeMapper->Update();

    vtkSmartPointer<vtkActor> edgeActor;
    edgeActor = vtkSmartPointer<vtkActor>::New();
    edgeActor->SetMapper(edgeMapper);
    edgeActor->SetPickable(true);
    edgeActor->GetProperty()->SetColor(1.0, 1.0, 1.0);
    edgeActor->Modified();

For coincident topology I use:
vtkPolyDataMapper::SetResolveCoincidentTopologyToPolygonOffset().


If I use vtkAssembly coincident topology are correctly handled but the
render time is long.
If I use vtkPropAssembly coincident topology is not correctly handled (edge
and poly overlap) but render time is good.

My question is how to manage the display of
multiple vtkCellArray and vtkPolyLine, with individual selection capability
and coincident topology display management?

Thanks in advance for the help.

 Nathanaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140404/f8d4e453/attachment.html>


More information about the vtkusers mailing list