SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Classes | Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
pqSMTKAttributeItemWidget Class Referenceabstract

A subclass of qtItem common to all ParaView property widgets. More...

#include <pqSMTKAttributeItemWidget.h>

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

Classes

class  Internal
 State shared by all ParaView-enabled qtItem widgets. More...
 

Public Types

enum  OverrideWhen { OverrideWhen::Unset, OverrideWhen::Never }
 Specify when the widget may override values in the item. More...
 
enum  FallbackStrategy { FallbackStrategy::Hide, FallbackStrategy::Force }
 Specify how to size/place a widget. More...
 
enum  GeometrySource {
  GeometrySource::Item, GeometrySource::Associations, GeometrySource::Links, GeometrySource::Scene,
  GeometrySource::BestGuess, GeometrySource::None
}
 Specify how to size/place a widget. More...
 
using qtItem = smtk::extension::qtItem
 
using qtAttributeItemInfo = smtk::extension::qtAttributeItemInfo
 

Public Slots

virtual void updateItemFromWidget ()
 
virtual void updateWidgetFromItem ()
 
void setOutputOptional (int optionEnabled)
 Change whether the item is enabled (and thus the widget active). More...
 
void renderViewEventually () const
 Cause the active view (in which the widget appears) to re-render.
 
- Public Slots inherited from smtk::extension::qtItem
virtual void updateItemData ()
 Tell the qtItem to update itself based on changes to its underlying attribute item.
 

Public Member Functions

void markForDeletion () override
 Indicates that the item should be deleted. More...
 
 pqSMTKAttributeItemWidget (const qtAttributeItemInfo &info, Qt::Orientation orient=Qt::Horizontal)
 
 pqSMTKAttributeItemWidget (smtk::attribute::ItemPtr, QWidget *p, smtk::extension::qtBaseView *bview, Qt::Orientation orient=Qt::Horizontal)
 
virtual bool createProxyAndWidget (vtkSMProxy *&source, pqInteractivePropertyWidget *&widget)=0
 Subclasses must override this method to create the ParaView widget of their choice.
 
pqInteractivePropertyWidget * propertyWidget ()
 
- Public Member Functions inherited from smtk::extension::qtItem
 qtItem (const qtAttributeItemInfo &info)
 
smtk::attribute::ItemPtr item () const
 
template<typename ItemType >
std::shared_ptr< ItemType > itemAs () const
 
qtUIManageruiManager () const
 
smtk::attribute::ResourcePtr attributeResource () const
 Return the underlying Attribute Resource.
 
QPointer< QWidget > widget ()
 
QPointer< QWidget > parentWidget ()
 
bool isLeafItem ()
 
virtual void setLabelVisible (bool)
 
virtual bool isFixedWidth () const
 
void showAdvanceLevelOverlay (bool)
 
bool useSelectionManager () const
 
void setReadOnly (bool mode)
 
bool isReadOnly () const
 
virtual QWidget * lastEditor () const
 Returns editor widget, used when setting tab order.
 
virtual void updateTabOrder (QWidget *)
 Sets previous widget for tabbing order.
 

Static Public Member Functions

static OverrideWhen OverrideWhenConvert (const std::string &str)
 
static std::string OverrideWhenConvert (OverrideWhen val)
 
static FallbackStrategy FallbackStrategyConvert (const std::string &str)
 
static std::string FallbackStrategyConvert (FallbackStrategy val)
 
static GeometrySource GeometrySourceConvert (const std::string &str)
 
static std::string GeometrySourceConvert (GeometrySource val)
 
static void setHideWidgetWhenInactive (bool val)
 Set visibility behavior of 3D widgets when Qt widget is inactive.
 
static bool hideWidgetWhenInactive ()
 

Protected Slots

void updateItemData () override
 Create Qt widgets as required (may be called multiple times if Item is reconfigured).
 
virtual void ignoreWidgetValues ()
 
virtual void acceptWidgetValues ()
 
virtual bool updateItemFromWidgetInternal ()=0
 Update smtk::attribute::Item(s) from widget, returning true if changes were made.
 
virtual bool updateWidgetFromItemInternal ()=0
 Update proxy properties from smtk::attribute::Item(s), returning true if changes were made.
 
- Protected Slots inherited from smtk::extension::qtItem
virtual void onAdvanceLevelChanged (int levelIdx)
 
virtual void onChildWidgetSizeChanged ()
 

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event) override
 An event filter that watches for the associated Qt widget to be hidden or shown. More...
 
virtual void update3DWidgetVisibility (bool visible)
 Hide 3-d widgets when the Qt widget is hidden, show the widget when the Qt widget reappears. More...
 
void createWidget () override
 Initialize Qt widgets used to represent our smtk::attribute::Item.
 
