Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed hard-coded path of VTK_BINARY_DIR #7

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
55c706d
Tune FlatTreeView sizing
Oblomov Nov 30, 2015
a915c5e
Added support for reading NFACE_n and NGON_n CGNS files
Feb 22, 2016
90f5fc5
working on testing
Mar 1, 2016
7801712
Merge remote-tracking branch 'origin' into NFACE_n-NGON_n-CGNSReader
Mar 1, 2016
1790933
added tests
Mar 2, 2016
d50b302
vtkProcessModule: store the current directory of the executable
mathstuf Feb 18, 2016
a9f4a8f
Merge branch 'master' of https://gitlab.kitware.com/paraview/paraview…
Mar 7, 2016
edbab0d
Cleanup testing code.
utkarshayachit Mar 5, 2016
589f5b1
Remove CGNS headers from vtkCGNSReader.h.
utkarshayachit Mar 5, 2016
0de03c4
Added CGNS_ENUMV(NGON_n). Applied diffs from code review.
Mar 7, 2016
27115ba
Removed hard-coded path of VTK_BINARY_DIR
albertov Mar 8, 2016
a480a24
Merge topic 'expose-self-dir'
mathstuf Mar 9, 2016
0284bf3
Use `vtk_module_link_libraries` for modules.
utkarshayachit Mar 9, 2016
743036c
BUG #16020: restore defaults for repeatable vector properties
cquammen Mar 4, 2016
1b038f2
Merge topic 'fix_cgns_kits'
utkarshayachit Mar 10, 2016
d374b02
Merge remote-tracking branch 'origin' into NFACE_n-NGON_n-CGNSReader
Mar 11, 2016
ac4f824
Added another acceptable condition for setting property elements
cquammen Mar 10, 2016
e50f934
When resetting values, reset to default rather than XML default
cquammen Mar 10, 2016
b837301
Merge topic '16020_restore_repeatable_defaults'
cquammen Mar 12, 2016
7cf0e4c
Merge topic 'pipeline-browser-dpi-fix'
utkarshayachit Mar 12, 2016
16385fa
Merge topic 'NFACE_n-NGON_n-CGNSReader'
utkarshayachit Mar 12, 2016
fcd0436
Remove unused header.
utkarshayachit Mar 12, 2016
080622a
vtkCleanArrays now support cleaning composite datasets.
utkarshayachit Mar 12, 2016
f136c67
BUG #15167: Show multiple blocks in spreadsheet view.
utkarshayachit Mar 7, 2016
5f60463
Adding test for testing spreadsheet with multiblock
utkarshayachit Mar 9, 2016
a1e085d
Merge topic 'axes-grid-15672'
utkarshayachit Mar 13, 2016
03e7e55
Update VTK.
utkarshayachit Mar 13, 2016
20c10b9
Merge topic '0015167_multiple_blocks_in_spreadsheet_view'
utkarshayachit Mar 14, 2016
7d13f75
Update VTK to master on 2016/03/14.
utkarshayachit Mar 14, 2016
7a35f41
Update vtk_add_python_wrapping calls to use new signatures
yumin Mar 10, 2016
85c8699
Python: import the API module, not the Python library
mathstuf Mar 10, 2016
f60c8e7
eigen: add a space between strings
mathstuf Mar 14, 2016
4c46737
Cleanup ParaView's python package generation.
utkarshayachit Mar 15, 2016
d179bff
Python: import the API module, not the Python library
msmolens Mar 14, 2016
ed854cd
Merge topic 'gcc6-support'
mathstuf Mar 15, 2016
aadfe86
Prefer `vtk` package from `paraview`.
utkarshayachit Mar 15, 2016
30de5e1
Fix incorrect imports.
utkarshayachit Mar 15, 2016
10f61cf
Making PythonSelection test more robust.
utkarshayachit Mar 15, 2016
fd0e9d4
Update VTK to bring kits+static+python fixes.
utkarshayachit Mar 15, 2016
763c25f
Merge topic 'update_vtk'
utkarshayachit Mar 16, 2016
5483620
Merge topic 'vtk_for_pv_5.0.1'
utkarshayachit Mar 16, 2016
9e856f7
Merge branch 'vtk_for_pv_5.0.1' into release
utkarshayachit Mar 16, 2016
9b8a714
Merge topic 'release'
utkarshayachit Mar 16, 2016
efb2fb7
Removed hard-coded path of VTK_BINARY_DIR
albertov Mar 8, 2016
0ba2b42
Merge branch 'etesio' of https://github.com/meteogrid/ParaView into e…
albertov Mar 16, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Applications/ParaView/Testing/Python/TestPythonParaViewWebMPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
from paraview.web import wamp as pv_wamp
from paraview.web import ipython as pv_ipython

