Skip to content
Snippets Groups Projects
Commit e941b907 authored by Andrew Wilson's avatar Andrew Wilson :elephant:
Browse files

REFAC: Fix C# wrapper for rendering toggle

parent 49f8d4cd
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,9 @@ set(imstk_SWIG_DEFINITIONS "")
if(iMSTK_SWIG_PINNED_ARRAY)
list(APPEND imstk_SWIG_DEFINITIONS "SWIG_PINNED_ARRAY")
endif()
if (iMSTK_USE_RENDERING_VTK)
list(APPEND imstk_SWIG_DEFINITIONS "iMSTK_USE_RENDERING_VTK")
endif()
if(iMSTK_USE_OpenHaptics)
list(APPEND imstk_SWIG_DEFINITIONS "iMSTK_USE_OpenHaptics")
endif()
......@@ -64,7 +67,7 @@ set_property(TARGET iMSTKCWrapper PROPERTY SWIG_COMPILE_DEFINITIONS ${imstk_SWIG
target_compile_definitions(iMSTKCWrapper PRIVATE ${imstk_SWIG_DEFINITIONS})
# Link C Wrapper to the imstk libraries
target_link_libraries(iMSTKCWrapper PRIVATE
set(CWRAPPER_DEPENDENCIES
Common
Materials
Geometry
......@@ -74,7 +77,6 @@ target_link_libraries(iMSTKCWrapper PRIVATE
FilteringCore
Materials
RenderingCore
RenderingVTK
Solvers
DynamicalModels
CollisionDetection
......@@ -83,9 +85,16 @@ target_link_libraries(iMSTKCWrapper PRIVATE
Scene
SimulationManager
ViewerCore
ViewerVTK
Constraints
Animation)
Animation
)
if (iMSTK_USE_RENDERING_VTK)
list(APPEND CWRAPPER_DEPENDENCIES
RenderingVTK
ViewerVTK
)
endif()
target_link_libraries(iMSTKCWrapper PRIVATE ${CWRAPPER_DEPENDENCIES})
target_compile_options(iMSTKCWrapper PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -Wno-unused-function>
......@@ -116,7 +125,7 @@ configure_file(iMSTKCWrapperConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/iMSTKCWrapperConfig.cmake"
@ONLY)
# If we're on msvc we will generate a library/.dll out of our generated C# files
# If on msvc, generate a library/.dll out of our generated C# files
if (MSVC)
# Because the files aren't generated until build time of the iMSTKCWrapper target
# we must wait to configure it until after it's done building
......@@ -136,11 +145,16 @@ if (MSVC)
-DSWIG_OUTPUT_DIR:PATH=${SWIG_CSHARP_OUTPUT_DIR}
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_PREFIX_PATH}
-DiMSTK_SWIG_PINNED_ARRAY:BOOL=${iMSTK_SWIG_PINNED_ARRAY}
-DiMSTK_USE_RENDERING_VTK:BOOL=${iMSTK_USE_RENDERING_VTK}
-DiMSTK_USE_OpenHaptics:BOOL=${iMSTK_USE_OpenHaptics}
-DiMSTK_USE_VRPN:BOOL=${iMSTK_USE_VRPN}
)
set_target_properties (iMSTKSharp PROPERTIES
FOLDER Wrappers)
# If on unix, a library/.so can still be generated through mono, but cmake does not support mono
elseif(UNIX)
message(WARNING "C# library/.so cannot be built on unix systems through cmake, please build manually using generated \".cs\" files")
#find_package(Mono) # Provided with cmake to find mono bits
endif()
# Clear the ".cs" wrapper code in the install directory and install new ones
......
......@@ -5,8 +5,10 @@ std::string Module_getPostUpdate();
std::string Module_getPreUpdate();
std::string SceneManager_getPreUpdate();
std::string SceneManager_getPostUpdate();
#ifdef iMSTK_USE_RENDERING_VTK
std::string VTKViewer_getPreUpdate();
std::string VTKViewer_getPostUpdate();
#endif
%nocallback;
%{
......@@ -35,6 +37,7 @@ std::string VTKViewer_getPostUpdate();
{
return imstk::SceneManager::preUpdate();
}
#ifdef iMSTK_USE_RENDERING_VTK
std::string VTKViewer_getPostUpdate()
{
return imstk::VTKViewer::postUpdate();
......@@ -43,4 +46,5 @@ std::string VTKViewer_getPostUpdate();
{
return imstk::VTKViewer::preUpdate();
}
#endif
%}
\ No newline at end of file
......@@ -172,15 +172,25 @@
* SimulationManager
*/
#include "imstkModule.h"
#include "imstkViewer.h"
#include "imstkAbstractVTKViewer.h"
#include "imstkVTKViewer.h"
#include "imstkVTKTextStatusManager.h"
#include "imstkSceneManager.h"
#include "imstkSimulationManager.h"
#include "imstkMouseSceneControl.h"
#include "imstkKeyboardSceneControl.h"
/*
* ViewerCore
*/
#include "imstkViewer.h"
#ifdef iMSTK_USE_RENDERING_VTK
/*
* ViewerVTK
*/
#include "imstkAbstractVTKViewer.h"
#include "imstkVTKTextStatusManager.h"
#include "imstkVTKViewer.h"
#endif
/*
* Devices
*/
......@@ -402,16 +412,18 @@ namespace std
%include "../../Scene/imstkSphObjectCollision.h"
/*
* ViewerCore & ViewerVTK
* ViewerCore
*/
%include "../../ViewerCore/imstkViewer.h";
#ifdef iMSTK_USE_RENDERING_VTK
/*
* ViewerVTK
*/
%include "../../ViewerVTK/imstkAbstractVTKViewer.h";
%include "../../ViewerVTK/imstkVTKViewer.h";
%include "../../ViewerVTK/imstkVTKTextStatusManager.h";
#endif
/*
* SimulationManager
......
......@@ -96,7 +96,7 @@
%shared_ptr(imstk::BackwardEuler)
/*
* Rendering
* Materials
*/
%shared_ptr(imstk::RenderMaterial)
%shared_ptr(imstk::Texture)
......@@ -182,14 +182,20 @@
*/
%shared_ptr(imstk::Module)
%shared_ptr(imstk::Viewer)
%shared_ptr(imstk::AbstractVTKViewer)
%shared_ptr(imstk::VTKViewer)
%shared_ptr(imstk::VTKTextStatusManager)
%shared_ptr(imstk::SceneManager)
%shared_ptr(imstk::SimulationManager)
%shared_ptr(imstk::MouseSceneControl)
%shared_ptr(imstk::KeyboardSceneControl)
#ifdef iMSTK_USE_RENDERING_VTK
/*
* ViewerVTK & RenderingVTK
*/
%shared_ptr(imstk::AbstractVTKViewer)
%shared_ptr(imstk::VTKViewer)
%shared_ptr(imstk::VTKTextStatusManager)
#endif
/*
* Devices
*/
......
......@@ -24,16 +24,18 @@ function(add_example example_name sources)
install(TARGETS ${target})
endfunction()
add_example(FemDeformable femDeformable.cs)
add_example(PBDCloth pbdCloth.cs)
add_example(PBDClothCollision pbdClothCollision.cs)
add_example(PBDCollisionOneObject pbdCollisionOneObject.cs)
add_example(PBDVolume pbdVolume.cs)
add_example(RigidBody2 rigidBody2.cs)
add_example(SPHFluid sphFluid.cs)
add_example(TestGeometry testGeometry.cs)
if (iMSTK_USE_RENDERING_VTK)
add_example(FemDeformable femDeformable.cs)
add_example(PBDCloth pbdCloth.cs)
add_example(PBDClothCollision pbdClothCollision.cs)
add_example(PBDCollisionOneObject pbdCollisionOneObject.cs)
add_example(PBDVolume pbdVolume.cs)
add_example(RigidBody2 rigidBody2.cs)
add_example(SPHFluid sphFluid.cs)
add_example(TestGeometry testGeometry.cs)
if (iMSTK_USE_OpenHaptics)
add_example(PBDCutting pbdCutting.cs)
add_example(SDFHaptics sdfHaptics.cs)
if (iMSTK_USE_OpenHaptics)
add_example(PBDCutting pbdCutting.cs)
add_example(SDFHaptics sdfHaptics.cs)
endif()
endif()
\ No newline at end of file
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