46 vtkInformationVector **inputVector,
47 vtkInformationVector *outputVector) {
51 if(this->Method == 0) {
53 }
else if(this->Method == 1) {
55 }
else if(this->Method == 2) {
59 const auto domain = vtkDataSet::GetData(inputVector[0]);
60 const auto constraints = vtkUnstructuredGrid::GetData(inputVector[1]);
61 if(!domain || !constraints)
62 return !this->
printErr(
"Unable to retrieve required input data objects.");
64 auto output = vtkDataSet::GetData(outputVector);
70 this->
printErr(
"Input triangulation pointer is NULL.");
76 if(triangulation->isEmpty()) {
77 this->
printErr(
"Triangulation allocation problem.");
82 this->
printErr(
"Input pointer is NULL.");
86 const auto numberOfVertices = domain->GetNumberOfPoints();
87 if(numberOfVertices <= 0) {
88 this->
printErr(
"Domain has no points.");
93 const auto inputScalars = this->GetInputArrayToProcess(0, domain);
95 this->
printErr(
"Input scalar field pointer is null.");
101 domain, 0, triangulation,
false, 2, ForceInputOffsetScalarField);
103 this->
printErr(
"Wrong input offset scalar field.");
115 outputScalars->DeepCopy(inputScalars);
118 outputOrder->DeepCopy(inputOrder);
121 int const numberOfConstraints = constraints->GetNumberOfPoints();
123 std::vector<ttk::SimplexId> idSpareStorage{};
126 constraints, idSpareStorage);
129 switch(inputScalars->GetDataType()) {
130 vtkTemplateMacro(ret = this->
execute(
131 ttkUtils::GetPointer<VTK_TT>(inputScalars),
132 ttkUtils::GetPointer<VTK_TT>(outputScalars), identifiers,
133 ttkUtils::GetPointer<SimplexId>(inputOrder),
134 ttkUtils::GetPointer<SimplexId>(outputOrder),
135 numberOfConstraints, this->AddPerturbation,
136 *triangulation->getData(), constraintDiagram));
141 this->
printErr(
"TopologicalSimplification.execute() error code: "
142 + std::to_string(ret));
146 output->ShallowCopy(domain);
147 output->GetPointData()->AddArray(outputOrder);
148 output->GetPointData()->AddArray(outputScalars);
ttk::SimplexId * GetIdentifierArrayPtr(const bool &enforceArrayIndex, const int &arrayIndex, const std::string &arrayName, vtkDataSet *const inputData, std::vector< ttk::SimplexId > &spareStorage, const int inputPort=0, const bool printErr=true)
vtkDataArray * GetOrderArray(vtkDataSet *const inputData, const int scalarArrayIdx, ttk::Triangulation *triangulation, const bool getGlobalOrder=false, const int orderArrayIdx=0, const bool enforceOrderArrayIdx=false)
int execute(const dataType *const inputScalars, dataType *const outputScalars, const SimplexId *const identifiers, const SimplexId *const inputOffsets, SimplexId *const offsets, const SimplexId constraintNumber, const bool addPerturbation, triangulationType &triangulation, const ttk::DiagramType &constraintDiagram={})
int VTUToDiagram(ttk::DiagramType &diagram, vtkUnstructuredGrid *vtu, const ttk::Debug &dbg)
Converts a Persistence Diagram in the VTK Unstructured Grid format (as generated by the ttkPersistenc...