Skip to content
Snippets Groups Projects
Commit 64384fb0 authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

Delete StandAloneExec from VatesSimpleGUI

parent 57c84372
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 2980 deletions
# bring in Mantid/VATES API dependencies
set_mantid_subprojects( Vates/VatesAPI )
# vtktypemacro doesn't play nicely with -Wpedantic
string(REPLACE "-Wpedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# NonOrthogonalSourcePlugin is necessary for viewing materials with nonorthogonal basis vectors.
# Copy it over to the pvplugins dir
if("${CMAKE_CFG_INTDIR}" STREQUAL ".")
# This is NOT a multi-configuration builder
find_library(NonOrthogonalSourcePlugin_LOCATION name NonOrthogonalSource HINTS ${ParaView_DIR}/lib)
file (COPY ${NonOrthogonalSourcePlugin_LOCATION} DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${PVPLUGINS_DIR}/${PVPLUGINS_SUBDIR})
elseif(MSVC)
# find_library won't find dlls only import libraries so just hardcode them
# Release
set( _pvplugins_dir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Release/${PVPLUGINS_DIR}/${PVPLUGINS_SUBDIR} )
set( RUNTIME_LIB ${ParaView_DIR}/bin/Release/NonOrthogonalSource.dll )
if (NOT ${_pvplugins_dir} )
file( MAKE_DIRECTORY ${_pvplugins_dir} )
file( COPY ${RUNTIME_LIB} DESTINATION ${_pvplugins_dir} )
endif ()
set( NonOrthogonalSourcePlugin_LOCATION ${RUNTIME_LIB} )
# Debug
set( RUNTIME_LIB_DEBUG ${ParaView_DIR}/bin/Debug/NonOrthogonalSource.dll )
if (EXISTS ${RUNTIME_LIB_DEBUG})
set( _pvplugins_dir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Debug/${PVPLUGINS_DIR}/${PVPLUGINS_SUBDIR} )
if (NOT ${_pvplugins_dir} )
file( MAKE_DIRECTORY ${_pvplugins_dir} )
file( COPY ${RUNTIME_LIB_DEBUG} DESTINATION ${_pvplugins_dir} )
endif ()
# Don't install the debug as the packaging is broken under debug
endif()
else ()
message ( WARNING "Unknown multi-configuration generator. Cannot copy NonOrthogonalSource plugin to our plugin directory." )
endif()
if ( (NOT APPLE) AND NonOrthogonalSourcePlugin_LOCATION)
# make_package.rb handles this for OSX
install( FILES ${NonOrthogonalSourcePlugin_LOCATION} DESTINATION ${PVPLUGINS_DIR}/${PVPLUGINS_SUBDIR} )
endif()
add_subdirectory( ParaViewFilters )
add_subdirectory( ParaViewReaders )
add_subdirectory( ParaViewSources )
add_subdirectory( ParaViewWidgets )
project( MantidVatesSimpleGuiViewWidgets )
# These are the C++ files to be compiled.
set( INCLUDE_FILES
inc/MantidVatesSimpleGuiViewWidgets/AutoScaleRangeGenerator.h
inc/MantidVatesSimpleGuiViewWidgets/CameraManager.h
inc/MantidVatesSimpleGuiViewWidgets/BackgroundRgbProvider.h
inc/MantidVatesSimpleGuiViewWidgets/ColorMapEditorPanel.h
inc/MantidVatesSimpleGuiViewWidgets/ColorSelectionWidget.h
inc/MantidVatesSimpleGuiViewWidgets/ColorUpdater.h
inc/MantidVatesSimpleGuiViewWidgets/LibHelper.h
inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h
inc/MantidVatesSimpleGuiViewWidgets/MultisliceView.h
inc/MantidVatesSimpleGuiViewWidgets/pqCameraToolbarNonOrthogonalAxes.h
inc/MantidVatesSimpleGuiViewWidgets/pqCameraReactionNonOrthogonalAxes.h
inc/MantidVatesSimpleGuiViewWidgets/VatesParaViewApplication.h
inc/MantidVatesSimpleGuiViewWidgets/RebinAlgorithmDialogProvider.h
inc/MantidVatesSimpleGuiViewWidgets/PeaksTableControllerVsi.h
inc/MantidVatesSimpleGuiViewWidgets/PeaksWidget.h
inc/MantidVatesSimpleGuiViewWidgets/PeaksTabWidget.h
inc/MantidVatesSimpleGuiViewWidgets/RebinnedSourcesManager.h
inc/MantidVatesSimpleGuiViewWidgets/VisibleAxesColor.h
inc/MantidVatesSimpleGuiViewWidgets/StandardView.h
inc/MantidVatesSimpleGuiViewWidgets/SplatterPlotView.h
inc/MantidVatesSimpleGuiViewWidgets/ThreesliceView.h
inc/MantidVatesSimpleGuiViewWidgets/TimeControlWidget.h
inc/MantidVatesSimpleGuiViewWidgets/ViewBase.h
inc/MantidVatesSimpleGuiViewWidgets/WidgetDllOption.h
inc/MantidVatesSimpleGuiViewWidgets/VsiApplyBehaviour.h
)
set( SOURCE_FILES
src/AutoScaleRangeGenerator.cpp
src/CameraManager.cpp
src/BackgroundRgbProvider.cpp
src/ColorMapEditorPanel.cpp
src/ColorSelectionWidget.cpp
src/ColorUpdater.cpp
src/MdViewerWidget.cpp
src/MultisliceView.cpp
src/RebinAlgorithmDialogProvider.cpp
src/PeaksTableControllerVsi.cpp
src/PeaksTabWidget.cpp
src/PeaksWidget.cpp
src/pqCameraToolbarNonOrthogonalAxes.cpp
src/pqCameraReactionNonOrthogonalAxes.cpp
src/RebinnedSourcesManager.cpp
src/VisibleAxesColor.cpp
src/StandardView.cpp
src/SplatterPlotView.cpp
src/ThreesliceView.cpp
src/TimeControlWidget.cpp
src/VatesParaViewApplication.cpp
src/ViewBase.cpp
src/VsiApplyBehaviour.cpp
)
set( TEST_FILES
)
# These are the headers to be preprocessed using
# Qt's moc preprocessor.
qt4_wrap_cpp( MOC_SOURCES
inc/MantidVatesSimpleGuiViewWidgets/ColorSelectionWidget.h
inc/MantidVatesSimpleGuiViewWidgets/ColorMapEditorPanel.h
inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h
inc/MantidVatesSimpleGuiViewWidgets/MultisliceView.h
inc/MantidVatesSimpleGuiViewWidgets/PeaksTableControllerVsi.h
inc/MantidVatesSimpleGuiViewWidgets/PeaksWidget.h
inc/MantidVatesSimpleGuiViewWidgets/PeaksTabWidget.h
inc/MantidVatesSimpleGuiViewWidgets/pqCameraToolbarNonOrthogonalAxes.h
inc/MantidVatesSimpleGuiViewWidgets/pqCameraReactionNonOrthogonalAxes.h
inc/MantidVatesSimpleGuiViewWidgets/RebinnedSourcesManager.h
inc/MantidVatesSimpleGuiViewWidgets/StandardView.h
inc/MantidVatesSimpleGuiViewWidgets/SplatterPlotView.h
inc/MantidVatesSimpleGuiViewWidgets/ThreesliceView.h
inc/MantidVatesSimpleGuiViewWidgets/TimeControlWidget.h
inc/MantidVatesSimpleGuiViewWidgets/VatesParaViewApplication.h
inc/MantidVatesSimpleGuiViewWidgets/ViewBase.h
inc/MantidVatesSimpleGuiViewWidgets/VsiApplyBehaviour.h
)
# These are the ui files to be processed using
# Qt's ui file processor.
qt4_wrap_ui( UI_BUILT_SOURCES
inc/MantidVatesSimpleGuiViewWidgets/ColorSelectionWidget.ui
inc/MantidVatesSimpleGuiViewWidgets/ColorMapEditorPanel.ui
inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.ui
inc/MantidVatesSimpleGuiViewWidgets/MultisliceView.ui
inc/MantidVatesSimpleGuiViewWidgets/PeaksWidget.ui
inc/MantidVatesSimpleGuiViewWidgets/PeaksTabWidget.ui
inc/MantidVatesSimpleGuiViewWidgets/pqCameraToolbarNonOrthogonalAxes.ui
inc/MantidVatesSimpleGuiViewWidgets/StandardView.ui
inc/MantidVatesSimpleGuiViewWidgets/SplatterPlotView.ui
inc/MantidVatesSimpleGuiViewWidgets/ThreesliceView.ui
inc/MantidVatesSimpleGuiViewWidgets/TimeControlWidget.ui
)
# Add the QtWidgets icons
qt4_add_resources( RES_FILES icons/ViewWidgetsIcons.qrc )
# Setup the include locations.
include_directories(
inc
${CMAKE_SOURCE_DIR}/MantidQt/API/inc
${CMAKE_SOURCE_DIR}/MantidQt/MantidWidgets/inc
${CMAKE_BINARY_DIR}/MantidQt/MantidWidgets
${CMAKE_SOURCE_DIR}/MantidQt/SliceViewer/inc
${CMAKE_BINARY_DIR}/MantidQt/SliceViewer
${CMAKE_SOURCE_DIR}/MantidQt/Factory/inc
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../QtWidgets
${CMAKE_SOURCE_DIR}/MantidPlot/src
)
set( ALL_FILES
${INCLUDE_FILES}
${SOURCE_FILES}
${MOC_SOURCES}
${UI_BUILT_SOURCES}
${RES_FILES}
)
set( TEST_SUITES
test/suite_MDEventWorkspace
test/suite_MDHistoWorkspace
)
# For Windows
add_definitions( -DIN_MANTID_VATES_SIMPLEGUI_VIEWWIDGETS )
# Add the target for this directory
add_library( VatesSimpleGuiViewWidgets ${ALL_FILES} )
# Set the name of the generated library
set_target_properties( VatesSimpleGuiViewWidgets PROPERTIES OUTPUT_NAME MantidVatesSimpleGuiViewWidgets )
# Add to the 'VatesSimpleGui' group in VS
set_property( TARGET VatesSimpleGuiViewWidgets PROPERTY FOLDER MantidVatesSimpleGui )
include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ${QWT_INCLUDE_DIR} ${PYTHON_INCLUDE_DIR} )
target_link_libraries( VatesSimpleGuiViewWidgets LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME}
pqApplicationComponents
pqComponents
${vtkjsoncpp_LIBRARIES}
vtkPVServerManagerRendering
vtkRenderingFreeType
vtksys
${QT_LIBRARIES}
VatesSimpleGuiQtWidgets
MantidQtAPI
VatesAPI
${MANTID_SUBPROJECT_LIBS}
MantidQtSliceViewer
MantidQtFactory
${PYTHON_LIBRARIES}
MantidWidgets
${POCO_LIBRARIES}
${Boost_LIBRARIES}
)
if (OSX_VERSION VERSION_GREATER 10.8)
set_target_properties ( VatesSimpleGuiViewWidgets PROPERTIES INSTALL_RPATH "@loader_path/../Contents/MacOS;@loader_path/../Contents/Libraries")
endif ()
# Create test file projects
include_directories ( SYSTEM ${CXXTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR} )
include_directories( inc ../../../Framework/TestHelpers/inc ../../../Framework/DataHandling/inc ../../../Framework/DataObjects/inc)
set ( TESTHELPER_SRCS ../../../Framework/TestHelpers/src/ComponentCreationHelper.cpp
../../../Framework/TestHelpers/src/InstrumentCreationHelper.cpp
../../../Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
../../../Framework/TestHelpers/src/MDEventsTestHelper.cpp
../../../Framework/TestHelpers/src/StartFrameworkManager.cpp )
cxxtest_add_test( VatesSimpleGuiViewWidgetsTest ${TEST_FILES} )
target_link_libraries( VatesSimpleGuiViewWidgetsTest LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME}
VatesSimpleGuiViewWidgets
${vtkjsoncpp_LIBRARIES}
DataHandling
Kernel
HistogramData
DataObjects
MantidQtAPI
${MANTID_SUBPROJECT_LIBS}
${POCO_LIBRARIES}
${Boost_LIBRARIES}
${GMOCK_LIBRARIES}
${GTEST_LIBRARIES} )
add_dependencies( AllTests VatesSimpleGuiViewWidgetsTest )
# Add to the 'UnitTests' group in VS
set_property ( TARGET VatesSimpleGuiViewWidgetsTest PROPERTY FOLDER "UnitTests" )
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidVatesSimpleGuiViewWidgets/LibHelper.h.in
${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidVatesSimpleGuiViewWidgets/LibHelper.h )
if( SQUISH_FOUND )
# Need to set the AUT first
set( SQUISH_AUT MantidPlot )
set( SQUISH_AUT_PATH $<TARGET_FILE_DIR:${SQUISH_AUT}> )
# Need to set environmental variables next
set( SQUISH_ENV_VARS
PV_PLUGIN_PATH=$<TARGET_FILE_DIR:${SQUISH_AUT}>/${PVPLUGINS_DIR}/${PVPLUGINS_DIR}
SCRIPTS_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test/mp_scripts
SQUISH_SCRIPT_DIR=${VSI_GLOBAL_SCRIPTS}:${CMAKE_CURRENT_SOURCE_DIR}/test/common/scripts
)
squish_add_test_suite( ${TEST_SUITES} )
endif()
install( TARGETS VatesSimpleGuiViewWidgets ${SYSTEM_PACKAGE_TARGET} DESTINATION ${PVPLUGINS_DIR} )
#ifndef MDVIEWERWIDGET_H_
#define MDVIEWERWIDGET_H_
#ifdef ERROR
#undef ERROR
#endif
#include "ui_MdViewerWidget.h"
#include "MantidQtAPI/MdConstants.h"
#include "MantidQtAPI/MdSettings.h"
#include "MantidQtAPI/VatesViewerInterface.h"
#include "MantidQtAPI/WorkspaceObserver.h"
#include "MantidVatesSimpleGuiViewWidgets/RebinAlgorithmDialogProvider.h"
#include "MantidVatesSimpleGuiViewWidgets/RebinnedSourcesManager.h"
#include "MantidVatesSimpleGuiViewWidgets/WidgetDllOption.h"
#include "MantidVatesAPI/ColorScaleGuard.h"
#include "vtkSmartPointer.h"
#include "boost/optional.hpp"
#include "boost/shared_ptr.hpp"
// forward declaration of ParaQ classes
class pqApplicationSettingsReaction;
class pqLoadDataReaction;
class pqPipelineSource;
class pqSaveScreenshotReaction;
// forward declaration of Qt classes
class QAction;
class QDragEnterEvent;
class QDropEvent;
class QEvent;
class QHBoxLayout;
class QObject;
class QWidget;
namespace Mantid {
namespace Vates {
namespace SimpleGui {
class RotationPointDialog;
class ViewBase;
class RebinDialog;
class ColorMapEditorPanel;
/**
*
This class represents the central widget for handling VATES visualization
operations for 3D and 4D datasets.
@date 11/08/2011
Copyright &copy; 2011 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS MdViewerWidget
: public MantidQt::API::VatesViewerInterface,
MantidQt::API::WorkspaceObserver {
Q_OBJECT
public:
/// Plugin mode constructor.
MdViewerWidget();
/// Standalone mode constructor.
MdViewerWidget(QWidget *parent);
/// Default destructor.
~MdViewerWidget() override;
/// Add extra menus for standalone mode.
void addMenus();
/// Connect data loader.
void connectLoadDataReaction(QAction *action);
/// Filter events to check for hide.
bool eventFilter(QObject *obj, QEvent *ev) override;
/// See MantidQt::API::VatesViewerInterface
void renderWorkspace(QString workspaceName, int workspaceType,
std::string instrumentName) override;
/// See MantidQt::API::VatesViewerInterface
void setupPluginMode(int WsType, const std::string &instrumentName) override;
/// Load the state of the window from a Mantid project file
void loadFromProject(const std::string &lines) override;
/// Save the state of the window to a Mantid project file
std::string saveToProject(ApplicationWindow *app) override;
/// Returns a list of workspace names that are used by this window
std::vector<std::string> getWorkspaceNames() override;
/// Returns the user friendly name of the window
std::string getWindowName() override;
/// Returns the type of the window
std::string getWindowType() override;
public slots:
/// See MantidQt::API::VatesViewerInterface
void shutdown() override;
protected slots:
/// Check for certain updates when an accept is fired.
void checkForUpdates();
/// Turn on/off the LOD threshold.
void onLodToggled(bool state);
/// Pop-up the rotation point dialog.
void onRotationPoint();
/// Show the wiki help in a browser.
void onWikiHelp();
/// Load and render data.
void onDataLoaded(pqPipelineSource *source);
/// Perform actions when rendering is done.
void renderingDone();
/// Execute view switch.
void switchViews(ModeControlWidget::Views v);
/// Triggered when panel is changed.
void panelChanged();
/// On rebin
void onRebin(const std::string &algorithmType);
/// On unbin
void onUnbin();
/// On switching an MDEvent source to a temporary source.
void onSwitchSources(std::string rebinnedWorkspaceName,
std::string sourceType);
/// reset state of all the views
void onResetViewsStateToAllData();
void showOutputWidget();
protected:
/// Handle workspace preDeletion tasks.
void
preDeleteHandle(const std::string &wsName,
const boost::shared_ptr<Mantid::API::Workspace> ws) override;
/// Handle workspace replacement tasks.
void afterReplaceHandle(
const std::string &wsName,
const boost::shared_ptr<Mantid::API::Workspace> ws) override;
/// Detects if something is dragged onto the VSI
void dragEnterEvent(QDragEnterEvent *e) override;
/// Reacts to something being dropped onto the VSI
void dropEvent(QDropEvent *e) override;
private:
Q_DISABLE_COPY(MdViewerWidget)
boost::optional<unsigned long> m_axesTag;
QString m_widgetName;
ViewBase *currentView; ///< Holder for the current (shown) view
ViewBase *hiddenView; ///< Holder for the view that is being switched from
bool viewSwitched;
pqLoadDataReaction *dataLoader; ///< Holder for the load data reaction
double lodThreshold; ///< Default value for the LOD threshold (5 MB)
QAction *lodAction; ///< Holder for the LOD threshold menu item
bool pluginMode; ///< Flag to say widget is in plugin mode
RotationPointDialog *rotPointDialog; ///< Holder for the rotation point dialog
pqSaveScreenshotReaction *screenShot; ///< Holder for the screen shot reaction
Ui::MdViewerWidgetClass ui; ///< The MD viewer's UI form
QHBoxLayout *viewLayout; ///< Layout manager for the view widget
pqApplicationSettingsReaction *
viewSettings; ///< Holder for the view settings reaction
bool useCurrentColorSettings;
ModeControlWidget::Views initialView; ///< Holds the initial view
MantidQt::API::MdSettings
mdSettings; ///<Holds the MD settings which are used to persist data
MantidQt::API::MdConstants mdConstants; /// < Holds the MD constants
RebinAlgorithmDialogProvider m_rebinAlgorithmDialogProvider; ///<Provides
/// dialogs to
/// execute rebin
/// algorithms
RebinnedSourcesManager
m_rebinnedSourcesManager; ///<Holds the rebinned sources manager
QString m_rebinnedWorkspaceIdentifier; ///< Holds the identifier for temporary
/// workspaces
ColorMapEditorPanel *
m_colorMapEditorPanel; ///< Holder for the color map editor panel.
bool m_gridAxesStartUpOn; /// flag for the initial grid axes setting
Mantid::VATES::ColorScaleLock
m_colorScaleLock; ///< Holds a color scale lock object
/// Holds the 'visual state' of the views. This relies on Load/SaveXMLState
/// which
/// produce/consume a vtk XML tree object. Otherwise, the properties to save
/// would be,
/// at least, the following. vtkCamera: Position, FocalPpoint, ViewUp,
/// ViewAngle,
/// ClippingRange. pqRenderView: CenterOfRotation, CenterAxesVisibility
struct AllVSIViewsState {
AllVSIViewsState();
~AllVSIViewsState();
void initialize();
vtkSmartPointer<vtkPVXMLElement> stateStandard;
vtkSmartPointer<vtkPVXMLElement> stateMulti;
vtkSmartPointer<vtkPVXMLElement> stateThreeSlice;
vtkSmartPointer<vtkPVXMLElement> stateSplatter;
};
AllVSIViewsState m_allViews;
/// Setup color selection widget connections.
void connectColorSelectionWidget();
/// Setup connections for all dialogs.
void connectDialogs();
/// Setup rotation point dialog connections.
void connectRotationPointDialog();
/// Add view specific stuff to a menu.
void createMenus();
/// Disconnect dialog connections.
void disconnectDialogs();
/// Consolidate constructor related items.
void internalSetup(bool pMode);
/// Perform first render and final setup for mode buttons.
void renderAndFinalSetup();
/// Set the signals/slots for the ParaView components based on the view.
void setParaViewComponentsForView();
/// Run the necessary setup for the main view.
void setupMainView(ModeControlWidget::Views viewType);
/// Creates the UI and mode switch connection.
void setupUiAndConnections();
/// Create the requested view.
ViewBase *createAndSetMainViewWidget(QWidget *container,
ModeControlWidget::Views v,
bool createRenderProxy = true);
/// Helper function to swap current and hidden view pointers.
void swapViews();
/// Update the state of application widgets.
void updateAppState();
/// Get the initial view for the current workspace and user setting
ModeControlWidget::Views getInitialView(int workspaceType,
const std::string &instrumentName);
/// Check that the view is valid for teh workspace type
ModeControlWidget::Views
checkViewAgainstWorkspace(ModeControlWidget::Views view, int workspaceType);
/// Get the technique associated with an instrument.
const std::string
getTechniqueForInstrument(const std::string &instrumentName) const;
/// Get the view for a specified instrument
QString getViewForInstrument(const std::string &instrument) const;
/// Check if a technique contains a keyword
bool checkIfTechniqueContainsKeyword(const std::set<std::string> &techniques,
const std::string &keyword) const;
/// Reset the current view to the appropriate initial view.
void resetCurrentView(int workspaceType, const std::string &instrumentName);
/// Render rebinned workspace
pqPipelineSource *
prepareRebinnedWorkspace(const std::string &rebinnedWorkspaceName,
const std::string &sourceType);
/// Handle drag and drop of peaks workspcaes
void handleDragAndDropPeaksWorkspaces(QEvent *e, const QString &text,
QStringList &wsNames);
/// Set up the default color for the background of the view.
void setColorForBackground();
/// Sets axes colors that are visible against the background.
void setVisibleAxesColors();
/// Set the color map
void setColorMap();
/// Render the original workspace
pqPipelineSource *
renderOriginalWorkspace(const std::string &originalWorkspaceName);
/// Remove the rebinning when switching views or otherwise.
void
removeRebinning(pqPipelineSource *source, bool forced,
ModeControlWidget::Views view = ModeControlWidget::STANDARD);
/// Remove all rebinned sources
void removeAllRebinning(ModeControlWidget::Views view);
/// Sets a listener for when sources are being destroyed
void setDestroyedListener();
/// Save the state of the currently shown view so its state can be restored
/// when switching back to it
void saveViewState(ViewBase *view);
/// Restore the state of the next (new) view when switching to it
void restoreViewState(ViewBase *view, ModeControlWidget::Views vtype);
/// Get the current grid axes setting
bool areGridAxesOn();
/// Load the state of VSI from an XML file
bool loadVSIState(const std::string &fileName);
/// Setup the view using the last active view and source from a project
void setupViewFromProject(ModeControlWidget::Views vtype);
/// Set the active objects on the current server
void setActiveObjects(pqView *view, pqPipelineSource *source);
};
} // SimpleGui
} // Vates
} // Mantid
#endif // MDVIEWERWIDGET_H_
This diff is collapsed.
......@@ -8,5 +8,3 @@ include_directories( QtWidgets/inc )
set_mantid_subprojects( qt/paraview_ext/VatesAPI )
add_subdirectory( ViewWidgets )
include_directories( ViewWidgets/inc )
add_subdirectory( StandAloneExec )
cmake_minimum_required( VERSION 3.5 )
project( VatesSimpleGui )
set( PROJECT_NAME VatesSimpleGui )
# Setup the include locations.
include_directories(
inc
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../QtWidgets
${CMAKE_CURRENT_BINARY_DIR}/../ViewWidgets
)
# These are the C++ files to be compiled.
set( INCLUDE_FILES
inc/SimpleGuiApp.h
inc/VsgMainWindow.h
)
set( SOURCE_FILES
src/main.cpp
src/SimpleGuiApp.cpp
src/VsgMainWindow.cpp
)
# These are the headers to be preprocessed using
# Qt's moc preprocessor.
qt4_wrap_cpp( MOC_SRCS
inc/SimpleGuiApp.h
inc/VsgMainWindow.h
)
set( TEST_SUITES
test/suite_StandAloneVsi
)
add_executable( ${PROJECT_NAME} ${INCLUDE_FILES} ${SOURCE_FILES} ${MOC_SRCS} )
include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} )
target_link_libraries( ${PROJECT_NAME} LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME}
pqCore pqComponents pqApplicationComponents
${QT_LIBRARIES}
API
Kernel
VatesAPI
VatesSimpleGuiQtWidgets
VatesSimpleGuiViewWidgets
qtwidgetscommon
vtkInteractionStyle
vtkRenderingFreeType
${POCO_LIBRARIES}
${Boost_LIBRARIES}
)
if (OSX_VERSION VERSION_GREATER 10.8)
set_target_properties ( ${PROJECT_NAME} PROPERTIES INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../MacOS")
endif ()
if( SQUISH_FOUND )
# Need to set the AUT first
set( SQUISH_AUT VatesSimpleGui )
set( SQUISH_AUT_PATH $<TARGET_FILE_DIR:${SQUISH_AUT}> )
# Need to set environmental variables next
set( auto_test_dir ${CMAKE_SOURCE_DIR} )
string( REGEX REPLACE "Code/Mantid" "Test/AutoTestData" auto_test_dir ${auto_test_dir} )
set( SQUISH_ENV_VARS
PV_PLUGIN_PATH=$<TARGET_FILE_DIR:${SQUISH_AUT}>/${PVPLUGINS_DIR}/${PVPLUGINS_DIR}
MANTID_AUTOTEST_DATA=${auto_test_dir}
SQUISH_SCRIPT_DIR=${VSI_GLOBAL_SCRIPTS}
)
squish_add_test_suite( ${TEST_SUITES} )
endif()
install( TARGETS VatesSimpleGui RUNTIME DESTINATION ${BIN_DIR} )
#ifndef SIMPLEGUIAPP_H
#define SIMPLEGUIAPP_H
#include <QApplication>
class pqPVApplicationCore;
/**
*
This is a wrapper to QApplication in order to handle exceptions and present
them to the user in dialog boxes for better error reporting.
@author Michael Reuter
@date 04/08/2011
Copyright &copy; 2011 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class SimpleGuiApp : public QApplication {
Q_OBJECT
public:
/**
* Object constructor.
* @param argc number of command-line arguments
* @param argv list of command-line agruments
*/
SimpleGuiApp(int &argc, char **argv);
/**
* Intercept exceptions and print them in dialog boxes.
* @param receiver receipient of an event
* @param event the event to pass to the receiver
* @return value from the receiver's event handler
*/
bool notify(QObject *receiver, QEvent *event) override;
private:
pqPVApplicationCore *pvApp; ///< ParaView application engine
};
#endif // SIMPLEGUIAPP_H
#ifndef VSGMAINWINDOW_H_
#define VSGMAINWINDOW_H_
#include <QMainWindow>
namespace Mantid {
namespace Vates {
namespace SimpleGui {
class MdViewerWidget;
}
}
}
class QAction;
class QMenu;
/**
*
This class represents the main level program.
@author Michael Reuter
@date 24/05/2011
Copyright &copy; 2011 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class VsgMainWindow : public QMainWindow {
Q_OBJECT
public:
/**
* Default constructor.
* @param parent the parent widget for the main window
*/
VsgMainWindow(QWidget *parent = nullptr);
/// Default destructor.
~VsgMainWindow() override;
private:
/// Create the actions for the main program.
void createActions();
/// Create the menus for the main program.
void createMenus();
QAction *openAction; ///< Action for opening files
QAction *exitAction; ///< Action for exiting the program
QMenu *fileMenu; ///< File actions menu
Mantid::Vates::SimpleGui::MdViewerWidget *mdViewer; ///< The VATES viz widget
};
#endif // VSGMAINWINDOW_H_
#include "SimpleGuiApp.h"
#include "MantidKernel/Logger.h"
#include <pqPVApplicationCore.h>
#include <QMessageBox>
#include <QPushButton>
#include <exception>
#include <iostream>
namespace {
// static logger
Mantid::Kernel::Logger g_log("VatesSimpleGui");
}
SimpleGuiApp::SimpleGuiApp(int &argc, char **argv) : QApplication(argc, argv) {
this->pvApp = new pqPVApplicationCore(argc, argv);
}
bool SimpleGuiApp::notify(QObject *receiver, QEvent *event) {
bool res = false;
try {
res = QApplication::notify(receiver, event);
} catch (std::exception &e) {
// Restore possible override cursor
while (QApplication::overrideCursor()) {
QApplication::restoreOverrideCursor();
}
g_log.fatal() << "Unexpected exception: " << e.what() << "\n";
QMessageBox ask;
QAbstractButton *terminateButton =
ask.addButton(tr("Terminate"), QMessageBox::ActionRole);
ask.addButton(tr("Continue"), QMessageBox::ActionRole);
ask.setText(
"Sorry, VatesSimpleGui has caught an unexpected exception:\n\n" +
QString::fromStdString(e.what()) +
"\n\nWould you like to terminate VatesSimpleGui or try to "
"continue working?\n\nIf you choose to continue it is advisable "
"to save your data and restart the application.");
ask.setIcon(QMessageBox::Critical);
ask.exec();
if (ask.clickedButton() == terminateButton) {
g_log.fatal("Terminated by user.");
quit();
}
} catch (...) {
g_log.fatal() << "Unknown exception\n";
QMessageBox ask;
QAbstractButton *terminateButton =
ask.addButton(tr("Terminate"), QMessageBox::ActionRole);
ask.addButton(tr("Continue"), QMessageBox::ActionRole);
ask.setText("Sorry, VatesSimpleGui has caught an unexpected exception\n\n"
"Would you like to terminate VatesSimpleGui or try to continue "
"working?\n\nIf you choose to continue it is advisable to save "
"your data and restart the application.");
ask.setIcon(QMessageBox::Critical);
ask.exec();
if (ask.clickedButton() == terminateButton) {
g_log.fatal("Terminated by user.");
quit();
}
}
return res;
}
#include "VsgMainWindow.h"
#include "MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h"
#include <QAction>
#include <QMenu>
#include <QMenuBar>
using namespace Mantid::Vates::SimpleGui;
VsgMainWindow::VsgMainWindow(QWidget *parent) : QMainWindow(parent) {
this->mdViewer = new MdViewerWidget(this);
this->setCentralWidget(this->mdViewer);
this->createActions();
this->createMenus();
this->mdViewer->addMenus();
}
VsgMainWindow::~VsgMainWindow() {}
void VsgMainWindow::createActions() {
// File loading
this->openAction = new QAction(QApplication::tr("&Open"), this);
this->openAction->setShortcut(QApplication::tr("Ctrl+O"));
this->openAction->setStatusTip(QApplication::tr("Open a file for viewing"));
this->mdViewer->connectLoadDataReaction(this->openAction);
// Program exit
this->exitAction = new QAction(QApplication::tr("&Exit"), this);
this->exitAction->setShortcut(QApplication::tr("Ctrl+Q"));
this->exitAction->setStatusTip(QApplication::tr("Exit the program."));
QObject::connect(this->exitAction, SIGNAL(triggered()), this, SLOT(close()));
}
void VsgMainWindow::createMenus() {
this->fileMenu = this->menuBar()->addMenu(QApplication::tr("&File"));
this->fileMenu->addAction(this->openAction);
this->fileMenu->addSeparator();
this->fileMenu->addAction(this->exitAction);
}
#include "SimpleGuiApp.h"
#include "VsgMainWindow.h"
#include <QMessageBox>
int main(int argc, char **argv) {
SimpleGuiApp app(argc, argv);
try {
VsgMainWindow window;
window.show();
return app.exec();
} catch (std::exception &e) {
QMessageBox::critical(nullptr, "VatesSimpleGui - Error",
QString("An unhandled exception has been caught. "
"VatesSimpleGui will have to close. "
"Details:\n\n") +
e.what());
} catch (...) {
QMessageBox::critical(nullptr, "VatesSimpleGui - Error",
"An unhandled exception has been caught. "
"VatesSimpleGui will have to close.");
}
}
<?xml version="1.0" encoding="UTF-8"?>
<testconfig version="1.0">
<information>
<summary>Tests for the VatesSimpleGui</summary>
<description>These are a collection of tests that excercise the standalone version of the Vates Simple User Interface.</description>
</information>
</testconfig>
:+X_QToolButton {text='+X' type='QToolButton' unnamed='1' visible='1' window=':_VsgMainWindow'}
:-X_QToolButton {text='-X' type='QToolButton' unnamed='1' visible='1' window=':_VsgMainWindow'}
:Automatic Color Scaling_QCheckBox {name='autoColorScaleCheckBox' text='Automatic Color Scaling' type='QCheckBox' visible='1' window=':_VsgMainWindow'}
:CurrentTimeIndex_pqSpinBox {name='CurrentTimeIndex' type='pqSpinBox' visible='1' window=':_VsgMainWindow'}
:CurrentTime_QLineEdit {name='CurrentTime' type='QLineEdit' visible='1' window=':_VsgMainWindow'}
:File_QMenu {title='File' type='QMenu' unnamed='1' visible='1' window=':_VsgMainWindow'}
:Next Frame_QToolButton {text='Next Frame' type='QToolButton' unnamed='1' visible='1' window=':_VsgMainWindow'}
:Open File: (open multiple files with <ctrl> key.).Cancel_QPushButton {name='Cancel' text='Cancel' type='QPushButton' visible='1' window=':Open File: (open multiple files with <ctrl> key.)_pqFileDialog'}
:Open File: (open multiple files with <ctrl> key.).Favorites_QListView {name='Favorites' type='QListView' visible='1' window=':Open File: (open multiple files with <ctrl> key.)_pqFileDialog'}
:Open File: (open multiple files with <ctrl> key.).FileName_QLineEdit {name='FileName' type='QLineEdit' visible='1' window=':Open File: (open multiple files with <ctrl> key.)_pqFileDialog'}
:Open File: (open multiple files with <ctrl> key.).FileType_QComboBox {name='FileType' type='QComboBox' visible='1' window=':Open File: (open multiple files with <ctrl> key.)_pqFileDialog'}
:Open File: (open multiple files with <ctrl> key.).Files_QTreeView {name='Files' type='QTreeView' visible='1' window=':Open File: (open multiple files with <ctrl> key.)_pqFileDialog'}
:Open File: (open multiple files with <ctrl> key.).NavigateUp_QToolButton {name='NavigateUp' type='QToolButton' visible='1' window=':Open File: (open multiple files with <ctrl> key.)_pqFileDialog'}
:Open File: (open multiple files with <ctrl> key.).OK_QPushButton {name='OK' text='OK' type='QPushButton' visible='1' window=':Open File: (open multiple files with <ctrl> key.)_pqFileDialog'}
:Open File: (open multiple files with <ctrl> key.).Parents_QComboBox {name='Parents' type='QComboBox' visible='1' window=':Open File: (open multiple files with <ctrl> key.)_pqFileDialog'}
:Open File: (open multiple files with <ctrl> key.).Recent_QListView {name='Recent' type='QListView' visible='1' window=':Open File: (open multiple files with <ctrl> key.)_pqFileDialog'}
:Open File: (open multiple files with <ctrl> key.)_pqFileDialog {name='FileOpenDialog' type='pqFileDialog' visible='1' windowTitle='Open File: (open multiple files with <ctrl> key.)'}
:Play_QToolButton {text='Play' type='QToolButton' unnamed='1' visible='1' window=':_VsgMainWindow'}
:Previous Frame_QToolButton {text='Previous Frame' type='QToolButton' unnamed='1' visible='1' window=':_VsgMainWindow'}
:Reset Camera_QToolButton {text='Reset Camera' type='QToolButton' unnamed='1' visible='1' window=':_VsgMainWindow'}
:ScrollArea.Bins_QLabel {container=':objectInspector.ScrollArea_QScrollArea' text='Bins' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Bins_QLabel_2 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='2' text='Bins' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Bins_QLabel_3 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='3' text='Bins' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Bins_QLabel_4 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='4' text='Bins' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Bins_QLineEdit {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Bins_QLabel' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.Bins_QLineEdit_2 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Bins_QLabel_2' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.Bins_QLineEdit_3 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Bins_QLabel_3' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.Bins_QLineEdit_4 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Bins_QLabel_4' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.DeltaE_QComboBox {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.DeltaE_QLabel' type='QComboBox' unnamed='1' visible='1'}
:ScrollArea.DeltaE_QLabel {container=':objectInspector.ScrollArea_QScrollArea' text='DeltaE' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.E_QComboBox {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.E_QLabel' type='QComboBox' unnamed='1' visible='1'}
:ScrollArea.E_QLabel {container=':objectInspector.ScrollArea_QScrollArea' text='E' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Editor_RebinningCutterObjectPanel {container=':objectInspector.ScrollArea_QScrollArea' name='Editor' type='RebinningCutterObjectPanel' visible='1'}
:ScrollArea.Int_QCheckBox {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Int_QLabel' type='QCheckBox' unnamed='1' visible='1'}
:ScrollArea.Int_QCheckBox_2 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Int_QLabel_2' type='QCheckBox' unnamed='1' visible='1'}
:ScrollArea.Int_QCheckBox_3 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Int_QLabel_3' type='QCheckBox' unnamed='1' visible='1'}
:ScrollArea.Int_QCheckBox_4 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Int_QLabel_4' type='QCheckBox' unnamed='1' visible='1'}
:ScrollArea.Int_QLabel {container=':objectInspector.ScrollArea_QScrollArea' text='Int' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Int_QLabel_2 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='2' text='Int' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Int_QLabel_3 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='3' text='Int' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Int_QLabel_4 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='4' text='Int' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.LineEdit_QLineEdit {container=':objectInspector.ScrollArea_QScrollArea' name='LineEdit' occurrence='2' type='QLineEdit' visible='1'}
:ScrollArea.Max_QLabel {container=':objectInspector.ScrollArea_QScrollArea' occurrence='2' text='Max' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Max_QLabel_2 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='3' text='Max' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Max_QLabel_3 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='4' text='Max' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Max_QLabel_4 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='5' text='Max' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Max_QLineEdit {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Max_QLabel' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.Max_QLineEdit_2 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Max_QLabel_2' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.Max_QLineEdit_3 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Max_QLabel_3' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.Max_QLineEdit_4 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Max_QLabel_4' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.Min_QLabel {container=':objectInspector.ScrollArea_QScrollArea' occurrence='2' text='Min' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Min_QLabel_2 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='3' text='Min' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Min_QLabel_3 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='4' text='Min' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Min_QLabel_4 {container=':objectInspector.ScrollArea_QScrollArea' occurrence='5' text='Min' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.Min_QLineEdit {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Min_QLabel' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.Min_QLineEdit_2 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Min_QLabel_2' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.Min_QLineEdit_3 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Min_QLabel_3' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.Min_QLineEdit_4 {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.Min_QLabel_4' type='QLineEdit' unnamed='1' visible='1'}
:ScrollArea.Number of Points_QLineEdit {container=':objectInspector.ScrollArea_QScrollArea' name='Number of Points' type='QLineEdit' visible='1'}
:ScrollArea.h_QComboBox {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.h_QLabel' type='QComboBox' unnamed='1' visible='1'}
:ScrollArea.h_QLabel {container=':objectInspector.ScrollArea_QScrollArea' text='h' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.k_QComboBox {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.k_QLabel' type='QComboBox' unnamed='1' visible='1'}
:ScrollArea.k_QLabel {container=':objectInspector.ScrollArea_QScrollArea' text='k' type='QLabel' unnamed='1' visible='1'}
:ScrollArea.l_QComboBox {container=':objectInspector.ScrollArea_QScrollArea' leftWidget=':ScrollArea.l_QLabel' type='QComboBox' unnamed='1' visible='1'}
:ScrollArea.l_QLabel {container=':objectInspector.ScrollArea_QScrollArea' text='l' type='QLabel' unnamed='1' visible='1'}
:ScrollArea_DimensionWidget {container=':objectInspector.ScrollArea_QScrollArea' occurrence='4' type='DimensionWidget' unnamed='1' visible='1'}
:ScrollArea_GeometryWidget {container=':objectInspector.ScrollArea_QScrollArea' type='GeometryWidget' unnamed='1' visible='1'}
:ScrollArea_QScrollBar {container=':objectInspector.ScrollArea_QScrollArea' type='QScrollBar' unnamed='1' visible='1'}
:TimeControlWidget_Mantid::Vates::SimpleGui::TimeControlWidget {name='timeControlWidget' type='Mantid::Vates::SimpleGui::TimeControlWidget' visible='1' window=':_VsgMainWindow' windowTitle='TimeControlWidget'}
:Viewport_pqQVTKWidget {name='Viewport' occurrence='2' type='pqQVTKWidget' visible='0'}
:_QGraphicsScene {type='QGraphicsScene' unnamed='1'}
:_QGraphicsScene_2 {occurrence='2' type='QGraphicsScene' unnamed='1'}
:_QGraphicsScene_3 {occurrence='3' type='QGraphicsScene' unnamed='1'}
:_QItemSelectionModel {occurrence='13' type='QItemSelectionModel' unnamed='1'}
:_QMenuBar {type='QMenuBar' unnamed='1' visible='1' window=':_VsgMainWindow'}
:_QVTKInteractorAdapter {occurrence='2' type='QVTKInteractorAdapter' unnamed='1'}
:_VsgMainWindow {type='VsgMainWindow' unnamed='1' visible='1'}
:_pqPipelineModel {type='pqPipelineModel' unnamed='1'}
:mainRenderFrame.Viewport_pqQVTKWidget {container=':splitter_2.mainRenderFrame_QFrame' name='Viewport' type='pqQVTKWidget' visible='1'}
:multiSliceButton_QPushButton {name='multiSliceButton' type='QPushButton' visible='1' window=':_VsgMainWindow'}
:objectInspector.Apply_QPushButton {container=':qt_tabwidget_stackedwidget.objectInspector_pqObjectInspectorWidget' name='Accept' text='Apply' type='QPushButton' visible='1'}
:objectInspector.Delete_QPushButton {container=':qt_tabwidget_stackedwidget.objectInspector_pqObjectInspectorWidget' name='Delete' text='Delete' type='QPushButton' visible='1'}
:objectInspector.ScrollArea_QScrollArea {container=':qt_tabwidget_stackedwidget.objectInspector_pqObjectInspectorWidget' name='ScrollArea' type='QScrollArea' visible='1'}
:parallelProjButton_QToolButton {name='parallelProjButton' type='QToolButton' visible='1' window=':_VsgMainWindow'}
:qt_spinbox_lineedit_QLineEdit {name='qt_spinbox_lineedit' type='QLineEdit' visible='1' window=':_VsgMainWindow'}
:qt_tabwidget_stackedwidget.objectInspector_pqObjectInspectorWidget {container=':splitter.qt_tabwidget_stackedwidget_QStackedWidget' name='objectInspector' type='pqObjectInspectorWidget' visible='1'}
:renderFrame.Viewport_pqQVTKWidget {container=':splitter_2.renderFrame_QFrame' name='Viewport' type='pqQVTKWidget' visible='1'}
:splatterPlotButton_QPushButton {name='splatterPlotButton' type='QPushButton' visible='1' window=':_VsgMainWindow'}
:splitter.Properties_pqProxyTabWidget {container=':splitter_2.splitter_QSplitter' name='proxyTabWidget' text='Properties' type='pqProxyTabWidget' visible='1'}
:splitter.pipelineBrowser_pqPipelineBrowserWidget {container=':splitter_2.splitter_QSplitter' name='pipelineBrowser' type='pqPipelineBrowserWidget' visible='1'}
:splitter.qt_tabwidget_stackedwidget_QStackedWidget {container=':splitter_2.splitter_QSplitter' name='qt_tabwidget_stackedwidget' type='QStackedWidget' visible='1'}
:splitter_2.Rebin_QPushButton {container=':splitter_2_QSplitter' name='rebinButton' text='Rebin' type='QPushButton' visible='1'}
:splitter_2.Threshold_QPushButton {container=':splitter_2_QSplitter' name='thresholdButton' text='Threshold' type='QPushButton' visible='1'}
:splitter_2.mainRenderFrame_QFrame {container=':splitter_2_QSplitter' name='mainRenderFrame' type='QFrame' visible='1'}
:splitter_2.renderFrame_QFrame {container=':splitter_2_QSplitter' name='renderFrame' type='QFrame' visible='1'}
:splitter_2.splitter_QSplitter {container=':splitter_2_QSplitter' name='splitter' type='QSplitter' visible='1'}
:splitter_2.xAxisWidget_Mantid::Vates::SimpleGui::AxisInteractor {container=':splitter_2_QSplitter' name='xAxisWidget' type='Mantid::Vates::SimpleGui::AxisInteractor' visible='1'}
:splitter_2.yAxisWidget_Mantid::Vates::SimpleGui::AxisInteractor {container=':splitter_2_QSplitter' name='yAxisWidget' type='Mantid::Vates::SimpleGui::AxisInteractor' visible='1'}
:splitter_2.zAxisWidget_Mantid::Vates::SimpleGui::AxisInteractor {container=':splitter_2_QSplitter' name='zAxisWidget' type='Mantid::Vates::SimpleGui::AxisInteractor' visible='1'}
:splitter_2_QGraphicsView {container=':splitter_2_QSplitter' type='QGraphicsView' unnamed='1' visible='1'}
:splitter_2_QGraphicsView_2 {container=':splitter_2_QSplitter' occurrence='2' type='QGraphicsView' unnamed='1' visible='1'}
:splitter_2_QGraphicsView_3 {container=':splitter_2_QSplitter' occurrence='3' type='QGraphicsView' unnamed='1' visible='1'}
:splitter_2_QSplitter {name='splitter_2' type='QSplitter' visible='1' window=':_VsgMainWindow'}
:splitter_2_QwtScaleWidget {container=':splitter_2_QSplitter' occurrence='2' type='QwtScaleWidget' unnamed='1' visible='1'}
:splitter_2_QwtScaleWidget_2 {container=':splitter_2_QSplitter' type='QwtScaleWidget' unnamed='1' visible='1'}
:splitter_2_QwtScaleWidget_3 {container=':splitter_2_QSplitter' occurrence='3' type='QwtScaleWidget' unnamed='1' visible='1'}
:standardButton_QPushButton {name='standardButton' type='QPushButton' visible='1' window=':_VsgMainWindow'}
:threeSliceButton_QPushButton {name='threeSliceButton' type='QPushButton' visible='1' window=':_VsgMainWindow'}
source(findFile("scripts", "global_checks.py"))
def check_mode_buttons(std, ms, ts, sp):
waitFor("object.exists(':standardButton_QPushButton')", 20000)
test.compare(fix_bool(findObject(":standardButton_QPushButton").enabled), std)
waitFor("object.exists(':multiSliceButton_QPushButton')", 20000)
test.compare(fix_bool(findObject(":multiSliceButton_QPushButton").enabled), ms)
waitFor("object.exists(':threeSliceButton_QPushButton')", 20000)
test.compare(fix_bool(findObject(":threeSliceButton_QPushButton").enabled), ts)
waitFor("object.exists(':splatterPlotButton_QPushButton')", 20000)
test.compare(fix_bool(findObject(":splatterPlotButton_QPushButton").enabled), sp)
def check_time_controls(mode):
waitFor("object.exists(':TimeControlWidget_Mantid::Vates::SimpleGui::TimeControlWidget')", 20000)
test.compare(fix_bool(findObject(":TimeControlWidget_Mantid::Vates::SimpleGui::TimeControlWidget").enabled),
mode)
def check_slices(axisScaleName, indicatorsRequired):
ext = None
if axisScaleName[0] == "y":
ext = ""
if axisScaleName[0] == "x":
ext = "_2"
if axisScaleName[0] == "z":
ext = "_3"
graphScene = waitForObject(":_QGraphicsScene%s" % ext)
indicatorsPresent = graphScene.items().size()
test.compare(indicatorsPresent, indicatorsRequired)
source(findFile("scripts", "global_helpers.py"))
import os
def open_file(filename):
activateItem(waitForObjectItem(":_QMenuBar", "File"))
activateItem(waitForObjectItem(":File_QMenu", "Open"))
ctx = currentApplicationContext()
dirname = ctx.environmentVariable("MANTID_AUTOTEST_DATA")
#test.log("Data Dir: %s" % dirname)
fileDialog = waitForObject(":Open File: (open multiple files with <ctrl> key.)_pqFileDialog")
fileDialog_NavigateUp = waitForObject(":Open File: (open multiple files with <ctrl> key.).NavigateUp_QToolButton")
fileDialog_Files = waitForObject(":Open File: (open multiple files with <ctrl> key.).Files_QTreeView")
fileDialog_Parents = waitForObject(":Open File: (open multiple files with <ctrl> key.).Parents_QComboBox")
# Reset to top-level directory
count = fileDialog_Parents.count
for i in range(count):
clickButton(fileDialog_NavigateUp)
# Now, click down the file path. CMake uses Linux slashes on Windows too.
dirs = dirname.split('/')
for dir in dirs:
# Left: Linux, Right: Windows
if '' == dir or ':' in dir:
continue
dir = fix_slashes(dir)
#test.log("Clicking Dir %s" % dir)
waitForObjectItem(":Open File: (open multiple files with <ctrl> key.).Files_QTreeView", dir)
doubleClickItem(":Open File: (open multiple files with <ctrl> key.).Files_QTreeView", dir, 27, 11, 0, Qt.LeftButton)
fileDialog_FileName = waitForObject(":Open File: (open multiple files with <ctrl> key.).FileName_QLineEdit")
fileDialog_FileName.setText(filename)
fileDialog_OkButton = waitForObject(":Open File: (open multiple files with <ctrl> key.).OK_QPushButton")
clickButton(fileDialog_OkButton)
def quit_program():
activateItem(waitForObjectItem(":_QMenuBar", "File"))
activateItem(waitForObjectItem(":File_QMenu", "Exit"))
def switch_mode(mode):
clickButton(":%sButton_QPushButton" % mode)
def set_ptw_lineedit_property(value, property, ext=""):
if ext != "":
ext = "_" + ext
object = ":ScrollArea.%s_QLineEdit%s" % (property, ext)
lineedit = waitForObject(object)
N = lineedit.text.length()
for i in range(N):
lineedit.cursorBackward(True)
type(lineedit, "<Del>")
lineedit.text = str(value)
CLASS=
CLASSPATH=
CWD=<CWD_of_Server>
ENVVARS=envvars
HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
TEST_CASES=tst_Startup tst_Load3dMdew tst_Load4dMdew tst_LoadPeaks tst_Splatter tst_MultiSlice tst_ThreeSlice tst_PeaksOverlay tst_RebinExtents_MultiSlice
VERSION=2
WRAPPERS=Qt
def main():
source(findFile("scripts", "test_helpers.py"))
source(findFile("scripts", "common_checks.py"))
startApplication("VatesSimpleGui")
open_file("SEQ_MDEW.nxs")
clickButton(":splitter_2.Rebin_QPushButton")
set_ptw_lineedit_property(20, "Bins")
set_ptw_lineedit_property(20, "Bins", "2")
set_ptw_lineedit_property(20, "Bins", "3")
set_ptw_lineedit_property(20, "Bins", "4")
apply_ptw_settings()
switch_mode("multiSlice")
# Num slices: X = 3, Y = 2, Z = 1
make_slice("xAxisWidget", 0.1)
make_slice("yAxisWidget", -0.7)
make_slice("zAxisWidget", -0.7)
make_slice("xAxisWidget", 0.3)
make_slice("yAxisWidget", -0.4)
make_slice("xAxisWidget", 0.4)
apply_ptw_settings()
mouseClick(waitForObject(":splitter.pipelineBrowser_pqPipelineBrowserWidget"), 51, 56, 0, Qt.LeftButton)
# Change the axis orientations
set_ptw_combobox_property("DeltaE", 1)
apply_ptw_settings()
check_axis_parameters("xAxisWidget", "DeltaE", 17.0, 19.0)
check_slices("xAxisWidget", 0)
check_slices("yAxisWidget", 2)
check_slices("zAxisWidget", 1)
def set_ptw_combobox_property(property, index):
object = ":ScrollArea.%s_QComboBox" % property
combobox = waitForObject(object)
comboboxItem = combobox.itemText(index)
clickItem(object, comboboxItem, 5, 5, 0, Qt.LeftButton)
def check_axis_parameters(axisScaleName, title, min, max):
axisScale = waitForObject(":splitter_2.%s_Mantid::Vates::SimpleGui::AxisInteractor" % axisScaleName)
min_curr = axisScale.getMinimum
max_curr = axisScale.getMaximum
title_curr = axisScale.getTitle
test.compare(title, title_curr)
test.compare(min, min_curr)
test.compare(max, max_curr)
def main():
source(findFile("scripts", "test_helpers.py"))
source(findFile("scripts", "common_checks.py"))
startApplication("VatesSimpleGui")
open_file("TOPAZ_3680_5_sec_MDEW.nxs")
check_mode_buttons(std=False, ms=True, ts=True, sp=True)
check_time_controls(False)
quit_program()
<?xml version="1.0" encoding="UTF-8"?>
<testconfig version="1.0">
<information>
<summary/>
<description/>
</information>
</testconfig>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment