diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h index c9aa86d42b84..c1a74e533e4a 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h @@ -235,6 +235,10 @@ namespace Mantid /// Get the ParaViewPath const std::string getParaViewPath() const; + + /// Get the initial view for vates + const std::string getVsiInitialView() const; + private: friend struct Mantid::Kernel::CreateUsingNew; /// Handles distribution of Poco signals. diff --git a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp index 73a355a4e66b..f9b591b334f3 100644 --- a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp +++ b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp @@ -2199,6 +2199,15 @@ const std::string ConfigServiceImpl::getParaViewPath() const return getString("paraview.path"); } +/** + * Get the user-specified initial view + * @returns A string with the initial view or an empty string + */ +const std::string ConfigServiceImpl::getVsiInitialView() const +{ + return getString("vsi.initialview"); +} + /// \cond TEMPLATE template DLLExport int ConfigServiceImpl::getValue(const std::string&, double&); template DLLExport int ConfigServiceImpl::getValue(const std::string&, std::string&); diff --git a/Code/Mantid/Installers/colormaps/All_vsi_default_cmaps.xml b/Code/Mantid/Installers/colormaps/All_vsi_default_cmaps.xml new file mode 100644 index 000000000000..86d575448a0e --- /dev/null +++ b/Code/Mantid/Installers/colormaps/All_vsi_default_cmaps.xml @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp index fc8c177f7b28..401e83e739a8 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp @@ -685,22 +685,48 @@ void MantidUI::showVatesSimpleInterface() { return; } - // Set the type of workspace, the GUI needs it + + // Set the type of workspace, the GUI needs it and + // extract the instrument which was used to measure the workspace data int wsType = MantidQt::API::VatesViewerInterface::MDEW; + + std::string instrumentName; + + // check for peak workspace if (pws) { wsType = MantidQt::API::VatesViewerInterface::PEAKS; + + instrumentName = pws->getInstrument()->getFullName(); } + + // Check for histo workspace if (mdhist) { wsType = MantidQt::API::VatesViewerInterface::MDHW; + + // Get the instrument name + if (mdhist->getNumExperimentInfo() > 0 ) + { + instrumentName = mdhist->getExperimentInfo(0)->getInstrument()->getFullName(); + } + } + + // Check for event workspace + if (mdews) + { + // Get the instrument name + if (mdews->getNumExperimentInfo() > 0 ) + { + instrumentName = mdews->getExperimentInfo(0)->getInstrument()->getFullName(); + } } if (m_vatesSubWindow) { QWidget *vwidget = m_vatesSubWindow->widget(); vwidget->show(); - qobject_cast(vwidget)->renderWorkspace(wsName, wsType); + qobject_cast(vwidget)->renderWorkspace(wsName, wsType, instrumentName); return; } else @@ -720,11 +746,12 @@ void MantidUI::showVatesSimpleInterface() connect(vsui, SIGNAL(requestClose()), m_vatesSubWindow, SLOT(close())); vsui->setParent(m_vatesSubWindow); m_vatesSubWindow->setWindowTitle("Vates Simple Interface"); + vsui->setupPluginMode(); //m_appWindow->setGeometry(m_vatesSubWindow, vsui); m_vatesSubWindow->setWidget(vsui); m_vatesSubWindow->widget()->show(); - vsui->renderWorkspace(wsName, wsType); + vsui->renderWorkspace(wsName, wsType, instrumentName); } else { diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/VatesViewerInterface.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/VatesViewerInterface.h index c019095bb5c1..8a20332e383f 100644 --- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/VatesViewerInterface.h +++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/VatesViewerInterface.h @@ -5,6 +5,8 @@ #include +#include + class QString; namespace MantidQt @@ -58,8 +60,11 @@ class EXPORT_OPT_MANTIDQT_API VatesViewerInterface : public QWidget * @param wsname the name of the workspace to visualize * @param wstype the type of workspace being visualized */ - virtual void renderWorkspace(QString wsname, int wstype); - /// Special function of correct widget invocation for plugin mode. + virtual void renderWorkspace(QString workspaceName, int workspaceType, std::string instrumentName); + + /** + * Special function of correct widget invocation for plugin mode. + */ virtual void setupPluginMode(); /// Enum to track the workspace type diff --git a/Code/Mantid/MantidQt/API/src/VatesViewerInterface.cpp b/Code/Mantid/MantidQt/API/src/VatesViewerInterface.cpp index cad38659ecc7..7fc9cbbb7393 100644 --- a/Code/Mantid/MantidQt/API/src/VatesViewerInterface.cpp +++ b/Code/Mantid/MantidQt/API/src/VatesViewerInterface.cpp @@ -18,10 +18,11 @@ void VatesViewerInterface::setupPluginMode() { } -void VatesViewerInterface::renderWorkspace(QString wsname, int wstype) +void VatesViewerInterface::renderWorkspace(QString workSpaceName, int workspaceType, std::string instrumentName) { - UNUSED_ARG(wsname); - UNUSED_ARG(wstype); + UNUSED_ARG(workSpaceName); + UNUSED_ARG(workspaceType); + UNUSED_ARG(instrumentName); } void VatesViewerInterface::shutdown() diff --git a/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/vtkSplatterPlotFactory.h b/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/vtkSplatterPlotFactory.h index 66955e0fb9ed..b08438cb0ccd 100644 --- a/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/vtkSplatterPlotFactory.h +++ b/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/vtkSplatterPlotFactory.h @@ -2,11 +2,13 @@ #define MANTID_VATES_vtkSplatterPlotFactory_H_ #include "MantidAPI/IMDEventWorkspace.h" +#include "MantidAPI/IMDHistoWorkspace.h" #include "MantidAPI/IMDNode.h" #include "MantidMDEvents/MDEventFactory.h" #include "MantidMDEvents/MDEventWorkspace.h" #include "MantidVatesAPI/ThresholdRange.h" #include "MantidVatesAPI/vtkDataSetFactory.h" +#include #include using Mantid::MDEvents::MDEventWorkspace; @@ -42,6 +44,7 @@ namespace VATES * File change history is stored at: * Code Documentation is available at: */ + class DLLExport vtkSplatterPlotFactory : public vtkDataSetFactory { public: @@ -81,6 +84,23 @@ class DLLExport vtkSplatterPlotFactory : public vtkDataSetFactory template void doCreate(typename MDEventWorkspace::sptr ws) const; + ///Check if the MDHisto workspace is 3D or 4D in nature + bool doMDHisto4D(Mantid::API::IMDHistoWorkspace_sptr workspace) const; + + /// Generate the vtkDataSet from the objects input MDHistoWorkspace + void doCreateMDHisto(Mantid::API::IMDHistoWorkspace_sptr workspace) const; + + /// Set the signals and the valid points which are to be displayed + double extractScalarSignal(Mantid::API::IMDHistoWorkspace_sptr workspace, + bool do4D, const int x, const int y, const int z) const; + + /// Set the points and point ids for a hexahedron structure. + void setPointsAndPointIdsForHex(vtkPoints* points, + std::vector &pointIDs, + Mantid::coord_t out[3], + double signalScalar, + Mantid::coord_t steps[3]) const; + /// Template Method pattern to validate the factory before use. virtual void validate() const; @@ -91,7 +111,7 @@ class DLLExport vtkSplatterPlotFactory : public vtkDataSetFactory const std::string m_scalarName; /// Member workspace to generate vtkdataset from. - Mantid::API::IMDEventWorkspace_sptr m_workspace; + Mantid::API::IMDWorkspace_sptr m_workspace; /// Approximate number of points to plot size_t m_numPoints; diff --git a/Code/Mantid/Vates/VatesAPI/src/vtkMDHistoHexFactory.cpp b/Code/Mantid/Vates/VatesAPI/src/vtkMDHistoHexFactory.cpp index ce9b098f1158..4de4177dd39b 100644 --- a/Code/Mantid/Vates/VatesAPI/src/vtkMDHistoHexFactory.cpp +++ b/Code/Mantid/Vates/VatesAPI/src/vtkMDHistoHexFactory.cpp @@ -281,7 +281,6 @@ namespace VATES delete [] voxelShown; delete [] pointNeeded; return visualDataSet; - } diff --git a/Code/Mantid/Vates/VatesAPI/src/vtkSplatterPlotFactory.cpp b/Code/Mantid/Vates/VatesAPI/src/vtkSplatterPlotFactory.cpp index 02ed12cd4f13..5f70dfb1ee53 100644 --- a/Code/Mantid/Vates/VatesAPI/src/vtkSplatterPlotFactory.cpp +++ b/Code/Mantid/Vates/VatesAPI/src/vtkSplatterPlotFactory.cpp @@ -1,15 +1,19 @@ #include "MantidVatesAPI/vtkSplatterPlotFactory.h" #include "MantidAPI/IMDEventWorkspace.h" +#include "MantidAPI/IMDHistoWorkspace.h" #include "MantidKernel/CPUTimer.h" #include "MantidKernel/ReadLock.h" #include "MantidMDEvents/MDEventFactory.h" #include "MantidVatesAPI/ProgressAction.h" +#include "MantidVatesAPI/Common.h" #include #include #include +#include #include +#include #include #include @@ -305,6 +309,256 @@ namespace VATES delete [] ids; } + /** + * Generate the vtkDataSet from the objects input MDHistoWorkspace (of a + * given type an dimensionality 3D or 4D). Note that for 4D we only look at t=0 currently. + * Note that this implementation is almost the same as for vtkMDHistoHexFactory. + * @param workspace A smart pointer to the histo workspace. + * @return A fully constructed vtkUnstructuredGrid containing geometric and scalar data. + */ + void vtkSplatterPlotFactory::doCreateMDHisto(IMDHistoWorkspace_sptr workspace) const + { + bool VERBOSE = true; + CPUTimer tim; + // Acquire a scoped read-only lock to the workspace (prevent segfault + // from algos modifying wworkspace) + ReadLock lock(*workspace); + + // Get the geometric information of the bins + const int nBinsX = static_cast(workspace->getXDimension()->getNBins()); + const int nBinsY = static_cast(workspace->getYDimension()->getNBins()); + const int nBinsZ = static_cast(workspace->getZDimension()->getNBins()); + + const coord_t maxX = workspace->getXDimension()->getMaximum(); + const coord_t minX = workspace->getXDimension()->getMinimum(); + const coord_t maxY = workspace->getYDimension()->getMaximum(); + const coord_t minY = workspace->getYDimension()->getMinimum(); + const coord_t maxZ = workspace->getZDimension()->getMaximum(); + const coord_t minZ = workspace->getZDimension()->getMinimum(); + + coord_t incrementX = (maxX - minX) / static_cast(nBinsX); + coord_t incrementY = (maxY - minY) / static_cast(nBinsY); + coord_t incrementZ = (maxZ - minZ) / static_cast(nBinsZ); + + const int imageSize = (nBinsX)*(nBinsY)*(nBinsZ); + + // Two points per bin, per direction. Two neighbouring bins share points. + const int nPointsX = nBinsX+1; + const int nPointsY = nBinsY+1; + const int nPointsZ = nBinsZ+1; + + // VTK structures + vtkFloatArray *signal = vtkFloatArray::New(); + signal->Allocate(imageSize); + signal->SetName(m_scalarName.c_str()); + signal->SetNumberOfComponents(1); + + vtkPoints *points = vtkPoints::New(); + points->Allocate(static_cast(imageSize)); + + // Set up the actual vtkDataSet, here the vtkUnstructuredGrid, the cell type + // we choose here is the vtk_poly_vertex + vtkUnstructuredGrid *visualDataSet = vtkUnstructuredGrid::New(); + this->dataSet = visualDataSet; + visualDataSet->Allocate(imageSize); + + // Create the Hexahedron structure. + vtkHexahedron *hexahedron = vtkHexahedron::New(); + vtkVertex* vertex = vtkVertex::New(); + + // Check if the workspace requires 4D handling. + bool do4D = doMDHisto4D(workspace); + + // Get the transformation that takes the points in the TRANSFORMED space back into the ORIGINAL (not-rotated) space. + Mantid::API::CoordTransform* transform = NULL; + if (m_useTransform) + { + transform = workspace->getTransformToOriginal(); + } + + Mantid::coord_t in[3]; + Mantid::coord_t out[3]; + + // We create one point per bin and create a hexahedron which is propoertional + // to the signal value in the bin, yet maximally the size of the bin. + std::vector pointIDs(8); + + double signalScalar; + + size_t index = 0; + + for (int z = 0; z < nBinsZ; z++) + { + in[2] = (minZ + (static_cast(z)*incrementZ + static_cast(0.5)*incrementZ)); + for (int y = 0; y < nBinsY; y++) + { + in[1] = (minY + (static_cast(y)*incrementY + static_cast(0.5)*incrementY)); + for (int x = 0; x < nBinsX; x++) + { + // Get the signalScalar + signalScalar = this->extractScalarSignal(workspace, do4D, x, y, z); + + // Make sure that the signal is not bad and is in the range and larger than 0 + if (!Mantid::VATES::isSpecial(signalScalar) && m_thresholdRange->inRange(signalScalar) &&(signalScalar > 0.0)) + { + in[0] = (minX + (static_cast(x) * incrementX + static_cast(0.5)*incrementX)); + + // Create the transformed value if required + if (transform) + { + transform->apply(in, out); + } + else + { + memcpy(&out, &in, sizeof in); + } + + // Store the signal + signal->InsertNextValue(static_cast(signalScalar)); + + // Currently selecting vertex as cell data type. + if (false) + { + // The range which is maximally the size of the + coord_t range = static_cast(signalScalar)/ static_cast(m_thresholdRange->getMaximum()); + coord_t steps[3] = {0.5*range*incrementX, 0.5*range*incrementY, 0.5*range*incrementZ}; + + // Set points for the variable size hexahedron + setPointsAndPointIdsForHex(points, pointIDs, out, signalScalar, steps); + + // Set the hexahedron + hexahedron->GetPointIds()->SetId(0, pointIDs[0]); + hexahedron->GetPointIds()->SetId(1, pointIDs[1]); + hexahedron->GetPointIds()->SetId(2, pointIDs[2]); + hexahedron->GetPointIds()->SetId(3, pointIDs[3]); + hexahedron->GetPointIds()->SetId(4, pointIDs[4]); + hexahedron->GetPointIds()->SetId(5, pointIDs[5]); + hexahedron->GetPointIds()->SetId(6, pointIDs[6]); + hexahedron->GetPointIds()->SetId(7, pointIDs[7]); + + visualDataSet->InsertNextCell(VTK_HEXAHEDRON, hexahedron->GetPointIds()); + } + else + { + vtkIdType id = points->InsertNextPoint(out); + + vertex->GetPointIds()->SetId(0,id); + + visualDataSet->InsertNextCell(VTK_VERTEX, vertex->GetPointIds()); + } + } + index++; + } + } + } + + hexahedron->Delete(); + vertex->Delete(); + + visualDataSet->SetPoints(points); + visualDataSet->GetCellData()->SetScalars(signal); + + std::cout << tim << " to create the visual data set." << std::endl; + + points->Delete(); + signal->Delete(); + visualDataSet->Squeeze(); + } + + /** + * Set the points and pointIDs for the rectangular hexahedron structure. + * @param points A pointer to a VTK points structure. + * @param pointIDs A vector which holds point Ids. + * @param centre The centre of the hexahedron. + * @param signalScalar + */ + void vtkSplatterPlotFactory::setPointsAndPointIdsForHex(vtkPoints* points, + std::vector &pointIDs, + Mantid::coord_t out[3], + double signalScalar, + Mantid::coord_t steps[3]) const + { + // 8 Points for variable size box + + //xyz + pointIDs[0] = points->InsertNextPoint(out[0] - steps[0], + out[1] - steps[1], + out[2] - steps[2]); + //dxyz + pointIDs[1] = points->InsertNextPoint(out[0] + steps[0], + out[1] - steps[1], + out[2] - steps[2]); + //dxdyz + pointIDs[2] = points->InsertNextPoint(out[0] + steps[0], + out[1] + steps[1], + out[2] - steps[2]); + //xdyz + pointIDs[3] = points->InsertNextPoint(out[0] - steps[0], + out[1] + steps[1], + out[2] - steps[2]); + //xydz + pointIDs[4] = points->InsertNextPoint(out[0] - steps[0], + out[1] - steps[1], + out[2] + steps[2]); + //dxydz + pointIDs[5] = points->InsertNextPoint(out[0] + steps[0], + out[1] - steps[1], + out[2] + steps[2]); + //dxdydz + pointIDs[6] = points->InsertNextPoint(out[0] + steps[0], + out[1] + steps[1], + out[2] + steps[2]); + //xdydz + pointIDs[7] = points->InsertNextPoint(out[0] - steps[0], + out[1] + steps[1], + out[2] + steps[2]); + } + + /** + * Set the signals, pointIDs and points for bins which are valid to be displayed + * @param workspace Smart pointer to the MDHisto workspace. + * @param do4D If the workspace contains time. + * @returns The scalar signal. + */ + double vtkSplatterPlotFactory::extractScalarSignal(IMDHistoWorkspace_sptr workspace, + bool do4D, const int x, const int y, const int z) const + { + double signalScalar; + + if (do4D) + { + signalScalar = workspace->getSignalNormalizedAt(x,y,z, m_time); + } + else + { + signalScalar = workspace->getSignalNormalizedAt(x,y,z); + } + + return signalScalar; + } + + /** + * Check if the MDHisto workspace is 3D or 4D in nature + * @param workspace The MDHisto workspace + * @returns Is the workspace 4D? + */ + bool vtkSplatterPlotFactory::doMDHisto4D(IMDHistoWorkspace_sptr workspace) const + { + bool do4D = false; + + bool bExactMatch = true; + + IMDHistoWorkspace_sptr workspace4D = castAndCheck(workspace, bExactMatch); + + if (workspace4D) + { + do4D = true; + } + + return do4D; + } + + /** * Generate the vtkDataSet from the objects input IMDEventWorkspace * @param progressUpdating : Reporting object to pass progress information up the stack. @@ -357,8 +611,19 @@ namespace VATES this->slice = false; } - // Macro to call the right instance of the - CALL_MDEVENT_FUNCTION(this->doCreate, m_workspace); + // Check for the workspace type, i.e. if it is MDHisto or MDEvent + IMDEventWorkspace_sptr eventWorkspace = boost::dynamic_pointer_cast(m_workspace); + IMDHistoWorkspace_sptr histoWorkspace = boost::dynamic_pointer_cast(m_workspace); + + if (eventWorkspace) + { + // Macro to call the right instance of the + CALL_MDEVENT_FUNCTION(this->doCreate, m_workspace); + } + else + { + this->doCreateMDHisto(histoWorkspace); + } // Clean up if (this->slice) @@ -380,7 +645,7 @@ namespace VATES */ void vtkSplatterPlotFactory::initialize(Mantid::API::Workspace_sptr ws) { - this->m_workspace = boost::dynamic_pointer_cast(ws); + this->m_workspace = boost::dynamic_pointer_cast(ws); this->validate(); } @@ -393,10 +658,20 @@ namespace VATES { throw std::invalid_argument("Workspace is null or not IMDEventWorkspace"); } + if (m_workspace->getNumDims() < 3) { throw std::runtime_error("Invalid vtkSplatterPlotFactory. Workspace must have at least 3 dimensions."); } + + // Make sure that the workspace is either an MDEvent Workspace or an MDHistoWorkspace + IMDEventWorkspace_sptr eventWorkspace = boost::dynamic_pointer_cast(m_workspace); + IMDHistoWorkspace_sptr histoWorkspace = boost::dynamic_pointer_cast(m_workspace); + + if (!eventWorkspace && !histoWorkspace) + { + throw std::runtime_error("Workspace is neither an IMDHistoWorkspace nor an IMDEventWorkspace."); + } } /** diff --git a/Code/Mantid/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/ModeControlWidget.h b/Code/Mantid/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/ModeControlWidget.h index 6f9e024dd15d..832e50d961ae 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/ModeControlWidget.h +++ b/Code/Mantid/Vates/VatesSimpleGui/QtWidgets/inc/MantidVatesSimpleGuiQtWidgets/ModeControlWidget.h @@ -4,6 +4,7 @@ #include "ui_ModeControlWidget.h" #include "MantidVatesSimpleGuiQtWidgets/WidgetDllOption.h" +#include #include namespace Mantid @@ -58,14 +59,23 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_QTWIDGETS ModeControlWidget : public QWid public slots: /// Enable/disable a specific view button. void enableViewButton(ModeControlWidget::Views mode, bool state); + /** * Enable/disable all view buttons, except standard. * @param state whether or not to enable the buttons + * @param initialView The initial view. */ - void enableViewButtons(bool state); + void enableViewButtons(ModeControlWidget::Views initialView, bool state); + /// Expose the standard view button. void setToStandardView(); + /// Switch to a selected view. + void setToSelectedView(ModeControlWidget::Views view); + + /// Convert a string into an enum + ModeControlWidget::Views getViewFromString(std::string view); + signals: /** * Function to make the main program window switch to a given view. @@ -97,6 +107,7 @@ protected slots: private: Ui::ModeControlWidgetClass ui; ///< The mode control widget's UI form + std::unordered_map mapFromStringToView; //< Holds the mapping from the a string to an associated enum }; } diff --git a/Code/Mantid/Vates/VatesSimpleGui/QtWidgets/src/ModeControlWidget.cpp b/Code/Mantid/Vates/VatesSimpleGui/QtWidgets/src/ModeControlWidget.cpp index aa0681c09825..8e72edcc572f 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/QtWidgets/src/ModeControlWidget.cpp +++ b/Code/Mantid/Vates/VatesSimpleGui/QtWidgets/src/ModeControlWidget.cpp @@ -1,4 +1,8 @@ #include "MantidVatesSimpleGuiQtWidgets/ModeControlWidget.h" +#include "MantidKernel/Logger.h" + +#include +#include namespace Mantid { @@ -6,6 +10,11 @@ namespace Vates { namespace SimpleGui { +namespace +{ + /// Static logger + Kernel::Logger g_log("MdControlWidget"); +} ModeControlWidget::ModeControlWidget(QWidget *parent) : QWidget(parent) { @@ -19,18 +28,60 @@ ModeControlWidget::ModeControlWidget(QWidget *parent) : QWidget(parent) this, SLOT(onThreeSliceViewButtonClicked())); QObject::connect(this->ui.splatterPlotButton, SIGNAL(clicked()), this, SLOT(onSplatterPlotViewButtonClicked())); + + // Add the mapping from string to the view enum + mapFromStringToView.reserve(4); + mapFromStringToView.insert(std::pair("STANDARD", ModeControlWidget::STANDARD)); + mapFromStringToView.insert(std::pair("THREESLICE", ModeControlWidget::THREESLICE)); + mapFromStringToView.insert(std::pair("MULTISLICE", ModeControlWidget::MULTISLICE)); + mapFromStringToView.insert(std::pair("SPLATTERPLOT", ModeControlWidget::SPLATTERPLOT)); + } ModeControlWidget::~ModeControlWidget() { - + } -void ModeControlWidget::enableViewButtons(bool state) +void ModeControlWidget::enableViewButtons(ModeControlWidget::Views initialView, bool state) { + // Set all buttons to the specified state + this->ui.standardButton->setEnabled(state); this->ui.multiSliceButton->setEnabled(state); this->ui.splatterPlotButton->setEnabled(state); this->ui.threeSliceButton->setEnabled(state); + + // Disable the defaultView (this is already disabled in the case of state == false) + switch(initialView) + { + case ModeControlWidget::STANDARD: + { + this->ui.standardButton->setEnabled(false); + } + break; + + case ModeControlWidget::THREESLICE: + { + this->ui.threeSliceButton->setEnabled(false); + } + break; + + case ModeControlWidget::MULTISLICE: + { + this->ui.multiSliceButton->setEnabled(false); + } + break; + + case ModeControlWidget::SPLATTERPLOT: + { + this->ui.splatterPlotButton->setEnabled(false); + } + break; + + default: + g_log.warning() << "An unknown default view was disabled. \n"; + break; + } } void ModeControlWidget::onMultiSliceViewButtonClicked() @@ -74,6 +125,43 @@ void ModeControlWidget::onSplatterPlotViewButtonClicked() emit executeSwitchViews(ModeControlWidget::SPLATTERPLOT); } +/** + * Set the current view to a new, selected view + * + */ +void ModeControlWidget::setToSelectedView(ModeControlWidget::Views view) +{ + switch(view) + { + case ModeControlWidget::STANDARD: + { + this->onStandardViewButtonClicked(); + } + break; + + case ModeControlWidget::MULTISLICE: + { + this->onMultiSliceViewButtonClicked(); + } + break; + + case ModeControlWidget::THREESLICE: + { + this->onThreeSliceViewButtonClicked(); + } + break; + + case ModeControlWidget::SPLATTERPLOT: + { + this->onSplatterPlotViewButtonClicked(); + } + break; + + default: + break; + } +} + /** * This function allows one to enable/disable a specific view button. * @param mode The view mode button to set state for @@ -101,6 +189,28 @@ void ModeControlWidget::enableViewButton(ModeControlWidget::Views mode, } } +/** + * A string is checked against the enum for the views. + * @param view A selected view. + * @returns The selected view as enum or the standard view. + */ +ModeControlWidget::Views ModeControlWidget::getViewFromString(std::string view) +{ + std::transform(view.begin(), view.end(), view.begin(), toupper); + + if (!view.empty() && mapFromStringToView.count(view) == 1) + { + return mapFromStringToView[view]; + } + else + { + // The view was not found, hence return the standard view + g_log.warning() << "The specified default view could not be found! \n"; + + return ModeControlWidget::STANDARD; + } +} + } // SimpleGui } // Vates } // Mantid diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h index ffd60fc49919..5987c3e3c881 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h @@ -78,7 +78,7 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS MdViewerWidget : public Manti /// Filter events to check for hide. bool eventFilter(QObject *obj, QEvent *ev); /// See MantidQt::API::VatesViewerInterface - void renderWorkspace(QString wsname, int wstype); + void renderWorkspace(QString workspaceName, int workspaceType, std::string instrumentName); /// See MantidQt::API::VatesViewerInterface void setupPluginMode(); @@ -126,6 +126,8 @@ protected slots: QHBoxLayout *viewLayout; ///< Layout manager for the view widget pqViewSettingsReaction *viewSettings; ///< Holder for the view settings reaction bool viewSwitched; + ModeControlWidget::Views initialView; ///< Holds the initial view + /// Check the environmental variables. void checkEnvSetup(); @@ -161,6 +163,18 @@ protected slots: 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, 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 + std::string getViewForInstrument(const std::string& instrument) const; + /// Check if a technique contains a keyword + bool checkIfTechniqueContainsKeyword(const std::set& techniques, const std::string& keyword) const; + /// Reset the current view to the appropriate initial view. + void resetCurrentView(int workspaceType, const std::string& instrumentName); }; } // SimpleGui diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/SplatterPlotView.h b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/SplatterPlotView.h index 10ba7cc4e375..ab87a452167b 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/SplatterPlotView.h +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/SplatterPlotView.h @@ -62,7 +62,7 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS SplatterPlotView : public Vie virtual ~SplatterPlotView(); /// @see ViewBase::checkView - void checkView(); + void checkView(ModeControlWidget::Views initialView); /** * ViewBase::destroyView */ diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/ViewBase.h b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/ViewBase.h index afaf39f1665e..08261eac545d 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/ViewBase.h +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/ViewBase.h @@ -63,7 +63,7 @@ class EXPORT_OPT_MANTIDVATES_SIMPLEGUI_VIEWWIDGETS ViewBase : public QWidget virtual ~ViewBase() {} /// Poll the view to set status for mode control buttons. - virtual void checkView(); + virtual void checkView(ModeControlWidget::Views initialView); /// Poll the view to set status for mode control buttons on view switch. virtual void checkViewOnSwitch(); /// Close view generated sub-windows. @@ -181,9 +181,10 @@ public slots: void setViewStatus(ModeControlWidget::Views mode, bool state); /** * Signal to set the status of the view mode buttons. - * @param state whether or not to enable to view mode buttons + * @param The initial view. + * @param state Whether or not to enable to view mode buttons. */ - void setViewsStatus(bool state); + void setViewsStatus(ModeControlWidget::Views view, bool state); private: Q_DISABLE_COPY(ViewBase) diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp index 6ffd05e4eba3..49918e566f24 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp @@ -14,6 +14,7 @@ #include "MantidKernel/DynamicFactory.h" #include "MantidKernel/Logger.h" #include "MantidKernel/ConfigService.h" +#include "MantidKernel/InstrumentInfo.h" // Have to deal with ParaView warnings and Intel compiler the hard way. #if defined(__INTEL_COMPILER) @@ -87,6 +88,8 @@ #include #include +#include +#include #include namespace Mantid @@ -100,8 +103,7 @@ using namespace MantidQt::API; namespace { - /// Static logger - Kernel::Logger g_log("MdViewerWidget"); + Mantid::Kernel::Logger g_log("MdViewerWidget"); } REGISTER_VATESGUI(MdViewerWidget) @@ -119,6 +121,9 @@ MdViewerWidget::MdViewerWidget() : VatesViewerInterface(), currentView(NULL), observeADSClear(); this->internalSetup(true); + + // Create the mapping from the measurement technique to the view + } /** @@ -139,6 +144,7 @@ MdViewerWidget::MdViewerWidget(QWidget *parent) : VatesViewerInterface(parent) QMainWindow *mw = qobject_cast(parent); new pqParaViewBehaviors(mw, mw); } + this->setupMainView(); } @@ -211,9 +217,8 @@ void MdViewerWidget::setupMainView() // all types of datasets supported by ParaView. //vtkSMProxyManager::GetProxyManager()->GetReaderFactory()->RegisterPrototypes("sources"); - // Set the standard view as the default - this->currentView = this->setMainViewWidget(this->ui.viewWidget, - ModeControlWidget::STANDARD); + // Set the view at startup to STANDARD, the view will be changed, depending on the workspace + this->currentView = this->setMainViewWidget(this->ui.viewWidget, ModeControlWidget::STANDARD); this->currentView->installEventFilter(this); // Create a layout to manage the view properly @@ -225,22 +230,7 @@ void MdViewerWidget::setupMainView() this->setParaViewComponentsForView(); } -/** - * This function performs setup for the plugin mode of the Vates Simple - * Interface. It calls a number of defined functions to complete the process. - */ -void MdViewerWidget::setupPluginMode() -{ - this->createAppCoreForPlugin(); - this->checkEnvSetup(); - this->setupUiAndConnections(); - if (!this->isPluginInitialized) - { - this->setupParaViewBehaviors(); - this->createMenus(); - } - this->setupMainView(); -} + /** * This function ensures that the main ParaView instance is only initialized @@ -386,6 +376,8 @@ void MdViewerWidget::setParaViewComponentsForView() this->ui.propertiesPanel->setView(this->currentView->getView()); this->ui.pipelineBrowser->setActiveView(this->currentView->getView()); + pqPipelineSource *src = pqActiveObjects::instance().activeSource(); + pqActiveObjects *activeObjects = &pqActiveObjects::instance(); QObject::connect(activeObjects, SIGNAL(portChanged(pqOutputPort*)), this->ui.propertiesPanel, SLOT(setOutputPort(pqOutputPort*))); @@ -424,8 +416,8 @@ void MdViewerWidget::setParaViewComponentsForView() SLOT(setToStandardView())); } - QObject::connect(this->currentView, SIGNAL(setViewsStatus(bool)), - this->ui.modeControlWidget, SLOT(enableViewButtons(bool))); + QObject::connect(this->currentView, SIGNAL(setViewsStatus(ModeControlWidget::Views, bool)), + this->ui.modeControlWidget, SLOT(enableViewButtons(ModeControlWidget::Views, bool))); QObject::connect(this->currentView, SIGNAL(setViewStatus(ModeControlWidget::Views, bool)), this->ui.modeControlWidget, @@ -478,17 +470,18 @@ void MdViewerWidget::renderingDone() /** * This function determines the type of source plugin and sets the workspace * name so that the data can be retrieved and rendered. - * @param wsname the workspace name for the data - * @param wstype a numeric indicator of the workspace type + * @param workspaceName The workspace name for the data. + * @param workspaceType A numeric indicator of the workspace type. + * @param intrumentName The name of the instrument which measured the workspace data. */ -void MdViewerWidget::renderWorkspace(QString wsname, int wstype) +void MdViewerWidget::renderWorkspace(QString workspaceName, int workspaceType, std::string instrumentName) { QString sourcePlugin = ""; - if (VatesViewerInterface::PEAKS == wstype) + if (VatesViewerInterface::PEAKS == workspaceType) { sourcePlugin = "Peaks Source"; } - else if (VatesViewerInterface::MDHW == wstype) + else if (VatesViewerInterface::MDHW == workspaceType) { sourcePlugin = "MDHW Source"; } @@ -497,8 +490,216 @@ void MdViewerWidget::renderWorkspace(QString wsname, int wstype) sourcePlugin = "MDEW Source"; } - this->currentView->setPluginSource(sourcePlugin, wsname); + // Load a new source plugin + this->currentView->setPluginSource(sourcePlugin, workspaceName); + this->renderAndFinalSetup(); + + // Reset the current view to the correct initial view + // Note that we can only reset if a source plugin exists. + // Also note that we can only reset the current view to the + // correct initial after calling renderAndFinalSetup. We first + // need to load in the current view and then switch to be inline + // with the current architecture. + resetCurrentView(workspaceType, instrumentName); +} + +/** + * Reset the current view if this is required + * @param workspaceType The type of workspace. + * @param instrumentName The name of the instrument. + */ +void MdViewerWidget::resetCurrentView(int workspaceType, const std::string& instrumentName) +{ + // Check if the current view is the correct initial view for the workspace type and the instrument + ModeControlWidget::Views initialView = getInitialView(workspaceType, instrumentName); + + bool isSetToCorrectInitialView = false; + + switch(initialView) + { + case ModeControlWidget::STANDARD: + { + isSetToCorrectInitialView = dynamic_cast(this->currentView) != 0; + } + break; + + case ModeControlWidget::MULTISLICE: + { + isSetToCorrectInitialView = dynamic_cast(this->currentView) != 0; + } + break; + + case ModeControlWidget::THREESLICE: + { + isSetToCorrectInitialView = dynamic_cast(this->currentView) != 0; + } + break; + + case ModeControlWidget::SPLATTERPLOT: + { + isSetToCorrectInitialView = dynamic_cast(this->currentView) != 0; + } + break; + + default: + isSetToCorrectInitialView = false; + break; + } + + if (isSetToCorrectInitialView == false) + { + this->ui.modeControlWidget->setToSelectedView(initialView); + } + + this->initialView = initialView; +} + +/* + * Provides an initial view. This view is specified either in the + * Mantid.user.properties file or by the most common technique of the + * instrument which is associated with the workspace data. + * @param workspaceType The work space type. + * @param instrumentName The name of the instrument with which the workspace + * data was measured. + * @returns An initial view. +*/ +ModeControlWidget::Views MdViewerWidget::getInitialView(int workspaceType, std::string instrumentName) +{ + // Get the possible initial views + std::string initialViewFromUserProperties = Mantid::Kernel::ConfigService::Instance().getVsiInitialView(); + std::string initialViewFromTechnique = getViewForInstrument(instrumentName); + + // The user-properties-defined default view takes precedence over the techique-defined default view + std::string initialView = initialViewFromUserProperties.empty() ? initialViewFromTechnique : initialViewFromUserProperties; + + ModeControlWidget::Views view = this->ui.modeControlWidget->getViewFromString(initialView); + + // Make sure that the default view is compatible with the current workspace, e.g. a a histo workspace cannot have a splatter plot + return checkViewAgainstWorkspace(view, workspaceType); +} + +/** + * Get the view which is adequat for a specified machine + * @param instrumentName The name of the instrument with which the workspace + * data was measured. + * @returns A view. + */ +std::string MdViewerWidget::getViewForInstrument(const std::string& instrumentName) const +{ + // If nothing is specified the standard view is chosen + if (instrumentName.empty()) + { + return "STANDARD"; + } + + // Check for techniques + // Precedence is 1. Single Crystal Diffraction -->SPLATTERPLOT + // 2. Neutron Diffraction --> SPLATTERPLOT + // 3. *Spectroscopy* --> MULTISLICE + // 4. Other --> STANDARD + const std::set techniques = Mantid::Kernel::ConfigService::Instance().getInstrument(instrumentName).techniques(); + + std::string associatedView; + + if (techniques.count("Single Crystal Diffraction") > 0 ) + { + associatedView = "SPLATTERPLOT"; + } + else if (techniques.count("Neutron Diffraction") > 0 ) + { + associatedView = "SPLATTERPLOT"; + } else if (checkIfTechniqueContainsKeyword(techniques, "Spectroscopy")) + { + associatedView = "MULTISLICE"; + } + else + { + associatedView = "STANDARD"; + } + + return associatedView; +} + +/** + * Check if a set of techniques contains a technique which matches specified keyword + * @param techniques A set of techniques + * @param keyword A keyword + * @param True if the keyword is contained in at least one technique else false. + */ +bool MdViewerWidget::checkIfTechniqueContainsKeyword(const std::set& techniques, const std::string& keyword) const +{ + std::regex pattern( "(.*)" + keyword + "(.*)"); + + for (std::set::iterator it = techniques.begin(); it != techniques.end(); ++it) + { + if (std::regex_match(*it, pattern)) + { + return true; + } + } + + return false; +} + +/* + * Check that the selected default view is compatible with the workspace type + * + * @param view An initial view. + * @param workspaceType The type of workspace. + * @returns A user-specified inital view or the standard view. +*/ +ModeControlWidget::Views MdViewerWidget::checkViewAgainstWorkspace(ModeControlWidget::Views view, int workspaceType) +{ + ModeControlWidget::Views selectedView; + + if (VatesViewerInterface::PEAKS == workspaceType) + { + // For now we set the standard view as default for the peak workspace + if (view != ModeControlWidget::STANDARD) + { + g_log.warning() << "Selected a plot which was not a standard plot for a peaks workspace. \n"; + } + + selectedView = ModeControlWidget::STANDARD; + } + else if (VatesViewerInterface::MDHW == workspaceType) + { + // Histo workspaces cannot have a splatter plot, + if (view == ModeControlWidget::SPLATTERPLOT) + { + g_log.warning() << "Selected a splatter plot for a histo workspace. Defaulted to standard view. \n"; + + selectedView = ModeControlWidget::STANDARD; + } + else + { + selectedView = view; + } + } + else + { + selectedView = view; + } + + return selectedView; +} + +/** + * This function performs setup for the plugin mode of the Vates Simple + * Interface. It calls a number of defined functions to complete the process. + */ +void MdViewerWidget::setupPluginMode() +{ + this->createAppCoreForPlugin(); + this->checkEnvSetup(); + this->setupUiAndConnections(); + if (!this->isPluginInitialized) + { + this->setupParaViewBehaviors(); + this->createMenus(); + } + this->setupMainView(); } /** @@ -510,7 +711,7 @@ void MdViewerWidget::renderAndFinalSetup() { this->currentView->render(); this->currentView->setColorsForView(); - this->currentView->checkView(); + this->currentView->checkView(this->initialView); this->currentView->updateAnimationControls(); } @@ -616,6 +817,7 @@ bool MdViewerWidget::eventFilter(QObject *obj, QEvent *ev) this->currentView->setColorScaleState(this->ui.colorSelectionWidget); pqObjectBuilder* builder = pqApplicationCore::instance()->getObjectBuilder(); builder->destroySources(); + this->ui.modeControlWidget->setToStandardView(); return true; } diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MultisliceView.cpp b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MultisliceView.cpp index 5021185d555c..80a385129599 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MultisliceView.cpp +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MultisliceView.cpp @@ -74,10 +74,14 @@ void MultiSliceView::setupData() { pqObjectBuilder *builder = pqApplicationCore::instance()->getObjectBuilder(); - pqDataRepresentation *drep = builder->createDataRepresentation(\ - this->origSrc->getOutputPort(0), this->mainView); - vtkSMPropertyHelper(drep->getProxy(), "Representation").Set("Slices"); - drep->getProxy()->UpdateVTKObjects(); + // Make sure that origsrc exists + if (this->origSrc) + { + pqDataRepresentation *drep = builder->createDataRepresentation(\ + this->origSrc->getOutputPort(0), this->mainView); + vtkSMPropertyHelper(drep->getProxy(), "Representation").Set("Slices"); + drep->getProxy()->UpdateVTKObjects(); + } } void MultiSliceView::render() diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/SplatterPlotView.cpp b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/SplatterPlotView.cpp index 527fef5654d1..737334d77f85 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/SplatterPlotView.cpp +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/SplatterPlotView.cpp @@ -223,6 +223,7 @@ void SplatterPlotView::checkPeaksCoordinates() if (!this->peaksSource.isEmpty() && !this->ui.overridePeakCoordsButton->isChecked()) { + int peakViewCoords = vtkSMPropertyHelper(this->origSrc->getProxy(), "SpecialCoordinates").GetAsInt(); // Make commensurate with vtkPeakMarkerFactory @@ -245,11 +246,11 @@ void SplatterPlotView::onThresholdButtonClicked() emit this->lockColorControls(); } -void SplatterPlotView::checkView() +void SplatterPlotView::checkView(ModeControlWidget::Views initialView) { if (!this->noOverlay && this->peaksSource.isEmpty()) { - ViewBase::checkView(); + ViewBase::checkView(initialView); } this->noOverlay = false; } diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/ThreesliceView.cpp b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/ThreesliceView.cpp index bc67d528228d..df5da7ea8161 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/ThreesliceView.cpp +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/ThreesliceView.cpp @@ -39,6 +39,8 @@ namespace /// Static logger Kernel::Logger g_log("ThreeSliceView"); } + + ThreeSliceView::ThreeSliceView(QWidget *parent) : ViewBase(parent) { this->ui.setupUi(this); diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/ViewBase.cpp b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/ViewBase.cpp index 60b4affd8072..10d265ed1fa4 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/ViewBase.cpp +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/ViewBase.cpp @@ -290,21 +290,22 @@ pqPipelineSource *ViewBase::getPvActiveSrc() * This function sets the status for the view mode control buttons. This * implementation looks at the original source for a view. Views may override * this function to provide alternate checks. + * @param initialView The initial view. */ -void ViewBase::checkView() +void ViewBase::checkView(ModeControlWidget::Views intialView) { if (this->isMDHistoWorkspace(this->origSrc)) { - emit this->setViewsStatus(true); + emit this->setViewsStatus(intialView, true); emit this->setViewStatus(ModeControlWidget::SPLATTERPLOT, false); } else if (this->isPeaksWorkspace(this->origSrc)) { - emit this->setViewsStatus(false); + emit this->setViewsStatus(intialView, false); } else { - emit this->setViewsStatus(true); + emit this->setViewsStatus(intialView, true); } } diff --git a/Test/AutoTestData/UsageData/INES_Definition.vtp b/Test/AutoTestData/UsageData/INES_Definition.vtp new file mode 100644 index 000000000000..23a71effa310 --- /dev/null +++ b/Test/AutoTestData/UsageData/INES_Definition.vtp @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + +