Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge topic 'fix-3d-widgets-in-properties-panel'

dc06698 Add support for 3D widgets in the Properties panel
  • Loading branch information...
commit 78baf1bfb0df3b0dca3ba33e9d614dd5b38654f6 2 parents 8924a44 + dc06698
@utkarshayachit utkarshayachit authored kwrobot committed
View
3  Qt/Components/CMakeLists.txt
@@ -65,6 +65,7 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${MOC_INCLUDE_DIRS}")
QT4_WRAP_CPP(MOC_BUILT_SOURCES
pq3DWidget.h
+ pq3DWidgetPropertyWidget.h
pqAboutDialog.h
pqActiveObjects.h
pqActivePlotMatrixViewOptions.h
@@ -370,6 +371,8 @@ SOURCE_GROUP("Generated" FILES
PVVTK_ADD_LIBRARY(pqComponents
pq3DWidget.cxx
pq3DWidget.h
+ pq3DWidgetPropertyWidget.cxx
+ pq3DWidgetPropertyWidget.h
pqAboutDialog.cxx
pqAboutDialog.h
pqActionGroupInterface.cxx
View
65 Qt/Components/pq3DWidgetPropertyWidget.cxx
@@ -0,0 +1,65 @@
+/*=========================================================================
+
+ Program: ParaView
+ Module: pq3DWidgetPropertyWidget.cxx
+
+ Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
+ All rights reserved.
+
+ ParaView is a free software; you can redistribute it and/or modify it
+ under the terms of the ParaView license version 1.2.
+
+ See License_v1.2.txt for the full ParaView license.
+ A copy of this license can be obtained by contacting
+ Kitware Inc.
+ 28 Corporate Drive
+ Clifton Park, NY 12065
+ USA
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================*/
+
+#include "pq3DWidgetPropertyWidget.h"
+
+#include <QVBoxLayout>
+
+#include "pq3DWidget.h"
+
+pq3DWidgetPropertyWidget::pq3DWidgetPropertyWidget(pq3DWidget *widget,
+ QWidget *parent_)
+ : pqPropertyWidget(widget->proxy(), parent_)
+{
+ this->Widget = widget;
+ this->connect(this->Widget, SIGNAL(modified()), this, SIGNAL(modified()));
+
+ QVBoxLayout *layout_ = new QVBoxLayout;
+ layout_->setMargin(0);
+ layout_->addWidget(widget);
+ this->setLayout(layout_);
+}
+
+pq3DWidgetPropertyWidget::~pq3DWidgetPropertyWidget()
+{
+ delete this->Widget;
+}
+
+void pq3DWidgetPropertyWidget::apply()
+{
+ this->Widget->accept();
+}
+
+void pq3DWidgetPropertyWidget::reset()
+{
+ this->Widget->reset();
+}
View
56 Qt/Components/pq3DWidgetPropertyWidget.h
@@ -0,0 +1,56 @@
+/*=========================================================================
+
+ Program: ParaView
+ Module: pq3DWidgetPropertyWidget.h
+
+ Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
+ All rights reserved.
+
+ ParaView is a free software; you can redistribute it and/or modify it
+ under the terms of the ParaView license version 1.2.
+
+ See License_v1.2.txt for the full ParaView license.
+ A copy of this license can be obtained by contacting
+ Kitware Inc.
+ 28 Corporate Drive
+ Clifton Park, NY 12065
+ USA
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================*/
+#ifndef __pq3DWidgetPropertyWidget_h
+#define __pq3DWidgetPropertyWidget_h
+
+#include "pqPropertyWidget.h"
+
+class pq3DWidget;
+
+class pq3DWidgetPropertyWidget : public pqPropertyWidget
+{
+ Q_OBJECT
+
+public:
+ explicit pq3DWidgetPropertyWidget(pq3DWidget *widget, QWidget *parent = 0);
+ ~pq3DWidgetPropertyWidget();
+
+ void apply();
+ void reset();
+
+ pq3DWidget* get3DWidget() const { return this->Widget; }
+
+private:
+ pq3DWidget *Widget;
+};
+
+#endif // __pq3DWidgetPropertyWidget_h
View
28 Qt/Components/pqPropertiesPanel.cxx
@@ -56,6 +56,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqView.h"
#include "pqProxy.h"
+#include "pq3DWidget.h"
#include "pqUndoStack.h"
#include "pqOutputPort.h"
#include "pqDisplayPanel.h"
@@ -69,6 +70,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqPropertiesPanelItem.h"
#include "pqObjectPanelInterface.h"
#include "pqProxySelectionWidget.h"
+#include "pq3DWidgetPropertyWidget.h"
#include "pqApplyPropertiesManager.h"
#include "pqPropertyWidgetInterface.h"
#include "pqObjectPanelPropertyWidget.h"
@@ -520,6 +522,32 @@ void pqPropertiesPanel::setProxy(pqProxy *proxy)
widgets = this->createWidgetsForProxy(proxy);
}
+ // add 3D widgets
+ vtkSMProxy *smProxy = proxy->getProxy();
+ vtkPVXMLElement *hints = smProxy->GetHints();
+ if(hints)
+ {
+ QList<pq3DWidget*> widgets3d = pq3DWidget::createWidgets(smProxy, smProxy);
+
+ foreach (pq3DWidget *widget, widgets3d)
+ {
+ connect(this, SIGNAL(viewChanged(pqView*)),
+ widget, SLOT(setView(pqView*)));
+ widget->setView(this->view());
+ widget->resetBounds();
+ widget->reset();
+
+ // must call select
+ widget->select();
+
+ pqPropertiesPanelItem item;
+ item.LabelWidget = 0;
+ item.PropertyWidget = new pq3DWidgetPropertyWidget(widget);
+ item.IsAdvanced = false;
+ widgets.append(item);
+ }
+ }
+
// add widgets to the panel
foreach(const pqPropertiesPanelItem &item, widgets)
{
Please sign in to comment.
Something went wrong with that request. Please try again.