OGS
VtkAppendArrayFilter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6// ** INCLUDES **
8
9#include <vtkUnstructuredGridAlgorithm.h>
10
11#include <vector>
12
15class VtkAppendArrayFilter : public vtkUnstructuredGridAlgorithm, public VtkAlgorithmProperties
16{
17public:
20
21 vtkTypeMacro(VtkAppendArrayFilter, vtkUnstructuredGridAlgorithm);
22
24 void PrintSelf(ostream& os, vtkIndent indent) override;
25
27 void SetUserProperty(QString name, QVariant value) override
28 {
29 Q_UNUSED(name);
30 Q_UNUSED(value);
31 }
32
33 void SetArray(const std::string& array_name,
34 const std::vector<double>& new_array);
35
36protected:
39
41 int RequestData(vtkInformation* request,
42 vtkInformationVector** inputVector,
43 vtkInformationVector* outputVector) override;
44
45private:
46 std::vector<double> _array;
47 std::string _array_name;
48};
VtkAlgorithmProperties(QObject *parent=nullptr)
Constructor (sets default values)
static VtkAppendArrayFilter * New()
Create new objects with New() because of VTKs object reference counting.
std::vector< double > _array
void SetArray(const std::string &array_name, const std::vector< double > &new_array)
vtkTypeMacro(VtkAppendArrayFilter, vtkUnstructuredGridAlgorithm)
void SetUserProperty(QString name, QVariant value) override
Sets user properties.
~VtkAppendArrayFilter() override
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
The filter logic.
void PrintSelf(ostream &os, vtkIndent indent) override
Prints the mesh data to an output stream.