Last active
October 21, 2017 23:56
-
-
Save saliksyed/b923ff7a2001b4863bc023221d9e8c0a to your computer and use it in GitHub Desktop.
Add SWIG Wrapper for manipulating camera
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8.11) | |
project(Tungsten) | |
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) | |
include(CXX11) | |
check_for_cxx11_compiler(CXX11_COMPILER) | |
if(CXX11_COMPILER) | |
enable_cxx11() | |
else() | |
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} seems to have no C++11 support. Please try again with a more recent compiler version.") | |
endif() | |
# AVX does not do much benefit at the moment, but breaks compilation on some platforms. | |
# Disabled for now until AVX becomes important enough to reconsider. | |
SET(EMBREE_MAX_ISA "SSE4.2" CACHE STRING "Selects highest ISA to support.") | |
set(USE_AVX FALSE CACHE BOOL "Use AVX.") | |
set(USE_AVX2 FALSE CACHE BOOL "Use AVX2.") | |
include(OptimizeForArchitecture) | |
OptimizeForArchitecture() | |
if (MSVC) | |
# Needed by MSVC, but not added by OptimizeForArchitexture() | |
add_definitions(-D__SSE__) | |
endif() | |
add_definitions(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") | |
if (USE_AVX) | |
message(STATUS "Compiling with AVX support") | |
set(__AVX__ 1) | |
elseif (USE_SSE4_2) | |
message(STATUS "Compiling with SSE4.2 support") | |
elseif (USE_SSSE3) | |
message(STATUS "Compiling with SSE3 support") | |
else() | |
message(FATAL_ERROR "The target machine does not support SSE3. At least SSE3 is required") | |
endif() | |
if (MSVC) | |
add_definitions(-DCONSTEXPR=const -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS) | |
else() | |
add_definitions(-DCONSTEXPR=constexpr) | |
endif() | |
IF(COMMAND cmake_policy) | |
if (POLICY CMP0043) | |
cmake_policy(SET CMP0043 NEW) | |
endif() | |
ENDIF(COMMAND cmake_policy) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Vc_ARCHITECTURE_FLAGS}") | |
set(EMBREE_STATIC_LIB ON CACHE BOOL "Build Embree as a static library." FORCE) | |
set(EMBREE_ISPC_SUPPORT OFF CACHE BOOL "Build Embree with support for ISPC applications." FORCE) | |
set(EMBREE_TUTORIALS OFF CACHE BOOL "Enable to build Embree tutorials" FORCE) | |
set(EMBREE_STAT_COUNTERS OFF CACHE BOOL "Enables statistic counters." FORCE) | |
set(EMBREE_RAY_MASK OFF CACHE BOOL "Enables ray mask support." FORCE) | |
set(EMBREE_BACKFACE_CULLING OFF CACHE BOOL "Enables backface culling." FORCE) | |
set(EMBREE_INTERSECTION_FILTER ON CACHE BOOL "Enables intersection filter callback." FORCE) | |
set(EMBREE_INTERSECTION_FILTER_RESTORE ON CACHE BOOL "Restores previous hit when hit is filtered out." FORCE) | |
set(EMBREE_TASKING_SYSTEM "INTERNAL" CACHE STRING "Selects tasking system" FORCE) | |
set(EMBREE_STATIC_RUNTIME OFF CACHE BOOL "Use the static version of the C/C++ runtime library." FORCE) | |
add_subdirectory(src/thirdparty/embree) | |
add_definitions(-DEMBREE_STATIC_LIB=1) | |
add_definitions(-DRAPIDJSON_HAS_STDSTRING=1) | |
add_definitions(-DSTBI_NO_STDIO=1) | |
add_definitions(-DLODEPNG_NO_COMPILE_DISK=1) | |
add_definitions(-DUSE_IPV6=1) | |
add_library(thirdparty STATIC | |
src/thirdparty/civetweb/civetweb.c | |
src/thirdparty/lodepng/lodepng.cpp | |
src/thirdparty/sobol/sobol.cpp | |
src/thirdparty/stbi/stb_image.c | |
src/thirdparty/miniz/miniz.c | |
src/thirdparty/skylight/ArHosekSkyModel.cpp | |
src/thirdparty/tribox/tribox.cpp) | |
if (CMAKE_COMPILER_IS_GNUCXX) | |
set(CXX_WARNINGS "-Wall -Wextra -Wpointer-arith -Wcast-align -fstrict-aliasing -Wno-unused-local-typedefs -Wno-misleading-indentation -Wno-maybe-uninitialized -Wno-int-in-bool-context -Wno-implicit-fallthrough") | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARNINGS} -fvisibility-inlines-hidden") | |
endif() | |
set(core_libs core thirdparty embree) | |
include_directories(src/core src/thirdparty src/thirdparty/embree/include src) | |
find_package(Eigen3) | |
if (EIGEN3_FOUND) | |
include_directories(${EIGEN3_INCLUDE_DIR}) | |
message(STATUS "Eigen3 detected. denoiser will be built") | |
else() | |
message(STATUS "No Eigen3 detected. denoiser will not be built") | |
endif() | |
find_package(OpenEXR) | |
if (OPENEXR_FOUND) | |
message(STATUS "OpenEXR detected. Building with .exr support") | |
add_definitions(-DOPENEXR_AVAILABLE) | |
include_directories(${OPENEXR_INCLUDE_DIR}) | |
set(core_libs ${core_libs} ${OPENEXR_LIBRARIES}) | |
else() | |
message(STATUS "No OpenEXR detected. Building without .exr support") | |
endif() | |
find_package(OpenVDB) | |
find_package(TBB) | |
if (OPENEXR_FOUND AND OPENVDB_FOUND AND TBB_FOUND) | |
message(STATUS "OpenVDB detected. Building with .vdb support") | |
add_definitions(-DOPENVDB_AVAILABLE) | |
include_directories(${OPENVDB_INCLUDE_DIR}) | |
set(core_libs ${core_libs} ${OPENVDB_LIBRARIES} ${TBB_LIBRARIES}) | |
else() | |
if (NOT OPENVDB_FOUND) | |
message(STATUS "No OpenVDB detected. Building without .vdb support") | |
elseif(NOT OPENEXR_FOUND) | |
message(STATUS "No OpenEXR libraries detected. Building without .vdb support") | |
else() | |
message(STATUS "No TBB detected. Building without .vdb support") | |
endif() | |
endif() | |
file(GLOB_RECURSE Core_SOURCES "src/core/*.cpp") | |
add_library(core STATIC ${Core_SOURCES}) | |
add_executable(obj2json src/obj2json/obj2json.cpp) | |
target_link_libraries(obj2json ${core_libs}) | |
add_executable(json2xml src/json2xml/json2xml.cpp) | |
target_link_libraries(json2xml ${core_libs}) | |
add_executable(scenemanip src/scenemanip/scenemanip.cpp) | |
target_link_libraries(scenemanip ${core_libs}) | |
add_executable(hdrmanip src/hdrmanip/hdrmanip.cpp) | |
target_link_libraries(hdrmanip ${core_libs}) | |
if (EIGEN3_FOUND) | |
file(GLOB_RECURSE denoiser_SOURCES "src/denoiser/*.cpp") | |
add_executable(denoiser ${denoiser_SOURCES}) | |
target_link_libraries(denoiser ${core_libs}) | |
endif() | |
add_executable(tungsten src/tungsten/tungsten.cpp) | |
target_link_libraries(tungsten ${core_libs}) | |
find_package(SWIG REQUIRED) | |
include(${SWIG_USE_FILE}) | |
find_package( PythonLibs 2.7 REQUIRED ) | |
find_package( PythonInterp 2.7 REQUIRED ) | |
include_directories(${PYTHON_INCLUDE_DIRS}) | |
set_property(SOURCE tungsten.i PROPERTY CPLUSPLUS ON) | |
swig_add_library(tungsten module LANGUAGE python SOURCES tungsten.i) | |
swig_link_libraries(tungsten ${core_libs} ${PYTHON_LIBRARIES} ) | |
if (WIN32) | |
set(socket_libs wsock32 Ws2_32) | |
else() | |
set(socket_libs "") | |
endif() | |
add_executable(tungsten_server src/tungsten-server/tungsten-server.cpp) | |
target_link_libraries(tungsten_server ${core_libs} ${socket_libs}) | |
set(executables obj2json json2xml scenemanip hdrmanip tungsten tungsten_server) | |
if (EIGEN3_FOUND) | |
set(executables ${executables} denoiser) | |
endif() | |
set(data_dirs example-scenes materialtest mc-loader) | |
find_package(OpenGL) | |
find_package(Qt5Widgets) | |
find_package(Qt5OpenGL) | |
if (OPENGL_FOUND AND Qt5Widgets_FOUND) | |
include_directories(${OPENGL_INCLUDE_DIR}) | |
set(opengl_libs ${OPENGL_LIBRARIES}) | |
file(GLOB_RECURSE Editor_SOURCES "src/editor/*.cpp") | |
if (APPLE) | |
list(APPEND Editor_SOURCES "src/editor/CoreProfileAttributes.mm") | |
endif() | |
add_executable(editor ${Editor_SOURCES} src/editor/resources/Tungsten.rc) | |
set_target_properties(editor PROPERTIES AUTOMOC TRUE) | |
qt5_use_modules(editor Widgets OpenGL) | |
target_link_libraries(editor ${core_libs} ${opengl_libs} Qt5::Widgets Qt5::OpenGL) | |
if (APPLE) | |
find_library(APPKIT NAMES AppKit) | |
target_link_libraries(editor ${APPKIT}) | |
endif() | |
message(STATUS "Building editor") | |
set(data_dirs ${data_dirs} editor shaders) | |
set(executables ${executables} editor) | |
else() | |
if (NOT Qt5Widgets_FOUND) | |
message(STATUS "Qt5 not found. Editor will not be built") | |
endif() | |
if (NOT OPENGL_FOUND) | |
message(STATUS "OpenGL not found. Editor will not be built") | |
endif() | |
endif() | |
if (WIN32) | |
set(data_prefix "data") | |
else() | |
set(data_prefix "share/tungsten") | |
endif() | |
foreach (data_dir ${data_dirs}) | |
install(DIRECTORY data/${data_dir} DESTINATION ${data_prefix}) | |
file(GLOB_RECURSE data_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/data "data/${data_dir}/*") | |
foreach (data ${data_files}) | |
configure_file(data/${data} ${CMAKE_CURRENT_BINARY_DIR}/${data_prefix}/${data} COPYONLY) | |
endforeach(data) | |
endforeach() | |
if (WIN32) | |
install(TARGETS ${executables} DESTINATION .) | |
else() | |
install(TARGETS ${executables} DESTINATION bin) | |
endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tungsten | |
p = tungsten.Path("/Users/saliksyed/src/tungsten-fork/data/example-scenes/water-caustic/scene.json") | |
s = tungsten.Scene.load(p) | |
s.loadResources() | |
traceable = s.makeTraceable(24324234) | |
print(s.getCamera().lookAt()) | |
s.getCamera().setLookAt([0.0, 2.0, 0.0]) | |
integrator = traceable.integrator() | |
while not integrator.done(): | |
integrator.startRender(None) | |
integrator.waitForCompletion() | |
integrator.saveOutputs(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%module tungsten | |
%include "stdint.i" | |
%include std_string.i | |
using std::string; | |
%{ | |
#define SWIG_FILE_WITH_INIT | |
#include "src/core/math/Angle.hpp" | |
#include "src/core/math/Bessel.hpp" | |
#include "src/core/math/BitManip.hpp" | |
#include "src/core/math/Box.hpp" | |
#include "src/core/math/BSpline.hpp" | |
#include "src/core/math/Erf.hpp" | |
#include "src/core/math/FastMath.hpp" | |
#include "src/core/math/GaussLegendre.hpp" | |
#include "src/core/math/Mat4f.hpp" | |
#include "src/core/math/MathUtil.hpp" | |
#include "src/core/math/Polynomial.hpp" | |
#include "src/core/math/Quaternion.hpp" | |
#include "src/core/math/Range.hpp" | |
#include "src/core/math/Ray.hpp" | |
#include "src/core/math/Spectral.hpp" | |
#include "src/core/math/TangentFrame.hpp" | |
#include "src/core/math/Vec.hpp" | |
#include "src/core/AlignedAllocator.hpp" | |
#include "src/core/bsdfs/Bsdf.hpp" | |
#include "src/core/bsdfs/BsdfFactory.hpp" | |
#include "src/core/bsdfs/BsdfLobes.hpp" | |
#include "src/core/bsdfs/ComplexIor.hpp" | |
#include "src/core/bsdfs/ComplexIorData.hpp" | |
#include "src/core/bsdfs/ConductorBsdf.hpp" | |
#include "src/core/bsdfs/DielectricBsdf.hpp" | |
#include "src/core/bsdfs/DiffuseTransmissionBsdf.hpp" | |
#include "src/core/bsdfs/ErrorBsdf.hpp" | |
#include "src/core/bsdfs/ForwardBsdf.hpp" | |
#include "src/core/bsdfs/Fresnel.hpp" | |
#include "src/core/bsdfs/HairBcsdf.hpp" | |
#include "src/core/bsdfs/LambertBsdf.hpp" | |
#include "src/core/bsdfs/LambertianFiberBcsdf.hpp" | |
#include "src/core/bsdfs/Microfacet.hpp" | |
#include "src/core/bsdfs/MirrorBsdf.hpp" | |
#include "src/core/bsdfs/MixedBsdf.hpp" | |
#include "src/core/bsdfs/NullBsdf.hpp" | |
#include "src/core/bsdfs/OrenNayarBsdf.hpp" | |
#include "src/core/bsdfs/PhongBsdf.hpp" | |
#include "src/core/bsdfs/PlasticBsdf.hpp" | |
#include "src/core/bsdfs/PrecomputedAzimuthalLobe.hpp" | |
#include "src/core/bsdfs/RoughCoatBsdf.hpp" | |
#include "src/core/bsdfs/RoughConductorBsdf.hpp" | |
#include "src/core/bsdfs/RoughDielectricBsdf.hpp" | |
#include "src/core/bsdfs/RoughPlasticBsdf.hpp" | |
#include "src/core/bsdfs/RoughWireBcsdf.hpp" | |
#include "src/core/bsdfs/SmoothCoatBsdf.hpp" | |
#include "src/core/bsdfs/ThinSheetBsdf.hpp" | |
#include "src/core/bsdfs/TransparencyBsdf.hpp" | |
#include "src/core/bvh/BinaryBvh.hpp" | |
#include "src/core/bvh/BinnedSahSplitter.hpp" | |
#include "src/core/bvh/BvhBuilder.hpp" | |
#include "src/core/bvh/FullSahSplitter.hpp" | |
#include "src/core/bvh/MidpointSplitter.hpp" | |
#include "src/core/bvh/NaiveBvhNode.hpp" | |
#include "src/core/bvh/Primitive.hpp" | |
#include "src/core/bvh/Splitter.hpp" | |
#include "src/core/cameras/AtomicFramebuffer.hpp" | |
#include "src/core/cameras/Camera.hpp" | |
#include "src/core/cameras/CameraFactory.hpp" | |
#include "src/core/cameras/CubemapCamera.hpp" | |
#include "src/core/cameras/EquirectangularCamera.hpp" | |
#include "src/core/cameras/OutputBuffer.hpp" | |
#include "src/core/cameras/OutputBufferSettings.hpp" | |
#include "src/core/cameras/PinholeCamera.hpp" | |
#include "src/core/cameras/ReconstructionFilter.hpp" | |
#include "src/core/cameras/ThinlensCamera.hpp" | |
#include "src/core/cameras/Tonemap.hpp" | |
#include "src/core/Debug.hpp" | |
#include "src/core/generators/Generator.hpp" | |
#include "src/core/generators/GeneratorFactory.hpp" | |
#include "src/core/generators/HeightField.hpp" | |
#include "src/core/generators/PointCloud.hpp" | |
#include "src/core/grids/Grid.hpp" | |
#include "src/core/grids/GridFactory.hpp" | |
#include "src/core/grids/VdbGrid.hpp" | |
#include "src/core/grids/VdbRaymarcher.hpp" | |
#include "src/core/integrators/bidirectional_path_tracer/BidirectionalPathTraceIntegrator.hpp" | |
#include "src/core/integrators/bidirectional_path_tracer/BidirectionalPathTracer.hpp" | |
#include "src/core/integrators/bidirectional_path_tracer/BidirectionalPathTracerSettings.hpp" | |
#include "src/core/integrators/bidirectional_path_tracer/CameraRecord.hpp" | |
#include "src/core/integrators/bidirectional_path_tracer/EmitterRecord.hpp" | |
#include "src/core/integrators/bidirectional_path_tracer/ImagePyramid.hpp" | |
#include "src/core/integrators/bidirectional_path_tracer/LightPath.hpp" | |
#include "src/core/integrators/bidirectional_path_tracer/MediumRecord.hpp" | |
#include "src/core/integrators/bidirectional_path_tracer/PathEdge.hpp" | |
#include "src/core/integrators/bidirectional_path_tracer/PathVertex.hpp" | |
#include "src/core/integrators/bidirectional_path_tracer/SurfaceRecord.hpp" | |
#include "src/core/integrators/ImageTile.hpp" | |
#include "src/core/integrators/Integrator.hpp" | |
#include "src/core/integrators/IntegratorFactory.hpp" | |
#include "src/core/integrators/kelemen_mlt/KelemenMltIntegrator.hpp" | |
#include "src/core/integrators/kelemen_mlt/KelemenMltSettings.hpp" | |
#include "src/core/integrators/kelemen_mlt/KelemenMltTracer.hpp" | |
#include "src/core/integrators/kelemen_mlt/MetropolisSampler.hpp" | |
#include "src/core/integrators/kelemen_mlt/SplatQueue.hpp" | |
#include "src/core/integrators/light_tracer/LightTraceIntegrator.hpp" | |
#include "src/core/integrators/light_tracer/LightTracer.hpp" | |
#include "src/core/integrators/light_tracer/LightTracerSettings.hpp" | |
#include "src/core/integrators/multiplexed_mlt/ChainTracker.hpp" | |
#include "src/core/integrators/multiplexed_mlt/LargeStepTracker.hpp" | |
#include "src/core/integrators/multiplexed_mlt/MultiplexedMltIntegrator.hpp" | |
#include "src/core/integrators/multiplexed_mlt/MultiplexedMltSettings.hpp" | |
#include "src/core/integrators/multiplexed_mlt/MultiplexedMltTracer.hpp" | |
#include "src/core/integrators/multiplexed_mlt/MultiplexedStats.hpp" | |
#include "src/core/integrators/path_tracer/PathTraceIntegrator.hpp" | |
#include "src/core/integrators/path_tracer/PathTracer.hpp" | |
#include "src/core/integrators/path_tracer/PathTracerSettings.hpp" | |
#include "src/core/integrators/path_tracer/SampleRecord.hpp" | |
#include "src/core/integrators/photon_map/FrustumBinner.hpp" | |
#include "src/core/integrators/photon_map/GridAccel.hpp" | |
#include "src/core/integrators/photon_map/KdTree.hpp" | |
#include "src/core/integrators/photon_map/Photon.hpp" | |
#include "src/core/integrators/photon_map/PhotonMapIntegrator.hpp" | |
#include "src/core/integrators/photon_map/PhotonMapSettings.hpp" | |
#include "src/core/integrators/photon_map/PhotonRange.hpp" | |
#include "src/core/integrators/photon_map/PhotonTracer.hpp" | |
#include "src/core/integrators/progressive_photon_map/ProgressivePhotonMapIntegrator.hpp" | |
#include "src/core/integrators/progressive_photon_map/ProgressivePhotonMapSettings.hpp" | |
#include "src/core/integrators/reversible_jump_mlt/ReversibleJumpMltIntegrator.hpp" | |
#include "src/core/integrators/reversible_jump_mlt/ReversibleJumpMltSettings.hpp" | |
#include "src/core/integrators/reversible_jump_mlt/ReversibleJumpMltTracer.hpp" | |
#include "src/core/integrators/reversible_jump_mlt/WritableMetropolisSampler.hpp" | |
#include "src/core/integrators/TraceBase.hpp" | |
#include "src/core/integrators/TraceSettings.hpp" | |
#include "src/core/integrators/TraceState.hpp" | |
#include "src/core/IntTypes.hpp" | |
#include "src/core/io/CliParser.hpp" | |
#include "src/core/io/CurveIO.hpp" | |
#include "src/core/io/DirectoryChange.hpp" | |
#include "src/core/io/FileIterables.hpp" | |
#include "src/core/io/FileIterator.hpp" | |
#include "src/core/io/FileStreambuf.hpp" | |
#include "src/core/io/FileUtils.hpp" | |
#include "src/core/io/ImageIO.hpp" | |
#include "src/core/io/JsonDocument.hpp" | |
#include "src/core/io/JsonLoadException.hpp" | |
#include "src/core/io/JsonObject.hpp" | |
#include "src/core/io/JsonPtr.hpp" | |
#include "src/core/io/JsonSerializable.hpp" | |
#include "src/core/io/JsonUtils.hpp" | |
#include "src/core/io/MeshIO.hpp" | |
#include "src/core/io/ObjLoader.hpp" | |
#include "src/core/io/ObjMaterial.hpp" | |
#include "src/core/io/Path.hpp" | |
#include "src/core/io/PlyLoader.hpp" | |
#include "src/core/io/RecursiveFileIterator.hpp" | |
#include "src/core/io/Scene.hpp" | |
#include "src/core/io/StringUtils.hpp" | |
#include "src/core/io/TextureCache.hpp" | |
#include "src/core/io/UnicodeUtils.hpp" | |
#include "src/core/io/ZipEntry.hpp" | |
#include "src/core/io/ZipReader.hpp" | |
#include "src/core/io/ZipStreambuf.hpp" | |
#include "src/core/io/ZipWriter.hpp" | |
#include "src/core/Logging.hpp" | |
#include "src/core/media/AtmosphericMedium.hpp" | |
#include "src/core/media/ExponentialMedium.hpp" | |
#include "src/core/media/HomogeneousMedium.hpp" | |
#include "src/core/media/Medium.hpp" | |
#include "src/core/media/MediumFactory.hpp" | |
#include "src/core/media/VoxelMedium.hpp" | |
#include "src/core/MemBuf.hpp" | |
#include "src/core/Memory.hpp" | |
#include "src/core/phasefunctions/HenyeyGreensteinPhaseFunction.hpp" | |
#include "src/core/phasefunctions/IsotropicPhaseFunction.hpp" | |
#include "src/core/phasefunctions/PhaseFunction.hpp" | |
#include "src/core/phasefunctions/PhaseFunctionFactory.hpp" | |
#include "src/core/phasefunctions/RayleighPhaseFunction.hpp" | |
#include "src/core/Platform.hpp" | |
#include "src/core/primitives/Cube.hpp" | |
#include "src/core/primitives/Curves.hpp" | |
#include "src/core/primitives/Disk.hpp" | |
#include "src/core/primitives/EmbreeUtil.hpp" | |
#include "src/core/primitives/InfiniteSphere.hpp" | |
#include "src/core/primitives/InfiniteSphereCap.hpp" | |
#include "src/core/primitives/IntersectionInfo.hpp" | |
#include "src/core/primitives/IntersectionTemporary.hpp" | |
#include "src/core/primitives/mc-loader/BiomeTexture.hpp" | |
#include "src/core/primitives/mc-loader/BlockDescriptor.hpp" | |
#include "src/core/primitives/mc-loader/BlockVariant.hpp" | |
#include "src/core/primitives/mc-loader/CubeFace.hpp" | |
#include "src/core/primitives/mc-loader/CubicElement.hpp" | |
#include "src/core/primitives/mc-loader/EmissiveBvh.hpp" | |
#include "src/core/primitives/mc-loader/MapLoader.hpp" | |
#include "src/core/primitives/mc-loader/Model.hpp" | |
#include "src/core/primitives/mc-loader/ModelRef.hpp" | |
#include "src/core/primitives/mc-loader/ModelResolver.hpp" | |
#include "src/core/primitives/mc-loader/MultiQuadLight.hpp" | |
#include "src/core/primitives/mc-loader/NamedFace.hpp" | |
#include "src/core/primitives/mc-loader/NBT.hpp" | |
#include "src/core/primitives/mc-loader/QuadGeometry.hpp" | |
#include "src/core/primitives/mc-loader/QuadMaterial.hpp" | |
#include "src/core/primitives/mc-loader/ResourcePackLoader.hpp" | |
#include "src/core/primitives/mc-loader/SolidAngleBvh.hpp" | |
#include "src/core/primitives/mc-loader/TexturedQuad.hpp" | |
#include "src/core/primitives/mc-loader/TraceableMinecraftMap.hpp" | |
#include "src/core/primitives/Point.hpp" | |
#include "src/core/primitives/Primitive.hpp" | |
#include "src/core/primitives/PrimitiveFactory.hpp" | |
#include "src/core/primitives/Quad.hpp" | |
#include "src/core/primitives/Skydome.hpp" | |
#include "src/core/primitives/Sphere.hpp" | |
#include "src/core/primitives/Triangle.hpp" | |
#include "src/core/primitives/Triangle4.hpp" | |
#include "src/core/primitives/TriangleMesh.hpp" | |
#include "src/core/primitives/Vertex.hpp" | |
#include "src/core/primitives/VoxelHierarchy.hpp" | |
#include "src/core/primitives/VoxelOctree.hpp" | |
#include "src/core/renderer/RendererSettings.hpp" | |
#include "src/core/renderer/TraceableScene.hpp" | |
#include "src/core/samplerecords/DirectionSample.hpp" | |
#include "src/core/samplerecords/LensSample.hpp" | |
#include "src/core/samplerecords/LightSample.hpp" | |
#include "src/core/samplerecords/MediumSample.hpp" | |
#include "src/core/samplerecords/PhaseSample.hpp" | |
#include "src/core/samplerecords/PositionSample.hpp" | |
#include "src/core/samplerecords/SurfaceScatterEvent.hpp" | |
#include "src/core/sampling/Distribution1D.hpp" | |
#include "src/core/sampling/Distribution2D.hpp" | |
#include "src/core/sampling/InterpolatedDistribution1D.hpp" | |
#include "src/core/sampling/PathSampleGenerator.hpp" | |
#include "src/core/sampling/SampleWarp.hpp" | |
#include "src/core/sampling/SobolPathSampler.hpp" | |
#include "src/core/sampling/UniformPathSampler.hpp" | |
#include "src/core/sampling/UniformSampler.hpp" | |
#include "src/core/sampling/WritablePathSampleGenerator.hpp" | |
#include "src/core/sse/SimdBool.hpp" | |
#include "src/core/sse/SimdFloat.hpp" | |
#include "src/core/sse/SimdUtils.hpp" | |
#include "src/core/sse/SimdVec.hpp" | |
#include "src/core/StringableEnum.hpp" | |
#include "src/core/textures/BitmapTexture.hpp" | |
#include "src/core/textures/BladeTexture.hpp" | |
#include "src/core/textures/CheckerTexture.hpp" | |
#include "src/core/textures/ConstantTexture.hpp" | |
#include "src/core/textures/DiskTexture.hpp" | |
#include "src/core/textures/IesTexture.hpp" | |
#include "src/core/textures/Texture.hpp" | |
#include "src/core/textures/TextureFactory.hpp" | |
#include "src/core/thread/TaskGroup.hpp" | |
#include "src/core/thread/ThreadPool.hpp" | |
#include "src/core/thread/ThreadUtils.hpp" | |
#include "src/core/Timer.hpp" | |
using namespace Tungsten; | |
%} | |
%include <std_shared_ptr.i> | |
%typemap(in) uint32 { | |
$1 = PyLong_AsSsize_t($input); | |
} | |
%typemap(in) std::function<void ()> { | |
$1 = [](){}; | |
} | |
%typemap(in) const Vec3f& { | |
PyObject* x = PyList_GetItem($input, 0); | |
PyObject* y = PyList_GetItem($input, 1); | |
PyObject* z = PyList_GetItem($input, 2); | |
$1 = new Vec3f((float)PyFloat_AsDouble(x), (float)PyFloat_AsDouble(y), (float)PyFloat_AsDouble(z)); | |
} | |
%typemap(out) Vec3f& { | |
PyObject* x = PyFloat_FromDouble($1->x()); | |
PyObject* y = PyFloat_FromDouble($1->y()); | |
PyObject* z = PyFloat_FromDouble($1->z()); | |
$result=PyList_New(3); | |
PyList_SetItem($result,0, x); | |
PyList_SetItem($result,1, y); | |
PyList_SetItem($result,2, z); | |
} | |
%init %{ | |
EmbreeUtil::initDevice(); | |
#ifdef OPENVDB_AVAILABLE | |
openvdb::initialize(); | |
#endif | |
ThreadUtils::startThreads(max(ThreadUtils::idealThreadCount() - 1, 1u)); | |
%} | |
%ignore Tungsten::Path::begin() const; | |
%ignore Tungsten::Path::end() const; | |
%ignore Tungsten::Path::files(const Path &extensionFilter = Path()) const; | |
%ignore Tungsten::Path::directories() const; | |
%ignore Tungsten::Path::recursive() const; | |
%ignore Tungsten::JsonSerializable::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Bsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::ConductorBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::DielectricBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::DiffuseTransmissionBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::ForwardBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::HairBcsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::LambertBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::LambertianFiberBcsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::MirrorBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::MixedBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::NullBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::OrenNayarBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::PhongBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::PlasticBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::RoughCoatBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::RoughConductorBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::RoughDielectricBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::RoughPlasticBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::RoughWireBcsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::SmoothCoatBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::ThinSheetBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::TransparencyBsdf::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Camera::toJson(Allocator &allocator) const; | |
%ignore Tungsten::CubemapCamera::toJson(Allocator &allocator) const; | |
%ignore Tungsten::EquirectangularCamera::toJson(Allocator &allocator) const; | |
%ignore Tungsten::PinholeCamera::toJson(Allocator &allocator) const; | |
%ignore Tungsten::ThinlensCamera::toJson(Allocator &allocator) const; | |
%ignore Tungsten::OutputBufferSettings::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Scene::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Primitive::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Cube::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Curves::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Disk::toJson(Allocator &allocator) const; | |
%ignore Tungsten::InfiniteSphere::toJson(Allocator &allocator) const; | |
%ignore Tungsten::InfiniteSphereCap::toJson(Allocator &allocator) const; | |
%ignore Tungsten::MultiQuadLight::toJson(Allocator &allocator) const; | |
%ignore Tungsten::TraceableMinecraftMap::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Point::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Quad::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Skydome::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Sphere::toJson(Allocator &allocator) const; | |
%ignore Tungsten::TriangleMesh::toJson(Allocator &allocator) const; | |
%ignore Tungsten::Texture::toJson(Allocator &allocator) const; | |
%ignore Tungsten::BitmapTexture::toJson(Allocator &allocator) const; | |
%ignore Tungsten::CheckerTexture::toJson(Allocator &allocator) const; | |
%ignore Tungsten::ConstantTexture::toJson(Allocator &allocator) const; | |
%ignore Tungsten::DiskTexture::toJson(Allocator &allocator) const; | |
%include "src/core/integrators/Integrator.hpp" | |
%include "src/core/renderer/TraceableScene.hpp" | |
%include "src/core/io/Path.hpp" | |
%include "src/core/io/JsonSerializable.hpp" | |
%include "src/core/bsdfs/Bsdf.hpp" | |
%include "src/core/bsdfs/ConductorBsdf.hpp" | |
%include "src/core/bsdfs/DielectricBsdf.hpp" | |
%include "src/core/bsdfs/DiffuseTransmissionBsdf.hpp" | |
%include "src/core/bsdfs/ForwardBsdf.hpp" | |
%include "src/core/bsdfs/HairBcsdf.hpp" | |
%include "src/core/bsdfs/LambertBsdf.hpp" | |
%include "src/core/bsdfs/LambertianFiberBcsdf.hpp" | |
%include "src/core/bsdfs/MirrorBsdf.hpp" | |
%include "src/core/bsdfs/MixedBsdf.hpp" | |
%include "src/core/bsdfs/NullBsdf.hpp" | |
%include "src/core/bsdfs/OrenNayarBsdf.hpp" | |
%include "src/core/bsdfs/PhongBsdf.hpp" | |
%include "src/core/bsdfs/PlasticBsdf.hpp" | |
%include "src/core/bsdfs/RoughCoatBsdf.hpp" | |
%include "src/core/bsdfs/RoughConductorBsdf.hpp" | |
%include "src/core/bsdfs/RoughDielectricBsdf.hpp" | |
%include "src/core/bsdfs/RoughPlasticBsdf.hpp" | |
%include "src/core/bsdfs/RoughWireBcsdf.hpp" | |
%include "src/core/bsdfs/SmoothCoatBsdf.hpp" | |
%include "src/core/bsdfs/ThinSheetBsdf.hpp" | |
%include "src/core/bsdfs/TransparencyBsdf.hpp" | |
%include "src/core/cameras/Camera.hpp" | |
%include "src/core/cameras/CubemapCamera.hpp" | |
%include "src/core/cameras/EquirectangularCamera.hpp" | |
%include "src/core/cameras/PinholeCamera.hpp" | |
%include "src/core/cameras/ThinlensCamera.hpp" | |
%include "src/core/io/Scene.hpp" | |
%include "src/core/primitives/Primitive.hpp" | |
%include "src/core/primitives/Cube.hpp" | |
%include "src/core/primitives/Curves.hpp" | |
%include "src/core/primitives/Disk.hpp" | |
%include "src/core/primitives/InfiniteSphere.hpp" | |
%include "src/core/primitives/InfiniteSphereCap.hpp" | |
%include "src/core/primitives/Point.hpp" | |
%include "src/core/primitives/Quad.hpp" | |
%include "src/core/primitives/Skydome.hpp" | |
%include "src/core/primitives/Sphere.hpp" | |
%include "src/core/primitives/TriangleMesh.hpp" | |
%include "src/core/textures/Texture.hpp" | |
%include "src/core/textures/BitmapTexture.hpp" | |
%include "src/core/textures/BladeTexture.hpp" | |
%include "src/core/textures/CheckerTexture.hpp" | |
%include "src/core/textures/ConstantTexture.hpp" | |
%include "src/core/textures/DiskTexture.hpp" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment