-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea2c4e7
commit db92f2c
Showing
11 changed files
with
400 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeaksViewer.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef PEAKSVIEWER_H | ||
#define PEAKSVIEWER_H | ||
|
||
#include <QtGui/QWidget> | ||
#include "DllOption.h" | ||
#include "MantidQtSliceViewer/PeaksPresenter.h" | ||
|
||
namespace MantidQt | ||
{ | ||
namespace SliceViewer | ||
{ | ||
|
||
class EXPORT_OPT_MANTIDQT_SLICEVIEWER PeaksViewer : public QWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
PeaksViewer(QWidget *parent = 0); | ||
void setPeaksWorkspaces(const SetPeaksWorkspaces& workspaces); | ||
~PeaksViewer(); | ||
}; | ||
|
||
} //namespace | ||
} | ||
#endif // PEAKSVIEWER_H |
33 changes: 33 additions & 0 deletions
33
Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeaksWorkspaceWidget.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef PEAKSWORKSPACEWIDGET_H | ||
#define PEAKSWORKSPACEWIDGET_H | ||
|
||
#include <QtGui/QWidget> | ||
#include "DllOption.h" | ||
#include "MantidAPI/IPeaksWorkspace.h" | ||
#include "ui_PeaksWorkspaceWidget.h" | ||
|
||
namespace MantidQt | ||
{ | ||
namespace SliceViewer | ||
{ | ||
|
||
class EXPORT_OPT_MANTIDQT_SLICEVIEWER PeaksWorkspaceWidget : public QWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
PeaksWorkspaceWidget(Mantid::API::IPeaksWorkspace_const_sptr ws, QWidget *parent = 0); | ||
~PeaksWorkspaceWidget(); | ||
private: | ||
/// Populate the widget with model data. | ||
void populate(); | ||
/// Auto-generated UI controls. | ||
Ui::PeaksWorkspaceWidget ui; | ||
/// Peaks workspace to view. | ||
Mantid::API::IPeaksWorkspace_const_sptr m_ws; | ||
private slots: | ||
void expandChanged(bool); | ||
}; | ||
|
||
} //namespace | ||
} | ||
#endif // PEAKSWORKSPACEWIDGET_H |
158 changes: 158 additions & 0 deletions
158
Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeaksWorkspaceWidget.ui
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>PeaksWorkspaceWidget</class> | ||
<widget class="QWidget" name="PeaksWorkspaceWidget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>654</width> | ||
<height>140</height> | ||
</rect> | ||
</property> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="maximumSize"> | ||
<size> | ||
<width>16777215</width> | ||
<height>300</height> | ||
</size> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,0,1"> | ||
<item> | ||
<layout class="QHBoxLayout" name="infoLayout"> | ||
<item> | ||
<widget class="QLabel" name="lblWorkspaceName"> | ||
<property name="text"> | ||
<string>[Workspace]</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="lblWorkspaceState"> | ||
<property name="text"> | ||
<string>[Integrated/UnIntegrated]</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="lblWorkspaceCoordinates"> | ||
<property name="text"> | ||
<string>[Viewing Coordinate System]</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QCheckBox" name="ckExpand"> | ||
<property name="text"> | ||
<string>Expand</string> | ||
</property> | ||
<property name="checked"> | ||
<bool>false</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="tableLayout"> | ||
<item> | ||
<widget class="QTableView" name="tblPeaks"> | ||
<property name="enabled"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="controlsLayout"> | ||
<item> | ||
<widget class="QPushButton" name="btnHide"> | ||
<property name="text"> | ||
<string>Hide</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="btnRemove"> | ||
<property name="text"> | ||
<string>Remove</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label_2"> | ||
<property name="text"> | ||
<string>Peak Color</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="btnPeakColor"> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label_3"> | ||
<property name="text"> | ||
<string>Peak Background Color</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="btnBackgroundColor"> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QCheckBox" name="ckShowBackground"> | ||
<property name="text"> | ||
<string>Show Background</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "MantidQtSliceViewer/PeaksViewer.h" | ||
#include "MantidQtSliceViewer/PeaksWorkspaceWidget.h" | ||
#include <QBoxLayout> | ||
|
||
namespace MantidQt | ||
{ | ||
namespace SliceViewer | ||
{ | ||
PeaksViewer::PeaksViewer(QWidget *parent) | ||
: QWidget(parent) | ||
{ | ||
this->setMinimumWidth(500); | ||
} | ||
|
||
void PeaksViewer::setPeaksWorkspaces(const SetPeaksWorkspaces& workspaces) | ||
{ | ||
auto _layout = layout(); | ||
if(_layout) | ||
{ | ||
delete _layout; | ||
} | ||
this->setLayout(new QVBoxLayout); | ||
auto it = workspaces.begin(); | ||
while(it != workspaces.end()) | ||
{ | ||
layout()->addWidget(new PeaksWorkspaceWidget(*it, this)); | ||
++it; | ||
} | ||
} | ||
|
||
PeaksViewer::~PeaksViewer() | ||
{ | ||
} | ||
|
||
} // namespace | ||
} |
45 changes: 45 additions & 0 deletions
45
Code/Mantid/MantidQt/SliceViewer/src/PeaksWorkspaceWidget.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include "MantidQtSliceViewer/PeaksWorkspaceWidget.h" | ||
|
||
namespace MantidQt | ||
{ | ||
namespace SliceViewer | ||
{ | ||
PeaksWorkspaceWidget::PeaksWorkspaceWidget(Mantid::API::IPeaksWorkspace_const_sptr ws, QWidget *parent) | ||
: QWidget(parent), m_ws(ws) | ||
{ | ||
ui.setupUi(this); | ||
|
||
ui.tblPeaks->setHidden(true); | ||
ui.tblPeaks->setFixedHeight(0); | ||
connect(ui.ckExpand, SIGNAL(clicked(bool)), this, SLOT(expandChanged(bool))); | ||
|
||
|
||
populate(); | ||
} | ||
|
||
void PeaksWorkspaceWidget::populate() | ||
{ | ||
ui.lblWorkspaceName->setText(m_ws->name().c_str()); | ||
|
||
const QString unintegratedMsg = "un-integrated"; | ||
const QString integratedMsg = "integrated"; | ||
|
||
ui.lblWorkspaceName->setText(m_ws->hasIntegratedPeaks() ? integratedMsg : unintegratedMsg ); | ||
|
||
// Viewing coordinate system.... ? SliceViewer::peakCoordinateSystem() -> PeakTransformSelector -> PeakTransformFactory::productName(instancemethod) -> PeakTransform::name(static) | ||
// Default Background colour .... ? -- PeakPallette ? | ||
// Default Foreground colour .... ? -- PeakPallette ? | ||
} | ||
|
||
PeaksWorkspaceWidget::~PeaksWorkspaceWidget() | ||
{ | ||
} | ||
|
||
void PeaksWorkspaceWidget::expandChanged(bool open) | ||
{ | ||
ui.tblPeaks->setHidden(!open); | ||
ui.tblPeaks->setFixedHeight(QWIDGETSIZE_MAX); | ||
} | ||
|
||
} // namespace | ||
} |
Oops, something went wrong.