OGS
VtkCompositeGeoObjectFilter Class Reference

Detailed Description

Highlights a single GeoObject.

Definition at line 23 of file VtkCompositeGeoObjectFilter.h.

#include <VtkCompositeGeoObjectFilter.h>

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

Public Member Functions

 VtkCompositeGeoObjectFilter (vtkAlgorithm *inputAlgorithm)
 
 ~VtkCompositeGeoObjectFilter () override
 
void init () override
 
void SetUserProperty (QString name, QVariant value) override
 Sets user properties.
 
void SetIndex (std::size_t idx)
 
- 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.
 
virtual void SetUserVectorProperty (QString name, QList< QVariant > values)
 Sets a vector user property. This should be implemented by subclasses.
 
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.
 

Private Attributes

GeoLib::GEOTYPE _type
 
vtkThreshold * _threshold
 

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

◆ VtkCompositeGeoObjectFilter()

VtkCompositeGeoObjectFilter::VtkCompositeGeoObjectFilter ( vtkAlgorithm * inputAlgorithm)
explicit

Definition at line 30 of file VtkCompositeGeoObjectFilter.cpp.

32 : VtkCompositeFilter(inputAlgorithm),
34 _threshold(vtkThreshold::New())
35{
36 if (inputAlgorithm->GetNumberOfInputPorts() &&
37 inputAlgorithm->GetNumberOfInputConnections(0))
38 {
39 vtkAlgorithmOutput* ao = inputAlgorithm->GetInputConnection(0, 0);
40
41 if (ao)
42 {
43 vtkAlgorithm* parentAlg = ao->GetProducer();
44
45 if (dynamic_cast<VtkPolylinesSource*>(parentAlg) != nullptr)
46 {
48 }
49 else if (dynamic_cast<VtkSurfacesSource*>(parentAlg) != nullptr)
50 {
52 }
53 else if (dynamic_cast<VtkStationSource*>(parentAlg) != nullptr)
54 {
55 /* TODO
56 if (dynamic_cast<VtkStationSource*>(parentAlg)->getType() ==
57 GeoLib::Station::StationType::BOREHOLE) _type =
58 GeoLib::GEOTYPE::POLYLINE;
59 */
60 }
61 }
62 this->init();
63 }
64}
VtkCompositeFilter(vtkAlgorithm *inputAlgorithm)
Constructor.
VtkPolylinesSource is a VTK source object for the visualisation of polyline data. As a vtkPolyDataAlg...
VTK source object for the visualisation of station data (including boreholes)
VTK source object for the visualisation of surfaces. Technically, surfaces are displayed as triangula...

References _type, init(), GeoLib::POLYLINE, and GeoLib::SURFACE.

◆ ~VtkCompositeGeoObjectFilter()

VtkCompositeGeoObjectFilter::~VtkCompositeGeoObjectFilter ( )
overridedefault

Member Function Documentation

◆ init()

void VtkCompositeGeoObjectFilter::init ( )
overridevirtual

Implements VtkCompositeFilter.

Definition at line 68 of file VtkCompositeGeoObjectFilter.cpp.

69{
70 this->_inputDataObjectType = VTK_POLY_DATA;
71 this->_outputDataObjectType = VTK_POLY_DATA;
72
73 _threshold->SetInputConnection(_inputAlgorithm->GetOutputPort());
74 _threshold->SetSelectedComponent(0);
75 _threshold->SetThresholdFunction(
76 vtkThreshold::ThresholdType::THRESHOLD_BETWEEN);
77 _threshold->SetLowerThreshold(0);
78 _threshold->SetUpperThreshold(0);
79
80 vtkDataSetSurfaceFilter* surface = vtkDataSetSurfaceFilter::New();
81 surface->SetInputConnection(_threshold->GetOutputPort());
82
83 VtkCompositeFilter* composite;
85 {
86 composite = new VtkCompositePointToGlyphFilter(surface);
87 composite->SetUserProperty("Radius", this->GetInitialRadius());
89 }
91 {
92 composite = new VtkCompositeLineToTubeFilter(surface);
93 composite->SetUserProperty("Radius", this->GetInitialRadius());
95 }
96 else
97 {
98 _outputAlgorithm = surface;
99 }
100}
virtual void SetUserProperty(QString name, QVariant value)
Sets a user property. This should be implemented by subclasses.
Is used to combine several filter in one VtkVisPipelineItem. You can use vtk filter and custom filter...
vtkAlgorithm * GetOutputAlgorithm() const
vtkAlgorithm * _outputAlgorithm
double GetInitialRadius() const
Calculates a 1/200th of the largest extension of the bounding box (this is used as default radius for...
vtkAlgorithm * _inputAlgorithm
Converts lines to tube-objects.
Converts point data to scalar-scaled spheres.

References VtkCompositeFilter::_inputAlgorithm, VtkCompositeFilter::_inputDataObjectType, VtkCompositeFilter::_outputAlgorithm, VtkCompositeFilter::_outputDataObjectType, _threshold, _type, VtkCompositeFilter::GetInitialRadius(), VtkCompositeFilter::GetOutputAlgorithm(), GeoLib::POINT, GeoLib::POLYLINE, and VtkAlgorithmProperties::SetUserProperty().

Referenced by VtkCompositeGeoObjectFilter().

◆ SetIndex()

void VtkCompositeGeoObjectFilter::SetIndex ( std::size_t idx)

Definition at line 102 of file VtkCompositeGeoObjectFilter.cpp.

103{
104 double const d_idx = static_cast<double>(idx);
105 _threshold->SetThresholdFunction(
106 vtkThreshold::ThresholdType::THRESHOLD_BETWEEN);
107 _threshold->SetLowerThreshold(d_idx);
108 _threshold->SetUpperThreshold(d_idx);
109}

References _threshold.

◆ SetUserProperty()

void VtkCompositeGeoObjectFilter::SetUserProperty ( QString name,
QVariant value )
inlineoverridevirtual

Sets user properties.

Reimplemented from VtkAlgorithmProperties.

Definition at line 32 of file VtkCompositeGeoObjectFilter.h.

33 {
34 Q_UNUSED(name);
35 Q_UNUSED(value);
36 }

Member Data Documentation

◆ _threshold

vtkThreshold* VtkCompositeGeoObjectFilter::_threshold
private

Definition at line 42 of file VtkCompositeGeoObjectFilter.h.

Referenced by init(), and SetIndex().

◆ _type

GeoLib::GEOTYPE VtkCompositeGeoObjectFilter::_type
private

Definition at line 41 of file VtkCompositeGeoObjectFilter.h.

Referenced by VtkCompositeGeoObjectFilter(), and init().


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