OGS
VtkGeoImageSource.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <vtkSimpleImageToImageFilter.h>
18
19#include <optional>
20
21#include "GeoLib/Raster.h"
23
24namespace GeoLib
25{
26class Raster;
27}
28
29class QString;
30class QPointF;
31class QImage;
32class vtkQImageToImageSource;
33class vtkImageShiftScale;
34class vtkImageData;
35
39class VtkGeoImageSource : public vtkSimpleImageToImageFilter, public VtkAlgorithmProperties
40{
41public:
44
45 vtkTypeMacro(VtkGeoImageSource, vtkSimpleImageToImageFilter);
46
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51 void operator=(const VtkGeoImageSource&) = delete;
52
54 vtkImageData* getImageData();
55
57 bool readImage(const QString &filename);
58
60 void setImage(vtkImageAlgorithm* image, const QString& name);
61
62 void SetUserProperty(QString name, QVariant value) override;
63
64 // @brief Converts the source object into a Raster object
65 static std::optional<GeoLib::Raster> convertToRaster(
66 VtkGeoImageSource* const source);
67
68protected:
71
73 ~VtkGeoImageSource() override;
74
76 void SimpleExecute(vtkImageData* input, vtkImageData* output) override;
77
78private:
79 vtkImageAlgorithm* _imageSource{nullptr};
80};
Definition of the GeoLib::Raster class.
Definition of the VtkAlgorithmProperties class.
Contains properties for the visualization of objects as VtkVisPipelineItems.
The VtkVisPipeline source object of a geo-referenced image (file).
vtkTypeMacro(VtkGeoImageSource, vtkSimpleImageToImageFilter)
VtkGeoImageSource(const VtkGeoImageSource &)=delete
static std::optional< GeoLib::Raster > convertToRaster(VtkGeoImageSource *const source)
VtkGeoImageSource()
Constructor.
void setImage(vtkImageAlgorithm *image, const QString &name)
Imports an existing image object.
void SetUserProperty(QString name, QVariant value) override
Sets a user property. This should be implemented by subclasses.
vtkImageAlgorithm * _imageSource
~VtkGeoImageSource() override
Destructor.
vtkImageData * getImageData()
Returns the ImageData object.
void PrintSelf(ostream &os, vtkIndent indent) override
Prints information about itself.
void SimpleExecute(vtkImageData *input, vtkImageData *output) override
Filter execution.
void operator=(const VtkGeoImageSource &)=delete
static VtkGeoImageSource * New()
Create new objects with New() because of VTKs reference counting.
bool readImage(const QString &filename)
Reads an image from file.