Signals | Public Member Functions | Properties | List of all members
pqDataAssemblyPropertyWidget Class Reference

pqPropertyWidget for properties with vtkDataAssembly More...

#include <pqDataAssemblyPropertyWidget.h>

Inheritance diagram for pqDataAssemblyPropertyWidget:
Inheritance graph
[legend]
Collaboration diagram for pqDataAssemblyPropertyWidget:
Collaboration graph
[legend]

Signals

void selectorsChanged ()
 
void colorsChanged ()
 
void opacitiesChanged ()
 
- Signals inherited from pqPropertyWidget
void viewChanged (pqView *view)
 This signal is emitted when the current view changes. More...
 
void changeAvailable ()
 This signal is fired as soon as the user starts editing in the widget. More...
 
void changeFinished ()
 This signal is fired as soon as the user is done with making an atomic change. More...
 
void restartRequired ()
 Indicates that a restart of the program is required for the setting to take effect. More...
 

Public Member Functions

 pqDataAssemblyPropertyWidget (vtkSMProxy *smproxy, vtkSMPropertyGroup *smgroup, QWidget *parent=nullptr)
 
 pqDataAssemblyPropertyWidget (vtkSMProxy *smproxy, vtkSMProperty *smproperty, QWidget *parent=nullptr)
 
 ~pqDataAssemblyPropertyWidget () override
 
void updateWidget (bool showing_advanced_properties) override
 
void setSelectors (const QStringList &paths)
 API for getting/setting selected/chosen path strings. More...
 
const QStringList & selectors () const
 API for getting/setting selected/chosen path strings. More...
 
void setSelectors (const QList< QVariant > &paths)
 API for getting/setting selected/chosen path strings. More...
 
QList< QVariant > selectorsAsVariantList () const
 API for getting/setting selected/chosen path strings. More...
 
void setCompositeIndices (const QList< QVariant > &values)
 API for getting/settings composite indices. More...
 
QList< QVariant > compositeIndicesAsVariantList () const
 API for getting/settings composite indices. More...
 
void setCompositeIndexColors (const QList< QVariant > &values)
 API to get/set colors. More...
 
QList< QVariant > compositeIndexColorsAsVariantList () const
 API to get/set colors. More...
 
void setSelectorColors (const QList< QVariant > &values)
 API to get/set colors. More...
 
QList< QVariant > selectorColorsAsVariantList () const
 API to get/set colors. More...
 
void setCompositeIndexOpacities (const QList< QVariant > &values)
 API to get/set opacities. More...
 
QList< QVariant > compositeIndexOpacitiesAsVariantList () const
 API to get/set opacities. More...
 
void setSelectorOpacities (const QList< QVariant > &values)
 API to get/set opacities. More...
 
QList< QVariant > selectorOpacitiesAsVariantList () const
 API to get/set opacities. More...
 
- Public Member Functions inherited from pqPropertyWidget
 pqPropertyWidget (vtkSMProxy *proxy, QWidget *parent=nullptr)
 
 ~pqPropertyWidget () override
 
virtual void apply ()
 
virtual void reset ()
 
pqViewview () const
 
vtkSMProxyproxy () const
 
vtkSMPropertyproperty () const
 
virtual char * panelVisibility () const
 Forward calls to vtkSMProperty. More...
 
virtual void setPanelVisibility (const char *vis)
 
virtual bool isSingleRowItem () const
 Determines if the PropertyWidget must be constructed using a single row. More...
 
bool showLabel () const
 
const QList< QPointer< pqPropertyWidgetDecorator > > & decorators () const
 Provides access to the decorators for this widget. More...
 
void setProperty (vtkSMProperty *property)
 
virtual void select ()
 These methods are called by pqPropertiesPanel when the panel for proxy becomes active/deactive. More...
 
virtual void selectPort (int portIndex)
 These methods are called by pqPropertiesPanel when the panel for proxy becomes active/deactive. More...
 
virtual void deselect ()
 These methods are called by pqPropertiesPanel when the panel for proxy becomes active/deactive. More...
 
bool isSelected () const
 These methods are called by pqPropertiesPanel when the panel for proxy becomes active/deactive. More...
 

Properties

QList< QVariant > selectors
 Property with selectors for checked nodes in the hierarchy. More...
 
QList< QVariant > selectorColors
 Property with selectors and associated colors (as RGB). More...
 
