OGS
VtkStationSource.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <vtkPolyDataAlgorithm.h>
7
10#include "GeoLib/Station.h"
12
16class VtkStationSource : public vtkPolyDataAlgorithm, public VtkAlgorithmProperties
17{
18public:
21
22 vtkTypeMacro(VtkStationSource,vtkPolyDataAlgorithm);
23
26 const std::map<std::string, DataHolderLib::Color>& getColorLookupTable() const
27 { return _colorLookupTable; }
28
30// int setColorLookupTable(const std::string &filename)
31// { return GeoLib::readColorLookupTable(_colorLookupTable, filename); }
32
34 void setStations(const std::vector<GeoLib::Point*>* stations) { _stations = stations; }
35
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
39 void SetUserProperty(QString name, QVariant value) override;
40
41protected:
43
45 int RequestData(vtkInformation* request,
46 vtkInformationVector** inputVector,
47 vtkInformationVector* outputVector) override;
48
49 int RequestInformation(vtkInformation* request,
50 vtkInformationVector** inputVector,
51 vtkInformationVector* outputVector) override;
52
54 const std::vector<GeoLib::Point*>* _stations{nullptr};
55
58 std::map<std::string, DataHolderLib::Color> _colorLookupTable;
59
60private:
61 std::size_t GetIndexByName( std::string const& name );
62
63 std::map<std::string, vtkIdType> _id_map;
64};
VtkAlgorithmProperties(QObject *parent=nullptr)
Constructor (sets default values)
std::size_t GetIndexByName(std::string const &name)
std::map< std::string, DataHolderLib::Color > _colorLookupTable
void SetUserProperty(QString name, QVariant value) override
Sets a user property. This should be implemented by subclasses.
static VtkStationSource * New()
Create new objects with New() because of VTKs object reference counting.
std::map< std::string, vtkIdType > _id_map
void setStations(const std::vector< GeoLib::Point * > *stations)
Sets a predefined color lookup table for the colouring of borehole stratigraphies.
const std::vector< GeoLib::Point * > * _stations
The stations to visualize.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Computes the polygonal data object.
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
void PrintSelf(ostream &os, vtkIndent indent) override
Prints its data on a stream.
const std::map< std::string, DataHolderLib::Color > & getColorLookupTable() const
vtkTypeMacro(VtkStationSource, vtkPolyDataAlgorithm)