Skip to content

Commit

Permalink
Merge branch '6347_vsi_multisliceview' into merge_new_views
Browse files Browse the repository at this point in the history
Refs #6347. Fixing merge conflict on ViewBase
  • Loading branch information
Michael Reuter committed Jan 14, 2013
2 parents fb752b0 + 567515f commit 190d466
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 650 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,19 @@
#include <QPointer>
#include <QWidget>

class pqColorMapModel;
class pqPipelineRepresentation;
class pqPipelineSource;
class pqRenderView;

class QModelIndex;
class pqMultiSliceView;

namespace Mantid
{
namespace Vates
{
namespace SimpleGui
{

class AxisInformation;
class AxisInteractor;
/**
*
This class creates a multislice view which is based on the Matlab(C)
SliceOMatic view. This view is specfically designed for 3(+1)D datasets.
This class uses the MultiSliceView created by Kitware based on our
specifications.
@author Michael Reuter
@date 24/05/2011
Copyright &copy; 2011 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
Expand Down Expand Up @@ -89,95 +80,23 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS MultiSliceView : public ViewB
* ViewBase::resetDisplay()
*/
void resetDisplay();
/// ViewBase::setAxisScales()
void setAxisScales();

protected slots:
/**
* Show or hide a given slice from the view.
* @param isVisible flag to show/hide associated cut
* @param name the slice to show/hide from the view
*/
void cutVisibility(bool isVisible, const QString &name);
/**
* Delete a slice from the view.
* @param name the name of the slice to be deleted
*/
void deleteCut(const QString &name);
/**
* Make the slice interactor appear on the view when an indicator is
* selected.
* @param name the server manager name of the selected slice
*/
void indicatorSelected(const QString &name);
/**
* Create a slice in the YZ plane at a specific point on the dataset x axis.
* @param value create a YZ slice at the given x axis location
*/
void makeXcut(double value);
/**
* Create a slice in the XZ plane at a specific point on the dataset y axis.
* @param value create a XZ slice at the given y axis location
*/
void makeYcut(double value);
/**
* Create a slice in the XY plane at a specific point on the dataset z axis.
* @param value create a XY slice at the given z axis location
*/
void makeZcut(double value);
/// Select the appropriate indicator on the correct axis interactor widget.
void selectIndicator();
///
void checkSliceClicked(int axisIndex, double sliceOffsetOnAxis,
int button, int modifier);
/// Launch SliceViewer with the specified cut.
void showCutInSliceViewer(const QString &name);
/**
* Update the origin position of the currently selected cut.
* @param position the origin coordinate to move the emitting slice to
*/
void updateCutPosition(double position);
/// Move the selected indicator to a given position.
void updateSelectedIndicator();

signals:
/**
* Signal to identify the name of a created slice indicator.
* @param name the name of the ParaView slice representation
*/
void sliceNamed(const QString &name);
void showCutInSliceViewer(int axisIndex, double sliceOffsetOnAxis);

private:
Q_DISABLE_COPY(MultiSliceView)

/// Determine if the incoming and current axis have the same bounds.
bool checkBounds(AxisInformation *info, AxisInteractor *axis);
/// Determine if the data can support the SliceViewer being shown.
void checkSliceViewCompat();
/// Determine if the incoming and current axis have the same title.
bool checkTitles(AxisInformation *info, AxisInteractor *axis);
/// Clear all axis indicator highlighting.
void clearIndicatorSelections();
/// Filter resize events.
bool eventFilter(QObject *ob, QEvent *ev);
/**
* Function that polls all of the axis indicators to see if any are left.
* @return true if no indicators are left, false if there are indicators
*/
bool noIndicatorsLeft();
/**
* Function that creates a slice in the appropriate plane at the
* requested axis location.
* @param origin the cartesian coordinates of the slice origin
* @param orient the cartesian coordinates of the slice normal
*/
void makeCut(double origin[], double orient[]);
/// Reset or delete indicator when bounds change.
void resetOrDeleteIndicators(AxisInteractor *axis, int pos);
/// Pull the dataset information and setup the axis interactors.
void setupAxisInfo();
/// Create the current data representation.
void setupData();

bool isOrigSrc; ///< Flag for SliceViewer information
QPointer<pqRenderView> mainView; ///< The main view class
QPointer<pqMultiSliceView> mainView; ///< The main view class
Ui::MultiSliceViewClass ui; ///< The view's UI form
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,58 +19,11 @@
<property name="windowTitle">
<string>MultiSliceView</string>
</property>
<layout class="QGridLayout" name="gridLayout" rowstretch="0,1" columnstretch="0,1,0" rowminimumheight="1,0" columnminimumwidth="1,0,1">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>1</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="1">
<widget class="Mantid::Vates::SimpleGui::AxisInteractor" name="yAxisWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Mantid::Vates::SimpleGui::AxisInteractor" name="xAxisWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1">
<item>
<widget class="QFrame" name="renderFrame">
<property name="enabled">
<bool>true</bool>
Expand All @@ -95,33 +48,9 @@
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="Mantid::Vates::SimpleGui::AxisInteractor" name="zAxisWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>Mantid::Vates::SimpleGui::AxisInteractor</class>
<extends>QWidget</extends>
<header>MantidVatesSimpleGuiQtWidgets/AxisInteractor.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS ViewBase : public QWidget
virtual void correctVisibility(pqPipelineBrowserWidget *pbw);
/// Creates a single view instance.
virtual pqRenderView *createRenderView(QWidget *container,
QString viewName="");
QString viewName=QString(""));
/// Remove all filters of a given name: i.e. Slice.
virtual void destroyFilter(pqObjectBuilder *builder, const QString &name);
/// Destroy sources and view relevant to mode switching.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,17 +357,6 @@ void MdViewerWidget::setParaViewComponentsForView()
SIGNAL(applied()),
this, SLOT(checkForUpdates()));

if (this->currentView->inherits("MultiSliceView"))
{
QObject::connect(this->ui.pipelineBrowser,
SIGNAL(clicked(const QModelIndex &)),
static_cast<MultiSliceView *>(this->currentView),
SLOT(selectIndicator()));
QObject::connect(this->ui.propertiesPanel,
SIGNAL(applied()),
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

0 comments on commit 190d466

Please sign in to comment.