virtual void clearChildWidgets ()
 Remove existing widgets in order to prepare for reconfiguration. More...
 
virtual void updateUI ()
 Actually create widgets for whole of Item (label, editor, and conditional children).
 
virtual void createEditor ()
 Create the widget(s) that allow editing of the Item (as opposed to labels and conditional child widgets).
 
bool validateControlItem (const smtk::attribute::StringItemPtr &item)
 Subclasses may call this to validate that a string item is appropriate for controlling the interaction state of the widget (i.e., the possibly tri-state checkbox that ParaView's Qt widgets provide to control render-view widget visibility).
 
- Protected Member Functions inherited from smtk::extension::qtItem
virtual void setLocalAdvanceLevel (unsigned int level)
 
virtual void addChildItem (qtItem *)
 
virtual void removeChildItem (qtItem *)
 
virtual void clearChildItems ()
 
QList< qtItem * > & childItems ()
 

Protected Attributes

Internalm_p
 
- Protected Attributes inherited from smtk::extension::qtItem
QPointer< QWidget > m_widget
 
bool m_isLeafItem
 
bool m_useSelectionManager
 
bool m_readOnly
 
bool m_markedForDeletion
 
qtAttributeItemInfo m_itemInfo
 
QList< smtk::extension::qtItem * > m_childItems
 

Additional Inherited Members

- Signals inherited from smtk::extension::qtItem
void widgetSizeChanged ()
 Signal indicates that the underlying widget's size has been modified.
 
void modified ()
 Signal indicates that the underlying item has been modified.
 
void childModified (qtItem *item)
 Signal indicates that the child from the underlying item has been modified More...
 
void editingWidgetChanged ()
 Indicates editing widget changed. More...
 

Detailed Description

A subclass of qtItem common to all ParaView property widgets.

SMTK's ParaView extensions provide custom qtItem subclasses that allow users to edit item values with 2-D/3-D widgets in the active view. This abstract class handles as much of the commonalities between the ParaView-widget-specific subclasses as possible.

In particular, it creates Qt widgets to hold the ParaView GUI components while also matching the style of other qtItem subclasses; it manages a checkbox enabling/disabling the widget if the item's IsOptional flag is true, it creates a label showing the item's title, etc.

Member Enumeration Documentation

◆ FallbackStrategy

Specify how to size/place a widget.

Enumerator
Hide 

Hide the widget rather than show an uninitialized widget.

Force 

Force the widget's size/placement to either the geometry source or the item's default.

◆ GeometrySource

Specify how to size/place a widget.

Enumerator
Item 

Use the item's current value(s).

Associations 

Use the attribute's current association(s).

Links 

Use the attribute-resource's linked resources.

Scene 

Use all geometric resources in the current scene.

BestGuess 

Use all of the above, falling back as needed.

None 

Do not use model/mesh resources to initialize the widget.

◆ OverrideWhen

Specify when the widget may override values in the item.

Enumerator
Unset 

When the item is unset and FallbackStrategy is Force.

Never 

Do not ever let the widget dictate values in the item without user input.

Member Function Documentation

◆ clearChildWidgets()

void pqSMTKAttributeItemWidget::clearChildWidgets ( )
protectedvirtual

Remove existing widgets in order to prepare for reconfiguration.

If conditional children exist, this may get called after createWidget().

◆ eventFilter()

bool pqSMTKAttributeItemWidget::eventFilter ( QObject *  obj,
QEvent *  event 
)
overrideprotected

An event filter that watches for the associated Qt widget to be hidden or shown.

When this happens, update3DWidgetVisibility() is invoked.

◆ markForDeletion()

void pqSMTKAttributeItemWidget::markForDeletion ( )
overridevirtual

Indicates that the item should be deleted.

This is similar to Qt's deleteLater() method (in fact it calls it); however, it also allows the qtItem to do some cleanup such as stop observing SMTK "signals".

Reimplemented from smtk::extension::qtItem.

◆ setOutputOptional

void pqSMTKAttributeItemWidget::setOutputOptional ( int  optionEnabled)
slot

Change whether the item is enabled (and thus the widget active).

Note that subclasses must override this method and, at a minimum, set the underlying smtk::attribute::Item's optional state. Subclasses must do this because ParaView widgets can represent items of different types.

However, subclasses may wish to call this method from within their override as it will enable/disable the paraview property widget.

◆ update3DWidgetVisibility()

void pqSMTKAttributeItemWidget::update3DWidgetVisibility ( bool  visible)
protectedvirtual

Hide 3-d widgets when the Qt widget is hidden, show the widget when the Qt widget reappears.

Subclasses may override update3DWidgetVisibility() if they do not want to inherit the default behavior.


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