OGS
MeshItem Class Reference

Detailed Description

A TreeItem containing a mesh and the associated vtk object used in the Mesh Model.

See also
TreeItem

Definition at line 29 of file MeshItem.h.

#include <MeshItem.h>

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

Public Member Functions

 MeshItem (const QList< QVariant > &data, TreeItem *parent, const MeshLib::Mesh *mesh)
 
 ~MeshItem () override
 
MeshLib::Mesh const * getMesh () const
 Returns the mesh.
 
MeshLib::VtkMappedMeshSourcevtkSource () const
 Returns the VTK object.
 
- Public Member Functions inherited from TreeItem
 TreeItem (QList< QVariant > data, TreeItem *parent)
 
virtual ~TreeItem ()
 
void appendChild (TreeItem *item)
 
TreeItemchild (int row) const
 
virtual int childCount () const
 
virtual int columnCount () const
 
virtual QVariant data (int column) const
 
virtual bool setData (int column, const QVariant &value)
 
int row () const
 
TreeItemparentItem () const
 
bool removeChildren (int position, int count)
 

Private Attributes

MeshLib::VtkMappedMeshSource_mesh_source
 

Constructor & Destructor Documentation

◆ MeshItem()

MeshItem::MeshItem ( const QList< QVariant > & data,
TreeItem * parent,
const MeshLib::Mesh * mesh )

Constructor, automatically generates VTK object of the given mesh.

Parameters
dataThe data associated with each column
parentThe parent item in the tree
meshThe mesh associated with this item

Definition at line 19 of file MeshItem.cpp.

21 : TreeItem(data, parent)
22{
24 static_cast<MeshLib::VtkMappedMeshSource*>(_mesh_source)->SetMesh(mesh);
25}
MeshLib::VtkMappedMeshSource * _mesh_source
Definition MeshItem.h:47
static VtkMappedMeshSource * New()
TreeItem(QList< QVariant > data, TreeItem *parent)
Definition TreeItem.cpp:23
virtual QVariant data(int column) const
Definition TreeItem.cpp:94

References _mesh_source, and MeshLib::VtkMappedMeshSource::New().

◆ ~MeshItem()

MeshItem::~MeshItem ( )
override

Definition at line 27 of file MeshItem.cpp.

28{
29 _mesh_source->Delete();
30}

References _mesh_source.

Member Function Documentation

◆ getMesh()

MeshLib::Mesh const * MeshItem::getMesh ( ) const
inline

Returns the mesh.

Definition at line 42 of file MeshItem.h.

42{ return _mesh_source->GetMesh(); }
const MeshLib::Mesh * GetMesh() const
Returns the mesh.

References _mesh_source, and MeshLib::VtkMappedMeshSource::GetMesh().

Referenced by MeshView::contextMenuEvent(), MeshModel::getMesh(), MeshModel::getMesh(), and MeshModel::updateMesh().

◆ vtkSource()

MeshLib::VtkMappedMeshSource * MeshItem::vtkSource ( ) const
inline

Member Data Documentation

◆ _mesh_source

MeshLib::VtkMappedMeshSource* MeshItem::_mesh_source
private

Definition at line 47 of file MeshItem.h.

Referenced by MeshItem(), ~MeshItem(), getMesh(), and vtkSource().


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