QList< QVariant > selectorOpacities
 Property with selectors and associated opacities. More...
 
QList< QVariant > compositeIndices
 These are similar to the selector-based variants, except, instead of a selector, the composite index is used. More...
 
QList< QVariant > compositeIndexOpacities
 These are similar to the selector-based variants, except, instead of a selector, the composite index is used. More...
 
QList< QVariant > compositeIndexColors
 These are similar to the selector-based variants, except, instead of a selector, the composite index is used. More...
 

Additional Inherited Members

- Public Slots inherited from pqPropertyWidget
virtual void setView (pqView *)
 called to set the active view. More...
 
- Static Public Member Functions inherited from pqPropertyWidget
template<class T >
static QString getXMLName (T *object)
 Description: This static utility method returns the XML name for an object as a QString. More...
 
static QString getTooltip (vtkSMProperty *property)
 Returns the tooltip to use for the property. More...
 
static int hintsWidgetHeightNumberOfRows (vtkPVXMLElement *hints, int defaultValue=10)
 Helper method to return value from WidgetHeight XML hint, if any. More...
 
static std::vector< std::stringparseComponentLabels (vtkPVXMLElement *hints, unsigned int elemCount=0)
 Parse a XML element as a list of label to use for this widget. More...
 
- Protected Member Functions inherited from pqPropertyWidget
void addPropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProperty *smproperty, int smindex=-1)
 
void addPropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProxy *smproxy, vtkSMProperty *smproperty, int smindex=-1)
 
void removePropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProperty *smproperty, int smindex=-1)
 
void removePropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProxy *smproxy, vtkSMProperty *smproperty, int smindex=-1)
 
void setShowLabel (bool show)
 
void setChangeAvailableAsChangeFinished (bool status)
 For most pqPropertyWidget subclasses a changeAvailable() signal, corresponds to a changeFinished() signal. More...
 
void addDecorator (pqPropertyWidgetDecorator *)
 Register a decorator. More...
 
void removeDecorator (pqPropertyWidgetDecorator *)
 Unregisters a decorator. More...
 
pqPropertyLinkslinks ()
 Provides access to the pqPropertyLinks instance. More...
 

Detailed Description

pqPropertyWidget for properties with vtkDataAssembly

pqDataAssemblyPropertyWidget is intended for properties that rely on a vtkDataAssembly i.e. use a vtkSMDataAssemblyDomain. This supports getting/setting the list of selectors for checked nodes based on the chosen vtkDataAssembly. Further more, it supports editing color and opacity, if requested.

pqDataAssemblyPropertyWidget can be used on a single property with a vtkSMDataAssemblyDomain or for a group of properties. For a single property, it allows for editing on selectors for checked nodes. For a group, it can support opacity and color editing as well.

Here's an example proxy XML for a single property.

<Proxy ...>
<StringVectorProperty name="Selectors"
repeat_command="1"
number_of_elements_per_command="1"
default_values="/" >
<DataAssemblyDomain name="data_assembly">
<RequiredProperties>
<Property function="Input" name="Input" />
</RequiredProperties>
</DataAssemblyDomain>
</StringVectorProperty>
...
</Proxy>

The widget will use the assembly provided by vtkSMDataAssemblyDomain::GetDataAssembly to render a tree in UI.

A property-group for editing color and opacity, along with choosing which named-assembly to use is as follows. All properties in the group are optional and one may specify on subset that is relevant for their use-case. It is assumed, however, that all properties in the group use the same data assembly. If that's not the case, one should use separate property groups, hence separate widgets, for each.

