48 vtkSmartPointer<vtkDataSetSurfaceFilter> surfaceFilter;
51 if (
dynamic_cast<vtkUnstructuredGrid*
>(
54 surfaceFilter = vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
56 surface->SetInputConnection(surfaceFilter->GetOutputPort());
63 QWidget* parent =
nullptr;
65 QString fileName = QFileDialog::getOpenFileName(
66 parent,
"Select raster file to apply as texture",
67 settings.value(
"lastOpenedTextureFileDirectory").toString(),
68 "Raster files (*.asc *.grd *.bmp *.jpg *.png *.tif);;"
70 "NetCDF files (*.nc);;"
73 QFileInfo fi(fileName);
75 if ((fi.suffix().toLower() ==
"asc") || (fi.suffix().toLower() ==
"tif") ||
76 (fi.suffix().toLower() ==
"png") || (fi.suffix().toLower() ==
"grd") ||
77 (fi.suffix().toLower() ==
"jpg") || (fi.suffix().toLower() ==
"bmp"))
79 std::string name = fileName.toStdString();
84 QDir dir = QDir(fileName);
85 settings.setValue(
"lastOpenedTextureFileDirectory", dir.absolutePath());
88 else if (fi.suffix().toLower() ==
"nc")
101 ERR(
"VtkCompositeTextureOnSurfaceFilter::init(): Error reading texture "
Definition of the VtkCompositeTextureOnSurfaceFilter class.
Definition of the VtkTextureOnSurfaceFilter class.
VtkCompositeTextureOnSurfaceFilter(vtkAlgorithm *inputAlgorithm)
~VtkCompositeTextureOnSurfaceFilter() override
void SetUserProperty(QString name, QVariant value) override
Sets a user property. This should be implemented by subclasses.
Filter class for assigning a texture to a surface.
static VtkTextureOnSurfaceFilter * New()
Create new objects with New() because of VTKs object reference counting.
void SetRaster(vtkImageAlgorithm *img)
Sets the raster/image to be used as a texture map.