| 537 | } |
| 538 | |
| 539 | int vtkBoostDividedEdgeBundling::RequestData(vtkInformation* vtkNotUsed(request), |
| 540 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 541 | { |
| 542 | // get the info objects |
| 543 | vtkInformation* graphInfo = inputVector[0]->GetInformationObject(0); |
| 544 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 545 | |
| 546 | // get the input and output |
| 547 | vtkDirectedGraph* g = |
| 548 | vtkDirectedGraph::SafeDownCast(graphInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 549 | vtkDirectedGraph* output = |
| 550 | vtkDirectedGraph::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 551 | |
| 552 | vtkBundlingMetadata* meta = new vtkBundlingMetadata(this, g); |
| 553 | |
| 554 | meta->NormalizeNodePositions(); |
| 555 | meta->CalculateEdgeLengths(); |
| 556 | meta->CalculateNodeDistances(); |
| 557 | meta->CalculateEdgeCompatibilities(); |
| 558 | meta->LayoutEdgePoints(); |
| 559 | meta->DenormalizeNodePositions(); |
| 560 | |
| 561 | output->ShallowCopy(g); |
| 562 | |
| 563 | for (vtkIdType e = 0; e < g->GetNumberOfEdges(); ++e) |
| 564 | { |
| 565 | output->ClearEdgePoints(e); |
| 566 | for (int m = 1; m < meta->MeshCount - 1; ++m) |
| 567 | { |
| 568 | vtkVector3f edgePoint = meta->EdgeMesh[e][m]; |
| 569 | output->AddEdgePoint(e, edgePoint[0], edgePoint[1], edgePoint[2]); |
| 570 | } |
| 571 | } |
| 572 | |
| 573 | delete meta; |
| 574 | |
| 575 | return 1; |
| 576 | } |
| 577 | |
| 578 | void vtkBoostDividedEdgeBundling::PrintSelf(ostream& os, vtkIndent indent) |
| 579 | { |
nothing calls this directly
no test coverage detected