Commit 1f441057 authored by John Tourtellott's avatar John Tourtellott

Update conda mods after rebase to smtk:master

* Takes out some changes not needed
* Makes polygon session Import & ExtractContours vtk-dependent
* Also uses cmake-documented order for finding python interp before libs
parent 922b2a2c
......@@ -63,7 +63,6 @@ function(smtk_add_header_test name dir_prefix lib)
#also link against the associated library so we build properly
target_link_libraries(TestBuild_${name}
PRIVATE ${lib})
#PRIVATE ${MOAB_LIBRARIES})
endfunction(smtk_add_header_test)
......
......@@ -94,7 +94,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
################################################################################
# Options that the user controls
################################################################################
include(CMakeDependentOption)
option(BUILD_SHARED_LIBS "Build SMTK using shared libraries" ON)
option(SMTK_NO_SYSTEM_BOOST "Allow boost to search for system installed boost" ON)
......@@ -127,8 +126,6 @@ cmake_dependent_option(SMTK_ENABLE_DISCRETE_SESSION "Build discrete model sessio
SMTK_ENABLE_VTK_SUPPORT OFF)
cmake_dependent_option(SMTK_ENABLE_MOAB_DISCRETE_READER "Build moab reader for discrete model" OFF
"SMTK_ENABLE_DISCRETE_SESSION" OFF)
# cmake_dependent_option(SMTK_ENABLE_POLYGON_SESSION "Build Boost.polygon model session." ON
# SMTK_ENABLE_VTK_SUPPORT OFF)
option(SMTK_ENABLE_POLYGON_SESSION "Build Boost.polygon model session." ON)
cmake_dependent_option(SMTK_ENABLE_VTK_SESSION "Build a session that uses VTK multiblock datasets" ON
SMTK_ENABLE_VTK_SUPPORT OFF)
......@@ -282,9 +279,6 @@ find_package(nlohmann_json REQUIRED)
# Moab is required for building smtk::mesh, as it is the default storage
# format for meshes.
if (DEFINED conda_prefix)
set(MOAB_ROOT_DIR "${conda_prefix}/lib/cmake/MOAB")
endif()
find_package(MOAB REQUIRED)
......@@ -348,13 +342,8 @@ if(SMTK_ENABLE_PYTHON_WRAPPING)
set(PYTHON_MODULE_EXTENSION ".so")
endif()
if (DEFINED conda_prefix)
find_package(PythonInterp 2.7 REQUIRED)
find_package(PythonLibs REQUIRED)
else()
find_package(PythonLibs REQUIRED)
find_package(PythonInterp 2.7 REQUIRED)
endif()
find_package(PythonInterp 2.7 REQUIRED)
find_package(PythonLibs REQUIRED)
# Initialize SMTK_PYTHON_MODULEDIR.
# This stores the location where we'll install SMTK's Python modules.
......@@ -390,8 +379,6 @@ if(SMTK_ENABLE_PYTHON_WRAPPING)
CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(SMTK_PYBIND11_FLAGS "${SMTK_PYBIND11_FLAGS} -Wno-shadow")
endif()
message("SMTK_PYTHON_MODULEDIR ${SMTK_PYTHON_MODULEDIR}")
# Set up environment variables needed to import the python modules for tests.
if (PYTHONINTERP_FOUND AND SMTK_ENABLE_TESTING)
......
......@@ -14,6 +14,8 @@ else()
set(BOOST_LIBRARYDIR "${conda_prefix}/lib" CACHE PATH "Initial cache")
endif()
set(MOAB_ROOT_DIR "${conda_prefix}/lib/cmake/MOAB")
set(SMTK_ENABLE_EXODUS_SESSION OFF CACHE BOOL "Initial cache")
set(SMTK_ENABLE_MESH_SESSION ON CACHE BOOL "Initial cache")
set(SMTK_ENABLE_POLYGON_SESSION ON CACHE BOOL "Initial cache")
......
......@@ -68,16 +68,15 @@ set(smtkCore_public_include_directories
set(smtkCore_private_include_directories
)
set(moab_libs ${MOAB_LIBRARIES})
if(WIN32)
set(moab_libs "MOAB")
endif()
set(smtkCore_public_link_libraries
cJSON
${MOAB_LIBRARIES}
)
if (NOT APPLE AND NOT $ENV{CONDA_PREFIX})
set(smtkCore_public_link_libraries
${smtkCore_public_link_libraries}
nlohmann_json
${moab_libs}
nlohmann_json
)
endif()
set(smtkCore_private_link_libraries
${Boost_LIBRARIES}
......
......@@ -37,7 +37,6 @@ def test_create_cell_field():
str(smtk.common.UUID.random()) + ".h5m")
smtk.io.exportMesh(write_path, c)
print 'Wrote write_path', os.path.abspath(write_path)
return write_path
......@@ -50,9 +49,6 @@ def test_read_cell_field(mesh_path):
raise RuntimeError("Failed to read back valid mesh")
mesh = c.meshes()
print 'points.size():', mesh.points().size()
print 'cells.size():', mesh.cells().size()
# Next line crashes
cellfields = mesh.cellFields()
if not cellfields:
......
......@@ -29,7 +29,6 @@ set(polygonSrcs
operators/Read.cxx
operators/SplitEdge.cxx
operators/TweakEdge.cxx
operators/ExtractContours.cxx
operators/Write.cxx
)
......@@ -72,7 +71,6 @@ set(polygonHeaders
operators/Read.h
operators/SplitEdge.h
operators/TweakEdge.h
operators/ExtractContours.h
operators/Write.h
json/jsonEdge.h
......@@ -97,7 +95,6 @@ smtk_operation_xml("${CMAKE_CURRENT_SOURCE_DIR}/operators/LegacyRead.sbt" polygo
smtk_operation_xml("${CMAKE_CURRENT_SOURCE_DIR}/operators/Read.sbt" polygonOperationXML)
smtk_operation_xml("${CMAKE_CURRENT_SOURCE_DIR}/operators/SplitEdge.sbt" polygonOperationXML)
smtk_operation_xml("${CMAKE_CURRENT_SOURCE_DIR}/operators/TweakEdge.sbt" polygonOperationXML)
smtk_operation_xml("${CMAKE_CURRENT_SOURCE_DIR}/operators/ExtractContours.sbt" polygonOperationXML)
smtk_operation_xml("${CMAKE_CURRENT_SOURCE_DIR}/operators/Write.sbt" polygonOperationXML)
set(import_vtk_depends)
......@@ -116,11 +113,14 @@ if(SMTK_ENABLE_VTK_SUPPORT)
vtk_smtk_process_modules()
set(polygonSrcs ${polygonSrcs}
operators/ExtractContours.cxx
operators/Import.cxx
)
set(polygonHeaders ${polygonHeaders}
operators/ExtractContours.h
operators/Import.h
)
smtk_operation_xml("${CMAKE_CURRENT_SOURCE_DIR}/operators/ExtractContours.sbt" polygonOperationXML)
smtk_operation_xml("${CMAKE_CURRENT_SOURCE_DIR}/operators/Import.sbt" polygonOperationXML)
list(APPEND import_vtk_depends
vtkCommonCore
......@@ -137,6 +137,9 @@ if(SMTK_ENABLE_VTK_SUPPORT)
endif()
add_library(smtkPolygonSession ${polygonSrcs})
if(SMTK_ENABLE_VTK_SUPPORT)
target_compile_definitions(smtkPolygonSession PUBLIC VTK_SUPPORT)
endif()
target_link_libraries(smtkPolygonSession
LINK_PUBLIC
smtkCore
......
......@@ -21,9 +21,7 @@
#include "smtk/session/polygon/operators/CreateVertices.h"
#include "smtk/session/polygon/operators/Delete.h"
#include "smtk/session/polygon/operators/DemoteVertex.h"
#include "smtk/session/polygon/operators/ExtractContours.h"
#include "smtk/session/polygon/operators/ForceCreateFace.h"
//#include "smtk/session/polygon/operators/Import.h"
#include "smtk/session/polygon/operators/LegacyRead.h"
#include "smtk/session/polygon/operators/Read.h"
#include "smtk/session/polygon/operators/SplitEdge.h"
......@@ -33,10 +31,15 @@
#include "smtk/session/polygon/Resource.h"
#include "smtk/operation/groups/CreatorGroup.h"
//#include "smtk/operation/groups/ImporterGroup.h"
#include "smtk/operation/groups/ReaderGroup.h"
#include "smtk/operation/groups/WriterGroup.h"
#ifdef VTK_SUPPORT
#include "smtk/operation/groups/ImporterGroup.h"
#include "smtk/session/polygon/operators/ExtractContours.h"
#include "smtk/session/polygon/operators/Import.h"
#endif
namespace smtk
{
namespace session
......@@ -48,7 +51,11 @@ namespace
{
typedef std::tuple<CleanGeometry, CreateEdge, CreateEdgeFromPoints, CreateEdgeFromVertices,
CreateFaces, CreateFacesFromEdges, CreateModel, CreateVertices, Delete, DemoteVertex,
ExtractContours, ForceCreateFace, LegacyRead, Read, SplitEdge, TweakEdge, Write>
ForceCreateFace,
#ifdef VTK_SUPPORT
ExtractContours, Import,
#endif
LegacyRead, Read, SplitEdge, TweakEdge, Write>
OperationList;
}
......@@ -65,8 +72,10 @@ void Registrar::registerTo(const smtk::operation::Manager::Ptr& operationManager
smtk::operation::CreatorGroup(operationManager)
.registerOperation<smtk::session::polygon::Resource, smtk::session::polygon::CreateModel>();
// smtk::operation::ImporterGroup(operationManager)
// .registerOperation<smtk::session::polygon::Resource, smtk::session::polygon::Import>();
#ifdef VTK_SUPPORT
smtk::operation::ImporterGroup(operationManager)
.registerOperation<smtk::session::polygon::Resource, smtk::session::polygon::Import>();
#endif
smtk::operation::ReaderGroup(operationManager)
.registerOperation<smtk::session::polygon::Resource, smtk::session::polygon::Read>();
......
......@@ -8,7 +8,6 @@ include(ParaViewPlugins)
list(APPEND CMAKE_MODULE_PATH "${VTK_MODULES_DIR}")
qt5_wrap_cpp(MOC_SRCS qtPolygonEdgeOperationView.h)
qt5_wrap_cpp(MOC_SRCS qtExtractContoursView.h)
#qt5_wrap_cpp(UI_SRCS qtPolygonEdgeOperationView.ui)
ADD_SMTK_UI_VIEW(
......@@ -17,20 +16,28 @@ ADD_SMTK_UI_VIEW(
CLASS_NAME qtPolygonEdgeOperationView
VIEW_NAME smtkPolygonEdgeView
)
ADD_SMTK_UI_VIEW(
OUTIFACES1
OUTSRCS1
CLASS_NAME qtExtractContoursView
VIEW_NAME smtkPolygonContourView
)
set(GUI_SOURCES
${OUTSRCS} ${OUTSRCS2} ${MOC_SRCS} ${UI_SRCS}
qtPolygonEdgeOperationView.cxx
)
if(SMTK_ENABLE_VTK_SUPPORT)
qt5_wrap_cpp(MOC_VTK_SRCS qtExtractContoursView.h)
ADD_SMTK_UI_VIEW(
OUTIFACES1
OUTSRCS1
CLASS_NAME qtExtractContoursView
VIEW_NAME smtkPolygonContourView
)
list(APPEND GUI_SOURCES ${OUTSRCS1} ${MOC_VTK_SRCS} qtExtractContoursView.cxx)
endif()
add_smtk_plugin(
smtkPolygonSessionPlugin "1.0"
SERVER_MANAGER_XML smconfig.xml
GUI_INTERFACES ${OUTIFACES} ${OUTIFACES1} ${OUTIFACES2}
GUI_SOURCES ${OUTSRCS} ${OUTSRCS1} ${OUTSRCS2} ${MOC_SRCS} ${UI_SRCS}
qtPolygonEdgeOperationView.cxx
qtExtractContoursView.cxx
GUI_SOURCES ${GUI_SOURCES}
CS_KITS
vtkSMTKWidgetsExt
vtkPolygonOperationsExt
......
......@@ -23,6 +23,9 @@ if(SMTK_ENABLE_VTK_SUPPORT)
)
endif()
target_link_libraries(${library_name} LINK_PUBLIC smtkCore smtkPolygonSession LINK_PRIVATE ${import_vtk_depends} ${Boost_LIBRARIES})
if(SMTK_ENABLE_VTK_SUPPORT)
target_compile_definitions(${library_name} PUBLIC VTK_SUPPORT)
endif()
set_target_properties(${library_name}
PROPERTIES
CXX_VISIBILITY_PRESET hidden
......
......@@ -37,15 +37,18 @@ using PySharedPtrClass = py::class_<T, std::shared_ptr<T>, Args...>;
#include "PybindCreateVertices.h"
#include "PybindDelete.h"
#include "PybindDemoteVertex.h"
//#include "PybindExtractContours.h"
#include "PybindForceCreateFace.h"
//#include "PybindImport.h"
#include "PybindRead.h"
#include "PybindLegacyRead.h"
#include "PybindSplitEdge.h"
#include "PybindTweakEdge.h"
#include "PybindWrite.h"
#ifdef VTK_SUPPORT
#include "PybindExtractContours.h"
#include "PybindImport.h"
#endif
#include "PybindRegistrar.h"
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>);
......@@ -69,14 +72,17 @@ PYBIND11_MODULE(_smtkPybindPolygonSession, polygon)
PySharedPtrClass< smtk::session::polygon::CreateVertices > smtk_session_polygon_CreateVertices = pybind11_init_smtk_session_polygon_CreateVertices(polygon, smtk_session_polygon_Operation);
PySharedPtrClass< smtk::session::polygon::Delete > smtk_session_polygon_Delete = pybind11_init_smtk_session_polygon_Delete(polygon, smtk_session_polygon_Operation);
PySharedPtrClass< smtk::session::polygon::DemoteVertex > smtk_session_polygon_DemoteVertex = pybind11_init_smtk_session_polygon_DemoteVertex(polygon, smtk_session_polygon_Operation);
//PySharedPtrClass< smtk::session::polygon::ExtractContours > smtk_session_polygon_ExtractContours = pybind11_init_smtk_session_polygon_ExtractContours(polygon, smtk_session_polygon_Operation);
PySharedPtrClass< smtk::session::polygon::ForceCreateFace > smtk_session_polygon_ForceCreateFace = pybind11_init_smtk_session_polygon_ForceCreateFace(polygon, smtk_session_polygon_Operation);
//PySharedPtrClass< smtk::session::polygon::Import > smtk_session_polygon_Import = pybind11_init_smtk_session_polygon_Import(polygon, smtk_session_polygon_Operation);
PySharedPtrClass< smtk::session::polygon::Read > smtk_session_polygon_Read = pybind11_init_smtk_session_polygon_Read(polygon, smtk_session_polygon_Operation);
PySharedPtrClass< smtk::session::polygon::LegacyRead > smtk_session_polygon_LegacyRead = pybind11_init_smtk_session_polygon_LegacyRead(polygon, smtk_session_polygon_Operation);
PySharedPtrClass< smtk::session::polygon::SplitEdge > smtk_session_polygon_SplitEdge = pybind11_init_smtk_session_polygon_SplitEdge(polygon, smtk_session_polygon_Operation);
PySharedPtrClass< smtk::session::polygon::TweakEdge > smtk_session_polygon_TweakEdge = pybind11_init_smtk_session_polygon_TweakEdge(polygon, smtk_session_polygon_Operation);
PySharedPtrClass< smtk::session::polygon::Write > smtk_session_polygon_Write = pybind11_init_smtk_session_polygon_Write(polygon, smtk_session_polygon_Operation);
#ifdef VTK_SUPPORT
PySharedPtrClass< smtk::session::polygon::ExtractContours > smtk_session_polygon_ExtractContours = pybind11_init_smtk_session_polygon_ExtractContours(polygon, smtk_session_polygon_Operation);
PySharedPtrClass< smtk::session::polygon::Import > smtk_session_polygon_Import = pybind11_init_smtk_session_polygon_Import(polygon, smtk_session_polygon_Operation);
#endif
py::class_< smtk::session::polygon::Registrar > smtk_session_polygon_Registrar = pybind11_init_smtk_session_polygon_Registrar(polygon);
}
......@@ -19,8 +19,10 @@ set (unit_tests
UnitTestPolygonFindOperationAttItems.cxx
UnitTestPolygonCleanGeometry.cxx)
set (unit_tests_which_require_data
UnitTestPolygonReadWrite.cxx)
if(SMTK_ENABLE_VTK_SUPPORT)
set (unit_tests_which_require_data
UnitTestPolygonReadWrite.cxx)
endif()
if (SMTK_ENABLE_REMUS_SUPPORT)
list(APPEND unit_tests_which_require_data UnitTestPolygonImport.cxx)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment