[vtkusers] GraphLayoutView and showing EdgePoints

Pablo Hernández pablo.hernandez.cerdan at outlook.com
Mon Sep 21 17:10:05 EDT 2015


Is there any way to show EdgePoints (points attached to each edge) with vtkGraphLayoutView?
I would like to view the edges as a polyLine from initial vertex, follow the EdgePoints and finish in the other vertex (undirectedGraph).

I am using:
    vtkSmartPointer<vtkGraphLayoutView> graphLayoutView =
      vtkSmartPointer<vtkGraphLayoutView>::New();
    graphLayoutView->AddRepresentationFromInput(graph);
    graphLayoutView->SetLayoutStrategy("Pass Through"); 

I have been testing it, and I have only managed to render edges between connected points that were set with graph->SetPoints(). Is there any API to visualize EdgePoints?

vtkGraphToPolyData uses EdgePoints to generate vtkLines, stored at CellData, but then I lose track at vtkRenderedGraphRepresentation (used by GraphLayoutView) .

The internal pipeline of vtkRenderedGraphRepresentation is a bit complex, the related bits are:

  this->GraphToPoly         = vtkSmartPointer<vtkGraphToPolyData>::New();
 // Edge actor
  this->GraphToPoly->SetInputConnection(this->ApplyColors->GetOutputPort());
  this->EdgeMapper->SetInputConnection(this->GraphToPoly->GetOutputPort());
  this->EdgeActor->SetMapper(this->EdgeMapper);

  this->EdgeMapper->SetScalarModeToUseCellFieldData();
  this->EdgeMapper->SelectColorArray("vtkApplyColors color");
  this->EdgeMapper->SetScalarVisibility(true);

Any suggestion? about API, or about the class that requires tweaking.
Thanks a lot,
Pablo


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150921/93a4293c/attachment.html>


More information about the vtkusers mailing list