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 18 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 8 of file MeshItem.cpp.

10 : TreeItem(data, parent)
11{
13 static_cast<MeshLib::VtkMappedMeshSource*>(_mesh_source)->SetMesh(mesh);
14}
MeshLib::VtkMappedMeshSource * _mesh_source
Definition MeshItem.h:36
static VtkMappedMeshSource * New()
TreeItem(QList< QVariant > data, TreeItem *parent)
Definition TreeItem.cpp:12
virtual QVariant data(int column) const
Definition TreeItem.cpp:83

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

◆ ~MeshItem()

MeshItem::~MeshItem ( )
override

Definition at line 16 of file MeshItem.cpp.

17{
18 _mesh_source->Delete();
19}

References _mesh_source.

Member Function Documentation

◆ getMesh()

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

Returns the mesh.

Definition at line 31 of file MeshItem.h.

31{ return _mesh_source->GetMesh(); }

References _mesh_source.

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

◆ vtkSource()

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

Returns the VTK object.

Definition at line 33 of file MeshItem.h.

33{ return _mesh_source; }

References _mesh_source.

Referenced by VtkVisPipeline::addPipelineItem(), MeshView::checkMeshQuality(), MeshView::selectionChanged(), and MeshModel::vtkSource().

Member Data Documentation

◆ _mesh_source

MeshLib::VtkMappedMeshSource* MeshItem::_mesh_source
private

Definition at line 36 of file MeshItem.h.

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


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