Commit c04611d9 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

ENH: Enabling BoxWidget

parent ba464808
......@@ -67,6 +67,7 @@ QT4_WRAP_CPP(MOC_BUILT_SOURCES
pqApplicationOptionsDialog.h
pqAutoGeneratedObjectPanel.h
pqBarChartDisplayProxyEditor.h
pqBoxWidget.h
pqCalculatorPanel.h
pqCameraDialog.h
pqCameraWidget.h
......@@ -213,6 +214,7 @@ SET(UI_FORMS
Resources/UI/pqAnimationSettings.ui
Resources/UI/pqApplicationOptions.ui
Resources/UI/pqBarChartDisplayEditor.ui
Resources/UI/pqBoxWidget.ui
Resources/UI/pqCalculatorPanel.ui
Resources/UI/pqCameraDialog.ui
Resources/UI/pqCameraWidget.ui
......@@ -359,6 +361,8 @@ ADD_LIBRARY(pqComponents
pqAutoGeneratedObjectPanel.h
pqBarChartDisplayProxyEditor.cxx
pqBarChartDisplayProxyEditor.h
pqBoxWidget.cxx
pqBoxWidget.h
pqCalculatorPanel.cxx
pqCalculatorPanel.h
pqCameraDialog.cxx
......
<ui version="4.0" >
<class>pqBoxWidget</class>
<widget class="QWidget" name="pqBoxWidget" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>289</width>
<height>167</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" colspan="2" >
<widget class="QCheckBox" name="show3DWidget" >
<property name="text" >
<string>Show Box</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2" >
<layout class="QGridLayout" >
<property name="horizontalSpacing" >
<number>2</number>
</property>
<property name="verticalSpacing" >
<number>2</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Translate</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="positionX" />
</item>
<item row="0" column="2" >
<widget class="QLineEdit" name="positionY" />
</item>
<item row="0" column="3" >
<widget class="QLineEdit" name="positionZ" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Rotate</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="rotationX" />
</item>
<item row="1" column="2" >
<widget class="QLineEdit" name="rotationY" />
</item>
<item row="1" column="3" >
<widget class="QLineEdit" name="rotationZ" />
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Scale</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLineEdit" name="scaleX" />
</item>
<item row="2" column="2" >
<widget class="QLineEdit" name="scaleY" />
</item>
<item row="2" column="3" >
<widget class="QLineEdit" name="scaleZ" />
</item>
</layout>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<widget class="QPushButton" name="resetBounds" >
<property name="text" >
<string>Reset Bounds</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
......@@ -32,17 +32,18 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pq3DWidget.h"
// ParaView Server Manager includes.
#include "vtkEventQtSlotConnect.h"
#include "vtkMemberFunctionCommand.h"
#include "vtkPVDataInformation.h"
#include "vtkPVXMLElement.h"
#include "vtkSmartPointer.h"
#include "vtkSMInputProperty.h"
#include "vtkSMIntVectorProperty.h"
#include "vtkSMNewWidgetRepresentationProxy.h"
#include "vtkSMProxyManager.h"
#include "vtkSMProxyProperty.h"
#include "vtkSMRenderViewProxy.h"
#include "vtkSMSourceProxy.h"
#include "vtkSMInputProperty.h"
// Qt includes.
#include <QtDebug>
......@@ -51,6 +52,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ParaView GUI includes.
#include "pqApplicationCore.h"
#include "pqBoxWidget.h"
#include "pqImplicitPlaneWidget.h"
#include "pqLineSourceWidget.h"
#include "pqPipelineFilter.h"
......@@ -69,12 +71,14 @@ public:
WidgetVisible(true),
Selected(false)
{
this->VTKConnect = vtkSmartPointer<vtkEventQtSlotConnect>::New();
}
vtkSmartPointer<vtkSMProxy> ReferenceProxy;
vtkSmartPointer<vtkSMNewWidgetRepresentationProxy> WidgetProxy;
vtkSmartPointer<vtkCommand> ControlledPropertiesObserver;
vtkSmartPointer<vtkPVXMLElement> Hints;
vtkSmartPointer<vtkEventQtSlotConnect> VTKConnect;
QMap<vtkSmartPointer<vtkSMProperty>, vtkSmartPointer<vtkSMProperty> > PropertyMap;
......@@ -135,6 +139,10 @@ QList<pq3DWidget*> pq3DWidget::createWidgets(vtkSMProxy* refProxy, vtkSMProxy* p
{
widget = new pqImplicitPlaneWidget(refProxy, pxy, 0);
}
else if (widgetType == "Box")
{
widget = new pqBoxWidget(refProxy, pxy, 0);
}
else if (widgetType == "Handle")
{
widget = new pqHandleWidget(refProxy, pxy, 0);
......@@ -251,9 +259,11 @@ void pq3DWidget::onControlledPropertyChanged()
//-----------------------------------------------------------------------------
void pq3DWidget::setWidgetProxy(vtkSMNewWidgetRepresentationProxy* pxy)
{
vtkSMNewWidgetRepresentationProxy* widget = this->getWidgetProxy();
this->Internal->VTKConnect->Disconnect();
vtkSMNewWidgetRepresentationProxy* widget = this->getWidgetProxy();
pqRenderView* rview = this->renderView();
if (rview && widget)
if (rview && widget)
{
// To add/remove the 3D widget display from the view module.
// we don't use the property. This is so since the 3D widget add/remove
......@@ -261,8 +271,21 @@ void pq3DWidget::setWidgetProxy(vtkSMNewWidgetRepresentationProxy* pxy)
rview->getRenderViewProxy()->RemoveRepresentation(widget);
rview->render();
}
this->Internal->WidgetProxy = pxy;
if (pxy)
{
this->Internal->VTKConnect->Connect(pxy, vtkCommand::StartInteractionEvent,
this, SIGNAL(widgetStartInteraction()));
this->Internal->VTKConnect->Connect(pxy, vtkCommand::StartInteractionEvent,
this, SLOT(setModified()));
this->Internal->VTKConnect->Connect(pxy, vtkCommand::InteractionEvent,
this, SIGNAL(widgetInteraction()));
this->Internal->VTKConnect->Connect(pxy, vtkCommand::EndInteractionEvent,
this, SIGNAL(widgetEndInteraction()));
}
if (rview && pxy)
{
// To add/remove the 3D widget display from the view module.
......@@ -401,14 +424,13 @@ void pq3DWidget::reset()
++iter)
{
iter.key()->Copy(iter.value());
iter.key()->Modified();
}
if (this->Internal->WidgetProxy)
{
this->Internal->WidgetProxy->UpdateVTKObjects();
this->Internal->WidgetProxy->UpdatePropertyInformation();
pqApplicationCore::instance()->render();
this->render();
}
this->blockSignals(false);
}
......
......@@ -91,11 +91,16 @@ public:
signals:
/// Notifies observers that widget visibility has changed
void widgetVisibilityChanged(bool);
/// Notifies observers that the user is dragging the 3D widget
void widgetStartInteraction();
/// Notifies observers that the user is done dragging the 3D widget
void widgetEndInteraction();
/// Notifies observers that the user is dragging the 3D widget
void widgetInteraction();
public slots:
/// Sets 3D widget visibility
void setWidgetVisible(bool);
......
/*=========================================================================
Program: ParaView
Module: pqBoxWidget.cxx
Copyright (c) 2005,2006 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 "pqBoxWidget.h"
#include "ui_pqBoxWidget.h"
// Server Manager Includes.
#include "vtkSMNewWidgetRepresentationProxy.h"
#include "vtkSMDoubleVectorProperty.h"
// Qt Includes.
#include <QDoubleValidator>
// ParaView Includes.
#include "pq3DWidgetFactory.h"
#include "pqApplicationCore.h"
#include "pqPropertyLinks.h"
#include "pqServer.h"
#include "pqServerManagerModel.h"
#include "pqSMAdaptor.h"
#include "pqSMSignalAdaptors.h"
class pqBoxWidget::pqImplementation : public Ui::pqBoxWidget
{
public:
pqPropertyLinks Links;
};
#define PVBOXWIDGET_TRIGGER_RENDER(ui) \
QObject::connect(this->Implementation->ui,\
SIGNAL(editingFinished()),\
this, SLOT(render()), Qt::QueuedConnection);
//-----------------------------------------------------------------------------
pqBoxWidget::pqBoxWidget(vtkSMProxy* refProxy, vtkSMProxy* pxy, QWidget* _parent) :
Superclass(refProxy, pxy, _parent)
{
this->Implementation = new pqImplementation();
this->Implementation->setupUi(this);
this->Implementation->show3DWidget->setChecked(this->widgetVisible());
// Setup validators for all line edits.
QDoubleValidator* validator = new QDoubleValidator(this);
this->Implementation->positionX->setValidator(validator);
this->Implementation->positionY->setValidator(validator);
this->Implementation->positionZ->setValidator(validator);
this->Implementation->scaleX->setValidator(validator);
this->Implementation->scaleY->setValidator(validator);
this->Implementation->scaleZ->setValidator(validator);
this->Implementation->rotationX->setValidator(validator);
this->Implementation->rotationY->setValidator(validator);
this->Implementation->rotationZ->setValidator(validator);
PVBOXWIDGET_TRIGGER_RENDER(positionX);
PVBOXWIDGET_TRIGGER_RENDER(positionY);
PVBOXWIDGET_TRIGGER_RENDER(positionZ);
PVBOXWIDGET_TRIGGER_RENDER(scaleX);
PVBOXWIDGET_TRIGGER_RENDER(scaleY);
PVBOXWIDGET_TRIGGER_RENDER(scaleZ);
PVBOXWIDGET_TRIGGER_RENDER(rotationX);
PVBOXWIDGET_TRIGGER_RENDER(rotationY);
PVBOXWIDGET_TRIGGER_RENDER(rotationZ);
QObject::connect(this->Implementation->show3DWidget,
SIGNAL(toggled(bool)), this, SLOT(setWidgetVisible(bool)));
QObject::connect(this, SIGNAL(widgetVisibilityChanged(bool)),
this, SLOT(onWidgetVisibilityChanged(bool)));
QObject::connect(this->Implementation->resetBounds,
SIGNAL(clicked()), this, SLOT(resetBounds()));
//QObject::connect(this, SIGNAL(widgetStartInteraction()),
// this, SLOT(showHandles()));
QObject::connect(&this->Implementation->Links, SIGNAL(qtWidgetChanged()),
this, SLOT(setModified()));
pqServerManagerModel* smmodel =
pqApplicationCore::instance()->getServerManagerModel();
this->createWidget(smmodel->findServer(refProxy->GetConnectionID()));
}
//-----------------------------------------------------------------------------
pqBoxWidget::~pqBoxWidget()
{
delete this->Implementation;
}
#define PVBOXWIDGET_LINK(ui, smproperty, index)\
{\
pqSignalAdaptorDouble* adaptor = new pqSignalAdaptorDouble(\
this->Implementation->ui, "text",\
SIGNAL(textChanged(const QString&)));\
this->Implementation->Links.addPropertyLink(\
adaptor, "value", SIGNAL(valueChanged(const QString&)),\
widget, widget->GetProperty(smproperty), index);\
}
//-----------------------------------------------------------------------------
void pqBoxWidget::createWidget(pqServer* server)
{
vtkSMNewWidgetRepresentationProxy* widget =
pqApplicationCore::instance()->get3DWidgetFactory()->
get3DWidget("BoxWidgetRepresentation", server);
this->setWidgetProxy(widget);
widget->UpdateVTKObjects();
widget->UpdatePropertyInformation();
PVBOXWIDGET_LINK(positionX, "Position", 0);
PVBOXWIDGET_LINK(positionY, "Position", 1);
PVBOXWIDGET_LINK(positionZ, "Position", 2);
PVBOXWIDGET_LINK(rotationX, "Rotation", 0);
PVBOXWIDGET_LINK(rotationY, "Rotation", 1);
PVBOXWIDGET_LINK(rotationZ, "Rotation", 2);
PVBOXWIDGET_LINK(scaleX, "Scale", 0);
PVBOXWIDGET_LINK(scaleY, "Scale", 1);
PVBOXWIDGET_LINK(scaleZ, "Scale", 2);
}
//-----------------------------------------------------------------------------
void pqBoxWidget::resetBounds()
{
vtkSMNewWidgetRepresentationProxy* widget = this->getWidgetProxy();
double input_bounds[6];
if (!widget || !this->getReferenceInputBounds(input_bounds))
{
return;
}
if (vtkSMDoubleVectorProperty* const place_widget =
vtkSMDoubleVectorProperty::SafeDownCast(
widget->GetProperty("PlaceWidget")))
{
place_widget->SetElements(input_bounds);
widget->UpdateVTKObjects();
}
this->setModified();
this->render();
}
//-----------------------------------------------------------------------------
void pqBoxWidget::cleanupWidget()
{
vtkSMNewWidgetRepresentationProxy* widget = this->getWidgetProxy();
if(widget)
{
pqApplicationCore::instance()->get3DWidgetFactory()->
free3DWidget(widget);
}
this->setWidgetProxy(0);
}
//-----------------------------------------------------------------------------
void pqBoxWidget::onWidgetVisibilityChanged(bool visible)
{
this->Implementation->show3DWidget->blockSignals(true);
this->Implementation->show3DWidget->setChecked(visible);
this->Implementation->show3DWidget->blockSignals(false);
}
//-----------------------------------------------------------------------------
void pqBoxWidget::accept()
{
this->Superclass::accept();
this->hideHandles();
}
//-----------------------------------------------------------------------------
void pqBoxWidget::reset()
{
this->Superclass::reset();
this->hideHandles();
}
//-----------------------------------------------------------------------------
void pqBoxWidget::showHandles()
{
/*
vtkSMProxy* proxy = this->getWidgetProxy();
if (proxy)
{
pqSMAdaptor::setElementProperty(proxy->GetProperty("HandleVisibility"), 1);
proxy->UpdateVTKObjects();
}
*/
}
//-----------------------------------------------------------------------------
void pqBoxWidget::hideHandles()
{
/*
vtkSMProxy* proxy = this->getWidgetProxy();
if (proxy)
{
pqSMAdaptor::setElementProperty(proxy->GetProperty("HandleVisibility"), 1);
proxy->UpdateVTKObjects();
}
*/
}
/*=========================================================================
Program: ParaView
Module: pqBoxWidget.h
Copyright (c) 2005,2006 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 __pqBoxWidget_h
#define __pqBoxWidget_h
#include "pq3DWidget.h"
class pqServer;
/// Provides UI for Box Widget.
class PQCOMPONENTS_EXPORT pqBoxWidget : public pq3DWidget
{
Q_OBJECT
typedef pq3DWidget Superclass;
public:
pqBoxWidget(vtkSMProxy* refProxy, vtkSMProxy* proxy, QWidget* p = 0);
virtual ~pqBoxWidget();
/// Resets the bounds of the 3D widget to the reference proxy bounds.
/// This typically calls PlaceWidget on the underlying 3D Widget
/// with reference proxy bounds.
/// This should be explicitly called after the panel is created
/// and the widget is initialized i.e. the reference proxy, controlled proxy
/// and hints have been set.
virtual void resetBounds();
/// accept the changes. Overridden to hide handles.
virtual void accept();
/// reset the changes. Overridden to hide handles.
virtual void reset();
protected:
/// Internal method to create the widget.
void createWidget(pqServer*);
/// Internal method to cleanup widget.
void cleanupWidget();
private slots:
/// Called when the user changes widget visibility
void onWidgetVisibilityChanged(bool visible);
void showHandles();
void hideHandles();
private:
pqBoxWidget(const pqBoxWidget&); // Not implemented.
void operator=(const pqBoxWidget&); // Not implemented.
class pqImplementation;
pqImplementation* Implementation;
};
#endif
......@@ -29,20 +29,13 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#include "pqApplicationCore.h"
#include "pqCutPanel.h"
#include "pqImplicitPlaneWidget.h"
#include "pqCollapsedGroup.h"
#include "pqPipelineFilter.h"
#include "pqPropertyManager.h"
#include "pqSampleScalarWidget.h"
#include <pqCollapsedGroup.h>
#include <vtkPVXMLElement.h>
#include <vtkSMDoubleVectorProperty.h>
#include <vtkSMProxyProperty.h>
#include <vtkSMProxyListDomain.h>
#include "vtkSMDoubleVectorProperty.h"
#include <QVBoxLayout>
......@@ -53,13 +46,10 @@ class pqCutPanel::pqImplementation
{
public:
pqImplementation() :
ImplicitPlaneWidget(NULL),
SampleScalarWidget(false)
{
}
/// Manages a 3D implicit plane widget, plus Qt controls
pqImplicitPlaneWidget* ImplicitPlaneWidget;
/// Controls the number and position of "slices"
pqSampleScalarWidget SampleScalarWidget;
};
......@@ -68,85 +58,35 @@ pqCutPanel::pqCutPanel(pqProxy* object_proxy, QWidget* p) :
Superclass(object_proxy, p),
Implementation(new pqImplementation())
{
// Setup the implicit plane widget ...
pqSMProxy controlled_proxy = NULL;
if(vtkSMProxyProperty* const cut_function_property = vtkSMProxyProperty::SafeDownCast(
this->proxy()->GetProperty("CutFunction")))
{
if (cut_function_property->GetNumberOfProxies() == 0)
{
vtkSMProxyListDomain* pld = vtkSMProxyListDomain::SafeDownCast(
cut_function_property->GetDomain("proxy_list"));
if (pld)
{
cut_function_property->AddProxy(pld->GetProxy(0));
this->proxy()->UpdateVTKObjects();
}
}
controlled_proxy = cut_function_property->GetProxy(0);
controlled_proxy->UpdateVTKObjects();
}
this->Implementation->ImplicitPlaneWidget =
new pqImplicitPlaneWidget(this->proxy(), controlled_proxy, NULL);
pqCollapsedGroup* const group1 = new pqCollapsedGroup(this);
group1->setTitle(QString("Slice Type: ") + QString(tr(controlled_proxy->GetXMLLabel())));
QVBoxLayout* l = new QVBoxLayout(group1);
this->Implementation->ImplicitPlaneWidget->layout()->setMargin(0);
l->addWidget(this->Implementation->ImplicitPlaneWidget);
pqCollapsedGroup* const group2 = new pqCollapsedGroup(this);
group2->setTitle(tr(this->proxy()->GetProperty("ContourValues")->GetXMLLabel()));
l = new QVBoxLayout(group2);
QVBoxLayout* l = new QVBoxLayout(group2);
this->Implementation->SampleScalarWidget.layout()->setMargin(0);
l->addWidget(&this->Implementation->SampleScalarWidget);
QGridLayout* const panel_layout = this->PanelLayout;
int rowCount = panel_layout->rowCount()-2;
// delete the widgets added by pqAutoGeneratedObjectPanel for the
// ContourValues since they are inappropriate.
delete this->findChild<QWidget*>("_labelForContourValues");
delete this->findChild<QWidget*>("ContourValues_0");
panel_layout->addWidget(group2, rowCount, 0, 1, panel_layout->columnCount());
//panel_layout->setRowStretch(panel_layout->rowCount(), 1);
QVBoxLayout* const panel_layout = new QVBoxLayout(this);
panel_layout->addWidget(group1);
panel_layout->addWidget(group2);
panel_layout->addStretch();
QObject::connect(this, SIGNAL(viewChanged(pqView*)),
this->Implementation->ImplicitPlaneWidget,
SLOT(setView(pqView*)));
this->Implementation->ImplicitPlaneWidget->setView(this->view());
connect(
this->Implementation->ImplicitPlaneWidget,
SIGNAL(modified()),
this, SLOT(setModified()));
// Link SampleScalarWidget's qProperty to vtkSMProperty
this->propertyManager()->registerLink(
&this->Implementation->SampleScalarWidget, "samples",
SIGNAL(samplesChanged()), this->proxy(),
this->proxy()->GetProperty("ContourValues"));
connect(
QObject::connect(
this->propertyManager(), SIGNAL(accepted()), this, SLOT(onAccepted()));
connect(
QObject::connect(
this->propertyManager(), SIGNAL(rejected()), this, SLOT(onRejected()));
if (controlled_proxy)
{
vtkPVXMLElement* hints = controlled_proxy->GetHints();
for (unsigned int cc=0; cc <hints->GetNumberOfNestedElements(); cc++)
{
vtkPVXMLElement* elem = hints->GetNestedElement(cc);
if (QString("PropertyGroup") == elem->GetName() &&
QString("Plane") == elem->GetAttribute("type"))
{
this->Implementation->ImplicitPlaneWidget->setHints(elem);
break;
}
}
}
this->Implementation->ImplicitPlaneWidget->resetBounds();
// Setup the sample scalar widget ...
this->Implementation->SampleScalarWidget.setDataSources(
this->proxy(),
......@@ -160,27 +100,11 @@ pqCutPanel::~pqCutPanel()
void pqCutPanel::onAccepted()
{
this->Implementation->ImplicitPlaneWidget->accept();
this->Implementation->SampleScalarWidget.accept();
}
void pqCutPanel::onRejected()
{
this->Implementation->ImplicitPlaneWidget->reset();
this->Implementation->SampleScalarWidget.reset();
}
void pqCutPanel::select()
{
this->Implementation->ImplicitPlaneWidget->select();
}
void pqCutPanel::deselect()
{
this->Implementation->ImplicitPlaneWidget->deselect();
}
pqImplicitPlaneWidget* pqCutPanel::getImplicitPlaneWidget()
{
return this->Implementation->ImplicitPlaneWidget;
}
......@@ -35,15 +35,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqComponentsExport.h"
#include "pqObjectPanel.h"
class pqImplicitPlaneWidget;