OGS
VtkCompositeLineToTubeFilter Class Reference

Detailed Description

Converts lines to tube-objects.

Definition at line 20 of file VtkCompositeLineToTubeFilter.h.

#include <VtkCompositeLineToTubeFilter.h>

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

Public Member Functions

 VtkCompositeLineToTubeFilter (vtkAlgorithm *inputAlgorithm)
 
 ~VtkCompositeLineToTubeFilter () override
 
void init () override
 
void SetUserProperty (QString name, QVariant value) override
 Sets a 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.
 
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.
 

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

◆ VtkCompositeLineToTubeFilter()

VtkCompositeLineToTubeFilter::VtkCompositeLineToTubeFilter ( vtkAlgorithm * inputAlgorithm)
explicit

Definition at line 22 of file VtkCompositeLineToTubeFilter.cpp.

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

References init().

◆ ~VtkCompositeLineToTubeFilter()

VtkCompositeLineToTubeFilter::~VtkCompositeLineToTubeFilter ( )
overridedefault

Member Function Documentation

◆ init()

void VtkCompositeLineToTubeFilter::init ( )
overridevirtual

Implements VtkCompositeFilter.

Definition at line 31 of file VtkCompositeLineToTubeFilter.cpp.

32{
33 this->_inputDataObjectType = VTK_DATA_SET;
34 this->_outputDataObjectType = VTK_POLY_DATA;
35
36 // collapse coincident points
37 vtkSmartPointer<vtkCleanPolyData> mergePoints =
38 vtkSmartPointer<vtkCleanPolyData>::New();
39 mergePoints->SetInputConnection(0, _inputAlgorithm->GetOutputPort(0));
40 mergePoints->SetTolerance(0.0);
41 mergePoints->ConvertLinesToPointsOn();
42
43 double default_radius(GetInitialRadius());
44 int default_number_of_sides(8);
45 vtkTubeFilter* tubes = vtkTubeFilter::New();
46 tubes->SetInputConnection(0, mergePoints->GetOutputPort(0));
47
48 // tubes->SetInputArrayToProcess(1,0,0,vtkDataObject::FIELD_ASSOCIATION_CELLS,"StationValue");
49 // tubes->SetVaryRadiusToVaryRadiusByScalar(); // KR radius changes with
50 // scalar
51
52 tubes->SetInputArrayToProcess(
53 1, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, "Stratigraphies");
54 tubes->SetRadius(default_radius);
55 tubes->SetNumberOfSides(default_number_of_sides);
56 tubes->SetCapping(1);
57
58 (*_algorithmUserProperties)["Radius"] = default_radius;
59 (*_algorithmUserProperties)["NumberOfSides"] = default_number_of_sides;
60 (*_algorithmUserProperties)["Capping"] = true;
61
62 _outputAlgorithm = tubes;
63}
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

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

Referenced by VtkCompositeLineToTubeFilter().

◆ SetUserProperty()

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

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

Reimplemented from VtkAlgorithmProperties.

Definition at line 65 of file VtkCompositeLineToTubeFilter.cpp.

66{
68
69 if (name.compare("Radius") == 0)
70 {
71 static_cast<vtkTubeFilter*>(_outputAlgorithm)
72 ->SetRadius(value.toDouble());
73 }
74 else if (name.compare("NumberOfSides") == 0)
75 {
76 static_cast<vtkTubeFilter*>(_outputAlgorithm)
77 ->SetNumberOfSides(value.toInt());
78 }
79 else if (name.compare("Capping") == 0)
80 {
81 static_cast<vtkTubeFilter*>(_outputAlgorithm)
82 ->SetCapping(value.toBool());
83 }
84}
virtual void SetUserProperty(QString name, QVariant value)
Sets a user property. This should be implemented by subclasses.

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


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