Skip to content

Commit

Permalink
Refs #6315. The VSI now compiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reuter committed Dec 13, 2012
1 parent 258e7da commit 7b131ab
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
<enum>QFrame::Raised</enum>
</property>
</widget>
<widget class="pqProxyTabWidget" name="proxyTabWidget">
<widget class="pqObjectInspectorWidget" name="proxyTabWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -217,12 +217,6 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>pqProxyTabWidget</class>
<extends>QTabWidget</extends>
<header>pqProxyTabWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>pqPipelineBrowserWidget</class>
<extends>QFrame</extends>
Expand Down Expand Up @@ -259,6 +253,12 @@
<header>MantidVatesSimpleGuiViewWidgets/ColorSelectionWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>pqObjectInspectorWidget</class>
<extends>QWidget</extends>
<header>pqObjectInspectorWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../../icons/ViewWidgetsIcons.qrc"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
#include <pqDefaultViewBehavior.h>
#include <pqDeleteBehavior.h>
#include <pqFixPathsInStateFilesBehavior.h>
#include <pqInterfaceTracker.h>
#include <pqObjectPickingBehavior.h>
//#include <pqPersistentMainWindowStateBehavior.h>
#include <pqPipelineContextMenuBehavior.h>
//#include <pqPluginActionGroupBehavior.h>
//#include <pqPluginDockWidgetsBehavior.h>
#include <pqPluginManager.h>
#include <pqPVNewSourceBehavior.h>
#include <pqQtMessageHandlerBehavior.h>
#include <pqSpreadSheetVisibilityBehavior.h>
Expand Down Expand Up @@ -232,7 +232,7 @@ void MdViewerWidget::createAppCoreForPlugin()
void MdViewerWidget::setupParaViewBehaviors()
{
// Register ParaView interfaces.
pqPluginManager* pgm = pqApplicationCore::instance()->getPluginManager();
pqInterfaceTracker* pgm = pqApplicationCore::instance()->interfaceTracker();

// * adds support for standard paraview views.
pgm->addInterface(new pqStandardViewModules(pgm));
Expand Down Expand Up @@ -332,10 +332,11 @@ ViewBase* MdViewerWidget::setMainViewWidget(QWidget *container,
void MdViewerWidget::setParaViewComponentsForView()
{
// Extra setup stuff to hook up view to other items
this->ui.proxyTabWidget->setupDefaultConnections();
//this->ui.proxyTabWidget->setupDefaultConnections();
this->ui.proxyTabWidget->setView(this->currentView->getView());
this->ui.proxyTabWidget->setShowOnAccept(true);
this->ui.pipelineBrowser->setActiveView(this->currentView->getView());
/*
QObject::connect(this->ui.proxyTabWidget->getObjectInspector(),
SIGNAL(postaccept()),
this, SLOT(checkForUpdates()));
Expand All @@ -353,7 +354,7 @@ void MdViewerWidget::setParaViewComponentsForView()
static_cast<MultiSliceView *>(this->currentView),
SLOT(updateSelectedIndicator()));
}

*/
QObject::connect(this->currentView, SIGNAL(setViewsStatus(bool)),
this->ui.modeControlWidget, SLOT(enableViewButtons(bool)));
QObject::connect(this->currentView,
Expand Down
32 changes: 18 additions & 14 deletions Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MultisliceView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
#include <pqRenderView.h>
#include <pqScalarsToColors.h>
#include <pqServerManagerModel.h>
#include <pqServerManagerSelectionModel.h>
#include <pqSMAdaptor.h>
#include <vtkDataObject.h>
#include <vtkProperty.h>
#include <vtkSMProperty.h>
#include <vtkSMPropertyHelper.h>
#include <vtkSMProxy.h>
#include <vtkSMProxySelectionModel.h>
#include <vtkSMViewProxy.h>

#include <vtkSMPropertyIterator.h>
Expand Down Expand Up @@ -303,8 +303,10 @@ void MultiSliceView::makeCut(double origin[], double orient[])

void MultiSliceView::selectIndicator()
{
pqServerManagerSelectionModel *smsModel = pqApplicationCore::instance()->getSelectionModel();
pqPipelineSource *source = qobject_cast<pqPipelineSource *>(smsModel->currentItem());
vtkSMProxySelectionModel *selection = pqActiveObjects::instance().activeSourcesSelectionModel();
pqServerManagerModel* pqModel = pqApplicationCore::instance()->getServerManagerModel();
vtkSMProxy* smProxy = selection->GetSelectedProxy(0);
pqPipelineSource *source = pqModel->findItem<pqPipelineSource*>(smProxy);
QString name = source->getSMName();
this->ui.xAxisWidget->selectIndicator(name);
this->ui.yAxisWidget->selectIndicator(name);
Expand All @@ -313,12 +315,13 @@ void MultiSliceView::selectIndicator()

void MultiSliceView::updateSelectedIndicator()
{
pqServerManagerSelectionModel *smsModel = pqApplicationCore::instance()->getSelectionModel();
pqPipelineSource *cut = qobject_cast<pqPipelineSource *>(smsModel->currentItem());
vtkSMProxySelectionModel *selection = pqActiveObjects::instance().activeSourcesSelectionModel();
pqServerManagerModel* pqModel = pqApplicationCore::instance()->getServerManagerModel();
vtkSMProxy* smProxy = selection->GetSelectedProxy(0);
pqPipelineSource *cut = pqModel->findItem<pqPipelineSource*>(smProxy);
if (cut->getSMName().contains("Slice"))
{
vtkSMProxy *plane = vtkSMPropertyHelper(cut->getProxy(),
"CutFunction").GetAsProxy();
vtkSMProxy *plane = vtkSMPropertyHelper(smProxy, "CutFunction").GetAsProxy();
double origin[3];
vtkSMPropertyHelper(plane, "Origin").Get(origin, 3);
if (this->ui.xAxisWidget->hasIndicator())
Expand All @@ -340,18 +343,19 @@ void MultiSliceView::indicatorSelected(const QString &name)
{
pqServerManagerModel *smModel = pqApplicationCore::instance()->getServerManagerModel();
pqPipelineSource *cut = smModel->findItem<pqPipelineSource *>(name);
pqServerManagerSelectionModel *smsModel = pqApplicationCore::instance()->getSelectionModel();
smsModel->setCurrentItem(cut, pqServerManagerSelectionModel::ClearAndSelect);
pqProxySelection new_selection = pqActiveObjects::instance().selection();
new_selection.clear();
pqActiveObjects::instance().setSelection(new_selection, cut);
}

void MultiSliceView::updateCutPosition(double position)
{
pqServerManagerSelectionModel *smsModel = pqApplicationCore::instance()->getSelectionModel();
const pqServerManagerSelection *list = smsModel->selectedItems();
pqPipelineSource *cut = qobject_cast<pqPipelineSource *>(list->at(0));
vtkSMProxySelectionModel *selection = pqActiveObjects::instance().activeSourcesSelectionModel();
pqServerManagerModel* pqModel = pqApplicationCore::instance()->getServerManagerModel();
vtkSMProxy* smProxy = selection->GetSelectedProxy(0);
pqPipelineSource *cut = pqModel->findItem<pqPipelineSource*>(smProxy);

vtkSMProxy *plane = vtkSMPropertyHelper(cut->getProxy(),
"CutFunction").GetAsProxy();
vtkSMProxy *plane = vtkSMPropertyHelper(smProxy, "CutFunction").GetAsProxy();
double origin[3] = {0.0, 0.0, 0.0};
if (this->ui.xAxisWidget->hasIndicator())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
#include <pqPipelineBrowserWidget.h>
#include <pqPipelineRepresentation.h>
#include <pqPipelineSource.h>
#include <pqProxyTabWidget.h>
#include <pqRenderView.h>
#include <pqScalarsToColors.h>
#include <pqServer.h>
#include <pqServerManagerModel.h>
#include <pqServerManagerSelectionModel.h>
#include <pqSMAdaptor.h>
#include <vtkDataObject.h>
#include <vtkProperty.h>
Expand Down Expand Up @@ -210,14 +208,14 @@ void ThreeSliceView::resetDisplay()

void ThreeSliceView::correctVisibility(pqPipelineBrowserWidget *pbw)
{
pqServerManagerSelectionModel *smsModel = pqApplicationCore::instance()->getSelectionModel();
smsModel->setCurrentItem(this->xCut, pqServerManagerSelectionModel::ClearAndSelect);
smsModel->setCurrentItem(this->yCut, pqServerManagerSelectionModel::Select);
smsModel->setCurrentItem(this->zCut, pqServerManagerSelectionModel::Select);
//pqServerManagerSelectionModel *smsModel = pqApplicationCore::instance()->getSelectionModel();
//smsModel->setCurrentItem(this->xCut, pqServerManagerSelectionModel::ClearAndSelect);
//smsModel->setCurrentItem(this->yCut, pqServerManagerSelectionModel::Select);
//smsModel->setCurrentItem(this->zCut, pqServerManagerSelectionModel::Select);
pbw->setSelectionVisibility(true);
smsModel->setCurrentItem(this->xCut, pqServerManagerSelectionModel::Clear);
smsModel->setCurrentItem(this->yCut, pqServerManagerSelectionModel::Clear);
smsModel->setCurrentItem(this->zCut, pqServerManagerSelectionModel::Clear);
//smsModel->setCurrentItem(this->xCut, pqServerManagerSelectionModel::Clear);
//smsModel->setCurrentItem(this->yCut, pqServerManagerSelectionModel::Clear);
//smsModel->setCurrentItem(this->zCut, pqServerManagerSelectionModel::Clear);
this->origRep->setVisible(false);
this->correctColorScaleRange();
}
Expand Down

0 comments on commit 7b131ab

Please sign in to comment.