Skip to content

Commit

Permalink
ENH: Remove unsupported/deprecated tcl functionality (#4867)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmjohnson committed Apr 21, 2020
1 parent 2fbf89c commit 9a9c2b1
Show file tree
Hide file tree
Showing 28 changed files with 0 additions and 1,691 deletions.
37 changes: 0 additions & 37 deletions Applications/SlicerApp/Testing/Cpp/CMakeLists.txt
@@ -1,41 +1,16 @@
set(KIT ${APPLIB_NAME})

if(Slicer_USE_PYTHONQT_WITH_TCL)
if(Slicer_BUILD_CLI_SUPPORT)
if(Slicer_BUILD_EMSegment)
include_directories(
${EMSegment_SOURCE_DIR}
${RemoteIO_SOURCE_DIR} ${RemoteIO_BINARY_DIR})
endif()
endif()
endif()

set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "DEBUG_LEAKS_ENABLE_EXIT_ERROR();" )
set(KIT_TEST_SRCS
qSlicerAppMainWindowTest1.cxx
qSlicerModuleFactoryManagerTest1.cxx
)
if(Slicer_USE_PYTHONQT_WITH_TCL)
list(APPEND KIT_TEST_SRCS qSlicerApplicationTpyclTest1.cxx)
if(Slicer_BUILD_CLI_SUPPORT)
if(Slicer_BUILD_EMSegment)
list(APPEND KIT_TEST_SRCS qSlicerApplicationTpyclEMSegmentIntegrationTest.cxx)
endif()
endif()
endif()
create_test_sourcelist(Tests ${KIT}CxxTests.cxx
${KIT_TEST_SRCS}
EXTRA_INCLUDE vtkMRMLDebugLeaksMacro.h
)

set(target_libraries ${KIT})
if(Slicer_USE_PYTHONQT_WITH_TCL)
if(Slicer_BUILD_CLI_SUPPORT)
if(Slicer_BUILD_EMSegment)
list(APPEND target_libraries vtkSlicerEMSegmentModuleLogic)
endif()
endif()
endif()

ctk_add_executable_utf8(${KIT}CxxTests ${Tests})
target_link_libraries(${KIT}CxxTests ${target_libraries})
Expand All @@ -44,18 +19,6 @@ set_target_properties(${KIT}CxxTests PROPERTIES FOLDER ${${PROJECT_NAME}_FOLDER}
#
# Add Tests
#

if(Slicer_USE_PYTHONQT_WITH_TCL)
if(Slicer_HAS_CONSOLE_IO_SUPPORT)
simple_test( qSlicerApplicationTpyclTest1 )
set_tests_properties(qSlicerApplicationTpyclTest1 PROPERTIES PASS_REGULAR_EXPRESSION stringArray)
endif()
if(Slicer_BUILD_CLI_SUPPORT)
if(Slicer_BUILD_EMSegment)
simple_test( qSlicerApplicationTpyclEMSegmentIntegrationTest $<TARGET_FILE:EMSegmentCommandLine>)
endif()
endif()
endif()
simple_test( qSlicerAppMainWindowTest1 )
simple_test( qSlicerModuleFactoryManagerTest1 )

Expand Down
@@ -1,58 +0,0 @@

// CTK includes
#include <ctkScopedCurrentDir.h>

// Slicer includes
#include "qSlicerApplication.h"
#include "qSlicerCorePythonManager.h"

// EMSegment includes
#include "vtkSlicerCommonInterface.h"

// STD includes
#include <cstdio>

// test the tcl adapter provided by the Slicer Common Interface
int qSlicerApplicationTpyclEMSegmentIntegrationTest(int argc, char* argv[])
{
if (argc < 2)
{
std::cerr << "Usage:\n"
<< " " << argv[0] << " </path/to/EMSegmentCommandLine>" << std::endl;
return EXIT_FAILURE;
}

vtkSlicerCommonInterface* common = vtkSlicerCommonInterface::New();

// Slicer4
qSlicerApplication* app = new qSlicerApplication(argc, argv);

#ifdef Slicer_USE_PYTHONQT_WITH_TCL
bool disablePython = qSlicerApplication::testAttribute(qSlicerApplication::AA_DisablePython);
if(!disablePython)
{
// Load EMSegment Python module(s)
QString emsegmentModulePath = QString::fromStdString(
vtkSlicerApplicationLogic::GetModuleSlicerXYLibDirectory(argv[1]));
emsegmentModulePath.append("/" Slicer_QTLOADABLEMODULES_SUBDIR);
app->pythonManager()->appendPythonPath(emsegmentModulePath);
// Update current application directory, so that *PythonD modules can be loaded
ctkScopedCurrentDir scopedCurrentDir(emsegmentModulePath);

QString emsegmentModulePythonPath = emsegmentModulePath + "/Python";
std::cout << "emsegmentModulePythonPath:" << qPrintable(emsegmentModulePythonPath) << std::endl;
app->pythonManager()->executeString(QString(
"from slicer.util import importVTKClassesFromDirectory;"
"importVTKClassesFromDirectory('%1', 'slicer', filematch='vtkSlicer%2ModuleLogic.py');"
"importVTKClassesFromDirectory('%1', 'slicer', filematch='vtkSlicer%2ModuleMRML.py');"
).arg(emsegmentModulePythonPath).arg("EMSegment"));

}
#endif

delete app;

common->Delete();

return EXIT_SUCCESS;
}
118 changes: 0 additions & 118 deletions Applications/SlicerApp/Testing/Cpp/qSlicerApplicationTpyclTest1.cxx

This file was deleted.

21 changes: 0 additions & 21 deletions Base/Python/CMakeLists.txt
Expand Up @@ -56,31 +56,10 @@ if(Slicer_USE_SimpleITK)
)
endif()

if(Slicer_USE_PYTHONQT_WITH_TCL)
list(APPEND Slicer_PYTHON_SCRIPTS
slicer/slicerqt-with-tcl
tpycl/__init__
tpycl/tpycl
)
list(APPEND Slicer_PYTHON_RESOURCES
tpycl/tpycl.tcl
slicer/tcl/Slicer3Adapters.tcl
)
endif()

ctkMacroCompilePythonScript(
TARGET_NAME SlicerBase
SCRIPTS "${Slicer_PYTHON_SCRIPTS}"
RESOURCES "${Slicer_PYTHON_RESOURCES}"
DESTINATION_DIR ${Slicer_BINARY_DIR}/bin/Python
INSTALL_DIR ${Slicer_INSTALL_BIN_DIR}
)

#-----------------------------------------------------------------------------
# Testing
#
if(BUILD_TESTING)
if(Slicer_USE_PYTHONQT_WITH_TCL)
add_subdirectory(tpycl/Testing)
endif()
endif()
42 changes: 0 additions & 42 deletions Base/Python/slicer/slicerqt-with-tcl.py

This file was deleted.

78 changes: 0 additions & 78 deletions Base/Python/slicer/tcl/Slicer3Adapters.tcl

This file was deleted.

6 changes: 0 additions & 6 deletions Base/Python/tpycl/Testing/CMakeLists.txt

This file was deleted.

0 comments on commit 9a9c2b1

Please sign in to comment.