OGS
VtkCompositeFilter.cpp
Go to the documentation of this file.
1
15// ** INCLUDES **
16#include "VtkCompositeFilter.h"
17
18#include <vtkAlgorithm.h>
19#include <vtkPolyData.h>
20
21#include <QMapIterator>
22#include <QString>
23#include <QVector>
24
25VtkCompositeFilter::VtkCompositeFilter(vtkAlgorithm* inputAlgorithm)
26 : _inputDataObjectType(0),
27 _outputDataObjectType(1),
28 _inputAlgorithm(inputAlgorithm),
29 _outputAlgorithm(nullptr)
30{
31}
32
37
39{
40 double bounding_box[6];
41 static_cast<vtkPolyData*>(this->_inputAlgorithm->GetOutputDataObject(0))
42 ->GetBounds(bounding_box);
43 double x_diff = fabs(bounding_box[0] - bounding_box[1]);
44 double y_diff = fabs(bounding_box[2] - bounding_box[3]);
45 double z_diff = fabs(bounding_box[4] - bounding_box[5]);
46
47 double max = (x_diff == 0) ? 1 : x_diff;
48 max = (max > y_diff) ? max : y_diff;
49 max = (max > z_diff) ? max : z_diff;
50
51 return max / 200.0;
52}
Definition of the VtkCompositeFilter class.
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