OGS
VtkGeoImageSource Class Reference

Detailed Description

The VtkVisPipeline source object of a geo-referenced image (file).

Definition at line 30 of file VtkGeoImageSource.h.

#include <VtkGeoImageSource.h>

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

Public Member Functions

 vtkTypeMacro (VtkGeoImageSource, vtkSimpleImageToImageFilter)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Prints information about itself. More...
 
 VtkGeoImageSource (const VtkGeoImageSource &)=delete
 
void operator= (const VtkGeoImageSource &)=delete
 
vtkImageData * getImageData ()
 Returns the ImageData object. More...
 
bool readImage (const QString &filename)
 Reads an image from file. More...
 
void setImage (vtkImageAlgorithm *image, const QString &name)
 Imports an existing image object. More...
 
void SetUserProperty (QString name, QVariant value) override
 Sets a user property. This should be implemented by subclasses. More...
 
- Public Member Functions inherited from VtkAlgorithmProperties
 VtkAlgorithmProperties (QObject *parent=nullptr)
 Constructor (sets default values) More...
 
 ~VtkAlgorithmProperties () override
 
vtkProperty * GetProperties () const
 Returns the vtk properties. More...
 
vtkTexture * GetTexture ()
 Returns a texture (if one has been assigned). More...
 
void SetTexture (vtkTexture *t)
 Sets a texture for the VtkVisPipelineItem. More...
 
vtkLookupTable * GetLookupTable (const QString &array_name)
 Returns the colour lookup table (if one has been assigned). More...
 
void RemoveLookupTable (const QString &array_name)
 Removes the lookup table for the given scalar. More...
 
void SetLookUpTable (const QString &array_name, vtkLookupTable *lut)
 Sets a colour lookup table for the given scalar array of the VtkVisPipelineItem. More...
 
void SetLookUpTable (const QString &array_name, const QString &filename)
 Loads a predefined color lookup table from a file for the specified scalar array. More...
 
bool GetScalarVisibility () const
 Returns the scalar visibility. More...
 
void SetScalarVisibility (bool on)
 Sets the scalar visibility. More...
 
QString GetName () const
 Returns the name. This is set to the file path if it is a source algorithm. More...
 
void SetName (QString name)
 Sets the name. More...
 
bool IsRemovable () const
 Is this algorithm removable from the pipeline (view). More...
 
QMap< QString, QVariant > * GetAlgorithmUserProperties () const
 Returns a map of user properties. More...
 
QMap< QString, QList< QVariant > > * GetAlgorithmUserVectorProperties () const
 Returns a map of vector user properties. More...
 
QVariant GetUserProperty (QString name) const
 Returns the value of a user property. More...
 
virtual void SetUserVectorProperty (QString name, QList< QVariant > values)
 Sets a vector user property. This should be implemented by subclasses. More...
 
QList< QVariant > GetUserVectorProperty (QString name) const
 Returns a list of values of a vector user property. More...
 
void SetActiveAttribute (QString name)
 Set the active attribute. More...
 
QString GetActiveAttribute () const
 Returns the desired active attribute. More...
 

Static Public Member Functions

static VtkGeoImageSourceNew ()
 Create new objects with New() because of VTKs reference counting. More...
 

Protected Member Functions

 VtkGeoImageSource ()
 Constructor. More...
 
 ~VtkGeoImageSource () override
 Destructor. More...
 
void SimpleExecute (vtkImageData *input, vtkImageData *output) override
 Filter execution. More...
 

Private Attributes

vtkImageAlgorithm * _imageSource {nullptr}
 

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
 

Constructor & Destructor Documentation

◆ VtkGeoImageSource() [1/2]

VtkGeoImageSource::VtkGeoImageSource ( const VtkGeoImageSource )
delete

◆ VtkGeoImageSource() [2/2]

VtkGeoImageSource::VtkGeoImageSource ( )
protecteddefault

Constructor.

◆ ~VtkGeoImageSource()

VtkGeoImageSource::~VtkGeoImageSource ( )
overrideprotected

Destructor.

Definition at line 64 of file VtkGeoImageSource.cpp.

