OGS
VtkCompositeNodeSelectionFilter Class Reference

Detailed Description

This filter displays the points/nodes given in the index field as spheres.

Definition at line 23 of file VtkCompositeNodeSelectionFilter.h.

#include <VtkCompositeNodeSelectionFilter.h>

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

Public Member Functions

 VtkCompositeNodeSelectionFilter (vtkAlgorithm *inputAlgorithm)
 
 ~VtkCompositeNodeSelectionFilter () override
 
void init () override
 
void setSelectionArray (const std::vector< unsigned > &point_indeces)
 Sets the point indices to be highlighted.
 
- 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.
 
virtual void SetUserProperty (QString name, QVariant value)
 Sets a user property. This should be implemented by subclasses.
 
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

std::vector< GeoLib::Point * > _selection
 

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

◆ VtkCompositeNodeSelectionFilter()

VtkCompositeNodeSelectionFilter::VtkCompositeNodeSelectionFilter ( vtkAlgorithm * inputAlgorithm)
explicit

Definition at line 26 of file VtkCompositeNodeSelectionFilter.cpp.

28 : VtkCompositeFilter(inputAlgorithm)
29{
30 // this->init();
31}
VtkCompositeFilter(vtkAlgorithm *inputAlgorithm)
Constructor.

◆ ~VtkCompositeNodeSelectionFilter()

VtkCompositeNodeSelectionFilter::~VtkCompositeNodeSelectionFilter ( )
override

Definition at line 33 of file VtkCompositeNodeSelectionFilter.cpp.

34{
35 for (auto& item : _selection)
36 {
37 delete item;
38 }
39}

References _selection.

Member Function Documentation

◆ init()

void VtkCompositeNodeSelectionFilter::init ( )
overridevirtual

Implements VtkCompositeFilter.

Definition at line 41 of file VtkCompositeNodeSelectionFilter.cpp.

42{
43 this->_inputDataObjectType = VTK_DATA_SET;
44 this->_outputDataObjectType = VTK_POLY_DATA;
45
46 if (!_selection.empty())
47 {
48 vtkSmartPointer<VtkPointsSource> point_source =
49 vtkSmartPointer<VtkPointsSource>::New();
50 point_source->setPoints(&_selection);
51
52 vtkSmartPointer<vtkSphereSource> _glyphSource =
53 vtkSmartPointer<vtkSphereSource>::New();
54 _glyphSource->SetRadius(this->GetInitialRadius());
55
56 vtkGlyph3D* glyphFilter = vtkGlyph3D::New();
57 glyphFilter->SetSourceConnection(_glyphSource->GetOutputPort());
58 glyphFilter->SetInputConnection(point_source->GetOutputPort());
59
60 _outputAlgorithm = glyphFilter;
61 }
62 else
63 {
64 _outputAlgorithm = nullptr;
65 }
66}
vtkAlgorithm * _outputAlgorithm
double GetInitialRadius() const
Calculates a 1/200th of the largest extension of the bounding box (this is used as default radius for...

References VtkCompositeFilter::_inputDataObjectType, VtkCompositeFilter::_outputAlgorithm, VtkCompositeFilter::_outputDataObjectType, _selection, and VtkCompositeFilter::GetInitialRadius().

Referenced by setSelectionArray().

◆ setSelectionArray()

void VtkCompositeNodeSelectionFilter::setSelectionArray ( const std::vector< unsigned > & point_indeces)

Sets the point indices to be highlighted.

Definition at line 68 of file VtkCompositeNodeSelectionFilter.cpp.

70{
71 for (unsigned int point_index : point_indeces)
72 {
73 double* coords = static_cast<vtkDataSetAlgorithm*>(_inputAlgorithm)
74 ->GetOutput()
75 ->GetPoint(point_index);
76 auto* p(new GeoLib::Point(coords[0], coords[1], coords[2]));
77 _selection.push_back(p);
78 }
79 init();
80}
vtkAlgorithm * _inputAlgorithm
constexpr ranges::views::view_closure coords
Definition Mesh.h:232

References VtkCompositeFilter::_inputAlgorithm, _selection, and init().

Member Data Documentation

◆ _selection

std::vector<GeoLib::Point*> VtkCompositeNodeSelectionFilter::_selection
private

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