<Proxy ...>
<StringVectorProperty name="Assembly"
command="SetAssemblyName"
number_of_elements="1">
<DataAssemblyListDomain name="data_assembly_list">
<RequiredProperties>
<Property function="Input" name="Input" />
</RequiredProperties>
</DataAssemblyListDomain>
<Documentation>
Select which assembly is used when specify selectors
to choose blocks to show for composite datasets.
</Documentation>
</StringVectorProperty>
<StringVectorProperty name="Selectors"
command="AddSelector"
clean_command="ClearSelectors"
repeat_command="1"
number_of_elements_per_command="1">
<DataAssemblyDomain name="data_assembly">
<RequiredProperties>
<Property function="Input" name="Input" />
<Property function="ActiveAssembly" name="Assembly" />
</RequiredProperties>
</DataAssemblyDomain>
<Documentation>
For composite datasets, specify selectors to limit the view
to a chosen subset of blocks.
</Documentation>
</StringVectorProperty>
<StringVectorProperty name="BlockColor"
element_types="2 1 1 1"
number_of_elements_per_command="4"
repeat_command="1">
<DataAssemblyDomain name="data_assembly">
<RequiredProperties>
<Property function="Input" name="Input" />
<Property function="ActiveAssembly" name="Assembly" />
</RequiredProperties>
</DataAssemblyDomain>
</StringVectorProperty>
<StringVectorProperty name="BlockOpacity"
element_types="2 1"
number_of_elements_per_command="2"
repeat_command="1">
<DataAssemblyDomain name="data_assembly">
<RequiredProperties>
<Property function="Input" name="Input" />
<Property function="ActiveAssembly" name="Assembly" />
</RequiredProperties>
</DataAssemblyDomain>
</StringVectorProperty>
<PropertyGroup label="Blocks" panel_widget="DataAssemblyEditor">
<Property name="Assembly" function="ActiveAssembly" />
<Property name="Selectors" function="Selectors" />
<Property name="BlockColor" function="Colors" />
<Property name="BlockOpacity" function="Opacities" />
</PropertyGroup>
</Proxy>

This widget is primarily intended for vtkSMDataAssemblyDomain. However, to support legacy code that uses vtkSMCompositeTreeDomain instead, we add support for vtkSMCompositeTreeDomain as well. It is required, however, that all properties in the group to consistently use vtkSMDataAssemblyDomain or vtkSMCompositeTreeDomain and mixing is not allowed.

TODO: Remove the usage of vvtkSMCompositeTreeDomain.

Hints

This widget supports hints that can be added to the group (or property). For example:

<PropertyGroup label="AssemblyOnly" panel_widget="DataAssemblyEditor">
<Property name="Assembly" function="ActiveAssembly" />
<Property name="Selectors" function="Selectors" />
<Hints>
<DataAssemblyPropertyWidget
is_checkable="0"
use_inputname_as_header="1"
link_active_selection="1"
/>
</Hints>
</PropertyGroup>

is_checkable can be set to 0 to avoid showing checkboxes for items in the tree.

use_inputname_as_header, when set to 1 causes the widget to use the input's registration name as the header for the tree widget rather than the XML label for the group (or property) attached to the widget.

link_active_selection, when set to 1 causes the widget to track the active block-selection and vice-versa.

Definition at line 160 of file pqDataAssemblyPropertyWidget.h.

Constructor & Destructor Documentation

◆ pqDataAssemblyPropertyWidget() [1/2]

pqDataAssemblyPropertyWidget::pqDataAssemblyPropertyWidget ( vtkSMProxy smproxy,
vtkSMPropertyGroup smgroup,
QWidget *  parent = nullptr 
)

◆ pqDataAssemblyPropertyWidget() [2/2]

pqDataAssemblyPropertyWidget::pqDataAssemblyPropertyWidget ( vtkSMProxy smproxy,
vtkSMProperty smproperty,
QWidget *  parent = nullptr 
)

◆ ~pqDataAssemblyPropertyWidget()

pqDataAssemblyPropertyWidget::~pqDataAssemblyPropertyWidget ( )
override

Member Function Documentation

◆ setSelectors() [1/2]

void pqDataAssemblyPropertyWidget::setSelectors ( const QStringList &  paths)

API for getting/setting selected/chosen path strings.

◆ selectors()

const QStringList& pqDataAssemblyPropertyWidget::selectors ( ) const

API for getting/setting selected/chosen path strings.

◆ setSelectors() [2/2]

void pqDataAssemblyPropertyWidget::setSelectors ( const QList< QVariant > &  paths)

API for getting/setting selected/chosen path strings.

◆ selectorsAsVariantList()

QList<QVariant> pqDataAssemblyPropertyWidget::selectorsAsVariantList ( ) const

API for getting/setting selected/chosen path strings.

◆ setCompositeIndices()

void pqDataAssemblyPropertyWidget::setCompositeIndices ( const QList< QVariant > &  values)

API for getting/settings composite indices.

◆ compositeIndicesAsVariantList()

QList<QVariant> pqDataAssemblyPropertyWidget::compositeIndicesAsVariantList ( ) const

API for getting/settings composite indices.

◆ setCompositeIndexColors()

void pqDataAssemblyPropertyWidget::setCompositeIndexColors ( const QList< QVariant > &  values)

