4#include <vtkDataObject.h>
5#include <vtkInformation.h>
6#include <vtkObjectFactory.h>
9#include <vtkUnstructuredGrid.h>
16 this->SetNumberOfInputPorts(1);
17 this->SetNumberOfOutputPorts(1);
21 vtkInformation *info) {
23 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkUnstructuredGrid");
30 vtkInformation *info) {
32 info->Set(vtkDataObject::DATA_TYPE_NAME(),
"vtkUnstructuredGrid");
39 if(this->TriangulationFilePath.length() < 8
40 || this->TriangulationFilePath
41 .substr(this->TriangulationFilePath.length() - 4, 4)
45 "TTK Preconditioned Triangulation file has to end with '.tpt'.");
53 vtkInformationVector **inputVector,
54 vtkInformationVector *outputVector) {
57 auto input = vtkUnstructuredGrid::GetData(inputVector[0]);
58 auto output = vtkUnstructuredGrid::GetData(outputVector, 0);
60 if(input ==
nullptr || output ==
nullptr) {
61 this->
printErr(
"Invalid input dataset");
65 output->ShallowCopy(input);
68 if(triangulation ==
nullptr) {
69 this->
printErr(
"Invalid input triangulation");
79 std::ifstream in(this->TriangulationFilePath);
80 explTri->readFromFile(in);
82 this->
printMsg(
"Restored triangulation from " + this->TriangulationFilePath,
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
ttk::Triangulation * GetTriangulation(vtkDataSet *dataSet)
TTK VTK-filter that reads a TTK Triangulation file.
int FillOutputPortInformation(int port, vtkInformation *info) override
int FillInputPortInformation(int port, vtkInformation *info) override
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
void setDebugMsgPrefix(const std::string &prefix)
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
ExplicitTriangulation is a class that provides time efficient traversal methods on triangulations of ...
vtkStandardNewMacro(ttkTriangulationReader)
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)