from vtkCommonCorePython import *
from vtkCommonDataModelPython import *
from vtkCommonExecutionModelPython import *
from vtkFiltersSourcesPython import *
from vtkParallelCorePython import *
from vtkParaViewWebCorePython import *
from vtkPVClientServerCoreCorePython import *
from vtkPVServerManagerApplicationPython import *
from vtkPVServerManagerCorePython import *
from vtkPVVTKExtensionsCorePython import *
from vtk.vtkCommonCore import *
from vtk.vtkCommonDataModel import *
from vtk.vtkCommonExecutionModel import *
from vtk.vtkFiltersSources import *
from vtk.vtkParallelCore import *
from vtk.vtkParaViewWebCore import *
from vtk.vtkPVClientServerCoreCore import *
from vtk.vtkPVServerManagerApplication import *
from vtk.vtkPVServerManagerCore import *
from vtkPVVTKExtensionsCore import *

#------------------------------------------------------------------------------
# InLine protocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
from paraview.web import wamp as pv_wamp
from paraview.web import ipython as pv_ipython

from vtkCommonCorePython import *
from vtkCommonDataModelPython import *
from vtkCommonExecutionModelPython import *
from vtkFiltersSourcesPython import *
from vtkParallelCorePython import *
from vtkParaViewWebCorePython import *
from vtkPVClientServerCoreCorePython import *
from vtkPVServerManagerApplicationPython import *
from vtkPVServerManagerCorePython import *
from vtkPVVTKExtensionsCorePython import *
from vtk.vtkCommonCore import *
from vtk.vtkCommonDataModel import *
from vtk.vtkCommonExecutionModel import *
from vtk.vtkFiltersSources import *
from vtk.vtkParallelCore import *
from vtk.vtkParaViewWebCore import *
from vtk.vtkPVClientServerCoreCore import *
from vtk.vtkPVServerManagerApplication import *
from vtk.vtkPVServerManagerCore import *
from vtk.vtkPVVTKExtensionsCore import *
from vtk import *

#------------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions Applications/ParaView/Testing/XML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ list(APPEND TESTS_WITH_BASELINES
${CMAKE_CURRENT_SOURCE_DIR}/SolidColorSource.xml
${CMAKE_CURRENT_SOURCE_DIR}/SpreadSheet1.xml
${CMAKE_CURRENT_SOURCE_DIR}/SpreadSheet2.xml
${CMAKE_CURRENT_SOURCE_DIR}/SpreadSheet3.xml
${CMAKE_CURRENT_SOURCE_DIR}/SPTimeseries.xml
${CMAKE_CURRENT_SOURCE_DIR}/SpyPlotHistoryReader.xml
${CMAKE_CURRENT_SOURCE_DIR}/SelectionLinkBasic.xml
Expand Down Expand Up @@ -580,6 +581,12 @@ IF (PARAVIEW_USE_MPI)
SET (SpreadSheet1_DISABLE_CS TRUE)
SET (SpreadSheet1_DISABLE_CRS TRUE)

# Disabled since the 1 column in spreadsheet view ends up being "Process ID"
# which messes up the sorting in this test. Need to extend the testing framework
# or fix spreadsheet view for these to work properly.
SET (SpreadSheet3_DISABLE_CS TRUE)
SET (SpreadSheet3_DISABLE_CRS TRUE)

