Skip to content
Snippets Groups Projects
Commit 715f81b3 authored by Pete Peterson's avatar Pete Peterson
Browse files

Merge pull request #13024 from mantidproject/12719_Newer_ParaView

Update ParaView 
parents 4f7668f3 8a90a5df
No related merge requests found
Showing
with 127 additions and 73 deletions
# This file will setup some common items that later setups depend on # This file will setup some common items that later setups depend on
# Set the version of ParaView that is compatible with the Mantid code base # Set the version of ParaView that is compatible with the Mantid code base
set ( COMPATIBLE_PARAVIEW_VERSION "4.3.1" ) set ( COMPATIBLE_PARAVIEW_VERSION "4.3.b40280" )
# Set the name of the OSX application as this tends to be different # Set the name of the OSX application as this tends to be different
set ( OSX_PARAVIEW_APP "paraview.app" ) set ( OSX_PARAVIEW_APP "paraview.app" )
...@@ -14,9 +14,9 @@ SCRIPT_DIR=$(dirname "$0") ...@@ -14,9 +14,9 @@ SCRIPT_DIR=$(dirname "$0")
BUILDPKG=true BUILDPKG=true
############################################################################### ###############################################################################
# All node currently have PARAVIEW_DIR=3.98.1 and PARAVIEW_NEXT_DIR=4.3.1 # All node currently have PARAVIEW_DIR=4.3.b40280 and PARAVIEW_NEXT_DIR=4.3.1
############################################################################### ###############################################################################
export PARAVIEW_DIR=${PARAVIEW_NEXT_DIR} #export PARAVIEW_DIR=${PARAVIEW_DIR}
############################################################################### ###############################################################################
# Print out the versions of things we are using # Print out the versions of things we are using
......
...@@ -9,9 +9,8 @@ setlocal enableextensions enabledelayedexpansion ...@@ -9,9 +9,8 @@ setlocal enableextensions enabledelayedexpansion
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: All node currently have PARAVIEW_DIR=3.98.1 and PARAVIEW_NEXT_DIR=4.3.1 :: All nodes currently have PARAVIEW_DIR=4.3.b40280 and PARAVIEW_NEXT_DIR=4.3.1
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set PARAVIEW_DIR=%PARAVIEW_NEXT_DIR%
set CMAKE_BIN_DIR=C:\Program Files (x86)\CMake 2.8\bin set CMAKE_BIN_DIR=C:\Program Files (x86)\CMake 2.8\bin
"%CMAKE_BIN_DIR%\cmake.exe" --version "%CMAKE_BIN_DIR%\cmake.exe" --version
......
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
require 'pathname' require 'pathname'
def copyFile(file) def copyFile(file)
p "copying file #{file}" p "copying file #{file}"
output = system("cp #{file} Contents/MacOS/") output = system("cp #{file} Contents/MacOS/")
if output != true if output != true
exit 1 exit 1
end end
end end
def addPythonLibrary(directory) def addPythonLibrary(directory)
p "copying directory #{directory}" p "copying directory #{directory}"
output = system("rsync -a --exclude=.pyc #{directory} Contents/MacOS/") output = system("rsync -a --exclude=.pyc #{directory} Contents/MacOS/")
if output != true if output != true
exit 1 exit 1
end end
end end
lib_dir = Pathname.new("/usr/local/lib") lib_dir = Pathname.new("/usr/local/lib")
...@@ -67,38 +67,17 @@ library_filenames = ["libboost_regex-mt.dylib", ...@@ -67,38 +67,17 @@ library_filenames = ["libboost_regex-mt.dylib",
#This copies the libraries over, then changes permissions and the id from /usr/local/lib to @rpath #This copies the libraries over, then changes permissions and the id from /usr/local/lib to @rpath
library_filenames.each do |filename| library_filenames.each do |filename|
if filename.include? "libssl.dylib" if filename.include? "libssl.dylib"
copyFile(openssl_dir+filename) copyFile(openssl_dir+filename)
elsif filename.include? "libcrypto.dylib" elsif filename.include? "libcrypto.dylib"
copyFile(openssl_dir+filename) copyFile(openssl_dir+filename)
else else
copyFile(lib_dir+filename) copyFile(lib_dir+filename)
end end
`chmod +w Contents/MacOS/#{filename}` `chmod +w Contents/MacOS/#{filename}`
`install_name_tool -id @rpath/#{filename} Contents/MacOS/#{filename}` `install_name_tool -id @rpath/#{filename} Contents/MacOS/#{filename}`
end
#use install_name_tool to change dependencies form /usr/local to libraries in the package.
search_patterns = ["**/*.dylib","**/*.so","**/MantidPlot","**/VatesSimpleGui"]
search_patterns.each do |pattern|
Dir[pattern].each do |library|
dependencies = `otool -L #{library}`
dependencies.split("\n").each do |dependency|
currentname = dependency.strip.split(" ")
name_split_on_slash = currentname[0].strip.split("/")
name_split_on_period = name_split_on_slash[-1].split(".")
prefix = name_split_on_period[0]+"."
library_filenames.each do |filename|
basename = File.basename(filename,"dylib")
if prefix == basename
`install_name_tool -change #{currentname[0]} @rpath/#{basename+"dylib"} #{library}`
end
end
end
end
end end
if( "@MAKE_VATES@" == "ON" ) if( "@MAKE_VATES@" == "ON" )
def add_ParaView_Libraries(file) def add_ParaView_Libraries(file)
...@@ -141,6 +120,7 @@ if( "@MAKE_VATES@" == "ON" ) ...@@ -141,6 +120,7 @@ if( "@MAKE_VATES@" == "ON" )
`install_name_tool -id @rpath/#{filename_no_dir} Contents/Libraries/#{filename_no_dir}` `install_name_tool -id @rpath/#{filename_no_dir} Contents/Libraries/#{filename_no_dir}`
end end
`install_name_tool -add_rpath @loader_path/../Libraries #{library} > /dev/null 2>&1` `install_name_tool -add_rpath @loader_path/../Libraries #{library} > /dev/null 2>&1`
`install_name_tool -add_rpath @loader_path/../MacOS #{library} > /dev/null 2>&1`
`install_name_tool -change #{filename} @rpath/#{filename_no_dir} #{library}` `install_name_tool -change #{filename} @rpath/#{filename_no_dir} #{library}`
end end
end end
...@@ -148,6 +128,28 @@ if( "@MAKE_VATES@" == "ON" ) ...@@ -148,6 +128,28 @@ if( "@MAKE_VATES@" == "ON" )
p "fixed #{issues_found} issues this iteration!" p "fixed #{issues_found} issues this iteration!"
break if issues_found == 0 break if issues_found == 0
end end
#fix libNonOrthogonalSource.dylib
`install_name_tool -id @rpath/libNonOrthogonalSource.dylib pvplugins/pvplugins/libNonOrthogonalSource.dylib`
end
#use install_name_tool to change dependencies form /usr/local to libraries in the package.
search_patterns = ["**/*.dylib","**/*.so","**/MantidPlot","**/VatesSimpleGui"]
search_patterns.each do |pattern|
Dir[pattern].each do |library|
dependencies = `otool -L #{library}`
dependencies.split("\n").each do |dependency|
currentname = dependency.strip.split(" ")
name_split_on_slash = currentname[0].strip.split("/")
name_split_on_period = name_split_on_slash[-1].split(".")
prefix = name_split_on_period[0]+"."
library_filenames.each do |filename|
basename = File.basename(filename,"dylib")
if prefix == basename
`install_name_tool -change #{currentname[0]} @rpath/#{basename+"dylib"} #{library}`
end
end
end
end
end end
#We'll use macdeployqt to fix qt dependencies. #We'll use macdeployqt to fix qt dependencies.
......
# bring in Mantid/VATES API dependencies # bring in Mantid/VATES API dependencies
set_mantid_subprojects( Vates/VatesAPI ) set_mantid_subprojects( Vates/VatesAPI )
# 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( ParaViewFilters )
add_subdirectory( ParaViewReaders ) add_subdirectory( ParaViewReaders )
add_subdirectory( ParaViewSources ) add_subdirectory( ParaViewSources )
......
...@@ -39,7 +39,6 @@ add_library( MantidParaViewQtWidgets ${SRC_FILES} ${MOCCED_FILES} ${INC_FILES} ) ...@@ -39,7 +39,6 @@ add_library( MantidParaViewQtWidgets ${SRC_FILES} ${MOCCED_FILES} ${INC_FILES} )
set_property( TARGET MantidParaViewQtWidgets PROPERTY FOLDER "MantidVates" ) set_property( TARGET MantidParaViewQtWidgets PROPERTY FOLDER "MantidVates" )
target_link_libraries( MantidParaViewQtWidgets LINK_PRIVATE target_link_libraries( MantidParaViewQtWidgets LINK_PRIVATE
vtkRenderingFreeType vtkRenderingFreeType
vtkRenderingFreeTypeOpenGL
${QT_LIBRARIES} ${QT_LIBRARIES}
${MANTID_SUBPROJECT_LIBS} ) ${MANTID_SUBPROJECT_LIBS} )
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "MantidGeometry/MDGeometry/MDTypes.h" #include "MantidGeometry/MDGeometry/MDTypes.h"
#include <string> #include <string>
#include <vector> #include <array>
class vtkDataSet; class vtkDataSet;
class vtkUnstructuredGrid; class vtkUnstructuredGrid;
...@@ -83,6 +83,7 @@ namespace VATES ...@@ -83,6 +83,7 @@ namespace VATES
Kernel::V3D m_basisY; ///< The Y direction basis vector Kernel::V3D m_basisY; ///< The Y direction basis vector
Kernel::V3D m_basisZ; ///< The Z direction basis vector Kernel::V3D m_basisZ; ///< The Z direction basis vector
Kernel::SpecialCoordinateSystem m_coordType; ///< The coordinate system for the workspace Kernel::SpecialCoordinateSystem m_coordType; ///< The coordinate system for the workspace
std::array<double, 6> m_boundingBox;
}; };
......
...@@ -17,9 +17,15 @@ ...@@ -17,9 +17,15 @@
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <vtkPVChangeOfBasisHelper.h>
#include <vtkFieldData.h> #include <vtkFieldData.h>
#include <vtkDataSet.h> #include <vtkDataSet.h>
namespace {
Mantid::Kernel::Logger g_log("MDHWLoadingPresenter");
}
namespace Mantid namespace Mantid
{ {
namespace VATES namespace VATES
...@@ -185,10 +191,12 @@ namespace Mantid ...@@ -185,10 +191,12 @@ namespace Mantid
*/ */
void MDHWLoadingPresenter::setAxisLabels(vtkDataSet *visualDataSet) void MDHWLoadingPresenter::setAxisLabels(vtkDataSet *visualDataSet)
{ {
vtkFieldData* fieldData = visualDataSet->GetFieldData(); if (!vtkPVChangeOfBasisHelper::AddBasisNames(
setAxisLabel("AxisTitleForX", axisLabels[0], fieldData); visualDataSet, axisLabels[0].c_str(), axisLabels[1].c_str(),
setAxisLabel("AxisTitleForY", axisLabels[1], fieldData); axisLabels[2].c_str())) {
setAxisLabel("AxisTitleForZ", axisLabels[2], fieldData); g_log.warning("The basis names could not be added to the field data of "
"the data set.\n");
}
} }
/** /**
......
...@@ -13,12 +13,14 @@ ...@@ -13,12 +13,14 @@
#include <vtkFloatArray.h> #include <vtkFloatArray.h>
#include <vtkDoubleArray.h> #include <vtkDoubleArray.h>
#include <vtkMatrix3x3.h> #include <vtkMatrix3x3.h>
#include "vtkVector.h"
#include <vtkNew.h> #include <vtkNew.h>
#include <vtkPoints.h> #include <vtkPoints.h>
#include <vtkUnstructuredGrid.h> #include <vtkUnstructuredGrid.h>
#include <vtkDataObject.h> #include <vtkDataObject.h>
#include <vtkMatrix4x4.h> #include <vtkMatrix4x4.h>
#include <vtkSmartPointer.h> #include <vtkSmartPointer.h>
#include <vtkPVChangeOfBasisHelper.h>
#include <boost/algorithm/string/find.hpp> #include <boost/algorithm/string/find.hpp>
#include <stdexcept> #include <stdexcept>
...@@ -26,9 +28,11 @@ ...@@ -26,9 +28,11 @@
using namespace Mantid; using namespace Mantid;
namespace { namespace {
void addChangeOfBasisMatrixToFieldData(vtkDataObject *dataObject, Mantid::Kernel::Logger g_log("vtkDataSetToNonOrthogonalDataSet");
const MantidVec &u, const MantidVec &v,
const MantidVec &w) { void addChangeOfBasisMatrixToFieldData(
vtkDataObject *dataObject, const MantidVec &u, const MantidVec &v,
const MantidVec &w, const std::array<double, 6> &boundingBox) {
if (!dataObject) { if (!dataObject) {
throw std::invalid_argument("Change of basis needs a vtkDataObject"); throw std::invalid_argument("Change of basis needs a vtkDataObject");
...@@ -44,21 +48,20 @@ void addChangeOfBasisMatrixToFieldData(vtkDataObject *dataObject, ...@@ -44,21 +48,20 @@ void addChangeOfBasisMatrixToFieldData(vtkDataObject *dataObject,
} }
vtkSmartPointer<vtkMatrix4x4> cobMatrix = vtkSmartPointer<vtkMatrix4x4> cobMatrix =
vtkSmartPointer<vtkMatrix4x4>::New(); vtkPVChangeOfBasisHelper::GetChangeOfBasisMatrix(
cobMatrix->Identity(); vtkVector3d(&u[0]), vtkVector3d(&v[0]), vtkVector3d(&w[0]));
std::copy(u.begin(), u.end(), cobMatrix->Element[0]);
std::copy(v.begin(), v.end(), cobMatrix->Element[1]); if (!vtkPVChangeOfBasisHelper::AddChangeOfBasisMatrixToFieldData(dataObject,
std::copy(w.begin(), w.end(), cobMatrix->Element[2]); cobMatrix)) {
g_log.warning("The Change-of-Basis-Matrix could not be added to the field "
cobMatrix->Transpose(); "data of the data set.\n");
}
vtkNew<vtkDoubleArray> cobArray;
cobArray->SetName("ChangeOfBasisMatrix"); if (!vtkPVChangeOfBasisHelper::AddBoundingBoxInBasis(dataObject,
cobArray->SetNumberOfComponents(16); &boundingBox[0])) {
cobArray->SetNumberOfTuples(1); g_log.warning("The bounding box could not be added to the field data of "
std::copy(&cobMatrix->Element[0][0], (&cobMatrix->Element[0][0]) + 16, "the data set.\n");
cobArray->GetPointer(0)); }
dataObject->GetFieldData()->AddArray(cobArray.GetPointer());
} }
} }
...@@ -127,6 +130,14 @@ void vtkDataSetToNonOrthogonalDataSet::execute() { ...@@ -127,6 +130,14 @@ void vtkDataSetToNonOrthogonalDataSet::execute() {
if (boost::algorithm::find_first(wsType, "MDHistoWorkspace")) { if (boost::algorithm::find_first(wsType, "MDHistoWorkspace")) {
API::IMDHistoWorkspace_const_sptr infoWs = API::IMDHistoWorkspace_const_sptr infoWs =
boost::dynamic_pointer_cast<const API::IMDHistoWorkspace>(ws); boost::dynamic_pointer_cast<const API::IMDHistoWorkspace>(ws);
m_boundingBox[0] = infoWs->getDimension(0)->getMinimum();
m_boundingBox[1] = infoWs->getDimension(0)->getMaximum();
m_boundingBox[2] = infoWs->getDimension(1)->getMinimum();
m_boundingBox[3] = infoWs->getDimension(1)->getMaximum();
m_boundingBox[4] = infoWs->getDimension(2)->getMinimum();
m_boundingBox[5] = infoWs->getDimension(2)->getMaximum();
m_numDims = infoWs->getNumDims(); m_numDims = infoWs->getNumDims();
m_coordType = infoWs->getSpecialCoordinateSystem(); m_coordType = infoWs->getSpecialCoordinateSystem();
if (Kernel::HKL != m_coordType) { if (Kernel::HKL != m_coordType) {
...@@ -331,7 +342,8 @@ void vtkDataSetToNonOrthogonalDataSet::stripMatrix(Kernel::DblMatrix &mat) { ...@@ -331,7 +342,8 @@ void vtkDataSetToNonOrthogonalDataSet::stripMatrix(Kernel::DblMatrix &mat) {
void vtkDataSetToNonOrthogonalDataSet::updateMetaData(vtkUnstructuredGrid *ugrid) void vtkDataSetToNonOrthogonalDataSet::updateMetaData(vtkUnstructuredGrid *ugrid)
{ {
// Create and add the change of basis matrix // Create and add the change of basis matrix
addChangeOfBasisMatrixToFieldData(ugrid, m_basisX, m_basisY, m_basisZ); addChangeOfBasisMatrixToFieldData(ugrid, m_basisX, m_basisY, m_basisZ,
m_boundingBox);
} }
} // namespace VATES } // namespace VATES
......
...@@ -48,7 +48,6 @@ VatesSimpleGuiQtWidgets ...@@ -48,7 +48,6 @@ VatesSimpleGuiQtWidgets
VatesSimpleGuiViewWidgets VatesSimpleGuiViewWidgets
MantidQtAPI MantidQtAPI
vtkRenderingFreeType vtkRenderingFreeType
vtkRenderingFreeTypeOpenGL
${POCO_LIBRARIES} ${POCO_LIBRARIES}
${Boost_LIBRARIES} ${Boost_LIBRARIES}
) )
......
...@@ -139,7 +139,6 @@ pqApplicationComponents ...@@ -139,7 +139,6 @@ pqApplicationComponents
pqComponents pqComponents
vtkPVServerManagerRendering vtkPVServerManagerRendering
vtkRenderingFreeType vtkRenderingFreeType
vtkRenderingFreeTypeOpenGL
vtksys vtksys
${QT_LIBRARIES} ${QT_LIBRARIES}
VatesSimpleGuiQtWidgets VatesSimpleGuiQtWidgets
......
...@@ -83,7 +83,7 @@ pqRenderView* ViewBase::createRenderView(QWidget* widget, QString viewName) ...@@ -83,7 +83,7 @@ pqRenderView* ViewBase::createRenderView(QWidget* widget, QString viewName)
pqActiveObjects::instance().setActiveView(view); pqActiveObjects::instance().setActiveView(view);
// Place the widget for the render view in the frame provided. // Place the widget for the render view in the frame provided.
hbox->addWidget(view->getWidget()); hbox->addWidget(view->widget());
/// Make a connection to the view's endRender signal for later checking. /// Make a connection to the view's endRender signal for later checking.
QObject::connect(view, SIGNAL(endRender()), QObject::connect(view, SIGNAL(endRender()),
......
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