Commit 459ec603 authored by Ben Boeckel's avatar Ben Boeckel

cmake: remove shiboken support

parent 64f586c5
Pipeline #83792 passed with stage
......@@ -11,17 +11,8 @@ set (CTEST_CUSTOM_WARNING_EXCEPTION
"Python/.* warning: declaration of .* shadows a member of 'this' \\[-Wshadow\\]"
"vtkPythonArgs.h.* warning: use of old-style cast \\[-Wold-style-cast\\]"
"Done, 0 warnings"
# The KWIML*_VERIFY_ symbols are extern but not actually defined anywhere.
# They are only there to cause compiler errors if one of the determined values
# is wrong. This confuses shiboken, so we ignore this warning when it comes
# from shiboken's code generation.
"WARNING scope not found for symbol:KWIML"
# This is to squash an "unused parameter" warning in moab.
"VALGRIND_MAKE_VEC_UNDEFINED"
# This is to silence shiboken-related warnings involving vtk.
"WARNING scope not found for function definition:vtkBuffer<ScalarT>"
# Shiboken doesn't know std::array.
"WARNING scope not found for function definition:std::array<double>"
)
##------------------------------------------------------------------------------
......
This diff is collapsed.
......@@ -93,7 +93,7 @@ option(SMTK_ENABLE_EXAMPLES "Enable Examples" OFF)
option(SMTK_ENABLE_PYTHON_WRAPPING "Build Python Wrappings" OFF)
cmake_dependent_option(
SMTK_USE_PYBIND11
"Build Python Wrappings using Pybind11 instead of Shiboken"
"Build Python Wrappings using Pybind11"
OFF
SMTK_ENABLE_PYTHON_WRAPPING OFF)
# Provide system packagers with the ability to install SMTK
......@@ -393,8 +393,6 @@ if(SMTK_ENABLE_PYTHON_WRAPPING)
CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(SMTK_PYBIND11_FLAGS "${SMTK_PYBIND11_FLAGS} -Wno-shadow")
endif()
else()
include(UseShiboken)
endif()
......@@ -402,20 +400,6 @@ if(SMTK_ENABLE_PYTHON_WRAPPING)
if (PYTHONINTERP_FOUND AND SMTK_ENABLE_TESTING)
set(required_python_modules)
if (NOT SMTK_USE_PYBIND11)
list(APPEND required_python_modules
shiboken)
set(shiboken_PYTHONPATH
"${SHIBOKEN_PYTHONPATH}")
if (WIN32)
get_filename_component(shiboken_runtime_dir "${SHIBOKEN_BINARY}" PATH)
else ()
get_filename_component(shiboken_runtime_dir "${SHIBOKEN_LIBRARY}" PATH)
endif ()
set(shiboken_libpath
"${shiboken_runtime_dir}")
endif()
if (SMTK_ENABLE_PARAVIEW_SUPPORT)
list(APPEND required_python_modules
paraview)
......
......@@ -145,62 +145,6 @@ if (SMTK_USE_PYBIND11)
)
endif()
if(NOT SMTK_USE_PYBIND11 AND SMTK_ENABLE_PYTHON_WRAPPING)
sbk_wrap_library(smtkCore
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
LOCAL_INCLUDE_DIRECTORIES
${CMAKE_CURRENT_SOURCE_DIR}/common
${CMAKE_CURRENT_SOURCE_DIR}/attribute
${CMAKE_CURRENT_SOURCE_DIR}/mesh
${CMAKE_CURRENT_SOURCE_DIR}/model
${CMAKE_CURRENT_SOURCE_DIR}/simulation
${CMAKE_CURRENT_SOURCE_DIR}/io
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM typesystem.xml
HEADERS ${smtk_headers}
)
set(SMTK_PYTHON_MODULE_SRCS
__init__
simple
testing
)
set(SMTK_PYTHON_MODULEFILES)
set(smtk_find_shiboken "build_tree")
foreach(pyfile ${SMTK_PYTHON_MODULE_SRCS})
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/smtk/${pyfile}.py"
"${SMTK_BINARY_DIR}/smtk/${pyfile}.py" @ONLY
)
list(APPEND SMTK_PYTHON_MODULEFILES "smtk/${pyfile}.py")
endforeach()
# TODO: We need to install this file in such a way that it can resolve
# the location of shiboken, which is going to mean running fixup
# bundle on the mac, and then fixing up the smtk/__init__.py
# package script
get_filename_component(SHIBOKEN_LIBRARY_NAME ${SHIBOKEN_LIBRARY} NAME)
install(
FILES ${SMTK_PYTHON_MODULEFILES}
DESTINATION "${SMTK_PYTHON_MODULEDIR}/smtk"
)
set(SMTK_FIND_SHIBOKEN "install_tree"
CACHE STRING "Set to empty if shiboken should be impicitly found in the install")
mark_as_advanced(SMTK_FIND_SHIBOKEN)
install(CODE
"set(LIBRARY_OUTPUT_PATH \"${CMAKE_INSTALL_PREFIX}/lib\")
set(SHIBOKEN_LIBRARY \"${CMAKE_INSTALL_PREFIX}/lib/${SHIBOKEN_LIBRARY_NAME}\")
set(smtk_find_shiboken \"${SMTK_FIND_SHIBOKEN}\")
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/smtk/__init__.py
${CMAKE_INSTALL_PREFIX}/${SMTK_PYTHON_MODULEDIR}/smtk/__init__.py )"
)
endif()
################################################################################
# Build smtk extensions
# Add libraries that extend other projects to have support for SMTK.
......
......@@ -138,34 +138,6 @@ if (SMTK_ENABLE_VTK_SUPPORT)
)
endif()
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
#extract the headers from cgm library we built to give them to shiboken
sbk_wrap_library(smtkCGMSession
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
WORKING_DIRECTORY ${SMTK_SOURCE_DIR}/smtk
LOCAL_INCLUDE_DIRECTORIES
${SMTK_SOURCE_DIR}/smtk/common
${SMTK_SOURCE_DIR}/smtk/attribute
${SMTK_SOURCE_DIR}/smtk/model
${SMTK_SOURCE_DIR}/smtk/session
${SMTK_SOURCE_DIR}/smtk/bridge/cgm
${SMTK_SOURCE_DIR}/smtk/simulation
${SMTK_SOURCE_DIR}/smtk/io
${SMTK_SOURCE_DIR}/smtk/view
${SMTK_SOURCE_DIR}/smtk
${SMTK_BINARY_DIR}/smtk
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/typesystem.xml
HEADERS ${cgmHeaders}
DEPENDS smtkCore
)
target_include_directories(smtkCGMSessionPython
PRIVATE ${CGM_INCLUDE_DIRS})
endif()
if(SMTK_ENABLE_PARAVIEW_SUPPORT)
add_subdirectory(plugin)
endif()
......
......@@ -241,43 +241,6 @@ smtk_public_headers(${discreteSessionHeaders} ${DiscreteModelHeaders})
#install the library and exports the library when used from a build tree
smtk_install_library(smtkDiscreteSession)
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
#extract the headers from discrete library we built to give them to shiboken
sbk_wrap_library(smtkDiscreteSession
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
WORKING_DIRECTORY ${SMTK_SOURCE_DIR}/smtk
LOCAL_INCLUDE_DIRECTORIES
${SMTK_SOURCE_DIR}/smtk/common
${SMTK_SOURCE_DIR}/smtk/attribute
${SMTK_SOURCE_DIR}/smtk/model
${SMTK_SOURCE_DIR}/smtk/session
${SMTK_SOURCE_DIR}/smtk/bridge/discrete
${SMTK_SOURCE_DIR}/smtk/simulation
${SMTK_SOURCE_DIR}/smtk/io
${SMTK_SOURCE_DIR}/smtk/view
${SMTK_SOURCE_DIR}/smtk
${SMTK_BINARY_DIR}/smtk
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/typesystem.xml
HEADERS ${discreteSessionHeaders}
DEPENDS
smtkCore
)
target_include_directories(smtkDiscreteSessionPython
PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/operation"
"${CMAKE_CURRENT_SOURCE_DIR}/kernel"
"${CMAKE_CURRENT_SOURCE_DIR}/kernel/Model"
"${CMAKE_CURRENT_SOURCE_DIR}/kernel/Serialize"
"${CMAKE_CURRENT_BINARY_DIR}/operation"
"${CMAKE_CURRENT_BINARY_DIR}/kernel"
)
endif()
if(SMTK_ENABLE_PARAVIEW_SUPPORT AND SMTK_ENABLE_DISCRETE_SESSION)
add_subdirectory(plugin)
endif()
......
......@@ -90,33 +90,6 @@ smtk_session_json("${CMAKE_CURRENT_SOURCE_DIR}/Session.json" exodusSessionJSON)
# Install the headers
smtk_public_headers(${exodusHeaders})
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
#extract the headers from exodus library we built to give them to shiboken
sbk_wrap_library(smtkExodusSession
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
WORKING_DIRECTORY ${SMTK_SOURCE_DIR}/smtk
LOCAL_INCLUDE_DIRECTORIES
${SMTK_SOURCE_DIR}/smtk/common
${SMTK_SOURCE_DIR}/smtk/attribute
${SMTK_SOURCE_DIR}/smtk/model
${SMTK_SOURCE_DIR}/smtk/session
${SMTK_SOURCE_DIR}/smtk/bridge/exodus
${SMTK_SOURCE_DIR}/smtk/simulation
${SMTK_SOURCE_DIR}/smtk/io
${SMTK_SOURCE_DIR}/smtk/view
${SMTK_SOURCE_DIR}/smtk
${SMTK_BINARY_DIR}/smtk
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/typesystem.xml
HEADERS ${exodusHeaders}
DEPENDS smtkCore
)
target_include_directories(smtkExodusSessionPython
PRIVATE ${EXODUS_INCLUDE_DIRS})
endif()
if(SMTK_ENABLE_PARAVIEW_SUPPORT)
add_subdirectory(plugin)
endif()
......
......@@ -48,33 +48,6 @@ smtk_session_json("${CMAKE_CURRENT_SOURCE_DIR}/Session.json" meshSessionJSON)
# Install the headers
smtk_public_headers(${meshHeaders})
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
#extract the headers from mesh library we built to give them to shiboken
sbk_wrap_library(smtkMeshSession
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
WORKING_DIRECTORY ${SMTK_SOURCE_DIR}/smtk
LOCAL_INCLUDE_DIRECTORIES
${SMTK_SOURCE_DIR}/smtk/common
${SMTK_SOURCE_DIR}/smtk/attribute
${SMTK_SOURCE_DIR}/smtk/model
${SMTK_SOURCE_DIR}/smtk/session
${SMTK_SOURCE_DIR}/smtk/bridge/mesh
${SMTK_SOURCE_DIR}/smtk/simulation
${SMTK_SOURCE_DIR}/smtk/io
${SMTK_SOURCE_DIR}/smtk/view
${SMTK_SOURCE_DIR}/smtk
${SMTK_BINARY_DIR}/smtk
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/typesystem.xml
HEADERS ${meshHeaders}
DEPENDS smtkCore
)
target_include_directories(smtkMeshSessionPython
PRIVATE ${MESH_INCLUDE_DIRS})
endif()
if (SMTK_ENABLE_PARAVIEW_SUPPORT)
add_subdirectory(plugin)
endif()
......
add_subdirectory(cxx)
#if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
# add_subdirectory(python)
#endif()
......@@ -63,33 +63,6 @@ smtk_operator_xml("${CMAKE_CURRENT_SOURCE_DIR}/operators/Revolve.sbt" multiscale
# Install the headers
smtk_public_headers(${multiscaleHeaders})
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
#extract the headers from multiscale library we built to give them to shiboken
sbk_wrap_library(smtkMultiscaleSession
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
WORKING_DIRECTORY ${SMTK_SOURCE_DIR}/smtk
LOCAL_INCLUDE_DIRECTORIES
${SMTK_SOURCE_DIR}/smtk/common
${SMTK_SOURCE_DIR}/smtk/attribute
${SMTK_SOURCE_DIR}/smtk/model
${SMTK_SOURCE_DIR}/smtk/session
${SMTK_SOURCE_DIR}/smtk/bridge/multiscale
${SMTK_SOURCE_DIR}/smtk/simulation
${SMTK_SOURCE_DIR}/smtk/io
${SMTK_SOURCE_DIR}/smtk/view
${SMTK_SOURCE_DIR}/smtk
${SMTK_BINARY_DIR}/smtk
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/typesystem.xml
HEADERS ${multiscaleHeaders}
DEPENDS smtkCore
)
target_include_directories(smtkMultiscaleSessionPython
PRIVATE ${MULTISCALE_INCLUDE_DIRS})
endif()
if(SMTK_ENABLE_PARAVIEW_SUPPORT)
add_subdirectory(plugin)
endif()
......
......@@ -150,31 +150,6 @@ target_include_directories(smtkPolygonSession
$<BUILD_INTERFACE:${SMTK_SOURCE_DIR}/smtk/extension/vtk/meshing>
)
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
# Extract the headers from polygon library we built to give them to shiboken
sbk_wrap_library(smtkPolygonSession
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
WORKING_DIRECTORY ${SMTK_SOURCE_DIR}/smtk
LOCAL_INCLUDE_DIRECTORIES
${SMTK_SOURCE_DIR}/smtk/common
${SMTK_SOURCE_DIR}/smtk/attribute
${SMTK_SOURCE_DIR}/smtk/model
${SMTK_SOURCE_DIR}/smtk/session
${SMTK_SOURCE_DIR}/smtk/bridge/polygon
${SMTK_SOURCE_DIR}/smtk/simulation
${SMTK_SOURCE_DIR}/smtk/io
${SMTK_SOURCE_DIR}/smtk/view
${SMTK_SOURCE_DIR}/smtk
${SMTK_BINARY_DIR}/smtk
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/typesystem.xml
HEADERS ${polygonHeaders}
DEPENDS smtkCore
)
endif()
if(SMTK_ENABLE_PARAVIEW_SUPPORT)
add_subdirectory(qt)
add_subdirectory(plugin)
......
......@@ -42,7 +42,7 @@ endif ()
smtk_public_headers(${headers})
# Potentially wrap in Python using VTK's wrapping methods, not shiboken.
# Potentially wrap in Python using VTK's wrapping methods.
# This makes the filters available for use with other VTK-wrapped filters.
#if (SMTK_ENABLE_PYTHON_WRAPPING AND VTK_WRAP_PYTHON)
# vtk_smtk_wrap_module_python3(${vtk-module} "${headers}")
......
......@@ -89,32 +89,6 @@ install(TARGETS smtk-model-server smtk-model-worker
ARCHIVE DESTINATION lib
)
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
#extract the headers from the library we built to give them to shiboken
sbk_wrap_library(smtkRemoteSession
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
WORKING_DIRECTORY ${SMTK_SOURCE_DIR}/smtk
LOCAL_INCLUDE_DIRECTORIES
${SMTK_SOURCE_DIR}/smtk/common
${SMTK_SOURCE_DIR}/smtk/attribute
${SMTK_SOURCE_DIR}/smtk/model
${SMTK_SOURCE_DIR}/smtk/bridge
${SMTK_SOURCE_DIR}/smtk/bridge/remote
${SMTK_SOURCE_DIR}/smtk/simulation
${SMTK_SOURCE_DIR}/smtk/io
${SMTK_SOURCE_DIR}/smtk/view
${SMTK_SOURCE_DIR}/smtk
${SMTK_BINARY_DIR}/smtk
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM ${SMTK_SOURCE_DIR}/smtk/bridge/remote/typesystem.xml
HEADERS ${RemoteLibHeaders}
DEPENDS smtkCore
)
#target_include_directories(smtkRemoteSessionPython PRIVATE ${CGM_INCLUDE_DIRS})
endif()
if (SMTK_USE_PYBIND11)
add_subdirectory(pybind11)
endif()
......
add_subdirectory(cxx)
if (SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
add_subdirectory(python)
endif()
set(smtkRemoteSessionPythonDataTests
integrationRemoteCGMWorker
)
if (SMTK_DATA_DIR AND EXISTS "${SMTK_DATA_DIR}/cmb-testing-data.marker")
foreach(test ${smtkRemoteSessionPythonDataTests})
smtk_add_test_python(${test}Py ${test}.py
--data-dir=${SMTK_DATA_DIR}
--temp-dir=${SMTK_BINARY_DIR}/Testing
--worker-dir=${SMTK_BINARY_DIR}/Testing)
endforeach()
endif()
#=============================================================================
#
# Copyright (c) Kitware, Inc.
# All rights reserved.
# See LICENSE.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
#=============================================================================
import unittest
import smtk
import smtk.testing
from smtk.simple import *
import os
import sys
class IntegrationRemoteCGMWorker(unittest.TestCase):
"""Start a remote model worker session and run
successive operations on entities to ensure that
the session stays alive and transmits the proper
entity information."""
def setUp(self):
self.mgr = smtk.model.Manager.create()
self.conn = smtk.bridge.remote.RemusConnection.create()
self.conn.addSearchDir(smtk.testing.WORKER_DIR)
print 'Session names\n ' + '\n '.join(self.conn.sessionTypeNames())
cgmWorkerName = 'smtk::model[cgm{OpenCascade}@ctest]'
if cgmWorkerName not in self.conn.sessionTypeNames():
print 'Skipping test due to missing worker.'
self.skipTest('Remote CGM session unavailable.')
sess = self.mgr.createSession(cgmWorkerName)
print 'Created session'
SetActiveSession(sess)
def testGeometryCreation(self):
brick = CreateBrick()
print 'Created brick %s' % brick.name()
tbrick = Translate(brick, [5, 0, 0])
self.assertEqual(
len(tbrick), 1, 'Expected 1 model result')
print 'Translated brick %s' % tbrick[0].name()
filename = os.path.join(smtk.testing.TEMP_DIR, 'tbrick.brep')
status = Write(filename, tbrick)
self.assertEqual(
status, smtk.model.OPERATION_SUCCEEDED,
'Failed to write generated model.')
def testGeometryModification(self):
filename = os.path.join(smtk.testing.DATA_DIR, 'cgm', 'pyramid.brep')
pyramid = Read(filename)[0]
brick = CreateBrick()
brick = Translate(brick, [0, 0, -1])[0]
result = Union([brick, pyramid])
filename = os.path.join(smtk.testing.TEMP_DIR, 'house.brep')
status = Write(filename, [result, ])
if __name__ == '__main__':
smtk.testing.process_arguments()
unittest.main()
......@@ -28,27 +28,6 @@ smtk_install_library(smtkDelaunayExt)
add_subdirectory(plugin)
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
sbk_wrap_library(smtkDelaunayExt
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
WORKING_DIRECTORY ${SMTK_SOURCE_DIR}/smtk
LOCAL_INCLUDE_DIRECTORIES
${SMTK_SOURCE_DIR}/smtk/attribute
${SMTK_SOURCE_DIR}/smtk/common
${SMTK_SOURCE_DIR}/smtk/mesh
${SMTK_SOURCE_DIR}/smtk/model
${SMTK_SOURCE_DIR}/smtk/extension/delaunay
${SMTK_SOURCE_DIR}/smtk
${SMTK_BINARY_DIR}/smtk
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/typesystem.xml
HEADERS ${headers}
DEPENDS smtkCore
)
endif()
if (SMTK_USE_PYBIND11)
add_subdirectory(pybind11)
endif()
......
set(smtkDelaunayExtPythonDataTests)
# This testfails during superbuild testing when built with shiboken, so we only
# test it when pybind11 bindings are enabled
if (SMTK_ENABLE_POLYGON_SESSION AND SMTK_USE_PYBIND11)
if (SMTK_ENABLE_POLYGON_SESSION)
set(smtkDelaunayExtPythonDataTests
${smtkDelaunayExtPythonDataTests}
unitTestTessellateFace
......
set(smtkDelaunayExtPythonDataTests)
if (SMTK_ENABLE_POLYGON_SESSION AND SMTK_USE_PYBIND11)
if (SMTK_ENABLE_POLYGON_SESSION)
set(smtkDelaunayExtPythonDataTests
${smtkDelaunayExtPythonDataTests}
testDelaunayMeshWorker
......
set(smtkMatplotlibExtPythonDataTests)
if (SMTK_USE_PYBIND11)
set(smtkMatplotlibExtPythonDataTests
${smtkMatplotlibExtPythonDataTests}
renderMesh
)
endif()
set(smtkMatplotlibExtPythonDataTests
renderMesh
)
if (SMTK_DATA_DIR AND EXISTS ${SMTK_DATA_DIR}/cmb-testing-data.marker)
foreach (test ${smtkMatplotlibExtPythonDataTests})
......
......@@ -66,31 +66,6 @@ if(SMTK_ENABLE_POLYGON_SESSION)
# Install the headers
smtk_public_headers(${opencvHeaders})
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
# Extract the headers from polygon library we built to give them to shiboken
sbk_wrap_library(smtkOpenCVExt
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
WORKING_DIRECTORY ${SMTK_SOURCE_DIR}/smtk
LOCAL_INCLUDE_DIRECTORIES
${SMTK_SOURCE_DIR}/smtk/common
${SMTK_SOURCE_DIR}/smtk/attribute
${SMTK_SOURCE_DIR}/smtk/model
${SMTK_SOURCE_DIR}/smtk/session
${SMTK_SOURCE_DIR}/smtk/bridge/polygon
${SMTK_SOURCE_DIR}/smtk/simulation
${SMTK_SOURCE_DIR}/smtk/io
${SMTK_SOURCE_DIR}/smtk/view
${SMTK_SOURCE_DIR}/smtk
${SMTK_BINARY_DIR}/smtk
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/typesystem.xml
HEADERS ${polygonHeaders}
DEPENDS smtkCore
)
endif()
if(SMTK_ENABLE_PARAVIEW_SUPPORT)
add_subdirectory(qt)
add_subdirectory(plugin)
......
......@@ -32,26 +32,6 @@ smtk_public_headers(${headers})
# ... and make header compilation tests link properly:
smtk_install_library(smtkIOVTK)
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
#extract the headers from cgm library we built to give them to shiboken
sbk_wrap_library(smtkIOVTK
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
WORKING_DIRECTORY ${SMTK_SOURCE_DIR}/smtk
LOCAL_INCLUDE_DIRECTORIES
${SMTK_SOURCE_DIR}/smtk/common
${SMTK_SOURCE_DIR}/smtk/mesh
${SMTK_SOURCE_DIR}/smtk/extension/vtk/io
${SMTK_SOURCE_DIR}/smtk
${SMTK_BINARY_DIR}/smtk
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/typesystem.xml
HEADERS ${headers}
DEPENDS smtkCore
)
endif()
if (SMTK_USE_PYBIND11)
add_subdirectory(pybind11)
endif()
......
......@@ -12,15 +12,9 @@
set(smtkExtensionVTKIOPythonDataTests
MultiScaleConverter
unitImportExportVTKData
)
if (SMTK_USE_PYBIND11)
set(smtkExtensionVTKIOPythonDataTests
${smtkExtensionVTKIOPythonDataTests}
unitImportExportVTKData
)
endif()
if (SMTK_DATA_DIR
AND EXISTS ${SMTK_DATA_DIR}/cmb-testing-data.marker)
foreach(test ${smtkExtensionVTKIOPythonDataTests})
......
......@@ -57,7 +57,7 @@ smtk_public_headers(${headers})
if (SMTK_ENABLE_TESTING)
add_subdirectory(testing)
endif()
# Potentially wrap in Python using VTK's wrapping methods, not shiboken.
# Potentially wrap in Python using VTK's wrapping methods.
# This makes the filters available for use with other VTK-wrapped filters.
#if (SMTK_ENABLE_PYTHON_WRAPPING AND VTK_WRAP_PYTHON)
# vtk_smtk_wrap_module_python3(${vtk-module} "${headers}")
......
......@@ -102,7 +102,7 @@ if (SMTK_ENABLE_PYTHON_WRAPPING)
vtk_add_python_wrapping(${vtk-module} VTKLibSrcs)
vtk_add_python_wrapping_library(${vtk-module} VTKLibSrcs ${vtk-module})
elseif (VTK_WRAP_PYTHON)
# Potentially wrap in Python using VTK's wrapping methods, not shiboken.
# Potentially wrap in Python using VTK's wrapping methods.
# This makes the filters available for use with other VTK-wrapped filters.
vtk_module_load(${vtk-module})
vtk_module_headers_load(${vtk-module})
......
add_subdirectory(cxx)
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
add_subdirectory(python)
endif()
set(smtkVTKExtPythonTests
)
# Additional tests that require SMTK_DATA_DIR
set(smtkVTKExtPythonDataTests
displayAnalysisMesh
)
foreach (test ${smtkVTKExtPythonTests})
smtk_add_test_python(${test}Py ${test}.py)
endforeach()
if (SMTK_DATA_DIR AND EXISTS ${SMTK_DATA_DIR}/cmb-testing-data.marker)
foreach (test ${smtkVTKExtPythonDataTests})
smtk_add_test_python(${test}Py ${test}.py
--data-dir=${SMTK_DATA_DIR})
endforeach()
endif()
#=============================================================================
#
# Copyright (c) Kitware, Inc.
# All rights reserved.
# See LICENSE.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notice for more information.
#
#=============================================================================
import os
import sys
import smtk
from smtk.simple import *
import smtk.testing
import unittest
try:
from vtkSMTKSourceExtPython import *
from vtk import *
except:
pass
class TestDisplayAnalysisMesh(smtk.testing.TestCase):
"""
Create a face with both an analysis and a display tessellation; verify that
the multiblock source can display both and that switching the source between
the two tessellations works as expected.
"""
def setUp(self):
self.mgr = smtk.model.Manager.create()
sref = self.mgr.createSession('native')
SetActiveSession(sref)
self.face = self.mgr.addFace()
self.model = self.mgr.addModel(3, 3, 'Simple face')
self.model.setSession(sref)
self.model.addCell(self.face)
def createTessellations(self, dgen, agen):
dtess = smtk.model.Tessellation()
amesh = smtk.model.Tessellation()
[dtess.addCoords(x[0], x[1], x[2])
for x in [(0, 0, 0), (2, 0, 0), (2, 2, 0), (0, 2, 0)]]
[dtess.addTriangle(ii[0], ii[1], ii[2])
for ii in [(0, 1, 2), (0, 2, 3)]]
[amesh.addCoords(x[0], x[1], x[2]) for x in [
(0, 0, 0), (1, 0.5, 0), (2, 0, 0), (2, 2, 0), (1, 1.5, 0), (0, 2, 0)]]
[amesh.addTriangle(ii[0], ii[1], ii[2])
for ii in [(0, 1, 4), (0, 4, 5), (1, 2, 3), (1, 3, 4)]]
dtessGen = self.face.setTessellationAndBoundingBox(dtess, 0)
ameshGen = self.face.setTessellationAndBoundingBox(amesh, 1)
self.assertEqual(
dtessGen, dgen, 'Unexpected display tessellation generation {dg}'.format(dg=dtessGen))