65 {
66  if (_imageSource)
67  {
68  _imageSource->Delete();
69  }
70 }
vtkImageAlgorithm * _imageSource

References _imageSource.

Member Function Documentation

◆ getImageData()

vtkImageData * VtkGeoImageSource::getImageData ( )

Returns the ImageData object.

Definition at line 95 of file VtkGeoImageSource.cpp.

96 {
97  return this->_imageSource->GetImageDataInput(0);
98 }

References _imageSource.

◆ New()

static VtkGeoImageSource* VtkGeoImageSource::New ( )
static

Create new objects with New() because of VTKs reference counting.

Referenced by NetCdfConfigureDialog::createDataObject(), and MainWindow::loadFile().

◆ operator=()

void VtkGeoImageSource::operator= ( const VtkGeoImageSource )
delete

◆ PrintSelf()

void VtkGeoImageSource::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
override

Prints information about itself.

Definition at line 72 of file VtkGeoImageSource.cpp.

73 {
74  this->Superclass::PrintSelf(os, indent);
75 }

◆ readImage()

bool VtkGeoImageSource::readImage ( const QString &  filename)

Reads an image from file.

Definition at line 77 of file VtkGeoImageSource.cpp.

78 {
79  vtkImageAlgorithm* img(VtkRaster::loadImage(filename.toStdString()));
80  if (img == nullptr)
81  {
82  return false;
83  }
84  this->setImage(img, filename);
85  return true;
86 }
void setImage(vtkImageAlgorithm *image, const QString &name)
Imports an existing image object.
static vtkImageAlgorithm * loadImage(const std::string &fileName)
Loads an image- or raster-file into an vtkImageAlgorithm-Object.
Definition: VtkRaster.cpp:43

References VtkRaster::loadImage(), and setImage().

Referenced by MainWindow::loadFile().

◆ setImage()

void VtkGeoImageSource::setImage ( vtkImageAlgorithm *  image,
const QString &  name 
)

Imports an existing image object.

Definition at line 88 of file VtkGeoImageSource.cpp.

89 {
90  this->_imageSource = image;
91  this->SetInputConnection(_imageSource->GetOutputPort());
92  this->SetName(name);
93 }
void SetName(QString name)
Sets the name.

References _imageSource, and VtkAlgorithmProperties::SetName().

Referenced by NetCdfConfigureDialog::createDataObject(), and readImage().

◆ SetUserProperty()

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

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

Reimplemented from VtkAlgorithmProperties.

Definition at line 117 of file VtkGeoImageSource.cpp.

118 {
119  Q_UNUSED(name);
120  Q_UNUSED(value);
121 }

References MaterialPropertyLib::name.

◆ SimpleExecute()

void VtkGeoImageSource::SimpleExecute ( vtkImageData *  input,
vtkImageData *  output 
)
overrideprotected

Filter execution.

Definition at line 100 of file VtkGeoImageSource.cpp.

101 {
102  vtkDebugMacro(<< "Executing VtkGeoImageSource");
103  void* inPtr = input->GetScalarPointer();
104  void* outPtr = output->GetScalarPointer();
105  switch (output->GetScalarType())
106  {
107  // This is simply a #define for a big case list.
108  // It handles all data types that VTK supports.
109  vtkTemplateMacro(vtkSimpleImageFilterExampleExecute(
110  input, output, (VTK_TT*)(inPtr), (VTK_TT*)(outPtr)));
111  default:
112  vtkGenericWarningMacro("Execute: Unknown input ScalarType");
113  return;
114  }
115 }
void vtkSimpleImageFilterExampleExecute(vtkImageData *input, vtkImageData *output, IT *inPtr, IT *outPtr)

References vtkSimpleImageFilterExampleExecute().

◆ vtkTypeMacro()

VtkGeoImageSource::vtkTypeMacro ( VtkGeoImageSource  ,
vtkSimpleImageToImageFilter   
)

Member Data Documentation

◆ _imageSource

vtkImageAlgorithm* VtkGeoImageSource::_imageSource {nullptr}
private

Definition at line 66 of file VtkGeoImageSource.h.

Referenced by ~VtkGeoImageSource(), getImageData(), and setImage().


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