# The hierchical fractal source is a temporary testing source and it does not
# create the dataset correctly in parallel. Since it's a testing source, I am
# just going to disable the test in parallel. We can fix the source when
Expand Down
71 changes: 71 additions & 0 deletions Applications/ParaView/Testing/XML/SpreadSheet3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" ?>
<pqevents>
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuSources" />
<pqevent object="pqClientMainWindow/menubar/menuSources" command="activate" arguments="SphereSource" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuSources" />
<pqevent object="pqClientMainWindow/menubar/menuSources" command="activate" arguments="SphereSource" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Center/LineEdit0" command="set_string" arguments="1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuTools" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionTesting_Window_Size" />
<pqevent object="pqClientMainWindow/cameraToolbar/1QToolButton0" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,58,13,/0:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,58,13,/0:0/0:0" />
<pqevent object="pqClientMainWindow/Common/1QToolButton0" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Function/Function" command="set_string" arguments="coordsX" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/ResultArrayName/ResultArrayName" command="set_string" arguments="Result1" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,65,9,/0:0/1:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,65,9,/0:0/1:0" />
<pqevent object="pqClientMainWindow/Common/1QToolButton0" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/ResultArrayName/ResultArrayName" command="set_string" arguments="Result2" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/Function/Function" command="set_string" arguments="coordsY" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,67108864,78,4,/0:0/0:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,67108864,78,4,/0:0/0:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="keyEvent" arguments="7,16777249,0,,0,1" />
<pqevent object="pqClientMainWindow/Common/1QToolButton9" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,53,3,/0:0/0:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,53,3,/0:0/0:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,70,13,/0:0/1:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,70,13,/0:0/1:0/0:0" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,94,5,/0:0/2:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,94,5,/0:0/2:0" />
<pqevent object="pqClientMainWindow/variableToolbar/displayColor/Variables" command="set_string" arguments="Solid Color" />
<pqevent object="pqClientMainWindow/variableToolbar/displayColor/Variables" command="set_string" arguments="vtkBlockColors" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Frame.0/TitleBar/SplitVertical" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/EmptyView/scrollArea/qt_scrollarea_viewport/widgetFoo/ConvertActionsFrame/SpreadSheetView" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/CompositeDataSetIndex/TreeWidget" command="setCheckState" arguments="0.0.1.0,2" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/pqSpreadSheetViewDecorator/Attribute" command="set_string" arguments="Cell Data" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mousePress" arguments="1,1,67108864,7,14,/0:1" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mouseRelease" arguments="1,0,67108864,7,14,/0:1" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mousePress" arguments="1,1,67108864,64,10,/1:0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mouseRelease" arguments="1,0,67108864,64,10,/1:0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mousePress" arguments="1,1,67108864,45,7,/2:0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mouseRelease" arguments="1,0,67108864,45,7,/2:0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0/1QHeaderView1" command="mousePress" arguments="1,1,0,0,0,0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0/1QHeaderView1" command="mouseRelease" arguments="1,0,0,0,0,0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="keyEvent" arguments="6,16777249,67108864,,0,1" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mousePress" arguments="1,1,67108864,53,26,/0:0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mouseRelease" arguments="1,0,67108864,53,26,/0:0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mousePress" arguments="1,1,67108864,50,14,/1:0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mouseRelease" arguments="1,0,67108864,50,14,/1:0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mousePress" arguments="1,1,67108864,50,8,/2:0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="mouseRelease" arguments="1,0,67108864,50,8,/2:0" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/CentralWidgetFrame/Viewport/1pqSpreadSheetViewWidget0" command="keyEvent" arguments="7,16777249,0,,0,1" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Splitter.0/Frame.2/TitleBar/Close" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuFilters" />
<pqevent object="pqClientMainWindow/menubar/menuFilters/DataAnalysis" command="activate" arguments="ExtractSelection" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/variableToolbar/displayColor/Variables" command="set_string" arguments="Solid Color" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/cameraToolbar/1QToolButton0" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/representationToolbar/displayRepresentation/comboBox" command="set_string" arguments="Surface With Edges" />
<pqevent object="pqClientMainWindow/cameraToolbar/1QToolButton0" command="activate" arguments="" />

</pqevents>
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,9 @@ if (PARAVIEW_ENABLE_PYTHON AND PARAVIEW_ENABLE_CATALYST)

list(APPEND VTK_PYTHON_MODULES ${vtk-module})
set(vtkPVPythonCatalyst_HEADERS vtkCPPythonScriptPipeline)
vtk_add_python_wrapping(${vtk-module})
vtk_add_python_wrapping(${vtk-module} pv_wrapping_sources)
vtk_add_python_wrapping_library(${vtk-module} pv_wrapping_sources ${vtk-module})

if (BUILD_TESTING)
set (_test_module_name "${vtk-module}-Test-Cxx")
add_subdirectory(
Expand Down
51 changes: 30 additions & 21 deletions ParaViewCore/ClientServerCore/Core/vtkProcessModule.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ bool vtkProcessModule::Initialize(ProcessTypes type, int &argc, char** &argv)

// Create the process module.
vtkProcessModule::Singleton = vtkSmartPointer<vtkProcessModule>::New();
vtkProcessModule::Singleton->InitializePythonEnvironment(argc, argv);
vtkProcessModule::Singleton->DetermineExecutablePath(argc, argv);
vtkProcessModule::Singleton->InitializePythonEnvironment();
return true;
}

Expand Down Expand Up @@ -547,42 +548,50 @@ void vtkProcessModule::SetOptions(vtkPVOptions* options)
}

