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

Display an interactive 3-D cone (or cylinder) frustum widget. More...

#include <pqSMTKConeItemWidget.h>

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

Public Slots

bool setForceCylindrical (bool)
 Change the user interface so that only cylinders are accepted (when passed true). More...
 
- 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.
 

Public Member Functions

 pqSMTKConeItemWidget (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
 
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 qtItemcreateConeItemWidget (const qtAttributeItemInfo &info)
 Create an instance of the widget that allows users to define a cone.
 
static qtItemcreateCylinderItemWidget (const qtAttributeItemInfo &info)
 Create an instance of the widget that allows users to define a cylinder.
 
- 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::ConePointsRadii, ItemBindings::CylinderPointsRadius, ItemBindings::Invalid }
 Describe how an attribute's items specify a cone or cylinder. More...
 

Protected Slots

bool updateItemFromWidgetInternal () override
 Retrieve property values from ParaView proxy and store them in the attribute's Item.
 
bool updateWidgetFromItemInternal () override
 Retrieve property values from the attribute's Item and update the ParaView proxy.
 
- 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 fetchConeItems (ItemBindings &binding, std::vector< smtk::attribute::DoubleItemPtr > &items)
 Starting with the widget's assigned item (which must currently be a GroupItem), determine and return bound 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 ()
 

Protected Attributes

bool m_forceCylinder { false }
 
- 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
 

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
 
- 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

Display an interactive 3-D cone (or cylinder) frustum widget.

The widget currently accepts 2 endpoints that define an axis for the cone and, at the same time, 2 parallel planes that cut the cone. Each endpoint may have an associated radius, one of which may be zero.

If setForceCylindrical(true) is called, then the cone is forced to be a cylinder with a single radius value accepted.

Note that the widget does not allow an interior apex (i.e., neither of the the radii may be negative).

In the future, other item types (such as a GroupItem holding children specifying a center, Euler angles, and a length) may be supported.

Currently, there is no support to initialize the placement to a given set of bounds; if you use this widget as part of the user interface to an operation, implement a configure() method on the operation to contextually place the widget based on associations.

Member Enumeration Documentation

◆ ItemBindings

enum pqSMTKConeItemWidget::ItemBindings
strongprotected

Describe how an attribute's items specify a cone or cylinder.

Enumerator
ConePointsRadii 

2 items with 3 values, 2 items with 1 value (x0, y0, z0, x1, y1, z1, r0, r1).

CylinderPointsRadius 

2 items with 3 values, 1 item with 1 value (x0, y0, z0, x1, y1, z1, radius).

Invalid 

No consistent set of items detected.

Member Function Documentation

◆ fetchConeItems()

bool pqSMTKConeItemWidget::fetchConeItems ( ItemBindings binding,
std::vector< smtk::attribute::DoubleItemPtr > &  items 
)
protected

Starting with the widget's assigned item (which must currently be a GroupItem), determine and return bound items.

The named item must be a Group holding items as called out by one of the valid ItemBindings enumerants. The items inside the Group must currently be Double items.

If errors (such as a lack of matching item names or an unexpected number of values per item) are encountered, this method returns false.

◆ setForceCylindrical

bool pqSMTKConeItemWidget::setForceCylindrical ( bool  isCylinder)
slot

Change the user interface so that only cylinders are accepted (when passed true).

This method returns true when the user interface changes state as a result of the call and false otherwise.


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