OGS
VtkCompositeImageToPointCloudFilter Class Reference

Detailed Description

Definition at line 17 of file VtkCompositeImageToPointCloudFilter.h.

#include <VtkCompositeImageToPointCloudFilter.h>

Inheritance diagram for VtkCompositeImageToPointCloudFilter:
[legend]
Collaboration diagram for VtkCompositeImageToPointCloudFilter:
[legend]

Public Member Functions

 VtkCompositeImageToPointCloudFilter (vtkAlgorithm *inputAlgorithm)
 
 ~VtkCompositeImageToPointCloudFilter () override=default
 
void init () override
 
void SetUserProperty (QString name, QVariant value) override
 Sets a user property. This should be implemented by subclasses.
 
void SetUserVectorProperty (QString name, QList< QVariant > values) override
 Sets a vector user property. This should be implemented by subclasses.
 
- Public Member Functions inherited from VtkCompositeFilter
 VtkCompositeFilter (vtkAlgorithm *inputAlgorithm)
 Constructor.
 
 ~VtkCompositeFilter () override
 Destructor.
 
int GetInputDataObjectType () const
 
int GetOutputDataObjectType () const
 
vtkAlgorithm * GetOutputAlgorithm () const
 
- Public Member Functions inherited from VtkAlgorithmProperties
 VtkAlgorithmProperties (QObject *parent=nullptr)
 Constructor (sets default values)
 
 ~VtkAlgorithmProperties () override
 
vtkProperty * GetProperties () const
 Returns the vtk properties.
 
vtkTexture * GetTexture ()
 Returns a texture (if one has been assigned).
 
void SetTexture (vtkTexture *t)
 Sets a texture for the VtkVisPipelineItem.
 
vtkLookupTable * GetLookupTable (const QString &array_name)
 Returns the colour lookup table (if one has been assigned).
 
void RemoveLookupTable (const QString &array_name)
 Removes the lookup table for the given scalar.
 
void SetLookUpTable (const QString &array_name, vtkLookupTable *lut)
 Sets a colour lookup table for the given scalar array of the VtkVisPipelineItem.
 
void SetLookUpTable (const QString &array_name, const QString &filename)
 Loads a predefined color lookup table from a file for the specified scalar array.
 
bool GetScalarVisibility () const
 Returns the scalar visibility.
 
void SetScalarVisibility (bool on)
 Sets the scalar visibility.
 
QString GetName () const
 Returns the name. This is set to the file path if it is a source algorithm.
 
void SetName (QString name)
 Sets the name.
 
bool IsRemovable () const
 Is this algorithm removable from the pipeline (view).
 
QMap< QString, QVariant > * GetAlgorithmUserProperties () const
 Returns a map of user properties.
 
QMap< QString, QList< QVariant > > * GetAlgorithmUserVectorProperties () const
 Returns a map of vector user properties.
 
QVariant GetUserProperty (QString name) const
 Returns the value of a user property.
 
QList< QVariant > GetUserVectorProperty (QString name) const
 Returns a list of values of a vector user property.
 
void SetActiveAttribute (QString name)
 Set the active attribute.
 
QString GetActiveAttribute () const
 Returns the desired active attribute.
 

Additional Inherited Members

- Signals inherited from VtkAlgorithmProperties
void ScalarVisibilityChanged (bool on)
 
- Protected Member Functions inherited from VtkCompositeFilter
double GetInitialRadius () const
 Calculates a 1/200th of the largest extension of the bounding box (this is used as default radius for various filters)
 
- Protected Attributes inherited from VtkCompositeFilter
int _inputDataObjectType
 
int _outputDataObjectType
 
vtkAlgorithm * _inputAlgorithm
 
vtkAlgorithm * _outputAlgorithm
 
- Protected Attributes inherited from VtkAlgorithmProperties
vtkProperty * _property
 
vtkTexture * _texture
 
bool _scalarVisibility
 
std::map< QString, vtkLookupTable * > _lut
 
QString _name
 
QString _activeAttributeName
 
bool _removable
 
QMap< QString, QVariant > * _algorithmUserProperties
 
QMap< QString, QList< QVariant > > * _algorithmUserVectorProperties
 

Constructor & Destructor Documentation

◆ VtkCompositeImageToPointCloudFilter()

VtkCompositeImageToPointCloudFilter::VtkCompositeImageToPointCloudFilter ( vtkAlgorithm * inputAlgorithm)
explicit

Definition at line 22 of file VtkCompositeImageToPointCloudFilter.cpp.

24 : VtkCompositeFilter(inputAlgorithm)
25{
26 init();
27}
VtkCompositeFilter(vtkAlgorithm *inputAlgorithm)
Constructor.

References init().

◆ ~VtkCompositeImageToPointCloudFilter()

