open_iA 2024.7
Loading...
Searching...
No Matches
Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
iADataSetViewer Class Reference

Base class for handling the viewing of an iADataSet in the GUI. More...

#include <iADataSetViewer.h>

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

Signals

void dataSetChanged (size_t dataSetIdx)
 
void removeDataSet (size_t dataSetIdx)
 

Public Member Functions

QAction * addViewAction (QString const &name, QString const &iconName, bool checked)
 helper function for creating and adding a toggling action for switching some aspect of this viewer needs to be called before calling createGUI of this base class (which passes the view actions created so far to the dataset list.
 
iAAttributes attributesWithValues () const
 Retrieves the list of all attributes for this viewer, merged with their current values as default values:
 
QVariantMap attributeValues () const
 Retrieve only the current attribute values.
 
virtual void createGUI (iAMdiChild *child, size_t dataSetIdx)
 Should contain all things that need to be done in the GUI thread for viewing this dataset The default implementation creates a 3D renderer (via createRenderer method) and adds an entry to the dataset list.
 
virtual std::shared_ptr< iADataSetRenderercreateRenderer (vtkRenderer *ren, QVariantMap const &overrideValues=QVariantMap())
 Called to create a 3D renderer for the dataset.
 
virtual QString information () const
 Get information to display about the dataset.
 
virtual void prepare (iAProgress *p)
 called directly after the dataset is loaded, should do anything that needs to be computed in the background
 
bool renderFlagSet (QChar const &flag) const
 
void setAttributes (QVariantMap const &values)
 Call to change the attributes of this viewer.
 
virtual void setPickable (bool pickable)
 
void setPickActionVisible (bool visible)
 
void setRenderFlag (QChar const &flag, bool enable)
 
virtual uint slicerChannelID () const
 
virtual void slicerRegionSelected (double minVal, double maxVal, uint channelID)
 TODO NEWIO: improve!
 
void storeState ()
 called before a dataset is stored; stores the current viewer state into the metadata of the linked dataset (via attributeValues)
 
virtual void unitDistanceChanged (std::array< double, 3 > oldUnitDist, iAMdiChild *child)
 called when unit distance has changed due to dataset edit
 
iADataSetRendererrenderer ()
 
iADataSetRenderer const * renderer () const
 

Static Public Attributes

static const QChar Render3DFlag
 
static const QChar RenderCutPlane
 
static const QString RenderFlags
 key that specifies which views or renderers the viewer currently has visible
 
static const QChar RenderMagicLensFlag
 
static const QChar RenderOutlineFlag
 

Protected Member Functions

 iADataSetViewer (iADataSet *dataSet)
 
virtual ~iADataSetViewer ()
 
void addAttribute (QString const &name, iAValueType valueType, QVariant defaultValue=0.0, double min=std::numeric_limits< double >::lowest(), double max=std::numeric_limits< double >::max())
 adds an attribute that can be modified by the user to change the appearance of some aspect of the viewer
 

Protected Attributes

QVariantMap m_attribValues
 
iADataSetm_dataSet
 the dataset for which this viewer is responsible
 

Detailed Description

Base class for handling the viewing of an iADataSet in the GUI.

Holds all additional data structures (GUI, computed values, etc.) necessary to display it, in addition to the dataset itself (e.g., the histogram for a volume dataset)

Constructor & Destructor Documentation

◆ iADataSetViewer()

iADataSetViewer::iADataSetViewer ( iADataSet * dataSet)
protected

◆ ~iADataSetViewer()

iADataSetViewer::~iADataSetViewer ( )
protectedvirtual

Member Function Documentation

◆ addAttribute()

void iADataSetViewer::addAttribute ( QString const & name,
iAValueType valueType,
QVariant defaultValue = 0.0,
double min = std::numeric_limits<double>::lowest(),
double max = std::numeric_limits<double>::max() )
protected

adds an attribute that can be modified by the user to change the appearance of some aspect of the viewer

◆ addViewAction()

QAction * iADataSetViewer::addViewAction ( QString const & name,
QString const & iconName,
bool checked )

helper function for creating and adding a toggling action for switching some aspect of this viewer needs to be called before calling createGUI of this base class (which passes the view actions created so far to the dataset list.

Actions are shown in reverse order to call to this function, since we want to show the ones common to all viewers first, but these are only created in createGUI of this base class

◆ attributesWithValues()

iAAttributes iADataSetViewer::attributesWithValues ( ) const

Retrieves the list of all attributes for this viewer, merged with their current values as default values:

◆ attributeValues()

QVariantMap iADataSetViewer::attributeValues ( ) const

Retrieve only the current attribute values.

◆ createGUI()

void iADataSetViewer::createGUI ( iAMdiChild * child,
size_t dataSetIdx )
virtual

Should contain all things that need to be done in the GUI thread for viewing this dataset The default implementation creates a 3D renderer (via createRenderer method) and adds an entry to the dataset list.

If you want these things to happen, but additionally some other things, call this function from the derived method (i.e. iADataSetViewer::createGUI). Sometimes, you might not want these things to happen (as e.g. the iAProjectViewer does, since it does not need a 3D viewer nor a dataset list entry),

Reimplemented in iAProjectViewer, and iAVolumeViewer.

◆ createRenderer()

std::shared_ptr< iADataSetRenderer > iADataSetViewer::createRenderer ( vtkRenderer * ren,
QVariantMap const & overrideValues = QVariantMap() )
virtual

Called to create a 3D renderer for the dataset.

Override in derived class; used for both the "normal" 3D renderer and the magic lens renderer.

Parameters
renthe vtk renderer to attach the created renderer to
overrideValues(optional) parameter values for creating the renderer, overriding the default values that can be configured via Edit menu / iASettingsMananger

Reimplemented in iAVolumeViewer, iAMeshViewer, iAGraphViewer, iAGeometricObjectViewer, and iAObjectsViewer.

◆ dataSetChanged

void iADataSetViewer::dataSetChanged ( size_t dataSetIdx)
signal

◆ information()

QString iADataSetViewer::information ( ) const
virtual

Get information to display about the dataset.

Reimplemented in iAVolumeViewer, and iAObjectsViewer.

◆ prepare()

void iADataSetViewer::prepare ( iAProgress * p)
virtual

called directly after the dataset is loaded, should do anything that needs to be computed in the background

Reimplemented in iAVolumeViewer.

◆ removeDataSet

void iADataSetViewer::removeDataSet ( size_t dataSetIdx)
signal

◆ renderer() [1/2]

iADataSetRenderer * iADataSetViewer::renderer ( )

Retrieves the 3D renderer for this dataset (if any; by default, no renderer)

◆ renderer() [2/2]

iADataSetRenderer const * iADataSetViewer::renderer ( ) const

◆ renderFlagSet()

bool iADataSetViewer::renderFlagSet ( QChar const & flag) const

◆ setAttributes()

void iADataSetViewer::setAttributes ( QVariantMap const & values)

Call to change the attributes of this viewer.

◆ setPickable()

void iADataSetViewer::setPickable ( bool pickable)
virtual

Reimplemented in iAVolumeViewer.

◆ setPickActionVisible()

void iADataSetViewer::setPickActionVisible ( bool visible)

◆ setRenderFlag()

void iADataSetViewer::setRenderFlag ( QChar const & flag,
bool enable )

◆ slicerChannelID()

uint iADataSetViewer::slicerChannelID ( ) const
virtual

Reimplemented in iAVolumeViewer.

◆ slicerRegionSelected()

void iADataSetViewer::slicerRegionSelected ( double minVal,
double maxVal,
uint channelID )
virtual

TODO NEWIO: improve!

Reimplemented in iAVolumeViewer.

◆ storeState()

void iADataSetViewer::storeState ( )

called before a dataset is stored; stores the current viewer state into the metadata of the linked dataset (via attributeValues)

◆ unitDistanceChanged()

void iADataSetViewer::unitDistanceChanged ( std::array< double, 3 > oldUnitDist,
iAMdiChild * child )
virtual

called when unit distance has changed due to dataset edit

Reimplemented in iAVolumeViewer.

Member Data Documentation

◆ m_attribValues

QVariantMap iADataSetViewer::m_attribValues
protected

◆ m_dataSet

iADataSet* iADataSetViewer::m_dataSet
protected

the dataset for which this viewer is responsible

◆ Render3DFlag

const QChar iADataSetViewer::Render3DFlag
static

◆ RenderCutPlane

const QChar iADataSetViewer::RenderCutPlane
static

◆ RenderFlags

const QString iADataSetViewer::RenderFlags
static

key that specifies which views or renderers the viewer currently has visible

◆ RenderMagicLensFlag

const QChar iADataSetViewer::RenderMagicLensFlag
static

◆ RenderOutlineFlag

const QChar iADataSetViewer::RenderOutlineFlag
static

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