OGS
|
Filter class for assigning a texture to a surface.
Use SetRaster() to define the texture that should be mapped on the object. The input of this class is a vtkPolyData object. It is important to call SetTexture() before calling SetInputConnection(). Texture coordinates will then be calculated automatically and the texture will also be saved in the VtkAlgorithmProperties object from which this class is derived (i.e. the texture can be returned by VtkAlgorithmProperties::GetTexture()).
For convenience this class also has a converter function ConvertImageToTexture() which uses a QImage as input.
Definition at line 37 of file VtkTextureOnSurfaceFilter.h.
#include <VtkTextureOnSurfaceFilter.h>
Public Member Functions | |
vtkTypeMacro (VtkTextureOnSurfaceFilter, vtkPolyDataAlgorithm) | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Prints the object data to an output stream. | |
void | SetRaster (vtkImageAlgorithm *img) |
Sets the raster/image to be used as a texture map. | |
void | SetUserProperty (QString name, QVariant value) override |
Sets a user property. This should be implemented by subclasses. | |
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. | |
Static Public Member Functions | |
static VtkTextureOnSurfaceFilter * | New () |
Create new objects with New() because of VTKs object reference counting. | |
Protected Member Functions | |
VtkTextureOnSurfaceFilter () | |
~VtkTextureOnSurfaceFilter () override | |
int | RequestData (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override |
Private Attributes | |
std::pair< double, double > | _origin {0, 0} |
double | _scalingFactor {0.} |
Additional Inherited Members | |
Signals inherited from VtkAlgorithmProperties | |
void | ScalarVisibilityChanged (bool on) |
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 |
|
protecteddefault |
|
overrideprotecteddefault |
|
static |
Create new objects with New() because of VTKs object reference counting.
Referenced by VtkCompositeTextureOnSurfaceFilter::init().
|
override |
Prints the object data to an output stream.
Definition at line 40 of file VtkTextureOnSurfaceFilter.cpp.
|
overrideprotected |
Copies the input data and calculates texture coordinates (this requires that SetRaster() has been called before this method is executed.
Definition at line 45 of file VtkTextureOnSurfaceFilter.cpp.
References _origin, _scalingFactor, ERR(), and VtkAlgorithmProperties::GetTexture().
void VtkTextureOnSurfaceFilter::SetRaster | ( | vtkImageAlgorithm * | img | ) |
Sets the raster/image to be used as a texture map.
Definition at line 134 of file VtkTextureOnSurfaceFilter.cpp.
References _origin, _scalingFactor, and VtkAlgorithmProperties::SetTexture().
Referenced by VtkCompositeTextureOnSurfaceFilter::init().
|
overridevirtual |
Sets a user property. This should be implemented by subclasses.
Reimplemented from VtkAlgorithmProperties.
Definition at line 160 of file VtkTextureOnSurfaceFilter.cpp.
References VtkAlgorithmProperties::SetUserProperty().
VtkTextureOnSurfaceFilter::vtkTypeMacro | ( | VtkTextureOnSurfaceFilter | , |
vtkPolyDataAlgorithm | ) |
|
private |
Definition at line 64 of file VtkTextureOnSurfaceFilter.h.
Referenced by RequestData(), and SetRaster().
|
private |
Definition at line 65 of file VtkTextureOnSurfaceFilter.h.
Referenced by RequestData(), and SetRaster().