//----------------------------------------------------------------------------
bool vtkProcessModule::InitializePythonEnvironment(int argc, char** argv)
void vtkProcessModule::DetermineExecutablePath(int argc, char* argv[])
{
#ifdef PARAVIEW_ENABLE_PYTHON
assert(argc >= 1);
if (!vtkPythonInterpreter::IsInitialized())
{
// If someone already initialized Python before ProcessModule was started,
// we don't finalize it when ProcessModule finalizes. This is for the cases
// where ParaView modules are directly imported in python (not pvpython).
vtkProcessModule::FinalizePython = true;
}

std::string self_dir, programname;

if (argc > 0)
{
std::string errMsg;
if (!vtksys::SystemTools::FindProgramPath(argv[0], programname, errMsg))
if (!vtksys::SystemTools::FindProgramPath(argv[0], this->ProgramPath, errMsg))
{
// if FindProgramPath fails. We really don't have much of an alternative
// here. Python module importing is going to fail.
programname = vtksys::SystemTools::CollapseFullPath(argv[0]);
this->ProgramPath = vtksys::SystemTools::CollapseFullPath(argv[0]);
}
self_dir = vtksys::SystemTools::GetFilenamePath(programname.c_str());
this->SelfDir = vtksys::SystemTools::GetFilenamePath(this->ProgramPath);
}
else
{
self_dir = vtksys::SystemTools::GetCurrentWorkingDirectory(/*collapse=*/true);
programname = self_dir + "/unknown_exe";
this->SelfDir = vtksys::SystemTools::GetCurrentWorkingDirectory(/*collapse=*/true);
this->ProgramPath = this->SelfDir + "/unknown_exe";
}
}

//----------------------------------------------------------------------------
void vtkProcessModule::SetExecutablePath(const std::string& path)
{
this->ProgramPath = vtksys::SystemTools::CollapseFullPath(path);
this->SelfDir = vtksys::SystemTools::GetFilenamePath(this->ProgramPath);
}

//----------------------------------------------------------------------------
bool vtkProcessModule::InitializePythonEnvironment()
{
#ifdef PARAVIEW_ENABLE_PYTHON
if (!vtkPythonInterpreter::IsInitialized())
{
// If someone already initialized Python before ProcessModule was started,
// we don't finalize it when ProcessModule finalizes. This is for the cases
// where ParaView modules are directly imported in python (not pvpython).
vtkProcessModule::FinalizePython = true;
}

vtkPythonInterpreter::SetProgramName(programname.c_str());
vtkPythonAppInitPrependPath(self_dir.c_str());
vtkPythonInterpreter::SetProgramName(this->ProgramPath.c_str());
vtkPythonAppInitPrependPath(this->SelfDir);
#endif
(void)argc;
(void)argv;
return true;
}

Expand Down
29 changes: 27 additions & 2 deletions ParaViewCore/ClientServerCore/Core/vtkProcessModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "vtkObject.h"
#include "vtkSmartPointer.h" // needed for vtkSmartPointer.

#include <string> // for std::string

class vtkMultiProcessController;
class vtkNetworkAccessManager;
class vtkPVOptions;
Expand Down Expand Up @@ -235,6 +237,24 @@ class VTKPVCLIENTSERVERCORECORE_EXPORT vtkProcessModule : public vtkObject
// session id is ever repeated.
vtkIdType MaxSessionId;

// Description:
// Sets the executable path of the process so that ParaView can, e.g., set up
// paths for Python properly.
void SetExecutablePath(const std::string& path);

// Description:
// The full path to the current executable that is running (or empty if unknown).
std::string GetProgramPath() const
{
return this->ProgramPath;
}
// Description:
// The directory containing the current executable (or empty if unknown).
std::string GetSelfDir() const
{
return this->SelfDir;
}

protected:
vtkProcessModuleInternals* Internals;

Expand All @@ -247,10 +267,12 @@ class VTKPVCLIENTSERVERCORECORE_EXPORT vtkProcessModule : public vtkObject
vtkProcessModule(const vtkProcessModule&); // Not implemented.
void operator=(const vtkProcessModule&); // Not implemented.

void DetermineExecutablePath(int argc, char** argv);

// Helper to initialize Python environment. This doesn't initialize Python
// but simply sets up the environment so when Python is initialized, it can
// find ParaView modules. This does nothing is not build with Python support.
bool InitializePythonEnvironment(int argc, char** argv);
// find ParaView modules. This does nothing if not build with Python support.
bool InitializePythonEnvironment();

static ProcessTypes ProcessType;

Expand All @@ -269,6 +291,9 @@ class VTKPVCLIENTSERVERCORECORE_EXPORT vtkProcessModule : public vtkObject
bool MultipleSessionsSupport;

vtkIdType EventCallDataSessionId;

std::string ProgramPath;
std::string SelfDir;
//ETX
};

Expand Down
Loading