SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | Static Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | List of all members
pqSMTKPointItemWidget Class Reference

Display a 3-D point with draggable handles for editing a DoubleItem. More...

#include <pqSMTKPointItemWidget.h>

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

Public Member Functions

 pqSMTKPointItemWidget (const smtk::extension::qtAttributeItemInfo &info, Qt::Orientation orient=Qt::Horizontal)
 
bool createProxyAndWidget (vtkSMProxy *&proxy, pqInteractivePropertyWidget *&widget) override
 Subclasses must override this method to create the ParaView widget of their choice.
 
- Public Member Functions inherited from pqSMTKAttributeItemWidget
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)
 
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
 

Static Public Member Functions

static qtItemcreatePointItemWidget (const qtAttributeItemInfo &info)
 
- Static Public Member Functions inherited from pqSMTKAttributeItemWidget
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 Types

enum  ItemBindings { ItemBindings::PointCoords, ItemBindings::PointCoordsAndControl, ItemBindings::Invalid }
 SMTK attribute items to which the widget's values are bound. More...
 

Protected Slots

bool updateItemFromWidgetInternal () override
 Retrieve property values from ParaView proxy and store them in the attribute's Item.
 
bool updateWidgetFromItemInternal () override
 
- Protected Slots inherited from pqSMTKAttributeItemWidget
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 fetchPointItems (ItemBindings &binding, smtk::attribute::DoubleItemPtr &coordItem, smtk::attribute::StringItemPtr &controlItem)
 Discover the item binding from the configuration and return the corresponding items. More...
 
- Protected Member Functions inherited from pqSMTKAttributeItemWidget
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 ()
 

Additional Inherited Members

- Public Types inherited from pqSMTKAttributeItemWidget
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 inherited from pqSMTKAttributeItemWidget
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.
 
- 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...
 
- Protected Attributes inherited from pqSMTKAttributeItemWidget
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
 

Detailed Description

Display a 3-D point with draggable handles for editing a DoubleItem.

This class accepts an item that a DoubleItem with 3 values, or with additional configuration parameters, a GroupItem containing such a DoubleItem along with a discrete StringItem used to control the display and interaction state of the widget. Additionally, the controlling StringItem may be specified via a path to that item rather than its membership in the same group as the DoubleItem.

To configure an item to use this widget, use Type="Point" in the item's view configuration XML. If the item you are configuring is a Double item, no further configuration is required. If the item is a Group containing a Double item that holds point coordinates, you must also provide an attribute named Coords that specifies the name of the item inside the group that holds point coordinates. You may always optionally provide

The controls for interaction state allow users to specify whether the point widget is displayed in render windows as well as whether keyboard shortcuts are registered for it. The UI controls may be hidden or displayed independent of whether the controls are bound to an SMTK item.

Currently, there is no support to initialize the bounding box coordinates used to place the point widget; the item's values will be copied to the 3-D representation only if they exist and there is no default or if they are non-default. In the future, flags in the qtAttributeItemInfo may be used to determine a default box based on model geometry loaded into ParaView, as the underlying widget supports this.

Member Enumeration Documentation

◆ ItemBindings

SMTK attribute items to which the widget's values are bound.

Enumerator
PointCoords 

1 double-item with 3 required values

PointCoordsAndControl 

1 double-item with 3 required values and 1 discrete string-item

Invalid 

No unique, preferred binding could be discovered.

Member Function Documentation

◆ fetchPointItems()

bool pqSMTKPointItemWidget::fetchPointItems ( ItemBindings binding,
smtk::attribute::DoubleItemPtr coordItem,
smtk::attribute::StringItemPtr controlItem 
)
protected

Discover the item binding from the configuration and return the corresponding items.

If no valid binding exists, false will be returned and binding will be set to Invalid.

In order to be a control item, a string item must be discrete and have the following enumerants: "active" (i.e., the point is displayed and accepting keyboard shortcuts), "visible" (i.e., the point is displayed but no shortcuts are active), and "inactive" (i.e., the point is neither displayed nor accepting shortcuts to set its value).


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