OGS
ElementTreeModel.h
Go to the documentation of this file.
1 
15 #pragma once
16 
17 #include <array>
18 #include "Base/TreeModel.h"
19 
20 class vtkUnstructuredGridAlgorithm;
21 
22 namespace MeshLib {
23  class Mesh;
24 }
25 
31 {
32  Q_OBJECT
33 
34 public:
35  explicit ElementTreeModel(QObject* parent = nullptr);
36  ~ElementTreeModel() override;
37 
38  vtkUnstructuredGridAlgorithm const* getSource() const { return _mesh_source; };
39 
40 public slots:
42  void clearView();
43 
45  void setElement(vtkUnstructuredGridAlgorithm const*const grid, const unsigned elem_index);
46 
48  void setMesh(MeshLib::Mesh const& mesh);
49 
50 private:
51  vtkUnstructuredGridAlgorithm const* _mesh_source{nullptr};
52 };
Definition of the TreeModel class.
A model for the display of information concerning element information implemented as a TreeModel.
void setElement(vtkUnstructuredGridAlgorithm const *const grid, const unsigned elem_index)
Displays information of the element with the given index from the given grid.
~ElementTreeModel() override
vtkUnstructuredGridAlgorithm const * _mesh_source
vtkUnstructuredGridAlgorithm const * getSource() const
void clearView()
Clears the tree.
ElementTreeModel(QObject *parent=nullptr)
void setMesh(MeshLib::Mesh const &mesh)
Displays information of the given mesh.
A hierarchical model for a tree implemented as a double-linked list.
Definition: TreeModel.h:30
QModelIndex parent(const QModelIndex &index) const override
Definition: TreeModel.cpp:81