6#include <vtkInformation.h>
7#include <vtkObjectFactory.h>
8#include <vtkPointData.h>
9#include <vtkPointSet.h>
14 this->SetNumberOfInputPorts(2);
15 this->SetNumberOfOutputPorts(1);
19 vtkInformation *info) {
21 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkPointSet");
23 }
else if(port == 1) {
24 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkPointSet");
31 int port, vtkInformation *info) {
41 vtkInformationVector **inputVector,
42 vtkInformationVector *outputVector) {
44 auto inputPointSet = vtkPointSet::GetData(inputVector[0]);
45 auto inputMesh = vtkPointSet::GetData(inputVector[1]);
46 auto outputPointSet = vtkPointSet::GetData(outputVector);
49 if(triangulationToSmooth ==
nullptr) {
55 if(triangulationSurface ==
nullptr) {
60 std::vector<ttk::SimplexId> idSpareStorage{};
63 idSpareStorage, 0,
false);
64 if(vertsId ==
nullptr) {
65 this->
printWrn(
"No vertex scalar field detected on input");
72 outputPointSet->DeepCopy(inputPointSet);
75 auto inputPoints = inputPointSet->GetPoints();
76 auto outputPoints = outputPointSet->GetPoints();
78 const auto hasMask{this->UseMaskScalarField && inputMaskField !=
nullptr};
80 if(triangulationSurface->getType() != triangulationToSmooth->getType()) {
81 this->
printErr(
"Triangulations should have the same type");
88 triangulationToSmooth->getType(),
90 ttkUtils::GetPointer<float>(outputPoints->GetData()),
91 ttkUtils::GetPointer<float>(inputPoints->GetData()),
92 hasMask ? ttkUtils::GetPointer<char>(inputMaskField) :
nullptr, vertsId,
93 this->NumberOfIterations,
94 *
static_cast<TTK_TT *
>(triangulationToSmooth->getData()),
95 *
static_cast<TTK_TT *
>(triangulationSurface->getData())));
#define ttkTemplateMacro(triangulationType, call)
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
static vtkInformationIntegerKey * SAME_DATA_TYPE_AS_INPUT_PORT()
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)
ttk::Triangulation * GetTriangulation(vtkDataSet *dataSet)
vtkDataArray * GetOptionalArray(const bool &enforceArrayIndex, const int &arrayIndex, const std::string &arrayName, vtkDataSet *const inputData, const int &inputPort=0)
TTK VTK-filter for smoothing meshes on surfaces.
int FillOutputPortInformation(int port, vtkInformation *info) override
ttkSurfaceGeometrySmoother()
int FillInputPortInformation(int port, vtkInformation *info) override
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
int printWrn(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
void preconditionTriangulationSurface(AbstractTriangulation *const triangulation)
void preconditionTriangulationToSmooth(AbstractTriangulation *const triangulation)
const char VertexScalarFieldName[]
default name for vertex scalar field
const char MaskScalarFieldName[]
default name for mask scalar field
vtkStandardNewMacro(ttkSurfaceGeometrySmoother)