50 vtkInformationVector **inputVector,
51 vtkInformationVector *outputVector) {
54 auto input = vtkDataSet::GetData(inputVector[0]);
55 auto output = vtkDataSet::GetData(outputVector);
58 return !this->
printErr(
"Unable to retrieve input/output data objects.");
61 output->ShallowCopy(input);
63 size_t const nPoints = output->GetNumberOfPoints();
64 size_t const nEdges = output->GetNumberOfCells();
67 auto sequenceArray = this->GetInputArrayToProcess(0, inputVector);
69 return !this->
printErr(
"Unable to retrieve sequence array.");
71 auto sizeArray = this->GetInputArrayToProcess(1, inputVector);
73 return !this->
printErr(
"Unable to retrieve size array.");
75 auto branchArray = this->GetInputArrayToProcess(2, inputVector);
77 return !this->
printErr(
"Unable to retrieve branch array.");
79 auto levelArray = this->GetInputArrayToProcess(3, inputVector);
81 return !this->
printErr(
"Unable to retrieve level array.");
86 outputArray->SetNumberOfComponents(2);
87 outputArray->SetNumberOfValues(nPoints * 2);
89 vtkDataArray *cells{
nullptr};
90 if(
auto outputAsUG = vtkUnstructuredGrid::SafeDownCast(output))
91 cells = outputAsUG->GetCells()->GetConnectivityArray();
92 else if(
auto outputAsPD = vtkPolyData::SafeDownCast(output))
93 cells = outputAsPD->GetLines()->GetConnectivityArray();
96 return !this->
printErr(
"Unable to retrieve connectivity array.");
102 cells->GetDataType(),
103 (status = this->computeLayout<T0, T1, T2>(
105 ttkUtils::GetPointer<float>(outputArray),
107 ttkUtils::GetPointer<T2>(cells), nPoints, nEdges,
110 this->
GetUseSizes() ? ttkUtils::GetPointer<float>(sizeArray) :
nullptr,
111 this->
GetUseBranches() ? ttkUtils::GetPointer<T1>(branchArray) :
nullptr,
112 this->
GetUseLevels() ? ttkUtils::GetPointer<T1>(levelArray) :
nullptr)));
118 output->GetPointData()->AddArray(outputArray);
125 vtkUnstructuredGrid *treeNodes,
126 vtkUnstructuredGrid *treeArcs,
127 vtkUnstructuredGrid *output) {
128 auto mergeTree = ttk::ftm::makeTree<dataType>(treeNodes, treeArcs);
131 ttk::ftm::computePersistencePairs<dataType>(tree);
133 std::vector<std::vector<int>> treeNodeCorrMesh(1);
136 treeNodeCorrMesh[0][j] = j;
164 vtkInformationVector **inputVector,
165 vtkInformationVector *outputVector) {
167 vtkUnstructuredGrid *treeNodes
168 = vtkUnstructuredGrid::GetData(inputVector[0], 0);
169 vtkUnstructuredGrid *treeArcs
170 = vtkUnstructuredGrid::GetData(inputVector[0], 1);
171 auto output = vtkUnstructuredGrid::GetData(outputVector);
173 return mergeTreePlanarLayoutCallTemplate<float>(treeNodes, treeArcs, output);
177 vtkInformationVector **inputVector,
178 vtkInformationVector *outputVector) {
179 if(not InputIsAMergeTree)