OGS
VtkCompositeFilter.cpp
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// ** INCLUDES **
6
7#include <vtkAlgorithm.h>
8#include <vtkPolyData.h>
9
10#include <QMapIterator>
11#include <QString>
12#include <QVector>
13
14VtkCompositeFilter::VtkCompositeFilter(vtkAlgorithm* inputAlgorithm)
17 _inputAlgorithm(inputAlgorithm),
18 _outputAlgorithm(nullptr)
19{
20}
21
26
28{
29 double bounding_box[6];
30 static_cast<vtkPolyData*>(this->_inputAlgorithm->GetOutputDataObject(0))
31 ->GetBounds(bounding_box);
32 double x_diff = fabs(bounding_box[0] - bounding_box[1]);
33 double y_diff = fabs(bounding_box[2] - bounding_box[3]);
34 double z_diff = fabs(bounding_box[4] - bounding_box[5]);
35
36 double max = (x_diff == 0) ? 1 : x_diff;
37 max = (max > y_diff) ? max : y_diff;
38 max = (max > z_diff) ? max : z_diff;
39
40 return max / 200.0;
41}
vtkAlgorithm * _outputAlgorithm
~VtkCompositeFilter() override
Destructor.
VtkCompositeFilter(vtkAlgorithm *inputAlgorithm)
Constructor.
double GetInitialRadius() const
Calculates a 1/200th of the largest extension of the bounding box (this is used as default radius for...
vtkAlgorithm * _inputAlgorithm