API to get/set colors.

Colors are specified either as a list of selectors followed by corresponding RGB color or list of composite indices followed by the color.

◆ compositeIndexColorsAsVariantList()

QList<QVariant> pqDataAssemblyPropertyWidget::compositeIndexColorsAsVariantList ( ) const

API to get/set colors.

Colors are specified either as a list of selectors followed by corresponding RGB color or list of composite indices followed by the color.

◆ setSelectorColors()

void pqDataAssemblyPropertyWidget::setSelectorColors ( const QList< QVariant > &  values)

API to get/set colors.

Colors are specified either as a list of selectors followed by corresponding RGB color or list of composite indices followed by the color.

◆ selectorColorsAsVariantList()

QList<QVariant> pqDataAssemblyPropertyWidget::selectorColorsAsVariantList ( ) const

API to get/set colors.

Colors are specified either as a list of selectors followed by corresponding RGB color or list of composite indices followed by the color.

◆ setCompositeIndexOpacities()

void pqDataAssemblyPropertyWidget::setCompositeIndexOpacities ( const QList< QVariant > &  values)

API to get/set opacities.

Opacities are specified either as a list of selectors followed by corresponding opacity or list of composite indices followed by the opacity.

◆ compositeIndexOpacitiesAsVariantList()

QList<QVariant> pqDataAssemblyPropertyWidget::compositeIndexOpacitiesAsVariantList ( ) const

API to get/set opacities.

Opacities are specified either as a list of selectors followed by corresponding opacity or list of composite indices followed by the opacity.

◆ setSelectorOpacities()

void pqDataAssemblyPropertyWidget::setSelectorOpacities ( const QList< QVariant > &  values)

API to get/set opacities.

Opacities are specified either as a list of selectors followed by corresponding opacity or list of composite indices followed by the opacity.

◆ selectorOpacitiesAsVariantList()

QList<QVariant> pqDataAssemblyPropertyWidget::selectorOpacitiesAsVariantList ( ) const

API to get/set opacities.

Opacities are specified either as a list of selectors followed by corresponding opacity or list of composite indices followed by the opacity.

◆ updateWidget()

void pqDataAssemblyPropertyWidget::updateWidget ( bool  showing_advanced_properties)
overridevirtual

Reimplemented from pqPropertyWidget.

◆ selectorsChanged

void pqDataAssemblyPropertyWidget::selectorsChanged ( )
signal

◆ colorsChanged

void pqDataAssemblyPropertyWidget::colorsChanged ( )
signal

◆ opacitiesChanged

void pqDataAssemblyPropertyWidget::opacitiesChanged ( )
signal

Property Documentation

◆ selectors

QList<QVariant> pqDataAssemblyPropertyWidget::selectors
readwrite

Property with selectors for checked nodes in the hierarchy.

Definition at line 169 of file pqDataAssemblyPropertyWidget.h.

◆ selectorColors

QList<QVariant> pqDataAssemblyPropertyWidget::selectorColors
readwrite

Property with selectors and associated colors (as RGB).

Definition at line 169 of file pqDataAssemblyPropertyWidget.h.

◆ selectorOpacities

QList<QVariant> pqDataAssemblyPropertyWidget::selectorOpacities
readwrite

Property with selectors and associated opacities.

Definition at line 175 of file pqDataAssemblyPropertyWidget.h.

◆ compositeIndices

QList<QVariant> pqDataAssemblyPropertyWidget::compositeIndices
readwrite

These are similar to the selector-based variants, except, instead of a selector, the composite index is used.

This is used when supported vtkSMCompositeTreeDomain-based properties.

Definition at line 181 of file pqDataAssemblyPropertyWidget.h.

◆ compositeIndexOpacities

QList<QVariant> pqDataAssemblyPropertyWidget::compositeIndexOpacities
readwrite

These are similar to the selector-based variants, except, instead of a selector, the composite index is used.

This is used when supported vtkSMCompositeTreeDomain-based properties.

Definition at line 190 of file pqDataAssemblyPropertyWidget.h.

◆ compositeIndexColors

QList<QVariant> pqDataAssemblyPropertyWidget::compositeIndexColors
readwrite

These are similar to the selector-based variants, except, instead of a selector, the composite index is used.

This is used when supported vtkSMCompositeTreeDomain-based properties.

Definition at line 192 of file pqDataAssemblyPropertyWidget.h.


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