6#include <vtkDataArray.h>
7#include <vtkExecutive.h>
8#include <vtkImageData.h>
9#include <vtkInformation.h>
10#include <vtkObjectFactory.h>
11#include <vtkPointData.h>
12#include <vtkUnstructuredGrid.h>
17 this->SetNumberOfInputPorts(1);
22 vtkInformation *info) {
24 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkDataSet");
32 std::ofstream f(
Filename, std::ios::out | std::ios::binary);
48 const auto dataset = vtkDataSet::SafeDownCast(this->
GetInput());
49 if(dataset ==
nullptr) {
53 if(!dataset->IsA(
"vtkUnstructuredGrid")) {
54 this->
printErr(
"This filter only works on Explicit Triangulations");
58 if(triangulation ==
nullptr) {
59 this->
printErr(
"Invalid triangulation");
64 triangulation->preconditionEdges();
65 if(triangulation->getDimensionality() > 2) {
66 triangulation->preconditionTriangles();
80 explTri->writeToFile(this->
Stream);
85 tm.getElapsedTime(), 1);
92 if(this->GetNumberOfInputConnections(0) < 1) {
95 return this->GetExecutive()->GetInputData(0, 0);
100 this->SetInputDataInternal(0, input);
ttk::Triangulation * GetTriangulation(vtkDataSet *dataSet)
ttkTriangulationWriter - Explicit Triangulation Writer
vtkDataObject * GetInput()
void SetInputData(vtkDataObject *input)
int FillInputPortInformation(int port, vtkInformation *info) override
void setDebugMsgPrefix(const std::string &prefix)
virtual int setDebugLevel(const int &debugLevel)
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 ...
int writeToFileASCII(std::ofstream &stream) const
Write internal state to disk using an ASCII format.
vtkStandardNewMacro(ttkTriangulationWriter)
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)