...
 
Commits (3)
# This file specifies people who "own" specific
# pieces of code in SMTK. It is used to suggest
# reviewers for merge requests based on the set
# of files changed in the MR.
# Subsystems have specific owners
conda/ tj.corona@kitware.com john.tourtellott@kitware.com
doc/tutorials/ david.thompson@kitware.com
doc/userguide/ david.thompson@kitware.com
smtk/attribute/ bob.obara@kitware.com
smtk/common/ david.thompson@kitware.com
smtk/extension/opencv/ jacob.becker@kitware.com
smtk/extension/paraview/ david.thompson@kitware.com
smtk/extension/qt/ bob.obara@kitware.com
smtk/extension/vtk/ david.thompson@kitware.com tj.corona@kitware.com
smtk/io/ bob.obara@kitware.com
smtk/mesh/ tj.corona@kitware.com
smtk/model/ david.thompson@kitware.com
smtk/operation/ tj.corona@kitware.com
smtk/plugin/ tj.corona@kitware.com
smtk/project/ john.tourtellott@kitware.com
smtk/pybind11/ tj.corona@kitware.com
smtk/resource/ tj.corona@kitware.com
smtk/session/discrete/ bob.obara@kitware.com
smtk/session/multiscale/ tj.corona@kitware.com
smtk/session/oscillator/ david.thompson@kitware.com
smtk/session/polygon/ david.thompson@kitware.com
smtk/session/vtk/ david.thompson@kitware.com
smtk/simulation/ john.tourtellott@kitware.com
smtk/smtk/ tj.corona@kitware.com david.thompson@kitware.com
smtk/view/ david.thompson@kitware.com
utilities/ ben.boeckel@kitware.com
......@@ -1816,6 +1816,42 @@
</PropertyGroup>
</Proxy>
<!-- Axis-aligned box widget -->
<Proxy
name="SMTKAxisAlignedBoxWidget"
class="vtkPVBox"
>
<DoubleVectorProperty command="SetBounds"
default_values="0 1 0 1 0 1"
name="Bounds"
number_of_elements="6"></DoubleVectorProperty>
<DoubleVectorProperty animateable="1"
command="SetPosition"
default_values="0.0 0.0 0.0"
name="Position"
number_of_elements="3">
<DoubleRangeDomain name="range" />
<Documentation>
Set the position of the box.
</Documentation>
</DoubleVectorProperty>
<DoubleVectorProperty animateable="1"
command="SetScale"
default_values="1.0 1.0 1.0"
name="Scale"
number_of_elements="3">
<DoubleRangeDomain name="range" />
<Documentation>
Set the size of the box via a scale factor.
</Documentation>
</DoubleVectorProperty>
<PropertyGroup panel_widget="InteractiveBox" label="Box Parameters">
<Property function="Position" name="Position" />
<Property function="Scale" name="Scale" />
<Property function="PlaceWidget" name="Bounds" />
</PropertyGroup>
</Proxy>
</ProxyGroup>
<ProxyGroup name="settings">
......
......@@ -39,16 +39,29 @@ public:
static qtItem* createBoxItemWidget(const AttributeItemInfo& info);
bool createProxyAndWidget(vtkSMProxy*& proxy, pqInteractivePropertyWidget*& widget) override;
/// Retrieve property values from ParaView proxy and store them in the attribute's Item.
void updateItemFromWidget() override;
/// Retrieve property values from the attribute's Item and update the ParaView proxy.
void updateWidgetFromItem() override;
protected:
/// Describe how an attribute's items specify a bounding box.
enum class ItemBindings
{
AxisAlignedBounds, //!< 1 item with 6 values (xmin, xmax, ymin, ymax, zmin, zmax)
AxisAlignedMinMax, //!< 2 items with 3 values each (xlo, ylo, zlo), (xhi, yhi, zhi)
AxisAlignedCenterDeltas, //!< 2 items with 3 values each (xc, yc, zc), (dx, dy, dz)
EulerAngleMinMax, //!< 3 items with 3 values each (xlo, ylo, zlo), (xhi, yhi, zhi), (roll, pitch, yaw)
EulerAngleCenterDeltas //!< 3 items with 3 values each (xc, yc, zc), (dx, dy, dz), (roll, pitch, yaw)
/// 1 item with 6 values (xmin, xmax, ymin, ymax, zmin, zmax)
AxisAlignedBounds,
/// 2 items with 3 values each (xlo, ylo, zlo), (xhi, yhi, zhi)
AxisAlignedMinMax,
/// 2 items with 3 values each (xc, yc, zc), (dx, dy, dz)
AxisAlignedCenterDeltas,
/// 1 item with 6 values (min/max as above), 1 item with (roll, pitch, yaw)
EulerAngleBounds,
/// 3 items with 3 values each (xlo, ylo, zlo), (xhi, yhi, zhi), (roll, pitch, yaw)
EulerAngleMinMax,
/// 3 items with 3 values each (xc, yc, zc), (dx, dy, dz), (roll, pitch, yaw)
EulerAngleCenterDeltas,
/// No consistent set of items detected.
Invalid
};
/**\brief Starting with the widget's assigned item (which may
* be a GroupItem or a DoubleItem), determine and return bound items.
......@@ -56,15 +69,14 @@ protected:
* If errors are encountered, this method returns false.
* If the name of a DoubleItem is provided, then the AxisAlignedBounds binding
* is assumed and that item is returned as the sole entry of \items.
* Otherwise, the named item must be a Group holding items called out as one
* of the following:
* + AxisAlignedMinMax: "Min", "Max" with numberOfValues == 3
* + AxisAlignedCenterDeltas: "Center", "Deltas", with numberOfValues == 3
* + EulerAngleMinMax: "Angles", "Min", "Max" with numberOfValues == 3
* + EulerAngleCenterDeltas: "Angles, "Center", "Deltas" with numberOfValues == 3
* Otherwise, the named item must be a Group holding items called out as via
* one of the remaining valid ItemBindings enumerants.
*
* Euler angles must be provided in degrees and are roll, pitch, and yaw
* (i.e., rotation about the x, y, and z axes, respectively).
* Angles must be provided in degrees and are Tait-Bryan angles
* as used by VTK (i.e., rotations about y then x then z axes).
* These are similar to Euler angles and sometimes called as such.
* See https://en.wikipedia.org/wiki/Euler_angles#Intrinsic_rotations
* for more information. VTK uses the Y_1 X_2 Z_3 ordering.
*/
bool fetchBoxItems(ItemBindings& binding, std::vector<smtk::attribute::DoubleItemPtr>& items);
};
......
......@@ -13,7 +13,6 @@ set(QAttrLibSrcs
qtCollapsibleGroupWidget.cxx
qtComponentItem.cxx
qtDescriptivePhraseDelegate.cxx
qtDescriptivePhraseEditor.cxx
qtDescriptivePhraseModel.cxx
qtGroupView.cxx
qtAnalysisView.cxx
......@@ -81,7 +80,6 @@ set(QAttrLibMocHeaders
qtComponentItem.h
qtEmittingStringBuffer.h
qtDescriptivePhraseDelegate.h
qtDescriptivePhraseEditor.h
qtDescriptivePhraseModel.h
qtGroupView.h
qtAnalysisView.h
......
......@@ -9,11 +9,11 @@
//=========================================================================
#include "smtk/extension/qt/qtDescriptivePhraseDelegate.h"
#include "smtk/extension/qt/qtDescriptivePhraseEditor.h"
#include "smtk/extension/qt/qtDescriptivePhraseModel.h"
#include <QAbstractProxyModel>
#include <QApplication>
#include <QLineEdit>
#include <QMouseEvent>
#include <QPainter>
......@@ -279,7 +279,7 @@ QWidget* qtDescriptivePhraseDelegate::createEditor(
// Otherwise, edit the title if the item says we can.
if (idx.data(qtDescriptivePhraseModel::TitleTextMutableRole).toBool())
{
smtk::extension::qtDescriptivePhraseEditor* editor = new qtDescriptivePhraseEditor(owner);
QLineEdit* editor = new QLineEdit(owner);
return editor;
}
return nullptr;
......@@ -336,24 +336,20 @@ void qtDescriptivePhraseDelegate::updateEditorGeometry(
void qtDescriptivePhraseDelegate::setEditorData(QWidget* editor, const QModelIndex& idx) const
{
smtk::extension::qtDescriptivePhraseEditor* entityEditor =
qobject_cast<smtk::extension::qtDescriptivePhraseEditor*>(editor);
if (entityEditor)
QLineEdit* titleEditor = qobject_cast<QLineEdit*>(editor);
if (titleEditor)
{
entityEditor->setTitle(idx.data(qtDescriptivePhraseModel::TitleTextRole).toString());
// TODO: editor should also allow adjusting entity type?
titleEditor->setText(idx.data(qtDescriptivePhraseModel::TitleTextRole).toString());
}
}
void qtDescriptivePhraseDelegate::setModelData(
QWidget* editor, QAbstractItemModel* model, const QModelIndex& idx) const
{
smtk::extension::qtDescriptivePhraseEditor* entityEditor =
qobject_cast<smtk::extension::qtDescriptivePhraseEditor*>(editor);
if (entityEditor)
QLineEdit* titleEditor = qobject_cast<QLineEdit*>(editor);
if (titleEditor)
{
// TODO: editor should also allow adjusting entity type?
model->setData(idx, entityEditor->title(), qtDescriptivePhraseModel::TitleTextRole);
model->setData(idx, titleEditor->text(), qtDescriptivePhraseModel::TitleTextRole);
}
}
......
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#include "smtk/extension/qt/qtDescriptivePhraseEditor.h"
#include <QHBoxLayout>
#include <QLineEdit>
namespace smtk
{
namespace extension
{
qtDescriptivePhraseEditor::qtDescriptivePhraseEditor(QWidget* super)
: QWidget(super)
{
m_title = new QLineEdit(this);
this->setFocusProxy(m_title);
new QHBoxLayout(this);
QObject::connect(m_title, SIGNAL(editingFinished()), this, SIGNAL(editingFinished()));
}
qtDescriptivePhraseEditor::~qtDescriptivePhraseEditor()
{
}
/*
QSize qtDescriptivePhraseEditor::sizeHint() const
{
return m_title->sizeHint();
}
*/
QString qtDescriptivePhraseEditor::title() const
{
return m_title->text();
}
void qtDescriptivePhraseEditor::setTitle(const QString& text)
{
m_title->setText(text);
}
} // namespace model
} // namespace smtk
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#ifndef __smtk_extension_qtDescriptivePhraseEditor_h
#define __smtk_extension_qtDescriptivePhraseEditor_h
#include "smtk/extension/qt/Exports.h"
#include <QWidget>
class QLineEdit;
namespace smtk
{
namespace extension
{
/**\brief Allow user edits to an smtk::model::Resource instance via qtDescriptivePhraseModel.
*
*/
class SMTKQTEXT_EXPORT qtDescriptivePhraseEditor : public QWidget
{
Q_OBJECT
public:
qtDescriptivePhraseEditor(QWidget* parent = 0);
~qtDescriptivePhraseEditor() override;
//QSize sizeHint() const;
QString title() const;
void setTitle(const QString& text);
signals:
void editingFinished();
protected:
QLineEdit* m_title;
};
} // namespace model
} // namespace smtk
#endif // __smtk_extension_qtDescriptivePhraseEditor_h
......@@ -10,7 +10,6 @@
#include "smtk/extension/qt/qtResourceBrowser.h"
#include "smtk/extension/qt/qtDescriptivePhraseDelegate.h"
#include "smtk/extension/qt/qtDescriptivePhraseEditor.h"
#include "smtk/extension/qt/qtDescriptivePhraseModel.h"
#include "smtk/extension/qt/qtSMTKUtilities.h"
......