OGS
GeoObjectListItem Class Reference

Detailed Description

Creates parent items for geometric object lists (i.e. points, polylines and surfaces) for the GeoTreeModel

See also
GeoTreeModel, GeoTreeItem

Definition at line 33 of file GeoObjectListItem.h.

#include <GeoObjectListItem.h>

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

Public Member Functions

 GeoObjectListItem (const QList< QVariant > &data, TreeItem *parent, const std::vector< GeoLib::Point * > *geo_data=nullptr, GeoLib::GEOTYPE type=GeoLib::GEOTYPE::POINT)
 Constructor for the TreeItem specifying the "Points"-subtree of a geometry.
 
 GeoObjectListItem (const QList< QVariant > &data, TreeItem *parent, const std::vector< GeoLib::Polyline * > *geo_data=nullptr, GeoLib::GEOTYPE type=GeoLib::GEOTYPE::POLYLINE)
 Constructor for the TreeItem specifying the "Polylines"-subtree of a geometry.
 
 GeoObjectListItem (const QList< QVariant > &data, TreeItem *parent, const std::vector< GeoLib::Surface * > *geo_data=nullptr, GeoLib::GEOTYPE type=GeoLib::GEOTYPE::SURFACE)
 Constructor for the TreeItem specifying the "Surfaces"-subtree of a geometry.
 
 ~GeoObjectListItem () override
 
GeoLib::GEOTYPE getType ()
 Returns the type of geo-objects contained in the subtree of this item.
 
vtkPolyDataAlgorithm * vtkSource () const
 Returns the Vtk polydata source 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

vtkPolyDataAlgorithm * _vtkSource
 
GeoLib::GEOTYPE _type
 

Constructor & Destructor Documentation

◆ GeoObjectListItem() [1/3]

GeoObjectListItem::GeoObjectListItem ( const QList< QVariant > & data,
TreeItem * parent,
const std::vector< GeoLib::Point * > * geo_data = nullptr,
GeoLib::GEOTYPE type = GeoLib::GEOTYPE::POINT )
inline

Constructor for the TreeItem specifying the "Points"-subtree of a geometry.

Definition at line 37 of file GeoObjectListItem.h.

41 : TreeItem(data, parent),
43 _type(type)
44 {
45 QString geo_name = parent->data(0).toString();
46 static_cast<VtkPointsSource*>(_vtkSource)->setPoints(geo_data);
47 static_cast<VtkPointsSource*>(_vtkSource)->SetName(geo_name + " - Points");
48 }
vtkPolyDataAlgorithm * _vtkSource
GeoLib::GEOTYPE _type
TreeItem(QList< QVariant > data, TreeItem *parent)
Definition TreeItem.cpp:23
virtual QVariant data(int column) const
Definition TreeItem.cpp:94
VtkPointsSource is a VTK source object for the visualization of point data. As a vtkPolyDataAlgorithm...
static VtkPointsSource * New()
Create new objects with New() because of VTKs object reference counting.

References _vtkSource, and TreeItem::data().

◆ GeoObjectListItem() [2/3]

GeoObjectListItem::GeoObjectListItem ( const QList< QVariant > & data,
TreeItem * parent,
const std::vector< GeoLib::Polyline * > * geo_data = nullptr,
GeoLib::GEOTYPE type = GeoLib::GEOTYPE::POLYLINE )
inline

Constructor for the TreeItem specifying the "Polylines"-subtree of a geometry.

Definition at line 51 of file GeoObjectListItem.h.

55 : TreeItem(data, parent),
57 _type(type)
58 {
59 QString geo_name = parent->data(0).toString();
60 static_cast<VtkPolylinesSource*>(_vtkSource)->setPolylines(geo_data);
61 static_cast<VtkPolylinesSource*>(_vtkSource)->SetName(geo_name + " - Polylines");
62 }
VtkPolylinesSource is a VTK source object for the visualisation of polyline data. As a vtkPolyDataAlg...
static VtkPolylinesSource * New()
Create new objects with New() because of VTKs object reference counting.

References _vtkSource, and TreeItem::data().

◆ GeoObjectListItem() [3/3]

GeoObjectListItem::GeoObjectListItem ( const QList< QVariant > & data,
TreeItem * parent,
const std::vector< GeoLib::Surface * > * geo_data = nullptr,
GeoLib::GEOTYPE type = GeoLib::GEOTYPE::SURFACE )
inline

Constructor for the TreeItem specifying the "Surfaces"-subtree of a geometry.

Definition at line 65 of file GeoObjectListItem.h.

69 : TreeItem(data, parent),
71 _type(type)
72 {
73 QString geo_name = parent->data(0).toString();
74 static_cast<VtkSurfacesSource*>(_vtkSource)->setSurfaces(geo_data);
75 static_cast<VtkSurfacesSource*>(_vtkSource)->SetName(geo_name + " - Surfaces");
76 }
VTK source object for the visualisation of surfaces. Technically, surfaces are displayed as triangula...
static VtkSurfacesSource * New()
Create new objects with New() because of VTKs object reference counting.

References _vtkSource, and TreeItem::data().

◆ ~GeoObjectListItem()

GeoObjectListItem::~GeoObjectListItem ( )
inlineoverride

Definition at line 78 of file GeoObjectListItem.h.

78{ _vtkSource->Delete(); }

References _vtkSource.

Member Function Documentation

◆ getType()

GeoLib::GEOTYPE GeoObjectListItem::getType ( )
inline

Returns the type of geo-objects contained in the subtree of this item.

Definition at line 80 of file GeoObjectListItem.h.

80{ return _type; }

References _type.

◆ vtkSource()

vtkPolyDataAlgorithm * GeoObjectListItem::vtkSource ( ) const
inline

Returns the Vtk polydata source object.

Definition at line 83 of file GeoObjectListItem.h.

83{ return _vtkSource; }

References _vtkSource.

Referenced by GeoTreeView::selectionChanged(), and GeoTreeModel::vtkSource().

Member Data Documentation

◆ _type

GeoLib::GEOTYPE GeoObjectListItem::_type
private

Definition at line 90 of file GeoObjectListItem.h.

Referenced by getType().

◆ _vtkSource

vtkPolyDataAlgorithm* GeoObjectListItem::_vtkSource
private

The Vtk data source object. This is the starting point for a Vtk data visualization pipeline.

Definition at line 88 of file GeoObjectListItem.h.

Referenced by GeoObjectListItem(), GeoObjectListItem(), GeoObjectListItem(), ~GeoObjectListItem(), and vtkSource().


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