Skip to content

Commit

Permalink
Re #6162. Reconnected the instrument tree widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Dec 10, 2012
1 parent 08f60dd commit defb7fe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,22 @@ void InstrumentWindow::multipleDetectorsSelected(QList<int>& detlist)
showPickOptions();
}

/**
* Update the display to view a selected component. The selected component
* is visible the rest of the instrument is hidden.
* @param id :: The component id.
*/
void InstrumentWindow::componentSelected(ComponentID id)
{
ProjectionSurface *surface = getSurface();
if (surface)
{
surface->componentSelected(id);
surface->updateView();
updateInstrumentView();
}
}

/** A class for creating grouping xml files
*/
class DetXMLFile
Expand Down Expand Up @@ -1295,7 +1311,7 @@ int InstrumentWindow::getInstrumentDisplayHeight() const
/// Redraw the instrument view
void InstrumentWindow::updateInstrumentView()
{
if ( isGLEnabled() )
if ( m_instrumentDisplayLayout->currentWidget() == dynamic_cast<QWidget*>(m_InstrumentDisplay) )
{
m_InstrumentDisplay->updateView();
}
Expand All @@ -1309,7 +1325,7 @@ void InstrumentWindow::updateInstrumentView()
void InstrumentWindow::updateInstrumentDetectors()
{
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
if ( isGLEnabled() )
if ( m_instrumentDisplayLayout->currentWidget() == dynamic_cast<QWidget*>(m_InstrumentDisplay) )
{
m_InstrumentDisplay->updateDetectors();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class InstrumentWindow : public MdiSubWindow, public MantidQt::API::WorkspaceObs
public slots:
void tabChanged(int);
void multipleDetectorsSelected(QList<int>&);
void componentSelected(Mantid::Geometry::ComponentID id);
void showPickOptions();
void spectraInfoDialog();
void plotSelectedSpectra();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "InstrumentWindow.h"
#include "InstrumentWindowTreeTab.h"
#include "InstrumentTreeWidget.h"
#include "InstrumentActor.h"

InstrumentWindowTreeTab::InstrumentWindowTreeTab(InstrumentWindow* instrWindow):
InstrumentWindowTab(instrWindow)
Expand All @@ -9,8 +10,8 @@ InstrumentWindowTab(instrWindow)
//Tree Controls
m_instrumentTree = new InstrumentTreeWidget(0);
layout->addWidget(m_instrumentTree);
// connect(m_instrumentTree,SIGNAL(componentSelected(Mantid::Geometry::ComponentID)),
// m_InstrumentDisplay,SLOT(componentSelected(Mantid::Geometry::ComponentID)));
connect(m_instrumentTree,SIGNAL(componentSelected(Mantid::Geometry::ComponentID)),
m_instrWindow,SLOT(componentSelected(Mantid::Geometry::ComponentID)));
}

void InstrumentWindowTreeTab::initSurface()
Expand All @@ -32,6 +33,6 @@ QModelIndex InstrumentWindowTreeTab::findComponentByName(const QString &name)
*/
void InstrumentWindowTreeTab::hideEvent(QHideEvent *)
{
//m_instrumentActor->accept(SetAllVisibleVisitor());
m_instrWindow->getInstrumentActor()->accept(SetAllVisibleVisitor());
}

0 comments on commit defb7fe

Please sign in to comment.