VtkCompositeImageToPointCloudFilter::~VtkCompositeImageToPointCloudFilter ( )
overridedefault

Member Function Documentation

◆ init()

void VtkCompositeImageToPointCloudFilter::init ( )
overridevirtual

Implements VtkCompositeFilter.

Definition at line 29 of file VtkCompositeImageToPointCloudFilter.cpp.

30{
31 _inputDataObjectType = VTK_IMAGE_DATA;
32 _outputDataObjectType = VTK_POLY_DATA;
33
34 VtkImageDataToPointCloudFilter* point_cloud_filter =
36 point_cloud_filter->SetInputConnection(_inputAlgorithm->GetOutputPort());
37 _inputAlgorithm->Update();
38
39 QList<QVariant> n_points_range_list;
40 n_points_range_list.push_back(
41 point_cloud_filter->GetMinNumberOfPointsPerCell());
42 n_points_range_list.push_back(
43 point_cloud_filter->GetMaxNumberOfPointsPerCell());
44 (*_algorithmUserVectorProperties)["Number of points range"] =
45 n_points_range_list;
46 QList<QVariant> vertical_extent_list;
47 vertical_extent_list.push_back(point_cloud_filter->GetMinHeight());
48 vertical_extent_list.push_back(point_cloud_filter->GetMaxHeight());
49 (*_algorithmUserVectorProperties)["Vertical extent"] = vertical_extent_list;
50 (*_algorithmUserProperties)["Logarithmic interpolation"] =
51 !point_cloud_filter->GetIsLinear();
52 (*_algorithmUserProperties)["Gamma value"] = point_cloud_filter->GetGamma();
53
54 point_cloud_filter->Update();
55 _outputAlgorithm = point_cloud_filter;
56}
vtkAlgorithm * _outputAlgorithm
vtkAlgorithm * _inputAlgorithm
static VtkImageDataToPointCloudFilter * New()
Create a new objects (required because of VTKs reference counting)

References VtkCompositeFilter::_inputAlgorithm, VtkCompositeFilter::_inputDataObjectType, VtkCompositeFilter::_outputAlgorithm, VtkCompositeFilter::_outputDataObjectType, and VtkImageDataToPointCloudFilter::New().

Referenced by VtkCompositeImageToPointCloudFilter().

◆ SetUserProperty()

void VtkCompositeImageToPointCloudFilter::SetUserProperty ( QString name,
QVariant value )
overridevirtual

Sets a user property. This should be implemented by subclasses.

Reimplemented from VtkAlgorithmProperties.

Definition at line 58 of file VtkCompositeImageToPointCloudFilter.cpp.

60{
62
63 if ((name == "Gamma value") && (value.toDouble() > 0))
64 {
66 ->SetGamma(value.toDouble());
67 }
68 if (name == "Logarithmic interpolation")
69 {
70 if (value.toBool())
71 {
72 double const gamma =
74 .toDouble();
75 if (gamma > 0)
76 {
78 ->useLogarithmicInterpolation(gamma);
79 }
80 }
81 else
82 {
84 ->useLinearInterpolation();
85 }
86 }
87}
QVariant GetUserProperty(QString name) const
Returns the value of a user property.
virtual void SetUserProperty(QString name, QVariant value)
Sets a user property. This should be implemented by subclasses.

References VtkCompositeFilter::_outputAlgorithm, VtkAlgorithmProperties::GetUserProperty(), and VtkAlgorithmProperties::SetUserProperty().

◆ SetUserVectorProperty()

void VtkCompositeImageToPointCloudFilter::SetUserVectorProperty ( QString name,
QList< QVariant > values )
overridevirtual

Sets a vector user property. This should be implemented by subclasses.

Reimplemented from VtkAlgorithmProperties.

Definition at line 89 of file VtkCompositeImageToPointCloudFilter.cpp.

91{
93
94 if (name == "Number of points range")
95 {
96 if (values[0].toInt() >= 0 && values[1].toInt() >= 0 &&
97 values[0].toInt() <= values[1].toInt())
98 {
100 ->SetMinNumberOfPointsPerCell(values[0].toInt());
102 ->SetMaxNumberOfPointsPerCell(values[1].toInt());
103 }
104 }
105 else if (name == "Vertical extent")
106 {
107 if (values[0].toDouble() <= values[1].toDouble())
108 {
110 ->SetMinHeight(values[0].toDouble());
112 ->SetMaxHeight(values[1].toDouble());
113 }
114 }
115}
virtual void SetUserVectorProperty(QString name, QList< QVariant > values)
Sets a vector user property. This should be implemented by subclasses.

References VtkCompositeFilter::_outputAlgorithm, and VtkAlgorithmProperties::SetUserVectorProperty().


The documentation for this class was generated from the following files: