OGS
BaseItem.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
7#include <QModelIndex>
8#include <vtkPolyDataAlgorithm.h>
9
10namespace GeoLib
11{
12class Point;
13}
14
22{
23public:
24 explicit BaseItem(const QString& listName,
25 const std::vector<GeoLib::Point*>* stations = nullptr)
26 : _stations(stations), _vtkSource(VtkStationSource::New())
27 {
28 // create the vtk-object for 3d-visualisation of this list
29 static_cast<VtkStationSource*>(_vtkSource)->setStations(stations);
30 static_cast<VtkStationSource*>(_vtkSource)->SetName(listName);
31 }
32
34 {
35 _vtkSource->Delete();
36 }
37
39 QModelIndex modelIndex() const { return _modelIndex; }
40
42 void setModelIndex( QModelIndex index ) { _modelIndex = index; }
43
44 const std::vector<GeoLib::Point*>* getStations() { return _stations; }
45
47 vtkPolyDataAlgorithm* vtkSource() const { return _vtkSource; }
48
49private:
50 QModelIndex _modelIndex;
51 const std::vector<GeoLib::Point*>* _stations;
52
55 vtkPolyDataAlgorithm* _vtkSource;
56};
vtkPolyDataAlgorithm * vtkSource() const
Returns the Vtk polydata source object.
Definition BaseItem.h:47
const std::vector< GeoLib::Point * > * getStations()
Definition BaseItem.h:44
QModelIndex modelIndex() const
Returns the associated QModelIndex which belongs to a Qt model.
Definition BaseItem.h:39
~BaseItem()
Definition BaseItem.h:33
void setModelIndex(QModelIndex index)
Sets the model index.
Definition BaseItem.h:42
vtkPolyDataAlgorithm * _vtkSource
Definition BaseItem.h:55
const std::vector< GeoLib::Point * > * _stations
Definition BaseItem.h:51
BaseItem(const QString &listName, const std::vector< GeoLib::Point * > *stations=nullptr)
Definition BaseItem.h:24
QModelIndex _modelIndex
Definition BaseItem.h:50
void SetName(QString name)
Sets the name.
VTK source object for the visualisation of station data (including boreholes)
void setStations(const std::vector< GeoLib::Point * > *stations)
Sets a predefined color lookup table for the colouring of borehole stratigraphies.