Merging r43130 through r43500 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 18 Jan 2012 17:25:05 +0000 (17:25 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 18 Jan 2012 17:25:05 +0000 (17:25 +0000)
690 files changed:
CMakeLists.txt
SConstruct
build_files/cmake/RpmBuild.cmake
build_files/cmake/config/blender_lite.cmake
build_files/cmake/project_info.py
build_files/cmake/project_source_info.py
build_files/scons/config/freebsd7-config.py
build_files/scons/config/freebsd8-config.py
build_files/scons/config/freebsd9-config.py
build_files/scons/config/linux-config.py
build_files/scons/config/win32-mingw-config.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/btools.py
doc/python_api/examples/bpy.types.Menu.1.py
doc/python_api/examples/bpy.types.Menu.py
doc/python_api/examples/bpy.types.Operator.4.py
doc/python_api/examples/bpy.types.Operator.5.py
doc/python_api/examples/bpy.types.Panel.1.py
doc/python_api/rst/bge.texture.rst
doc/python_api/rst/bge.types.rst
doc/python_api/rst/info_best_practice.rst
doc/python_api/rst/info_overview.rst
doc/python_api/rst/info_quickstart.rst
doc/python_api/rst/info_tips_and_tricks.rst
extern/CMakeLists.txt
extern/SConscript
extern/carve/CMakeLists.txt [new file with mode: 0644]
extern/carve/LICENSE.GPL2 [new file with mode: 0644]
extern/carve/SConscript [new file with mode: 0644]
extern/carve/bundle.sh [new file with mode: 0755]
extern/carve/files.txt [new file with mode: 0644]
extern/carve/include/carve/aabb.hpp [new file with mode: 0644]
extern/carve/include/carve/aabb_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/carve.hpp [new file with mode: 0644]
extern/carve/include/carve/cbrt.h [new file with mode: 0644]
extern/carve/include/carve/classification.hpp [new file with mode: 0644]
extern/carve/include/carve/collection.hpp [new file with mode: 0644]
extern/carve/include/carve/collection/unordered.hpp [new file with mode: 0644]
extern/carve/include/carve/collection/unordered/boost_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/collection/unordered/fallback_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/collection/unordered/libstdcpp_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/collection/unordered/std_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/collection/unordered/tr1_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/collection/unordered/vcpp_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/collection_types.hpp [new file with mode: 0644]
extern/carve/include/carve/colour.hpp [new file with mode: 0644]
extern/carve/include/carve/config.h [new file with mode: 0644]
extern/carve/include/carve/convex_hull.hpp [new file with mode: 0644]
extern/carve/include/carve/csg.hpp [new file with mode: 0644]
extern/carve/include/carve/csg_triangulator.hpp [new file with mode: 0644]
extern/carve/include/carve/debug_hooks.hpp [new file with mode: 0644]
extern/carve/include/carve/djset.hpp [new file with mode: 0644]
extern/carve/include/carve/edge_decl.hpp [new file with mode: 0644]
extern/carve/include/carve/edge_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/exact.hpp [new file with mode: 0644]
extern/carve/include/carve/face_decl.hpp [new file with mode: 0644]
extern/carve/include/carve/face_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/faceloop.hpp [new file with mode: 0644]
extern/carve/include/carve/geom.hpp [new file with mode: 0644]
extern/carve/include/carve/geom2d.hpp [new file with mode: 0644]
extern/carve/include/carve/geom3d.hpp [new file with mode: 0644]
extern/carve/include/carve/geom_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/gnu_cxx.h [new file with mode: 0644]
extern/carve/include/carve/heap.hpp [new file with mode: 0644]
extern/carve/include/carve/input.hpp [new file with mode: 0644]
extern/carve/include/carve/interpolator.hpp [new file with mode: 0644]
extern/carve/include/carve/intersection.hpp [new file with mode: 0644]
extern/carve/include/carve/iobj.hpp [new file with mode: 0644]
extern/carve/include/carve/kd_node.hpp [new file with mode: 0644]
extern/carve/include/carve/math.hpp [new file with mode: 0644]
extern/carve/include/carve/math_constants.hpp [new file with mode: 0644]
extern/carve/include/carve/matrix.hpp [new file with mode: 0644]
extern/carve/include/carve/mesh.hpp [new file with mode: 0644]
extern/carve/include/carve/mesh_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/mesh_ops.hpp [new file with mode: 0644]
extern/carve/include/carve/mesh_simplify.hpp [new file with mode: 0644]
extern/carve/include/carve/octree_decl.hpp [new file with mode: 0644]
extern/carve/include/carve/octree_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/pointset.hpp [new file with mode: 0644]
extern/carve/include/carve/pointset_decl.hpp [new file with mode: 0644]
extern/carve/include/carve/pointset_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/pointset_iter.hpp [new file with mode: 0644]
extern/carve/include/carve/poly.hpp [new file with mode: 0644]
extern/carve/include/carve/poly_decl.hpp [new file with mode: 0644]
extern/carve/include/carve/poly_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/polyhedron_base.hpp [new file with mode: 0644]
extern/carve/include/carve/polyhedron_decl.hpp [new file with mode: 0644]
extern/carve/include/carve/polyhedron_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/polyline.hpp [new file with mode: 0644]
extern/carve/include/carve/polyline_decl.hpp [new file with mode: 0644]
extern/carve/include/carve/polyline_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/polyline_iter.hpp [new file with mode: 0644]
extern/carve/include/carve/rescale.hpp [new file with mode: 0644]
extern/carve/include/carve/rtree.hpp [new file with mode: 0644]
extern/carve/include/carve/spacetree.hpp [new file with mode: 0644]
extern/carve/include/carve/tag.hpp [new file with mode: 0644]
extern/carve/include/carve/timing.hpp [new file with mode: 0644]
extern/carve/include/carve/tree.hpp [new file with mode: 0644]
extern/carve/include/carve/triangulator.hpp [new file with mode: 0644]
extern/carve/include/carve/triangulator_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/util.hpp [new file with mode: 0644]
extern/carve/include/carve/vcpp_config.h [new file with mode: 0644]
extern/carve/include/carve/vector.hpp [new file with mode: 0644]
extern/carve/include/carve/vertex_decl.hpp [new file with mode: 0644]
extern/carve/include/carve/vertex_impl.hpp [new file with mode: 0644]
extern/carve/include/carve/win32.h [new file with mode: 0755]
extern/carve/lib/aabb.cpp [new file with mode: 0644]
extern/carve/lib/carve.cpp [new file with mode: 0644]
extern/carve/lib/convex_hull.cpp [new file with mode: 0644]
extern/carve/lib/csg.cpp [new file with mode: 0644]
extern/carve/lib/csg_collector.cpp [new file with mode: 0644]
extern/carve/lib/csg_collector.hpp [new file with mode: 0644]
extern/carve/lib/csg_data.hpp [new file with mode: 0644]
extern/carve/lib/csg_detail.hpp [new file with mode: 0644]
extern/carve/lib/edge.cpp [new file with mode: 0644]
extern/carve/lib/face.cpp [new file with mode: 0644]
extern/carve/lib/geom2d.cpp [new file with mode: 0644]
extern/carve/lib/geom3d.cpp [new file with mode: 0644]
extern/carve/lib/intersect.cpp [new file with mode: 0644]
extern/carve/lib/intersect_classify_common.hpp [new file with mode: 0644]
extern/carve/lib/intersect_classify_common_impl.hpp [new file with mode: 0644]
extern/carve/lib/intersect_classify_edge.cpp [new file with mode: 0644]
extern/carve/lib/intersect_classify_group.cpp [new file with mode: 0644]
extern/carve/lib/intersect_common.hpp [new file with mode: 0644]
extern/carve/lib/intersect_debug.cpp [new file with mode: 0644]
extern/carve/lib/intersect_debug.hpp [new file with mode: 0644]
extern/carve/lib/intersect_face_division.cpp [new file with mode: 0644]
extern/carve/lib/intersect_group.cpp [new file with mode: 0644]
extern/carve/lib/intersect_half_classify_group.cpp [new file with mode: 0644]
extern/carve/lib/intersection.cpp [new file with mode: 0644]
extern/carve/lib/math.cpp [new file with mode: 0644]
extern/carve/lib/mesh.cpp [new file with mode: 0644]
extern/carve/lib/octree.cpp [new file with mode: 0644]
extern/carve/lib/pointset.cpp [new file with mode: 0644]
extern/carve/lib/polyhedron.cpp [new file with mode: 0644]
extern/carve/lib/polyline.cpp [new file with mode: 0644]
extern/carve/lib/tag.cpp [new file with mode: 0644]
extern/carve/lib/timing.cpp [new file with mode: 0644]
extern/carve/lib/triangulator.cpp [new file with mode: 0644]
extern/carve/mkfiles.sh [new file with mode: 0755]
extern/carve/patches/files/config.h [new file with mode: 0644]
extern/carve/patches/files/random.hpp [new file with mode: 0644]
extern/carve/patches/gcc46.patch [new file with mode: 0644]
extern/carve/patches/includes.patch [new file with mode: 0644]
extern/carve/patches/mesh_iterator.patch [new file with mode: 0644]
extern/carve/patches/mingw.patch [new file with mode: 0644]
extern/carve/patches/series [new file with mode: 0644]
extern/carve/patches/strict_flags.patch [new file with mode: 0644]
extern/carve/patches/win32.patch [new file with mode: 0644]
extern/libmv/CMakeLists.txt
extern/libmv/SConscript
extern/libmv/bundle.sh
extern/libmv/third_party/glog/src/stacktrace_x86_64-inl.h
extern/libmv/third_party/glog/src/utilities.cc
intern/boolop/CMakeLists.txt
intern/boolop/SConscript
intern/boolop/intern/BOP_BSPNode.cpp
intern/boolop/intern/BOP_BSPNode.h
intern/boolop/intern/BOP_BSPTree.cpp
intern/boolop/intern/BOP_CarveInterface.cpp [new file with mode: 0644]
intern/boolop/intern/BOP_Edge.cpp
intern/boolop/intern/BOP_Face.h
intern/boolop/intern/BOP_Indexs.h
intern/boolop/intern/BOP_Interface.cpp
intern/boolop/intern/BOP_MathUtils.cpp
intern/boolop/intern/BOP_Merge.h
intern/boolop/intern/BOP_Merge2.h
intern/boolop/intern/BOP_Mesh.h
intern/boolop/intern/BOP_Segment.cpp
intern/boolop/intern/BOP_Segment.h
intern/boolop/intern/BOP_Splitter.cpp
intern/boolop/intern/BOP_Triangulator.cpp
intern/cycles/app/cycles_server.cpp
intern/cycles/app/cycles_test.cpp
intern/cycles/app/cycles_xml.cpp
intern/cycles/blender/CCL_api.h [new file with mode: 0644]
intern/cycles/blender/CMakeLists.txt
intern/cycles/blender/addon/__init__.py
intern/cycles/blender/addon/engine.py
intern/cycles/blender/addon/enums.py
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_object.cpp
intern/cycles/blender/blender_python.cpp
intern/cycles/blender/blender_session.cpp
intern/cycles/blender/blender_session.h
intern/cycles/blender/blender_shader.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/blender/blender_sync.h
intern/cycles/bvh/bvh.cpp
intern/cycles/bvh/bvh.h
intern/cycles/bvh/bvh_params.h
intern/cycles/device/device.cpp
intern/cycles/device/device.h
intern/cycles/device/device_cpu.cpp
intern/cycles/device/device_cuda.cpp
intern/cycles/device/device_intern.h
intern/cycles/device/device_memory.h
intern/cycles/device/device_multi.cpp
intern/cycles/device/device_network.cpp
intern/cycles/device/device_opencl.cpp
intern/cycles/kernel/CMakeLists.txt
intern/cycles/kernel/svm/svm.h
intern/cycles/kernel/svm/svm_checker.h [new file with mode: 0644]
intern/cycles/kernel/svm/svm_musgrave.h
intern/cycles/kernel/svm/svm_types.h
intern/cycles/render/buffers.cpp
intern/cycles/render/mesh.cpp
intern/cycles/render/mesh_displace.cpp
intern/cycles/render/nodes.cpp
intern/cycles/render/nodes.h
intern/cycles/render/session.cpp
intern/cycles/render/session.h
intern/cycles/render/tile.cpp
intern/cycles/util/util_cache.cpp
intern/cycles/util/util_cache.h
intern/cycles/util/util_progress.h
intern/ghost/GHOST_ISystem.h
intern/ghost/intern/GHOST_DisplayManagerSDL.cpp
intern/ghost/intern/GHOST_DisplayManagerX11.cpp
intern/ghost/intern/GHOST_System.cpp
intern/ghost/intern/GHOST_System.h
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/test/CMakeLists.txt
release/scripts/modules/addon_utils.py
release/scripts/modules/animsys_refactor.py
release/scripts/modules/bpy/utils.py
release/scripts/modules/bpy_extras/keyconfig_utils.py
release/scripts/modules/rna_xml.py
release/scripts/presets/ffmpeg/DV.py
release/scripts/presets/ffmpeg/DVD.py
release/scripts/presets/ffmpeg/SVCD.py
release/scripts/presets/ffmpeg/VCD.py
release/scripts/presets/ffmpeg/h264.py
release/scripts/presets/ffmpeg/theora.py
release/scripts/presets/ffmpeg/xvid.py
release/scripts/presets/keyconfig/maya.py
release/scripts/startup/bl_operators/clip.py
release/scripts/startup/bl_operators/mesh.py
release/scripts/startup/bl_operators/presets.py
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/__init__.py
release/scripts/startup/bl_ui/properties_data_curve.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/properties_object_constraint.py
release/scripts/startup/bl_ui/properties_paint_common.py [new file with mode: 0644]
release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
release/scripts/startup/bl_ui/properties_physics_fluid.py
release/scripts/startup/bl_ui/properties_render.py
release/scripts/startup/bl_ui/properties_scene.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_clip.py
release/scripts/startup/bl_ui/space_dopesheet.py
release/scripts/startup/bl_ui/space_graph.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_info.py
release/scripts/startup/bl_ui/space_logic.py
release/scripts/startup/bl_ui/space_nla.py
release/scripts/startup/bl_ui/space_node.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_time.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
release/scripts/templates/addon_add_object.py
source/blender/blenfont/BLF_api.h
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_glyph.c
source/blender/blenfont/intern/blf_lang.c
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/BKE_array_mallocn.h [deleted file]
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_brush.h
source/blender/blenkernel/BKE_cloth.h
source/blender/blenkernel/BKE_deform.h
source/blender/blenkernel/BKE_main.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_movieclip.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/BKE_text.h
source/blender/blenkernel/BKE_tracking.h
source/blender/blenkernel/BKE_writeavi.h
source/blender/blenkernel/BKE_writeffmpeg.h
source/blender/blenkernel/BKE_writeframeserver.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/boids.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/property.c
source/blender/blenkernel/intern/sca.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenkernel/intern/writeavi.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/blenkernel/intern/writeframeserver.c
source/blender/blenlib/BLI_editVert.h
source/blender/blenlib/BLI_fnmatch.h
source/blender/blenlib/BLI_math_color.h
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/BLI_utildefines.h
source/blender/blenlib/intern/boxpack2d.c
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/math_color.c
source/blender/blenlib/intern/math_color_inline.c
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/storage.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/animation/keyframing.c
source/blender/editors/armature/armature_intern.h
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/armature/poseSlide.c
source/blender/editors/armature/poselib.c
source/blender/editors/armature/poseobject.c
source/blender/editors/armature/reeb.c
source/blender/editors/curve/curve_intern.h
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editcurve.c
source/blender/editors/curve/editfont.c
source/blender/editors/datafiles/Bfont.c
source/blender/editors/gpencil/gpencil_buttons.c
source/blender/editors/gpencil/gpencil_ops.c
source/blender/editors/include/ED_armature.h
source/blender/editors/include/ED_image.h
source/blender/editors/include/ED_mesh.h
source/blender/editors/include/ED_uvedit.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_resources.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_style.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/resources.c
source/blender/editors/interface/view2d.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mesh/editmesh.c
source/blender/editors/mesh/editmesh_lib.c
source/blender/editors/mesh/editmesh_loop.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/loopcut.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/metaball/mball_intern.h
source/blender/editors/metaball/mball_ops.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_group.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/object/object_transform.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/physics/physics_intern.h
source/blender/editors/physics/physics_ops.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_opengl.c
source/blender/editors/render/render_preview.c
source/blender/editors/render/render_shading.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/CMakeLists.txt
source/blender/editors/sculpt_paint/SConscript
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_uv.c [new file with mode: 0644]
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_buttons/buttons_ops.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/clip_editor.c
source/blender/editors/space_clip/clip_graph_draw.c
source/blender/editors/space_clip/clip_graph_ops.c
source/blender/editors/space_clip/clip_intern.h
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/clip_utils.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_console/console_ops.c
source/blender/editors/space_console/space_console.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/filesel.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/space_graph/graph_select.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_intern.h
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/info_ops.c
source/blender/editors/space_logic/logic_ops.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_nla/nla_ops.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_intern.h
source/blender/editors/space_node/node_ops.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_ops.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_intern.h
source/blender/editors/space_sequencer/sequencer_ops.c
source/blender/editors/space_sequencer/sequencer_scopes.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_text/text_intern.h
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_view3d/drawanimviz.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/util/ed_util.c
source/blender/editors/util/numinput.c
source/blender/editors/util/undo.c
source/blender/editors/uvedit/CMakeLists.txt
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_intern.h
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_parametrizer.c
source/blender/editors/uvedit/uvedit_smart_stitch.c [new file with mode: 0644]
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/GPU_extensions.h
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_material.c
source/blender/imbuf/IMB_imbuf.h
source/blender/imbuf/intern/anim_movie.c
source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
source/blender/imbuf/intern/divers.c
source/blender/imbuf/intern/indexer.c
source/blender/imbuf/intern/tiff.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_actuator_types.h
source/blender/makesdna/DNA_armature_types.h
source/blender/makesdna/DNA_brush_types.h
source/blender/makesdna/DNA_constraint_types.h
source/blender/makesdna/DNA_controller_types.h
source/blender/makesdna/DNA_customdata_types.h
source/blender/makesdna/DNA_defs.h
source/blender/makesdna/DNA_dynamicpaint_types.h
source/blender/makesdna/DNA_effect_types.h
source/blender/makesdna/DNA_image_types.h
source/blender/makesdna/DNA_key_types.h
source/blender/makesdna/DNA_lattice_types.h
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_meta_types.h
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesdna/DNA_movieclip_types.h
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_object_force.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_particle_types.h
source/blender/makesdna/DNA_property_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_sensor_types.h
source/blender/makesdna/DNA_sequence_types.h
source/blender/makesdna/DNA_sound_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_texture_types.h
source/blender/makesdna/DNA_tracking_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/SConscript
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/SConscript
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_actuator.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_dynamicpaint.c
source/blender/makesrna/intern/rna_fluidsim.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_nodetree_types.h
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_property.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_tracking.c
source/blender/makesrna/intern/rna_ui.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm.c
source/blender/modifiers/intern/MOD_armature.c
source/blender/modifiers/intern/MOD_bevel.c
source/blender/modifiers/intern/MOD_boolean.c
source/blender/modifiers/intern/MOD_cast.c
source/blender/modifiers/intern/MOD_curve.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_lattice.c
source/blender/modifiers/intern/MOD_smooth.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/modifiers/intern/MOD_util.c
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/modifiers/intern/MOD_wave.c
source/blender/modifiers/intern/MOD_weightvg_util.c
source/blender/modifiers/intern/MOD_weightvg_util.h
source/blender/nodes/CMakeLists.txt
source/blender/nodes/NOD_composite.h
source/blender/nodes/NOD_shader.h
source/blender/nodes/composite/node_composite_tree.c
source/blender/nodes/composite/node_composite_util.c
source/blender/nodes/composite/node_composite_util.h
source/blender/nodes/composite/nodes/node_composite_blur.c
source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c [new file with mode: 0644]
source/blender/nodes/intern/node_common.c
source/blender/nodes/shader/node_shader_util.c
source/blender/nodes/shader/nodes/node_shader_tex_checker.c [new file with mode: 0644]
source/blender/nodes/texture/nodes/node_texture_output.c
source/blender/python/SConscript
source/blender/python/generic/bpy_internal_import.c
source/blender/python/generic/idprop_py_api.c
source/blender/python/intern/CMakeLists.txt
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_props.c
source/blender/python/intern/bpy_rna.c
source/blender/python/mathutils/mathutils_Matrix.c
source/blender/quicktime/apple/qtkit_export.m
source/blender/render/CMakeLists.txt
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/include/render_result.h [new file with mode: 0644]
source/blender/render/intern/include/render_types.h
source/blender/render/intern/include/renderpipeline.h
source/blender/render/intern/raytrace/rayobject.cpp
source/blender/render/intern/raytrace/rayobject_blibvh.cpp
source/blender/render/intern/raytrace/rayobject_empty.cpp
source/blender/render/intern/raytrace/rayobject_instance.cpp
source/blender/render/intern/raytrace/rayobject_octree.cpp
source/blender/render/intern/raytrace/rayobject_qbvh.cpp
source/blender/render/intern/raytrace/rayobject_svbvh.cpp
source/blender/render/intern/raytrace/rayobject_vbvh.cpp
source/blender/render/intern/raytrace/vbvh.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/external_engine.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/render_result.c [new file with mode: 0644]
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_dragdrop.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_jobs.c
source/blender/windowmanager/intern/wm_keymap.c
source/blender/windowmanager/intern/wm_operators.c
source/blenderplayer/CMakeLists.txt
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt
source/creator/creator.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/Converter/KX_ConvertProperties.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
source/gameengine/GameLogic/SCA_ILogicBrick.h
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.h
source/gameengine/GameLogic/SCA_PropertyActuator.cpp
source/gameengine/GameLogic/SCA_PropertySensor.cpp
source/gameengine/GameLogic/SCA_RandomActuator.cpp
source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
source/gameengine/GamePlayer/ghost/GPG_Application.cpp
source/gameengine/GamePlayer/ghost/GPG_Application.h
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
source/gameengine/Ketsji/KX_CameraActuator.cpp
source/gameengine/Ketsji/KX_CameraActuator.h
source/gameengine/Ketsji/KX_ConstraintActuator.cpp
source/gameengine/Ketsji/KX_FontObject.cpp
source/gameengine/Ketsji/KX_IpoActuator.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_RaySensor.cpp
source/gameengine/Ketsji/KX_SceneActuator.cpp
source/gameengine/Ketsji/KX_TouchSensor.cpp
source/gameengine/Rasterizer/RAS_TexVert.cpp
source/tests/bl_mesh_modifiers.py [new file with mode: 0644]

index 01d81eb..fb6b946 100644 (file)
@@ -156,7 +156,7 @@ endif()
 
 if(UNIX AND NOT APPLE)
        option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)"   ON)
-       option(WITH_X11_XF86VMODE "Enable X11 video mode switching"     OFF)
+       option(WITH_X11_XF86VMODE "Enable X11 video mode switching"     ON)
        option(WITH_BUILTIN_GLEW "Use GLEW OpenGL wrapper library bundled with blender" ON)
        option(WITH_XDG_USER_DIRS    "Build with XDG Base Directory Specification (only config and documents for now)" OFF)
        mark_as_advanced(WITH_XDG_USER_DIRS)
@@ -208,6 +208,9 @@ option(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)"
 # Camera/motion tracking
 option(WITH_LIBMV         "Enable libmv structure from motion library" ON)
 
+# Mesh boolean lib
+option(WITH_CARVE         "Enable Carve library to handle mesh boolean operations" ON)
+
 # Misc
 option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
 option(WITH_RAYOPTIMIZATION    "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
@@ -270,8 +273,8 @@ if(NOT WITH_SDL AND WITH_GHOST_SDL)
        message(FATAL_ERROR "WITH_GHOST_SDL requires WITH_SDL to be ON")
 endif()
 
-if(NOT WITH_IMAGE_OPENJPEG AND WITH_IMAGE_REDCODE)
-       message(FATAL_ERROR "WITH_IMAGE_REDCODE requires WITH_IMAGE_OPENJPEG")
+if(WITH_IMAGE_REDCODE AND ((NOT WITH_IMAGE_OPENJPEG) OR (NOT WITH_CODEC_FFMPEG)))
+       message(FATAL_ERROR "WITH_IMAGE_REDCODE requires WITH_IMAGE_OPENJPEG and WITH_CODEC_FFMPEG")
 endif()
 
 # python module, needs some different options
@@ -300,9 +303,13 @@ if(WITH_PYTHON_MODULE)
        set(WITH_HEADLESS ON)
 endif()
 
-# auto enable openimageio and boost for cycles
+# auto enable openimageio for cycles
 if(WITH_CYCLES)
        set(WITH_OPENIMAGEIO ON)
+endif()
+
+# auto enable boost for cycles and carve
+if(WITH_CYCLES OR WITH_CARVE)
        set(WITH_BOOST ON)
 endif()
 
@@ -461,7 +468,8 @@ if(UNIX AND NOT APPLE)
                # use lib dir if available and nothing else specified
                if(LIBDIR AND NOT FFMPEG)
                        set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory")
-                       set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale dirac_encoder mp3lame ogg orc-0.4 schroedinger-1.0 theora theoraenc theoradec vorbis vorbisenc vpx x264 xvidcore faad asound CACHE STRING "FFMPEG Libraries")
+                       # XXX, some distros might need 'theoraenc theoradec' too
+                       set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale dirac_encoder mp3lame ogg orc-0.4 schroedinger-1.0 theora vorbis vorbisenc vpx x264 xvidcore faad asound CACHE STRING "FFMPEG Libraries")
                else()
                        set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
                        set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
@@ -619,6 +627,10 @@ if(UNIX AND NOT APPLE)
        # CLang is the same as GCC for now.
        elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
                set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
+       # Solaris CC
+       elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro") 
+               set(PLATFORM_CFLAGS "-pipe -features=extensions -fPIC -D__FUNCTION__=__func__")
+               
        # Intel C++ Compiler
        elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
                # think these next two are broken
@@ -711,8 +723,8 @@ elseif(WIN32)
 
                add_definitions(/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB)
 
-               set(CMAKE_CXX_FLAGS "/nologo /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013" CACHE STRING "MSVC MT C++ flags " FORCE)
-               set(CMAKE_C_FLAGS   "/nologo /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE)
+               set(CMAKE_CXX_FLAGS "/nologo /J /W1 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013" CACHE STRING "MSVC MT C++ flags " FORCE)
+               set(CMAKE_C_FLAGS   "/nologo /J /W1 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE)
 
                if(CMAKE_CL_64)
                        set(CMAKE_CXX_FLAGS_DEBUG "/Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
@@ -1026,9 +1038,13 @@ elseif(WIN32)
                        set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
                        set(OPENIMAGEIO_DEFINITIONS)
                endif()
-
+               
                set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
 
+               ## DISABLE - causes linking errors 
+               ## for re-distrobution, so users dont need mingw installed
+               # set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-libgcc -static-libstdc++")
+
        endif()
 
        # used in many places so include globally, like OpenGL
@@ -1076,16 +1092,28 @@ elseif(APPLE)
        endif()
 
        if(WITH_PYTHON)
-               # we use precompiled libraries for py 3.2 and up by default
+               if(NOT WITH_PYTHON_MODULE)
+                       # we use precompiled libraries for py 3.2 and up by default
 
-               # normally cached but not since we include them with blender
-               set(PYTHON_VERSION 3.2)
-               set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
-               # set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
-               set(PYTHON_LIBRARY python${PYTHON_VERSION})
-               set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
-               # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
+                       # normally cached but not since we include them with blender
+                       set(PYTHON_VERSION 3.2)
+                       set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
+                       # set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
+                       set(PYTHON_LIBRARY python${PYTHON_VERSION})
+                       set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
+                       # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
+               else()
+                       # module must be compiled against Python framework
 
+                       # normally cached but not since we include them with blender
+                       set(PYTHON_VERSION 3.2)
+                       set(PYTHON_INCLUDE_DIR "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}m")
+                       set(PYTHON_BINARY "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
+                       #set(PYTHON_LIBRARY python${PYTHON_VERSION})
+                       set(PYTHON_LIBPATH "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config-3.2m")
+                       #set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python")  # won't  build with this enabled
+               endif()
+               
                # uncached vars
                set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
                set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
@@ -1180,7 +1208,11 @@ elseif(APPLE)
                set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
                set(WITH_INPUT_NDOF OFF)  # unsupported
        endif()
-
+       
+       if(WITH_PYTHON_MODULE)
+               set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/python")# force cmake to link right framework
+       endif()
+       
        if(WITH_OPENCOLLADA)
                set(OPENCOLLADA ${LIBDIR}/opencollada)
 
index ee43015..0dd59ad 100644 (file)
@@ -147,9 +147,8 @@ if toolset:
         env.Tool('mstoolkit', [toolpath])
     else:
         env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
-        # xxx commented out, as was supressing warnings under mingw..
-        #if env:
-        #    btools.SetupSpawn(env)
+        if env:
+            btools.SetupSpawn(env)
 else:
     if bitness==64 and platform=='win32':
         env = BlenderEnvironment(ENV = os.environ, MSVS_ARCH='amd64')
index 2fdd0a7..f46c41e 100644 (file)
@@ -13,7 +13,7 @@ if(NOT DEFINED RPMBUILD)
 
        if(RPMBUILD)
                message(STATUS "RPM Build Found: ${RPMBUILD}")
-       else(RPMBUILD
+       else() 
                message(STATUS "RPM Build Not Found (rpmbuild). RPM generation will not be available")
        endif()
 
@@ -21,6 +21,6 @@ endif()
 
 if(RPMBUILD)
        set(RPMBUILD_FOUND TRUE)
-else(RPMBUILD
+else() 
        set(RPMBUILD_FOUND FALSE)
 endif()
\ No newline at end of file
index 26fa762..e72a0ff 100644 (file)
@@ -15,6 +15,7 @@ set(WITH_CODEC_SNDFILE       OFF CACHE FORCE BOOL)
 set(WITH_CYCLES              OFF CACHE FORCE BOOL)
 set(WITH_FFTW3               OFF CACHE FORCE BOOL)
 set(WITH_LIBMV               OFF CACHE FORCE BOOL)
+set(WITH_CARVE               OFF CACHE FORCE BOOL)
 set(WITH_GAMEENGINE          OFF CACHE FORCE BOOL)
 set(WITH_IK_ITASC            OFF CACHE FORCE BOOL)
 set(WITH_IMAGE_CINEON        OFF CACHE FORCE BOOL)
@@ -33,6 +34,7 @@ set(WITH_LZO                 OFF CACHE FORCE BOOL)
 set(WITH_MOD_BOOLEAN         OFF CACHE FORCE BOOL)
 set(WITH_MOD_DECIMATE        OFF CACHE FORCE BOOL)
 set(WITH_MOD_FLUID           OFF CACHE FORCE BOOL)
+set(WITH_MOD_REMESH          OFF CACHE FORCE BOOL)
 set(WITH_MOD_SMOKE           OFF CACHE FORCE BOOL)
 set(WITH_MOD_OCEANSIM        OFF CACHE FORCE BOOL)
 set(WITH_AUDASPACE           OFF CACHE FORCE BOOL)
@@ -43,3 +45,4 @@ set(WITH_PYTHON_INSTALL      OFF CACHE FORCE BOOL)
 set(WITH_RAYOPTIMIZATION     OFF CACHE FORCE BOOL)
 set(WITH_SDL                 OFF CACHE FORCE BOOL)
 set(WITH_X11_XINPUT          OFF CACHE FORCE BOOL)
+set(WITH_X11_XF86VMODE       OFF CACHE FORCE BOOL)
index 65afd10..77574f1 100755 (executable)
@@ -133,7 +133,7 @@ def cmake_advanced_info():
     """ Extracr includes and defines from cmake.
     """
 
-    def create_eclipse_project(CMAKE_DIR):
+    def create_eclipse_project():
         print("CMAKE_DIR %r" % CMAKE_DIR)
         if sys.platform == "win32":
             cmd = 'cmake "%s" -G"Eclipse CDT4 - MinGW Makefiles"' % CMAKE_DIR
@@ -145,7 +145,7 @@ def cmake_advanced_info():
     includes = []
     defines = []
 
-    create_eclipse_project(CMAKE_DIR)
+    create_eclipse_project()
 
     from xml.dom.minidom import parse
     tree = parse(join(CMAKE_DIR, ".cproject"))
index a39ed94..ed17ec5 100644 (file)
@@ -160,7 +160,6 @@ def build_info(use_c=True, use_cxx=True, ignore_prefix_list=None):
 def queue_processes(process_funcs, job_total=-1):
     """ Takes a list of function arg pairs, each function must return a process
     """
-    import sys
 
     if job_total == -1:
         import multiprocessing
index bf77806..7826ca2 100644 (file)
@@ -117,7 +117,7 @@ BF_FFMPEG_INC = '${BF_FFMPEG}/include'
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 
 # enable ogg, vorbis and theora in ffmpeg
-WITH_BF_OGG = True  # -DWITH_OGG 
+WITH_BF_OGG = True
 BF_OGG = '/usr/local'
 BF_OGG_INC = '${BF_OGG}/include'
 BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
index 738f14a..f2d5cf2 100644 (file)
@@ -117,7 +117,7 @@ BF_FFMPEG_INC = '${BF_FFMPEG}/include'
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 
 # enable ogg, vorbis and theora in ffmpeg
-WITH_BF_OGG = True  # -DWITH_OGG 
+WITH_BF_OGG = True
 BF_OGG = '/usr/local'
 BF_OGG_INC = '${BF_OGG}/include'
 BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
index f40fc33..ea321b1 100644 (file)
@@ -117,7 +117,7 @@ BF_FFMPEG_INC = '${BF_FFMPEG}/include'
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 
 # enable ogg, vorbis and theora in ffmpeg
-WITH_BF_OGG = True  # -DWITH_OGG 
+WITH_BF_OGG = True
 BF_OGG = '/usr/local'
 BF_OGG_INC = '${BF_OGG}/include'
 BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
index 6964ff9..fdef856 100644 (file)
@@ -140,7 +140,7 @@ BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 #BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH/libavcodec.a ${BF_FFMPEG_LIBPATH}/libswscale.a ${BF_FFMPEG_LIBPATH}/libavutil.a ${BF_FFMPEG_LIBPATH}/libavdevice.a'
 
 # enable ogg, vorbis and theora in ffmpeg
-WITH_BF_OGG = False  # -DWITH_OGG 
+WITH_BF_OGG = False
 BF_OGG = '/usr'
 BF_OGG_INC = '${BF_OGG}/include'
 BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
index e4f8827..9fac0a3 100644 (file)
@@ -190,6 +190,10 @@ LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32
 
 PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
 
+## DISABLED, causes linking errors!
+## for re-distrobution, so users dont need mingw installed
+# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
+
 BF_DEBUG = False
 BF_DEBUG_CCFLAGS= ['-g', '-D_DEBUG']
 
index 07cd30b..2142620 100644 (file)
@@ -185,7 +185,7 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a'
 CC = 'cl.exe'
 CXX = 'cl.exe'
 
-CCFLAGS = ['/nologo', '/Ob1', '/J', '/W0', '/Gd', '/wd4018', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267', '/we4013']
+CCFLAGS = ['/nologo', '/Ob1', '/J', '/W1', '/Gd', '/wd4018', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267', '/we4013']
 CXXFLAGS = ['/EHsc']
 BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
 
index 2e7ea6d..794f29c 100644 (file)
@@ -190,7 +190,7 @@ CC = 'cl.exe'
 CXX = 'cl.exe'
 
 CFLAGS = []
-CCFLAGS = ['/nologo', '/Ob1', '/J', '/W0', '/Gd', '/we4013', '/wd4018', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267']
+CCFLAGS = ['/nologo', '/Ob1', '/J', '/W1', '/Gd', '/we4013', '/wd4018', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267']
 CXXFLAGS = ['/EHsc']
 BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast']
 
index 9d47edc..a71ab04 100644 (file)
@@ -161,7 +161,7 @@ def validate_arguments(args, bc):
             'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES' 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE',
             'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
             'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH',
-            'WITH_BF_LIBMV'
+            'WITH_BF_LIBMV', 'WITH_BF_CARVE'
             ]
     
     # Have options here that scons expects to be lists
@@ -222,15 +222,15 @@ class ourSpawn:
         newargs = string.join(args[1:], ' ')
         cmdline = cmd + " " + newargs
         startupinfo = subprocess.STARTUPINFO()
-        startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
+        #startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
         proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
             stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False)
         data, err = proc.communicate()
         rv = proc.wait()
-        if rv:
-            print "====="
-            print err
-            print "====="
+        if data:
+            print(data)
+        if err:
+            print(err)
         return rv
 
 def SetupSpawn( env ):
@@ -323,7 +323,7 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_STATICFFMPEG', 'Use static FFMPEG if true', False)),
         ('BF_FFMPEG_LIB_STATIC', 'Static FFMPEG libraries', ''),
         
-        (BoolVariable('WITH_BF_OGG', 'Use OGG, THEORA, VORBIS in FFMPEG if true',
+        (BoolVariable('WITH_BF_OGG', 'Link OGG, THEORA, VORBIS with FFMPEG if true',
                     False)),
         ('BF_OGG', 'OGG base path', ''),
         ('BF_OGG_LIB', 'OGG library', ''),
@@ -521,6 +521,7 @@ def read_opts(env, cfg, args):
         
         (BoolVariable('WITH_BF_LZO', 'Enable fast LZO pointcache compression', True)),
         (BoolVariable('WITH_BF_LZMA', 'Enable best LZMA pointcache compression', True)),
+        (BoolVariable('WITH_BF_CARVE', 'Enable carve library for mesh boolean operations', True)),
         
         (BoolVariable('WITH_BF_LIBMV', 'Enable libmv structure from motion library', True)),
 
index 92c961e..e82bf39 100644 (file)
@@ -13,8 +13,8 @@ class SubMenu(bpy.types.Menu):
     def draw(self, context):
         layout = self.layout
 
-        layout.operator("object.select_all", text="Select/Deselect All")
-        layout.operator("object.select_inverse", text="Inverse")
+        layout.operator("object.select_all", text="Select/Deselect All").action = 'TOGGLE'
+        layout.operator("object.select_all", text="Inverse").action = 'INVERT'
         layout.operator("object.select_random", text="Random")
 
         # access this operator as a submenu
index e8c4a2a..4ca18a6 100644 (file)
@@ -27,8 +27,8 @@ class BasicMenu(bpy.types.Menu):
     def draw(self, context):
         layout = self.layout
 
-        layout.operator("object.select_all", text="Select/Deselect All")
-        layout.operator("object.select_inverse", text="Inverse")
+        layout.operator("object.select_all", text="Select/Deselect All").action = 'TOGGLE'
+        layout.operator("object.select_all", text="Inverse").action = 'INVERT'
         layout.operator("object.select_random", text="Random")
 
 
index 4cb7b02..861496c 100644 (file)
@@ -22,7 +22,7 @@ class CustomDrawOperator(bpy.types.Operator):
     my_string = bpy.props.StringProperty(name="String Value")
 
     def execute(self, context):
-        print()
+        print("Test", self)
         return {'FINISHED'}
 
     def invoke(self, context, event):
index 7d1a98d..e123768 100644 (file)
@@ -31,6 +31,7 @@ class ModalOperator(bpy.types.Operator):
 
     def execute(self, context):
         context.object.location.x = self.value / 100.0
+        return {'FINISHED'}
 
     def modal(self, context, event):
         if event.type == 'MOUSEMOVE':  # Apply
index ab32a04..cd85d30 100644 (file)
@@ -34,9 +34,9 @@ class ObjectSelectPanel(bpy.types.Panel):
 
         box = layout.box()
         box.label("Selection Tools")
-        box.operator("object.select_all")
+        box.operator("object.select_all").action = 'TOGGLE'
         row = box.row()
-        row.operator("object.select_inverse")
+        row.operator("object.select_all").action = 'INVERT'
         row.operator("object.select_random")
 
 
index 0b32c7a..0abefcb 100644 (file)
@@ -516,7 +516,7 @@ When the texture object is deleted, the new texture is deleted and the old textu
       line by line starting from the bottom of the image. The pixel size and format is determined by the mode
       parameter.
 
-.. function materialID(object,name)
+.. function:: materialID(object,name)
 
    Returns a numeric value that can be used in :class:`Texture` to create a dynamic texture.
 
@@ -538,7 +538,7 @@ When the texture object is deleted, the new texture is deleted and the old textu
    :type name: string
    :rtype: integer
 
-.. function setLogFile(filename)
+.. function:: setLogFile(filename)
 
    Sets the name of a text file in which runtime error messages will be written, in addition to the printing
    of the messages on the Python console. Only the runtime errors specific to the VideoTexture module
index b1277df..f97c95b 100644 (file)
@@ -1765,33 +1765,29 @@ Game Types (bge.types)
       #. Polygon shape (triangle/quad)
       #. Game Object
 
-   #. Verticies will be split by face if necessary.  Verticies can only be shared between faces if:
+   #. Vertices will be split by face if necessary.  Vertices can only be shared between faces if:
 
       #. They are at the same position
       #. UV coordinates are the same
       #. Their normals are the same (both polygons are "Set Smooth")
-      #. They are the same colour, for example: a cube has 24 verticies: 6 faces with 4 verticies per face.
+      #. They are the same colour, for example: a cube has 24 vertices: 6 faces with 4 vertices per face.
 
    The correct method of iterating over every :class:`KX_VertexProxy` in a game object
    
    .. code-block:: python
 
-      import GameLogic
+      from bge import logic
 
-      co = GameLogic.getCurrentController()
-      obj = co.owner
+      cont = logic.getCurrentController()
+      object = cont.owner
 
-      m_i = 0
-      mesh = obj.getMesh(m_i) # There can be more than one mesh...
-      while mesh != None:
-         for mat in range(mesh.getNumMaterials()):
+      for mesh in object.meshes:
+         for material in mesh.materials:
             for v_index in range(mesh.getVertexArrayLength(mat)):
                vertex = mesh.getVertex(mat, v_index)
                # Do something with vertex here...
                # ... eg: colour the vertex red.
                vertex.colour = [1.0, 0.0, 0.0, 1.0]
-         m_i += 1
-         mesh = obj.getMesh(m_i)
 
    .. attribute:: materials
 
@@ -2401,135 +2397,53 @@ Game Types (bge.types)
 
       Some of the methods/variables are CObjects.  If you mix these up, you will crash blender.
 
-   This example requires `PyOpenGL <http://pyopengl.sourceforge.net>`_ and `GLEWPy <http://glewpy.sourceforge.net>`_
-
    .. code-block:: python
 
-      import GameLogic
-      import OpenGL
-      from OpenGL.GL import *
-      from OpenGL.GLU import *
-      import glew
-      from glew import *
-      
-      glewInit()
+      from bge import logic
       
       vertex_shader = """
       
       void main(void)
       {
+         // original vertex position, no changes
          gl_Position = ftransform();
+         // coordinate of the 1st texture channel
+         gl_TexCoord[0] = gl_MultiTexCoord0;
+         // coordinate of the 2nd texture channel
+         gl_TexCoord[1] = gl_MultiTexCoord1;
       }
       """
       
       fragment_shader ="""
-      
+
+      uniform sampler2D color_0;
+      uniform sampler2D color_1;
+      uniform float factor;
+
       void main(void)
       {
-         gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+         vec4 color_0 = texture2D(color_0, gl_TexCoord[0].st);
+         vec4 color_1 = texture2D(color_1, gl_TexCoord[1].st);
+         gl_FragColor = mix(color_0, color_1, factor);
       }
       """
-      
-      class MyMaterial:
-         def __init__(self):
-            self.pass_no = 0
-            # Create a shader
-            self.m_program = glCreateProgramObjectARB()
-            # Compile the vertex shader
-            self.shader(GL_VERTEX_SHADER_ARB, (vertex_shader))
-            # Compile the fragment shader
-            self.shader(GL_FRAGMENT_SHADER_ARB, (fragment_shader))
-            # Link the shaders together
-            self.link()
-            
-         def PrintInfoLog(self, tag, object):
-            """
-            PrintInfoLog prints the GLSL compiler log
-            """
-            print "Tag:    def PrintGLError(self, tag = ""):
-            
-         def PrintGLError(self, tag = ""):
-            """
-            Prints the current GL error status
-            """
-            if len(tag):
-               print tag
-            err = glGetError()
-            if err != GL_NO_ERROR:
-               print "GL Error: %s\\n"%(gluErrorString(err))
-      
-         def shader(self, type, shaders):
-            """
-            shader compiles a GLSL shader and attaches it to the current
-            program.
-            
-            type should be either GL_VERTEX_SHADER_ARB or GL_FRAGMENT_SHADER_ARB
-            shaders should be a sequence of shader source to compile.
-            """
-            # Create a shader object
-            shader_object = glCreateShaderObjectARB(type)
-      
-            # Add the source code
-            glShaderSourceARB(shader_object, len(shaders), shaders)
-            
-            # Compile the shader
-            glCompileShaderARB(shader_object)
-            
-            # Print the compiler log
-            self.PrintInfoLog("vertex shader", shader_object)
-            
-            # Check if compiled, and attach if it did
-            compiled = glGetObjectParameterivARB(shader_object, GL_OBJECT_COMPILE_STATUS_ARB)
-            if compiled:
-               glAttachObjectARB(self.m_program, shader_object)
-               
-            # Delete the object (glAttachObjectARB makes a copy)
-            glDeleteObjectARB(shader_object)
-            
-            # print the gl error log
-            self.PrintGLError()
-            
-         def link(self):
-            """
-            Links the shaders together.
-            """
-            # clear error indicator
-            glGetError()
-            
-            glLinkProgramARB(self.m_program)
-      
-            self.PrintInfoLog("link", self.m_program)
-         
-            linked = glGetObjectParameterivARB(self.m_program, GL_OBJECT_LINK_STATUS_ARB)
-            if not linked:
-               print "Shader failed to link"
-               return
-      
-            glValidateProgramARB(self.m_program)
-            valid = glGetObjectParameterivARB(self.m_program, GL_OBJECT_VALIDATE_STATUS_ARB)
-            if not valid:
-               print "Shader failed to validate"
-               return
-            
-         def activate(self, rasty, cachingInfo, mat):
-            self.pass_no+=1
-            if (self.pass_no == 1):
-               glDisable(GL_COLOR_MATERIAL)
-               glUseProgramObjectARB(self.m_program)
-               return True
-            
-            glEnable(GL_COLOR_MATERIAL)
-            glUseProgramObjectARB(0)
-            self.pass_no = 0   
-            return False
 
-      obj = GameLogic.getCurrentController().owner
-      
-      mesh = obj.meshes[0]
-      
-      for mat in mesh.materials:
-         mat.setCustomMaterial(MyMaterial())
-         print mat.texture
+      object = logic.getCurrentController().owner
+      object = cont.owner
+      for mesh in object.meshes:
+          for material in mesh.materials:
+              shader = material.getShader()
+              if shader != None:
+                  if not shader.isValid():
+                      shader.setSource(vertex_shader, fragment_shader, True)
+
+                  # get the first texture channel of the material
+                  shader.setSampler('color_0', 0)
+                  # get the second texture channel of the material
+                  shader.setSampler('color_1', 1)
+                  # pass another uniform to the shader
+                  shader.setUniform1f('factor', 0.3)
+
 
    .. attribute:: texture
 
@@ -2932,7 +2846,7 @@ Game Types (bge.types)
       # +----------+     +-----------+     +-------------------------------------+
       # | Always   +-----+ Python    +-----+ Edit Object (Replace Mesh) LOD.Mesh |
       # +----------+     +-----------+     +-------------------------------------+
-      import GameLogic
+      from bge import logic
 
       # List detail meshes here
       # Mesh (name, near, far)
@@ -2942,16 +2856,16 @@ Game Types (bge.types)
             (".Lo", -40.0, -100.0)
           )
       
-      co = GameLogic.getCurrentController()
-      obj = co.owner
-      act = co.actuators["LOD." + obj.name]
-      cam = GameLogic.getCurrentScene().active_camera
+      cont = logic.getCurrentController()
+      object = cont.owner
+      actuator = cont.actuators["LOD." + obj.name]
+      camera = logic.getCurrentScene().active_camera
       
       def Depth(pos, plane):
         return pos[0]*plane[0] + pos[1]*plane[1] + pos[2]*plane[2] + plane[3]
       
       # Depth is negative and decreasing further from the camera
-      depth = Depth(obj.position, cam.world_to_camera[2])
+      depth = Depth(object.position, camera.world_to_camera[2])
       
       newmesh = None
       curmesh = None
@@ -2959,15 +2873,15 @@ Game Types (bge.types)
       for mesh in meshes:
         if depth < mesh[1] and depth > mesh[2]:
           newmesh = mesh
-        if "ME" + obj.name + mesh[0] == act.getMesh():
+        if "ME" + object.name + mesh[0] == actuator.getMesh():
             curmesh = mesh
       
-      if newmesh != None and "ME" + obj.name + newmesh[0] != act.getMesh():
+      if newmesh != None and "ME" + object.name + newmesh[0] != actuator.mesh:
         # The mesh is a different mesh - switch it.
         # Check the current mesh is not a better fit.
         if curmesh == None or curmesh[1] < depth or curmesh[2] > depth:
-          act.mesh = obj.getName() + newmesh[0]
-          GameLogic.addActiveActuator(act, True)
+          actuator.mesh = object.name + newmesh[0]
+          cont.activate(actuator)
 
    .. attribute:: mesh
 
@@ -3003,31 +2917,31 @@ Game Types (bge.types)
 
    .. code-block:: python
 
-      import GameLogic
+      from bge import logic
 
       # get the scene
-      scene = GameLogic.getCurrentScene()
+      scene = logic.getCurrentScene()
 
       # print all the objects in the scene
-      for obj in scene.objects:
-         print obj.name
+      for object in scene.objects:
+         print(object.name)
 
       # get an object named 'Cube'
-      obj = scene.objects["Cube"]
+      object = scene.objects["Cube"]
 
       # get the first object in the scene.
-      obj = scene.objects[0]
+      object = scene.objects[0]
 
    .. code-block:: python
 
       # Get the depth of an object in the camera view.
-      import GameLogic
+      from bge import logic
 
-      obj = GameLogic.getCurrentController().owner
-      cam = GameLogic.getCurrentScene().active_camera
+      object = logic.getCurrentController().owner
+      cam = logic.getCurrentScene().active_camera
 
       # Depth is negative and decreasing further from the camera
-      depth = obj.position[0]*cam.world_to_camera[2][0] + obj.position[1]*cam.world_to_camera[2][1] + obj.position[2]*cam.world_to_camera[2][2] + cam.world_to_camera[2][3]
+      depth = object.position[0]*cam.world_to_camera[2][0] + object.position[1]*cam.world_to_camera[2][1] + object.position[2]*cam.world_to_camera[2][2] + cam.world_to_camera[2][3]
 
    @bug: All attributes are read only at the moment.
 
@@ -4361,9 +4275,9 @@ Game Types (bge.types)
 
       .. code-block:: python
 
-         import GameLogic
-         co = GameLogic.getCurrentController()
-         cam = co.owner
+         from bge import logic
+         cont = logic.getCurrentController()
+         cam = cont.owner
          
          # A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0]
          if (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE):
@@ -4386,9 +4300,9 @@ Game Types (bge.types)
 
       .. code-block:: python
 
-         import GameLogic
-         co = GameLogic.getCurrentController()
-         cam = co.owner
+         from bge import logic
+         cont = logic.getCurrentController()
+         cam = cont.owner
 
          # Box to test...
          box = []
@@ -4422,9 +4336,9 @@ Game Types (bge.types)
 
       .. code-block:: python
 
-         import GameLogic
-         co = GameLogic.getCurrentController()
-         cam = co.owner
+         from bge import logic
+         cont = logic.getCurrentController()
+         cam = cont.owner
 
          # Test point [0.0, 0.0, 0.0]
          if (cam.pointInsideFrustum([0.0, 0.0, 0.0])):
index 9e31071..d191bb6 100644 (file)
@@ -10,7 +10,7 @@ For your own work this is of course fine, but if you want to collaborate with ot
 Style Conventions
 =================
 
-For Blender 2.5 we have chosen to follow python suggested style guide to avoid mixing styles amongst our own scripts and make it easier to use python scripts from other projects.
+For Blender/Python development we have chosen to follow python suggested style guide to avoid mixing styles amongst our own scripts and make it easier to use python scripts from other projects.
 
 Using our style guide for your own scripts makes it easier if you eventually want to contribute them to blender.
 
@@ -83,7 +83,7 @@ Even though you're not looping on the list data **python is**, so you need to be
 
 Modifying Lists
 ^^^^^^^^^^^^^^^
-In python we can add and remove from a list, This is slower when the list length is modifier, especially at the start of the list, since all the data after the index of modification needs to be moved up or down 1 place.
+In python we can add and remove from a list, This is slower when the list length is modified, especially at the start of the list, since all the data after the index of modification needs to be moved up or down 1 place.
 
 The most simple way to add onto the end of the list is to use ``my_list.append(list_item)`` or ``my_list.extend(some_list)`` and the fastest way to remove an item is ``my_list.pop()`` or ``del my_list[-1]``.
 
index fe73008..30c4521 100644 (file)
@@ -27,7 +27,7 @@ The Default Environment
 
 When developing your own scripts it may help to understand how blender sets up its python environment. Many python scripts come bundled with blender and can be used as a reference because they use the same API that script authors write tools in. Typical usage for scripts include: user interface, import/export, scene manipulation, automation, defining your own toolset and customization.
 
-On startup blender scans the ``scripts/startup/`` directory for python modules and imports them. The exact location of this directory depends on your installation. `See the directory layout docs <http://wiki.blender.org/index.php/Doc:2.5/Manual/Introduction/Installing_Blender/DirectoryLayout>`_
+On startup blender scans the ``scripts/startup/`` directory for python modules and imports them. The exact location of this directory depends on your installation. `See the directory layout docs <http://wiki.blender.org/index.php/Doc:2.6/Manual/Introduction/Installing_Blender/DirectoryLayout>`_
 
 
 Script Loading
@@ -71,7 +71,7 @@ The only difference between addons and built-in python modules is that addons mu
 
 The user preferences addon listing uses **bl_info** to display information about each addon.
 
-`See Addons <http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons>`_ for details on the **bl_info** dictionary.
+`See Addons <http://wiki.blender.org/index.php/Dev:2.6/Py/Scripts/Guidelines/Addons>`_ for details on the **bl_info** dictionary.
 
 
 Integration through Classes
index c81d2eb..b37b755 100644 (file)
@@ -40,14 +40,14 @@ The Blender/Python API **can't** (yet)...
 Before Starting
 ===============
 
-This document isn't intended to fully cover each topic. Rather, its purpose is to familiarize you with Blender 2.5's new Python API.
+This document isn't intended to fully cover each topic. Rather, its purpose is to familiarize you with Blender Python API.
 
 
 A quick list of helpful things to know before starting:
 
 * Blender uses Python 3.x; some 3rd party extensions are not available yet.
 
-* The interactive console in Blender 2.5 has been improved; testing one-liners in the console is a good way to learn.
+* The interactive console is great for testing one-liners, It also has autocompleation so you can inspect the api quickly.
 
 * Button tool tips show Python attributes and operator names.
 
@@ -113,7 +113,7 @@ Once you have a data block, such as a material, object, groups etc., its attribu
    bpy.data.materials['MyMaterial']
 
 
-For testing what data to access it's useful to use the "Console", which is its own space type in Blender 2.5. This supports auto-complete, giving you a fast way to dig into different data in your file.
+For testing what data to access it's useful to use the "Console", which is its own space type. This supports auto-complete, giving you a fast way to dig into different data in your file.
 
 Example of a data path that can be quickly found via the console:
 
index 491e972..0b94049 100644 (file)
@@ -26,6 +26,27 @@ There are 3 main uses for the terminal, these are:
    For Linux and OSX users this means starting the terminal first, then running blender from within it. On Windows the terminal can be enabled from the help menu.
 
 
+Interface Tricks
+================
+
+
+Access Operator Commands
+------------------------
+
+You may have noticed that the tooltip for menu items and buttons includes the ``bpy.ops``... command to run that button, a handy (hidden) feature is that you can press Ctrl+C over any menu item/button to copy this command into the clipboard.
+
+
+Access Data Path
+----------------
+
+To find the path from an :class:`ID` datablock to its setting isn't always so simple since it may be nested away. To get this quickly you can right click on the setting and select select **Copy Data Path**,
+if this can't be generated, only the property name is copied.
+
+.. note::
+
+   This uses the same method for creating the animation path used by :class:`FCurve.data_path` and :class:`DriverTarget.data_path` drivers.
+
+
 Show All Operators
 ==================
 
index 60253e0..6215673 100644 (file)
@@ -67,3 +67,7 @@ endif()
 if(WITH_LIBMV)
        add_subdirectory(libmv)
 endif()
+
+if(WITH_CARVE)
+       add_subdirectory(carve)
+endif()
index 031471a..738342b 100644 (file)
@@ -31,3 +31,6 @@ if env['WITH_BF_LZMA']:
 
 if env['WITH_BF_LIBMV']:
     SConscript(['libmv/SConscript'])
+
+if env['WITH_BF_CARVE']:
+    SConscript(['carve/SConscript'])
diff --git a/extern/carve/CMakeLists.txt b/extern/carve/CMakeLists.txt
new file mode 100644 (file)
index 0000000..abd35d3
--- /dev/null
@@ -0,0 +1,166 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Jacques Beaurai, Erwin Coumans
+#
+# ***** END GPL LICENSE BLOCK *****
+
+# NOTE: This file is automatically generated by bundle.sh script
+#       If you're doing changes in this file, please update template
+#       in that script too
+
+set(INC
+       include
+)
+
+set(INC_SYS
+)
+
+set(SRC
+       lib/carve.cpp
+       lib/mesh.cpp
+       lib/intersect_group.cpp
+       lib/intersect_classify_edge.cpp
+       lib/intersect_classify_group.cpp
+       lib/polyhedron.cpp
+       lib/geom3d.cpp
+       lib/polyline.cpp
+       lib/csg_collector.cpp
+       lib/triangulator.cpp
+       lib/intersect_face_division.cpp
+       lib/intersect_half_classify_group.cpp
+       lib/edge.cpp
+       lib/math.cpp
+       lib/geom2d.cpp
+       lib/tag.cpp
+       lib/intersection.cpp
+       lib/convex_hull.cpp
+       lib/csg.cpp
+       lib/intersect.cpp
+       lib/face.cpp
+       lib/pointset.cpp
+       lib/timing.cpp
+       lib/octree.cpp
+       lib/aabb.cpp
+       lib/intersect_debug.cpp
+
+       lib/intersect_classify_common.hpp
+       lib/csg_data.hpp
+       lib/csg_collector.hpp
+       lib/intersect_common.hpp
+       lib/intersect_classify_common_impl.hpp
+       lib/csg_detail.hpp
+       lib/intersect_debug.hpp
+
+       include/carve/polyhedron_decl.hpp
+       include/carve/geom2d.hpp
+       include/carve/exact.hpp
+       include/carve/triangulator_impl.hpp
+       include/carve/collection.hpp
+       include/carve/pointset.hpp
+       include/carve/djset.hpp
+       include/carve/kd_node.hpp
+       include/carve/polyline.hpp
+       include/carve/polyline_iter.hpp
+       include/carve/geom3d.hpp
+       include/carve/edge_decl.hpp
+       include/carve/face_decl.hpp
+       include/carve/aabb_impl.hpp
+       include/carve/colour.hpp
+       include/carve/pointset_iter.hpp
+       include/carve/polyline_decl.hpp
+       include/carve/rescale.hpp
+       include/carve/mesh_impl.hpp
+       include/carve/classification.hpp
+       include/carve/util.hpp
+       include/carve/triangulator.hpp
+       include/carve/polyhedron_base.hpp
+       include/carve/rtree.hpp
+       include/carve/math.hpp
+       include/carve/math_constants.hpp
+       include/carve/octree_decl.hpp
+       include/carve/input.hpp
+       include/carve/mesh_ops.hpp
+       include/carve/debug_hooks.hpp
+       include/carve/mesh_simplify.hpp
+       include/carve/interpolator.hpp
+       include/carve/poly_decl.hpp
+       include/carve/csg.hpp
+       include/carve/mesh.hpp
+       include/carve/carve.hpp
+       include/carve/gnu_cxx.h
+       include/carve/polyhedron_impl.hpp
+       include/carve/poly_impl.hpp
+       include/carve/aabb.hpp
+       include/carve/convex_hull.hpp
+       include/carve/vertex_decl.hpp
+       include/carve/win32.h
+       include/carve/edge_impl.hpp
+       include/carve/tag.hpp
+       include/carve/tree.hpp
+       include/carve/heap.hpp
+       include/carve/matrix.hpp
+       include/carve/poly.hpp
+       include/carve/vector.hpp
+       include/carve/intersection.hpp
+       include/carve/faceloop.hpp
+       include/carve/geom_impl.hpp
+       include/carve/octree_impl.hpp
+       include/carve/spacetree.hpp
+       include/carve/collection/unordered/std_impl.hpp
+       include/carve/collection/unordered/tr1_impl.hpp
+       include/carve/collection/unordered/libstdcpp_impl.hpp
+       include/carve/collection/unordered/boost_impl.hpp
+       include/carve/collection/unordered/vcpp_impl.hpp
+       include/carve/collection/unordered/fallback_impl.hpp
+       include/carve/collection/unordered.hpp
+       include/carve/face_impl.hpp
+       include/carve/pointset_impl.hpp
+       include/carve/cbrt.h
+       include/carve/vcpp_config.h
+       include/carve/geom.hpp
+       include/carve/vertex_impl.hpp
+       include/carve/polyline_impl.hpp
+       include/carve/pointset_decl.hpp
+       include/carve/timing.hpp
+       include/carve/csg_triangulator.hpp
+       include/carve/iobj.hpp
+       include/carve/collection_types.hpp
+)
+
+if(WITH_BOOST)
+       if(NOT MSVC)
+               # Boost is setting as preferred collections library in the Carve code when using MSVC compiler
+               add_definitions(
+                       -DHAVE_BOOST_UNORDERED_COLLECTIONS
+               )
+       endif()
+
+       add_definitions(
+               -DCARVE_SYSTEM_BOOST
+       )
+
+       list(APPEND INC
+               ${BOOST_INCLUDE_DIR}
+       )
+endif()
+
+blender_add_lib(extern_carve "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/extern/carve/LICENSE.GPL2 b/extern/carve/LICENSE.GPL2
new file mode 100644 (file)
index 0000000..792acb9
--- /dev/null
@@ -0,0 +1,361 @@
+                    GNU GENERAL PUBLIC LICENSE
+
+ The Qt GUI Toolkit is Copyright (C) 1994-2008 Trolltech ASA.
+
+ You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ GNU General Public License version 2, which is displayed below.
+
+-------------------------------------------------------------------------
+
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+-------------------------------------------------------------------------
+
+In addition, as a special exception, Trolltech gives permission to link the
+code of its release of Qt with the OpenSSL project's "OpenSSL" library (or
+modified versions of it that use the same license as the "OpenSSL"
+library), and distribute the linked executables. You must comply with the GNU
+General Public License version 2 or the GNU General Public License version 3
+in all respects for all of the code used other than the "OpenSSL" code.  If
+you modify this file, you may extend this exception to your version of the
+file, but you are not obligated to do so.  If you do not wish to do so,
+delete this exception statement from your version of this file.
diff --git a/extern/carve/SConscript b/extern/carve/SConscript
new file mode 100644 (file)
index 0000000..e2f3c81
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+# NOTE: This file is automatically generated by bundle.sh script
+#       If you're doing changes in this file, please update template
+#       in that script too
+
+Import ('env')
+
+sources = env.Glob('lib/*.cpp')
+
+defs = []
+incs = ['include']
+
+if env['WITH_BF_BOOST']:
+    if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'):
+        # Boost is setting as preferred collections library in the Carve code when using MSVC compiler
+        if env['OURPLATFORM'] != 'win32-mingw':
+            defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS')
+
+    defs.append('CARVE_SYSTEM_BOOST')
+    incs.append(env['BF_BOOST_INC'])
+
+env.BlenderLib ('extern_carve', Split(sources), incs, defs, libtype=['extern'], priority=[40] )
diff --git a/extern/carve/bundle.sh b/extern/carve/bundle.sh
new file mode 100755 (executable)
index 0000000..3f90286
--- /dev/null
@@ -0,0 +1,124 @@
+#!/bin/sh
+
+if [ -d ./.svn ]; then
+  echo "This script is supposed to work only when using git-svn"
+  exit 1
+fi
+
+tmp=`mktemp -d`
+
+hg clone https://code.google.com/p/carve/ $tmp/carve
+
+for p in `cat ./patches/series`; do
+  echo "Applying patch $p..."
+  cat ./patches/$p | patch -d $tmp/carve -p1
+done
+
+rm -rf include
+rm -rf lib
+
+cat "files.txt" | while f=`line`; do
+  mkdir -p `dirname $f`
+  cp $tmp/carve/$f $f
+done
+
+rm -rf $tmp
+
+sources=`find ./lib -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | sed -r 's/^\.\//\t/'`
+headers=`find ./lib -type f -iname '*.h' -or -iname '*.hpp' | sed -r 's/^\.\//\t/'`
+includes=`find ./include -type f -iname '*.h' -or -iname '*.hpp' | sed -r 's/^\.\//\t/'`
+
+mkdir -p include/carve/external/boost
+cp patches/files/random.hpp include/carve/external/boost/random.hpp
+cp patches/files/config.h include/carve/config.h
+
+cat > CMakeLists.txt << EOF
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Jacques Beaurai, Erwin Coumans
+#
+# ***** END GPL LICENSE BLOCK *****
+
+# NOTE: This file is automatically generated by bundle.sh script
+#       If you're doing changes in this file, please update template
+#       in that script too
+
+set(INC
+       include
+)
+
+set(INC_SYS
+)
+
+set(SRC
+${sources}
+
+${headers}
+
+${includes}
+)
+
+if(WITH_BOOST)
+       if(NOT MSVC)
+               # Boost is setting as preferred collections library in the Carve code when using MSVC compiler
+               add_definitions(
+                       -DHAVE_BOOST_UNORDERED_COLLECTIONS
+               )
+       endif()
+
+       add_definitions(
+               -DCARVE_SYSTEM_BOOST
+       )
+
+       list(APPEND INC
+               \${BOOST_INCLUDE_DIR}
+       )
+endif()
+
+blender_add_lib(extern_carve "\${SRC}" "\${INC}" "\${INC_SYS}")
+EOF
+
+cat > SConscript << EOF
+#!/usr/bin/python
+
+# NOTE: This file is automatically generated by bundle.sh script
+#       If you're doing changes in this file, please update template
+#       in that script too
+
+Import ('env')
+
+sources = env.Glob('lib/*.cpp')
+
+defs = []
+incs = ['include']
+
+if env['WITH_BF_BOOST']:
+    if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'):
+        # Boost is setting as preferred collections library in the Carve code when using MSVC compiler
+        if env['OURPLATFORM'] != 'win32-mingw':
+            defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS')
+
+    defs.append('CARVE_SYSTEM_BOOST')
+    incs.append(env['BF_BOOST_INC'])
+
+env.BlenderLib ('extern_carve', Split(sources), incs, defs, libtype=['extern'], priority=[40] )
+EOF
diff --git a/extern/carve/files.txt b/extern/carve/files.txt
new file mode 100644 (file)
index 0000000..c3cb927
--- /dev/null
@@ -0,0 +1,107 @@
+include/carve/polyhedron_decl.hpp
+include/carve/geom2d.hpp
+include/carve/exact.hpp
+include/carve/triangulator_impl.hpp
+include/carve/collection.hpp
+include/carve/pointset.hpp
+include/carve/djset.hpp
+include/carve/kd_node.hpp
+include/carve/polyline.hpp
+include/carve/polyline_iter.hpp
+include/carve/geom3d.hpp
+include/carve/edge_decl.hpp
+include/carve/face_decl.hpp
+include/carve/aabb_impl.hpp
+include/carve/colour.hpp
+include/carve/pointset_iter.hpp
+include/carve/polyline_decl.hpp
+include/carve/rescale.hpp
+include/carve/mesh_impl.hpp
+include/carve/classification.hpp
+include/carve/util.hpp
+include/carve/triangulator.hpp
+include/carve/polyhedron_base.hpp
+include/carve/rtree.hpp
+include/carve/math.hpp
+include/carve/math_constants.hpp
+include/carve/octree_decl.hpp
+include/carve/input.hpp
+include/carve/mesh_ops.hpp
+include/carve/debug_hooks.hpp
+include/carve/mesh_simplify.hpp
+include/carve/interpolator.hpp
+include/carve/poly_decl.hpp
+include/carve/csg.hpp
+include/carve/mesh.hpp
+include/carve/carve.hpp
+include/carve/gnu_cxx.h
+include/carve/polyhedron_impl.hpp
+include/carve/poly_impl.hpp
+include/carve/aabb.hpp
+include/carve/convex_hull.hpp
+include/carve/vertex_decl.hpp
+include/carve/win32.h
+include/carve/edge_impl.hpp
+include/carve/tag.hpp
+include/carve/tree.hpp
+include/carve/heap.hpp
+include/carve/matrix.hpp
+include/carve/poly.hpp
+include/carve/vector.hpp
+include/carve/intersection.hpp
+include/carve/faceloop.hpp
+include/carve/geom_impl.hpp
+include/carve/octree_impl.hpp
+include/carve/spacetree.hpp
+include/carve/collection/unordered/std_impl.hpp
+include/carve/collection/unordered/tr1_impl.hpp
+include/carve/collection/unordered/libstdcpp_impl.hpp
+include/carve/collection/unordered/boost_impl.hpp
+include/carve/collection/unordered/vcpp_impl.hpp
+include/carve/collection/unordered/fallback_impl.hpp
+include/carve/collection/unordered.hpp
+include/carve/face_impl.hpp
+include/carve/pointset_impl.hpp
+include/carve/cbrt.h
+include/carve/vcpp_config.h
+include/carve/geom.hpp
+include/carve/vertex_impl.hpp
+include/carve/polyline_impl.hpp
+include/carve/pointset_decl.hpp
+include/carve/timing.hpp
+include/carve/csg_triangulator.hpp
+include/carve/iobj.hpp
+include/carve/collection_types.hpp
+lib/carve.cpp
+lib/mesh.cpp
+lib/intersect_group.cpp
+lib/intersect_classify_common.hpp
+lib/intersect_classify_edge.cpp
+lib/intersect_classify_group.cpp
+lib/csg_data.hpp
+lib/polyhedron.cpp
+lib/csg_collector.hpp
+lib/geom3d.cpp
+lib/polyline.cpp
+lib/csg_collector.cpp
+lib/triangulator.cpp
+lib/intersect_face_division.cpp
+lib/intersect_half_classify_group.cpp
+lib/edge.cpp
+lib/math.cpp
+lib/geom2d.cpp
+lib/tag.cpp
+lib/intersection.cpp
+lib/convex_hull.cpp
+lib/intersect_common.hpp
+lib/intersect_classify_common_impl.hpp
+lib/csg.cpp
+lib/intersect.cpp
+lib/csg_detail.hpp
+lib/face.cpp
+lib/pointset.cpp
+lib/timing.cpp
+lib/octree.cpp
+lib/aabb.cpp
+lib/intersect_debug.hpp
+lib/intersect_debug.cpp
diff --git a/extern/carve/include/carve/aabb.hpp b/extern/carve/include/carve/aabb.hpp
new file mode 100644 (file)
index 0000000..20ee028
--- /dev/null
@@ -0,0 +1,150 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+#pragma once
+
+#include <carve/carve.hpp>
+
+#include <carve/geom.hpp>
+
+#include <vector>
+
+namespace carve {
+  namespace geom {
+
+
+
+    // n-dimensional AABB
+    template<unsigned ndim>
+    struct aabb {
+      typedef vector<ndim> vector_t;
+      typedef aabb<ndim> aabb_t;
+
+      vector_t pos;     // the centre of the AABB
+      vector_t extent;  // the extent of the AABB - the vector from the centre to the maximal vertex.
+
+      void empty();
+
+      bool isEmpty() const;
+
+      void fit(const vector_t &v1);
+      void fit(const vector_t &v1, const vector_t &v2);
+      void fit(const vector_t &v1, const vector_t &v2, const vector_t &v3);
+
+      template<typename iter_t, typename value_type>
+      void _fit(iter_t begin, iter_t end, value_type);
+
+      template<typename iter_t>
+      void _fit(iter_t begin, iter_t end, vector_t);
+
+      template<typename iter_t>
+      void _fit(iter_t begin, iter_t end, aabb_t);
+
+      template<typename iter_t>
+      void fit(iter_t begin, iter_t end);
+
+      template<typename iter_t, typename adapt_t>
+      void fit(iter_t begin, iter_t end, adapt_t adapt);
+
+      void unionAABB(const aabb<ndim> &a);
+
+      void expand(double pad);
+
+      bool completelyContains(const aabb<ndim> &other) const;
+
+      bool containsPoint(const vector_t &v) const;
+
+      bool intersectsLineSegment(const vector_t &v1, const vector_t &v2) const;
+
+      double axisSeparation(const aabb<ndim> &other, unsigned axis) const;
+
+      double maxAxisSeparation(const aabb<ndim> &other) const;
+
+      bool intersects(const aabb<ndim> &other) const;
+      bool intersects(const sphere<ndim> &s) const;
+      bool intersects(const plane<ndim> &plane) const;
+      bool intersects(const ray<ndim> &ray) const;
+      bool intersects(tri<ndim> tri) const;
+      bool intersects(const linesegment<ndim> &ls) const;
+
+      std::pair<double, double> rangeInDirection(const carve::geom::vector<ndim> &v) const;
+
+      vector_t min() const;
+      vector_t mid() const;
+      vector_t max() const;
+
+      double min(unsigned dim) const;
+      double mid(unsigned dim) const;
+      double max(unsigned dim) const;
+
+      double volume() const;
+
+      int compareAxis(const axis_pos &ap) const;
+
+      void constrainMax(const axis_pos &ap);
+      void constrainMin(const axis_pos &ap);
+
+      aabb getAABB() const;
+
+      aabb(const vector_t &_pos = vector_t::ZERO(),
+           const vector_t &_extent = vector_t::ZERO());
+
+      template<typename iter_t, typename adapt_t>
+      aabb(iter_t begin, iter_t end, adapt_t adapt);
+
+      template<typename iter_t>
+      aabb(iter_t begin, iter_t end);
+
+      aabb(const aabb<ndim> &a, const aabb<ndim> &b);
+    };
+
+    template<unsigned ndim>
+    bool operator==(const aabb<ndim> &a, const aabb<ndim> &b);
+
+    template<unsigned ndim>
+    bool operator!=(const aabb<ndim> &a, const aabb<ndim> &b);
+
+    template<unsigned ndim>
+    std::ostream &operator<<(std::ostream &o, const aabb<ndim> &a);
+
+
+
+    template<unsigned ndim, typename obj_t>
+    struct get_aabb {
+      aabb<ndim> operator()(const obj_t &obj) const {
+        return obj.getAABB();
+      }
+    };
+
+    template<unsigned ndim, typename obj_t>
+    struct get_aabb<ndim, obj_t *> {
+      aabb<ndim> operator()(const obj_t *obj) const {
+        return obj->getAABB();
+      }
+    };
+
+
+
+  }
+}
+
+namespace carve {
+  namespace geom3d {
+    typedef carve::geom::aabb<3> AABB;
+  }
+}
+
+#include <carve/aabb_impl.hpp>
diff --git a/extern/carve/include/carve/aabb_impl.hpp b/extern/carve/include/carve/aabb_impl.hpp
new file mode 100644 (file)
index 0000000..ccdddef
--- /dev/null
@@ -0,0 +1,423 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+#pragma once
+
+#include <carve/carve.hpp>
+
+#include <carve/vector.hpp>
+#include <carve/geom3d.hpp>
+
+#include <carve/geom.hpp>
+
+#include <vector>
+
+namespace carve {
+  namespace geom {
+
+    template<unsigned ndim>
+    void aabb<ndim>::empty() {
+      pos.setZero();
+      extent.setZero();
+    }
+
+    template<unsigned ndim>
+    bool aabb<ndim>::isEmpty() const {
+      return extent.exactlyZero();
+    }
+
+    template<unsigned ndim>
+    template<typename iter_t, typename value_type>
+    void aabb<ndim>::_fit(iter_t begin, iter_t end, value_type) {
+      if (begin == end) {
+        empty();
+        return;
+      }
+
+      vector_t min, max;
+      aabb<ndim> a = get_aabb<ndim, value_type>()(*begin); ++begin;
+      min = a.min();
+      max = a.max();
+      while (begin != end) {
+        aabb<ndim> a = get_aabb<ndim, value_type>()(*begin); ++begin;
+        assign_op(min, min, a.min(), carve::util::min_functor());
+        assign_op(max, max, a.max(), carve::util::max_functor());
+      }
+
+      pos = (min + max) / 2.0;
+      assign_op(extent, max - pos, pos - min, carve::util::max_functor());
+    }
+
+    template<unsigned ndim>
+    template<typename iter_t>
+    void aabb<ndim>::_fit(iter_t begin, iter_t end, vector_t) {
+      if (begin == end) {
+        empty();
+        return;
+      }
+
+      vector_t min, max;
+      bounds(begin, end, min, max);
+      pos = (min + max) / 2.0;
+      assign_op(extent, max - pos, pos - min, carve::util::max_functor());
+    }
+
+    template<unsigned ndim>
+    template<typename iter_t>
+    void aabb<ndim>::_fit(iter_t begin, iter_t end, aabb_t) {
+      if (begin == end) {
+        empty();
+        return;
+      }
+
+      vector_t min, max;
+      aabb<ndim> a = *begin++;
+      min = a.min();
+      max = a.max();
+      while (begin != end) {
+        aabb<ndim> a = *begin; ++begin;
+        assign_op(min, min, a.min(), carve::util::min_functor());
+        assign_op(max, max, a.max(), carve::util::max_functor());
+      }
+
+      pos = (min + max) / 2.0;
+      assign_op(extent, max - pos, pos - min, carve::util::max_functor());
+    }
+
+    template<unsigned ndim>
+    void aabb<ndim>::fit(const vector_t &v1) {
+      pos = v1;
+      extent.setZero();
+    }
+
+    template<unsigned ndim>
+    void aabb<ndim>::fit(const vector_t &v1, const vector_t &v2) {
+      vector_t min, max;
+      assign_op(min, v1, v2, carve::util::min_functor());
+      assign_op(max, v1, v2, carve::util::max_functor());
+
+      pos = (min + max) / 2.0;
+      assign_op(extent, max - pos, pos - min, carve::util::max_functor());
+    }
+
+    template<unsigned ndim>
+    void aabb<ndim>::fit(const vector_t &v1, const vector_t &v2, const vector_t &v3) {
+      vector_t min, max;
+      min = max = v1;
+
+      assign_op(min, min, v2, carve::util::min_functor());
+      assign_op(max, max, v2, carve::util::max_functor());
+      assign_op(min, min, v3, carve::util::min_functor());
+      assign_op(max, max, v3, carve::util::max_functor());
+
+      pos = (min + max) / 2.0;
+      assign_op(extent, max - pos, pos - min, carve::util::max_functor());
+    }
+
+    template<unsigned ndim>
+    template<typename iter_t, typename adapt_t>
+    void aabb<ndim>::fit(iter_t begin, iter_t end, adapt_t adapt) {
+      vector_t min, max;
+
+      bounds(begin, end, adapt, min, max);
+      pos = (min + max) / 2.0;
+      assign_op(extent, max - pos, pos - min, carve::util::max_functor());
+    }
+
+    template<unsigned ndim>
+    template<typename iter_t>
+    void aabb<ndim>::fit(iter_t begin, iter_t end) {
+      _fit(begin, end, typename std::iterator_traits<iter_t>::value_type());
+    }
+
+    template<unsigned ndim>
+    void aabb<ndim>::expand(double pad) {
+      extent += pad;
+    }
+
+    template<unsigned ndim>
+    void aabb<ndim>::unionAABB(const aabb<ndim> &a) {
+      vector_t vmin, vmax;
+
+      assign_op(vmin, min(), a.min(), carve::util::min_functor());
+      assign_op(vmax, max(), a.max(), carve::util::max_functor());
+      pos = (vmin + vmax) / 2.0;
+      assign_op(extent, vmax - pos, pos - vmin, carve::util::max_functor());
+    }
+
+    template<unsigned ndim>
+    bool aabb<ndim>::completelyContains(const aabb<ndim> &other) const {
+      for (unsigned i = 0; i < ndim; ++i) {
+        if (fabs(other.pos.v[i] - pos.v[i]) + other.extent.v[i] > extent.v[i]) return false;
+      }
+      return true;
+    }
+
+    template<unsigned ndim>
+    bool aabb<ndim>::containsPoint(const vector_t &v) const {
+      for (unsigned i = 0; i < ndim; ++i) {
+        if (fabs(v.v[i] - pos.v[i]) > extent.v[i]) return false;
+      }
+      return true;
+    }
+
+    template<unsigned ndim>
+    double aabb<ndim>::axisSeparation(const aabb<ndim> &other, unsigned axis) const {
+      return fabs(other.pos.v[axis] - pos.v[axis]) - extent.v[axis] - other.extent.v[axis];
+    }
+
+    template<unsigned ndim>
+    double aabb<ndim>::maxAxisSeparation(const aabb<ndim> &other) const {
+      double m = axisSeparation(other, 0);
+      for (unsigned i = 1; i < ndim; ++i) {
+        m = std::max(m, axisSeparation(other, i));
+      }
+      return m;
+    }
+
+    template<unsigned ndim>
+    bool aabb<ndim>::intersects(const aabb<ndim> &other) const {
+      return maxAxisSeparation(other) <= 0.0;
+    }
+    template<unsigned ndim>
+    bool aabb<ndim>::intersects(const sphere<ndim> &s) const {
+      double r = 0.0;
+      for (unsigned i = 0; i < ndim; ++i) {
+        double t = fabs(s.C[i] - pos[i]) - extent[i]; if (t > 0.0) r += t*t;
+      }
+      return r <= s.r*s.r;
+    }
+
+    template<unsigned ndim>
+    bool aabb<ndim>::intersects(const plane<ndim> &plane) const {
+      double d1 = fabs(distance(plane, pos));
+      double d2 = dot(abs(plane.N), extent);
+      return d1 <= d2;
+    }
+
+    template<unsigned ndim>
+    bool aabb<ndim>::intersects(const linesegment<ndim> &ls) const {
+      return intersectsLineSegment(ls.v1, ls.v2);
+    }
+
+    template<unsigned ndim>
+    std::pair<double, double> aabb<ndim>::rangeInDirection(const carve::geom::vector<ndim> &v) const {
+      double d1 = dot(v, pos);
+      double d2 = dot(abs(v), extent);
+
+      return std::make_pair(d1 - d2, d1 + d2);
+    }
+
+    template<unsigned ndim>
+    typename aabb<ndim>::vector_t aabb<ndim>::min() const { return pos - extent; }
+
+    template<unsigned ndim>
+    typename aabb<ndim>::vector_t aabb<ndim>::mid() const { return pos; }
+
+    template<unsigned ndim>
+    typename aabb<ndim>::vector_t aabb<ndim>::max() const { return pos + extent; }
+
+    template<unsigned ndim>
+    double aabb<ndim>::min(unsigned dim) const { return pos.v[dim] - extent.v[dim]; }
+
+    template<unsigned ndim>
+    double aabb<ndim>::mid(unsigned dim) const { return pos.v[dim]; }
+
+    template<unsigned ndim>
+    double aabb<ndim>::max(unsigned dim) const { return pos.v[dim] + extent.v[dim]; }
+
+    template<unsigned ndim>
+    double aabb<ndim>::volume() const {
+      double v = 1.0;
+      for (size_t dim = 0; dim < ndim; ++dim) { v *= 2.0 * extent.v[dim]; }
+      return v;
+    }
+
+    template<unsigned ndim>
+    int aabb<ndim>::compareAxis(const axis_pos &ap) const {
+      double p = ap.pos - pos[ap.axis];
+      if (p > extent[ap.axis]) return -1;
+      if (p < -extent[ap.axis]) return +1;
+      return 0;
+    }
+
+    template<unsigned ndim>
+    void aabb<ndim>::constrainMax(const axis_pos &ap) {
+      if (pos[ap.axis] + extent[ap.axis] > ap.pos) {
+        double min = std::min(ap.pos, pos[ap.axis] - extent[ap.axis]);
+        pos[ap.axis] = (min + ap.pos) / 2.0;
+        extent[ap.axis] = ap.pos - pos[ap.axis];
+      }
+    }
+
+    template<unsigned ndim>
+    void aabb<ndim>::constrainMin(const axis_pos &ap) {
+      if (pos[ap.axis] - extent[ap.axis] < ap.pos) {
+        double max = std::max(ap.pos, pos[ap.axis] + extent[ap.axis]);
+        pos[ap.axis] = (ap.pos + max) / 2.0;
+        extent[ap.axis] = pos[ap.axis] - ap.pos;
+      }
+    }
+
+    template<unsigned ndim>
+    aabb<ndim> aabb<ndim>::getAABB() const {
+      return *this;
+    }
+
+    template<unsigned ndim>
+    aabb<ndim>::aabb(const vector_t &_pos,
+                     const vector_t &_extent) : pos(_pos), extent(_extent) {
+    }
+
+    template<unsigned ndim>
+    template<typename iter_t, typename adapt_t>
+    aabb<ndim>::aabb(iter_t begin, iter_t end, adapt_t adapt) {
+      fit(begin, end, adapt);
+    }
+
+    template<unsigned ndim>
+    template<typename iter_t>
+    aabb<ndim>::aabb(iter_t begin, iter_t end) {
+      fit(begin, end);
+    }
+
+    template<unsigned ndim>
+    aabb<ndim>::aabb(const aabb<ndim> &a, const aabb<ndim> &b) {
+      fit(a, b);
+    }
+
+    template<unsigned ndim>
+    bool operator==(const aabb<ndim> &a, const aabb<ndim> &b) {
+      return a.pos == b.pos && a.extent == b.extent;
+    }
+
+    template<unsigned ndim>
+    bool operator!=(const aabb<ndim> &a, const aabb<ndim> &b) {
+      return a.pos != b.pos || a.extent != b.extent;
+    }
+
+    template<unsigned ndim>
+    std::ostream &operator<<(std::ostream &o, const aabb<ndim> &a) {
+      o << (a.pos - a.extent) << "--" << (a.pos + a.extent);
+      return o;
+    }
+
+    template<>
+    inline bool aabb<3>::intersects(const ray<3> &ray) const {
+      vector<3> t = pos - ray.v;
+      double r;
+
+      //l.cross(x-axis)?
+      r = extent.y * fabs(ray.D.z) + extent.z * fabs(ray.D.y);
+      if (fabs(t.y * ray.D.z - t.z * ray.D.y) > r) return false;
+
+      //ray.D.cross(y-axis)?
+      r = extent.x * fabs(ray.D.z) + extent.z * fabs(ray.D.x);
+      if (fabs(t.z * ray.D.x - t.x * ray.D.z) > r) return false;
+
+      //ray.D.cross(z-axis)?
+      r = extent.x*fabs(ray.D.y) + extent.y*fabs(ray.D.x);
+      if (fabs(t.x * ray.D.y - t.y * ray.D.x) > r) return false;
+
+      return true;
+    }
+
+    template<>
+    inline bool aabb<3>::intersectsLineSegment(const vector<3> &v1, const vector<3> &v2) const {
+      vector<3> half_length = 0.5 * (v2 - v1);
+      vector<3> t = pos - half_length - v1;
+      double r;
+
+      //do any of the principal axes form a separating axis?
+      if(fabs(t.x) > extent.x + fabs(half_length.x)) return false;
+      if(fabs(t.y) > extent.y + fabs(half_length.y)) return false;
+      if(fabs(t.z) > extent.z + fabs(half_length.z)) return false;
+
+      // NOTE: Since the separating axis is perpendicular to the line in
+      // these last four cases, the line does not contribute to the
+      // projection.
+
+      //line.cross(x-axis)?
+      r = extent.y * fabs(half_length.z) + extent.z * fabs(half_length.y);
+      if (fabs(t.y * half_length.z - t.z * half_length.y) > r) return false;
+
+      //half_length.cross(y-axis)?
+      r = extent.x * fabs(half_length.z) + extent.z * fabs(half_length.x);
+      if (fabs(t.z * half_length.x - t.x * half_length.z) > r) return false;
+
+      //half_length.cross(z-axis)?
+      r = extent.x*fabs(half_length.y) + extent.y*fabs(half_length.x);
+      if (fabs(t.x * half_length.y - t.y * half_length.x) > r) return false;
+
+      return true;
+    }
+
+    template<int Ax, int Ay, int Az, int c>
+    static inline bool intersectsTriangle_axisTest_3(const aabb<3> &aabb, const tri<3> &tri) {
+      const int d = (c+1) % 3, e = (c+2) % 3;
+      const vector<3> a = cross(VECTOR(Ax, Ay, Az), tri.v[d] - tri.v[c]);
+      double p1 = dot(a, tri.v[c]), p2 = dot(a, tri.v[e]);
+      if (p1 > p2) std::swap(p1, p2);
+      const double r = dot(abs(a), aabb.extent);
+      return !(p1 > r || p2 < -r);
+    }
+
+    template<int c>
+    static inline bool intersectsTriangle_axisTest_2(const aabb<3> &aabb, const tri<3> &tri) {
+      double vmin = std::min(std::min(tri.v[0][c], tri.v[1][c]), tri.v[2][c]),
+             vmax = std::max(std::max(tri.v[0][c], tri.v[1][c]), tri.v[2][c]);
+      return !(vmin > aabb.extent[c] || vmax < -aabb.extent[c]);
+    }
+
+    static inline bool intersectsTriangle_axisTest_1(const aabb<3> &aabb, const tri<3> &tri) {
+      vector<3> n = cross(tri.v[1] - tri.v[0], tri.v[2] - tri.v[0]);
+      double d1 = fabs(dot(n, tri.v[0]));
+      double d2 = dot(abs(n), aabb.extent);
+      return d1 <= d2;
+    }
+
+    template<>
+    inline bool aabb<3>::intersects(tri<3> tri) const {
+      tri.v[0] -= pos;
+      tri.v[1] -= pos;
+      tri.v[2] -= pos;
+
+      if (!intersectsTriangle_axisTest_2<0>(*this, tri)) return false;
+      if (!intersectsTriangle_axisTest_2<1>(*this, tri)) return false;
+      if (!intersectsTriangle_axisTest_2<2>(*this, tri)) return false;
+
+      if (!intersectsTriangle_axisTest_3<1,0,0,0>(*this, tri)) return false;
+      if (!intersectsTriangle_axisTest_3<1,0,0,1>(*this, tri)) return false;
+      if (!intersectsTriangle_axisTest_3<1,0,0,2>(*this, tri)) return false;
+                                                          
+      if (!intersectsTriangle_axisTest_3<0,1,0,0>(*this, tri)) return false;
+      if (!intersectsTriangle_axisTest_3<0,1,0,1>(*this, tri)) return false;
+      if (!intersectsTriangle_axisTest_3<0,1,0,2>(*this, tri)) return false;
+                                                          
+      if (!intersectsTriangle_axisTest_3<0,0,1,0>(*this, tri)) return false;
+      if (!intersectsTriangle_axisTest_3<0,0,1,1>(*this, tri)) return false;
+      if (!intersectsTriangle_axisTest_3<0,0,1,2>(*this, tri)) return false;
+
+      if (!intersectsTriangle_axisTest_1(*this, tri)) return false;
+
+      return true;
+    }
+
+
+
+  }
+}
diff --git a/extern/carve/include/carve/carve.hpp b/extern/carve/include/carve/carve.hpp
new file mode 100644 (file)
index 0000000..90ca6b4
--- /dev/null
@@ -0,0 +1,238 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+#pragma once
+
+#if defined(CMAKE_BUILD)
+#  include <carve/config.h>
+#elif defined(XCODE_BUILD)
+#  include <carve/xcode_config.h>
+#elif defined(_MSC_VER)
+#  include <carve/vcpp_config.h>
+#else
+#  include <carve/config.h>
+#endif
+
+#if defined(WIN32)
+#  include <carve/win32.h>
+#elif defined(__GNUC__)
+#  include <carve/gnu_cxx.h>
+#endif
+
+#if defined(CARVE_SYSTEM_BOOST)
+#  define BOOST_INCLUDE(x) <boost/x>
+#else
+#  define BOOST_INCLUDE(x) <carve/external/boost/x>
+#endif
+
+#include <math.h>
+
+#include <string>
+#include <set>
+#include <map>
+#include <vector>
+#include <list>
+#include <sstream>
+#include <iomanip>
+
+#include <carve/collection.hpp>
+
+#include <carve/util.hpp>
+
+#include <stdarg.h>
+
+#define STR(x) #x
+#define XSTR(x) STR(x)
+
+/**
+ * \brief Top level Carve namespace.
+ */
+namespace carve {
+  static struct noinit_t {} NOINIT;
+
+  inline std::string fmtstring(const char *fmt, ...);
+
+  /**
+   * \brief Base class for all Carve exceptions.
+   */
+  struct exception {
+  private:
+    mutable std::string err;
+    mutable std::ostringstream accum;
+
+  public:
+    exception(const std::string &e) : err(e), accum() { }
+    exception() : err(), accum() { }
+    exception(const exception &e) : err(e.str()), accum() { }
+    exception &operator=(const exception &e) {
+      if (this != &e) {
+        err = e.str();
+        accum.str("");
+      }
+      return *this;
+    }
+
+    const std::string &str() const {
+      if (accum.str().size() > 0) {
+        err += accum.str();
+        accum.str("");
+      }
+      return err;
+    }
+
+    template<typename T>
+    exception &operator<<(const T &t) {
+      accum << t;
+      return *this;
+    }
+  };
+
+  template<typename iter_t, typename order_t = std::less<typename std::iterator_traits<iter_t>::value_type > >
+  struct index_sort {
+    iter_t base;
+    order_t order;
+    index_sort(const iter_t &_base) : base(_base), order() { }
+    index_sort(const iter_t &_base, const order_t &_order) : base(_base), order(_order) { }
+    template<typename U>
+    bool operator()(const U &a, const U &b) {
+      return order(*(base + a), *(base + b));
+    }
+  };
+
+  template<typename iter_t, typename order_t>
+  index_sort<iter_t, order_t> make_index_sort(const iter_t &base, const order_t &order) {
+    return index_sort<iter_t, order_t>(base, order);
+  }
+
+  template<typename iter_t>
+  index_sort<iter_t> make_index_sort(const iter_t &base) {
+    return index_sort<iter_t>(base);
+  }
+
+
+  enum RayIntersectionClass {
+    RR_DEGENERATE = -2,
+    RR_PARALLEL = -1,
+    RR_NO_INTERSECTION = 0,
+    RR_INTERSECTION = 1
+  };
+
+  enum LineIntersectionClass {
+    COLINEAR        = -1,
+    NO_INTERSECTION = 0,
+    INTERSECTION_LL = 1,
+    INTERSECTION_PL = 2,
+    INTERSECTION_LP = 3,
+    INTERSECTION_PP = 4
+  };
+
+  enum PointClass {
+    POINT_UNK = -2,
+    POINT_OUT = -1,
+    POINT_ON = 0,
+    POINT_IN = 1,
+    POINT_VERTEX = 2,
+    POINT_EDGE = 3
+  };
+
+  enum IntersectionClass {
+    INTERSECT_BAD = -1,
+    INTERSECT_NONE = 0,
+    INTERSECT_FACE = 1,
+    INTERSECT_VERTEX = 2,
+    INTERSECT_EDGE = 3,
+    INTERSECT_PLANE = 4,
+  };
+
+
+
+  extern double EPSILON;
+  extern double EPSILON2;
+
+  static inline void setEpsilon(double ep) { EPSILON = ep; EPSILON2 = ep * ep; }
+
+
+
+  template<typename T>
+  struct identity_t {
+    typedef T argument_type;
+    typedef T result_type;
+    const T &operator()(const T &t) const { return t; }
+  };
+
+
+
+  template<typename iter_t>
+  inline bool is_sorted(iter_t first, iter_t last) {
+    if (first == last) return true;
+
+    iter_t iter = first;
+    iter_t next = first; ++next;
+    for (; next != last; iter = next, ++next) {
+      if (*next < *iter) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+
+
+  template<typename iter_t,
+           typename pred_t>
+  inline bool is_sorted(iter_t first, iter_t last, pred_t pred) {
+    if (first == last) return true;
+
+    iter_t iter = first;
+    iter_t next = first; ++next;
+    for (; next != last; iter = next, ++next) {
+      if (pred(*next, *iter)) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+
+
+  inline double rangeSeparation(const std::pair<double, double> &a,
+                                const std::pair<double, double> &b) {
+    if (a.second < b.first) {
+      return b.first - a.second;
+    } else if (b.second < a.first) {
+      return a.first - b.second;
+    } else {
+      return 0.0;
+    }
+  }
+}
+
+
+#if defined(_MSC_VER)
+#  define MACRO_BEGIN do {
+#  define MACRO_END   __pragma(warning(push)) __pragma(warning(disable:4127)) } while(0) __pragma(warning(pop))
+#else
+#  define MACRO_BEGIN do {
+#  define MACRO_END   } while(0)
+#endif
+
+#if !defined(CARVE_NODEBUG)
+#  define CARVE_ASSERT(x) MACRO_BEGIN if (!(x)) throw carve::exception() << __FILE__ << ":" << __LINE__ << "  " << #x; MACRO_END
+#else
+#  define CARVE_ASSERT(X)
+#endif
+
+#define CARVE_FAIL(x) MACRO_BEGIN throw carve::exception() << __FILE__ << ":" << __LINE__ << "  " << #x; MACRO_END
diff --git a/extern/carve/include/carve/cbrt.h b/extern/carve/include/carve/cbrt.h
new file mode 100644 (file)
index 0000000..aeceab0
--- /dev/null
@@ -0,0 +1,93 @@
+// N.B. only appropriate for IEEE doubles.
+// Cube root implementation obtained from code with the following notice:
+
+/* @(#)s_cbrt.c 1.3 95/01/18 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice 
+ * is preserved.
+ * ====================================================
+ *
+ */
+
+/* Sometimes it's necessary to define __LITTLE_ENDIAN explicitly
+   but these catch some common cases. */
+
+#if defined(i386) || defined(i486) || \
+       defined(intel) || defined(x86) || defined(i86pc) || \
+       defined(__alpha) || defined(__osf__)
+#define __LITTLE_ENDIAN
+#endif
+
+#ifdef __LITTLE_ENDIAN
+#define __HI(x) *(1+(int*)&x)
+#define __LO(x) *(int*)&x
+#define __HIp(x) *(1+(int*)x)
+#define __LOp(x) *(int*)x
+#else
+#define __HI(x) *(int*)&x
+#define __LO(x) *(1+(int*)&x)
+#define __HIp(x) *(int*)x
+#define __LOp(x) *(1+(int*)x)
+#endif
+
+/* cbrt(x)
+ * Return cube root of x
+ */
+
+inline double cbrt(double x) {
+
+  static const unsigned 
+    B1 = 715094163, /* B1 = (682-0.03306235651)*2**20 */
+    B2 = 696219795; /* B2 = (664-0.03306235651)*2**20 */
+  static const double
+    C =  5.42857142857142815906e-01, /* 19/35     = 0x3FE15F15, 0xF15F15F1 */
+    D = -7.05306122448979611050e-01, /* -864/1225 = 0xBFE691DE, 0x2532C834 */
+    E =  1.41428571428571436819e+00, /* 99/70     = 0x3FF6A0EA, 0x0EA0EA0F */
+    F =  1.60714285714285720630e+00, /* 45/28     = 0x3FF9B6DB, 0x6DB6DB6E */
+    G =  3.57142857142857150787e-01; /* 5/14      = 0x3FD6DB6D, 0xB6DB6DB7 */
+
+  int  hx;
+  double r,s,t=0.0,w;
+  unsigned sign;
+
+  hx = __HI(x);                /* high word of x */
+  sign=hx&0x80000000;          /* sign= sign(x) */
+  hx  ^=sign;
+  if(hx>=0x7ff00000) return(x+x); /* cbrt(NaN,INF) is itself */
+  if((hx|__LO(x))==0) 
+    return(x);         /* cbrt(0) is itself */
+
+  __HI(x) = hx;        /* x <- |x| */
+  /* rough cbrt to 5 bits */
+  if(hx<0x00100000)            /* subnormal number */
+    {__HI(t)=0x43500000;               /* set t= 2**54 */
+    t*=x; __HI(t)=__HI(t)/3+B2;
+    }
+  else
+    __HI(t)=hx/3+B1;   
+  
+
+  /* new cbrt to 23 bits, may be implemented in single precision */
+  r=t*t/x;
+  s=C+r*t;
+  t*=G+F/(s+E+D/s);    
+
+  /* chopped to 20 bits and make it larger than cbrt(x) */ 
+  __LO(t)=0; __HI(t)+=0x00000001;
+
+  /* one step newton iteration to 53 bits with error less than 0.667 ulps */
+  s=t*t;               /* t*t is exact */
+  r=x/s;
+  w=t+t;
+  r=(r-t)/(w+r);       /* r-s is exact */
+  t=t+t*r;
+
+  /* retore the sign bit */
+  __HI(t) |= sign;
+  return(t);
+}
diff --git a/extern/carve/include/carve/classification.hpp b/extern/carve/include/carve/classification.hpp
new file mode 100644 (file)
index 0000000..7df86db
--- /dev/null
@@ -0,0 +1,115 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+
+#pragma once
+
+#include <carve/carve.hpp>
+#include <carve/collection_types.hpp>
+
+namespace carve {
+  namespace csg {
+
+    enum FaceClass {
+      FACE_UNCLASSIFIED = -3,
+      FACE_ON_ORIENT_OUT = -2,
+      FACE_OUT = -1,
+      FACE_ON = 0,
+      FACE_IN = +1,
+      FACE_ON_ORIENT_IN = +2
+    };
+
+    enum FaceClassBit {
+      FACE_ON_ORIENT_OUT_BIT = 0x01,
+      FACE_OUT_BIT           = 0x02,
+      FACE_IN_BIT            = 0x04,
+      FACE_ON_ORIENT_IN_BIT  = 0x08,
+
+      FACE_ANY_BIT           = 0x0f,
+      FACE_ON_BIT            = 0x09,
+      FACE_NOT_ON_BIT        = 0x06
+    };
+
+    static inline FaceClass class_bit_to_class(unsigned i) {
+      if (i & FACE_ON_ORIENT_OUT_BIT) return FACE_ON_ORIENT_OUT;
+      if (i & FACE_OUT_BIT) return FACE_OUT;
+      if (i & FACE_IN_BIT) return FACE_IN;
+      if (i & FACE_ON_ORIENT_IN_BIT) return FACE_ON_ORIENT_IN;
+      return FACE_UNCLASSIFIED;
+    }
+
+    static inline unsigned class_to_class_bit(FaceClass f) {
+      switch (f) {
+      case FACE_ON_ORIENT_OUT: return FACE_ON_ORIENT_OUT_BIT;
+      case FACE_OUT: return FACE_OUT_BIT;
+      case FACE_ON: return FACE_ON_BIT;
+      case FACE_IN: return FACE_IN_BIT;
+      case FACE_ON_ORIENT_IN: return FACE_ON_ORIENT_IN_BIT;
+      case FACE_UNCLASSIFIED: return FACE_ANY_BIT;
+      default: return 0;
+      }
+    }
+
+    enum EdgeClass {
+      EDGE_UNK = -2,
+      EDGE_OUT = -1,
+      EDGE_ON = 0,
+      EDGE_IN = 1
+    };
+
+
+
+    const char *ENUM(FaceClass f);
+    const char *ENUM(PointClass p);
+
+
+
+    struct ClassificationInfo {
+      const carve::mesh::Mesh<3> *intersected_mesh;
+      FaceClass classification;
+
+      ClassificationInfo() : intersected_mesh(NULL), classification(FACE_UNCLASSIFIED) { }
+      ClassificationInfo(const carve::mesh::Mesh<3> *_intersected_mesh,
+                         FaceClass _classification) :
+          intersected_mesh(_intersected_mesh),
+          classification(_classification) {
+      }
+      bool intersectedMeshIsClosed() const {
+        return intersected_mesh->isClosed();
+      }
+    };
+
+
+
+    struct EC2 {
+      EdgeClass cls[2];
+      EC2() { cls[0] = cls[1] = EDGE_UNK; }
+      EC2(EdgeClass a, EdgeClass b) { cls[0] = a; cls[1] = b; }
+    };
+
+    struct PC2 {
+      PointClass cls[2];
+      PC2() { cls[0] = cls[1] = POINT_UNK; }
+      PC2(PointClass a, PointClass b) { cls[0] = a; cls[1] = b; }
+    };
+
+    typedef std::unordered_map<std::pair<const carve::mesh::MeshSet<3>::vertex_t *, const carve::mesh::MeshSet<3>::vertex_t *>,
+                               EC2> EdgeClassification;
+
+    typedef std::unordered_map<const carve::mesh::Vertex<3> *, PC2> VertexClassification;
+
+  }
+}
diff --git a/extern/carve/include/carve/collection.hpp b/extern/carve/include/carve/collection.hpp
new file mode 100644 (file)
index 0000000..ace63d1
--- /dev/null
@@ -0,0 +1,51 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+
+#pragma once
+
+#include <carve/collection/unordered.hpp>
+
+namespace carve {
+
+  template<typename set_t>
+  class set_insert_iterator : public std::iterator<std::output_iterator_tag, void, void, void, void> {
+
+  protected:
+    set_t *set;
+  public:
+
+    set_insert_iterator(set_t &s) : set(&s) {
+    }
+
+    set_insert_iterator &
+    operator=(typename set_t::const_reference value) {
+      set->insert(value);
+      return *this;
+    }
+
+    set_insert_iterator &operator*() { return *this; }
+    set_insert_iterator &operator++() { return *this; }
+    set_insert_iterator &operator++(int) { return *this; }
+  };
+
+  template<typename set_t>
+  inline set_insert_iterator<set_t>
+  set_inserter(set_t &s) {
+    return set_insert_iterator<set_t>(s);
+  }
+
+}
diff --git a/extern/carve/include/carve/collection/unordered.hpp b/extern/carve/include/carve/collection/unordered.hpp
new file mode 100644 (file)
index 0000000..494a1ca
--- /dev/null
@@ -0,0 +1,43 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+#pragma once
+
+#if defined(HAVE_STD_UNORDERED_COLLECTIONS)
+
+#  include <carve/collection/unordered/std_impl.hpp>
+
+#elif defined(HAVE_TR1_UNORDERED_COLLECTIONS)
+
+#  include <carve/collection/unordered/tr1_impl.hpp>
+
+#elif defined(HAVE_BOOST_UNORDERED_COLLECTIONS)
+
+#  include <carve/collection/unordered/boost_impl.hpp>
+
+#elif defined(HAVE_LIBSTDCPP_UNORDERED_COLLECTIONS)
+
+#  include <carve/collection/unordered/libstdcpp_impl.hpp>
+
+#elif defined(_MSC_VER) && _MSC_VER >= 1300
+
+#  include <carve/collection/unordered/vcpp_impl.hpp>
+
+#else
+
+#  include <carve/collection/unordered/fallback_impl.hpp>
+
+#endif
diff --git a/extern/carve/include/carve/collection/unordered/boost_impl.hpp b/extern/carve/include/carve/collection/unordered/boost_impl.hpp
new file mode 100644 (file)
index 0000000..96b1407
--- /dev/null
@@ -0,0 +1,45 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+
+#pragma once
+
+#include BOOST_INCLUDE(unordered_set.hpp)
+#include BOOST_INCLUDE(unordered_map.hpp)
+
+#include <functional>
+
+namespace std {
+  template <typename Key, typename T, typename Hash = boost::hash<Key>,
+            typename Pred = std::equal_to<Key> >
+  class unordered_map : public boost::unordered_map<Key, T, Hash, Pred> {
+
+  public:
+    typedef T data_type;
+  };
+
+  template <typename Key, typename T, typename Hash = boost::hash<Key>,
+            typename Pred = std::equal_to<Key> >
+  class unordered_multimap : public boost::unordered_multimap<Key, T, Hash, Pred> {
+  };
+
+  template <typename Value, typename Hash = boost::hash<Value>,
+            typename Pred = std::equal_to<Value> >
+  class unordered_set : public boost::unordered_set<Value, Hash, Pred> {
+  };
+}
+
+#undef UNORDERED_COLLECTIONS_SUPPORT_RESIZE
diff --git a/extern/carve/include/carve/collection/unordered/fallback_impl.hpp b/extern/carve/include/carve/collection/unordered/fallback_impl.hpp
new file mode 100644 (file)
index 0000000..70422b2
--- /dev/null
@@ -0,0 +1,40 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+
+#pragma once
+
+#include <set>
+#include <map>
+
+namespace std {
+
+  template<typename K, typename T, typename H = int>
+  class unordered_map : public std::map<K, T> {
+    typedef std::map<K, T> super;
+  public:
+    typedef T data_type;
+  };
+
+  template<typename K, typename H = int>
+  class unordered_set : public std::set<K> {
+    typedef std::set<K> super;
+  public:
+  };
+
+}
+
+#undef UNORDERED_COLLECTIONS_SUPPORT_RESIZE
diff --git a/extern/carve/include/carve/collection/unordered/libstdcpp_impl.hpp b/extern/carve/include/carve/collection/unordered/libstdcpp_impl.hpp
new file mode 100644 (file)
index 0000000..e1ad430
--- /dev/null
@@ -0,0 +1,61 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+#pragma once
+
+#include <ext/hash_map>
+#include <ext/hash_set>
+
+namespace __gnu_cxx {
+  template <typename T>
+  struct hash<T *> : public std::unary_function<T *, size_t> {
+    size_t operator()(T *v) const {
+      size_t x = (size_t)(v);
+      return x + (x>>3);
+    }
+  };
+
+  template <typename A, typename B>
+  struct hash<std::pair<A, B> > : public std::unary_function<std::pair<A, B>, size_t> {
+    size_t operator()(const std::pair<A, B> &v) const {
+      std::size_t seed = 0;
+
+      seed ^= hash<A>()(v.first);
+      seed ^= hash<B>()(v.second) + (seed<<6) + (seed>>2);
+
+      return seed;
+    }
+  };
+}
+
+namespace std {
+
+  template<typename K, typename V, typename H = __gnu_cxx::hash<K> >
+  class unordered_map : public __gnu_cxx::hash_map<K, V, H> {
+    typedef __gnu_cxx::hash_map<K, V, H> super;
+  public:
+    typedef typename super::mapped_type data_type;
+  };
+
+  template<typename K, typename H = __gnu_cxx::hash<K> >
+  class unordered_set : public __gnu_cxx::hash_set<K, H> {
+    typedef __gnu_cxx::hash_set<K, H> super;
+  public:
+  };
+
+}
+
+#define UNORDERED_COLLECTIONS_SUPPORT_RESIZE 1
diff --git a/extern/carve/include/carve/collection/unordered/std_impl.hpp b/extern/carve/include/carve/collection/unordered/std_impl.hpp
new file mode 100644 (file)
index 0000000..68a3f12
--- /dev/null
@@ -0,0 +1,23 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+
+#pragma once
+
+#include <unordered_map>
+#include <unordered_set>
+
+#undef UNORDERED_COLLECTIONS_SUPPORT_RESIZE
diff --git a/extern/carve/include/carve/collection/unordered/tr1_impl.hpp b/extern/carve/include/carve/collection/unordered/tr1_impl.hpp
new file mode 100644 (file)
index 0000000..2c7f39f
--- /dev/null
@@ -0,0 +1,58 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+
+#pragma once
+
+#include <tr1/unordered_map>
+#include <tr1/unordered_set>
+#include <tr1/functional>
+
+namespace std {
+  namespace tr1 {
+    template <typename A, typename B>
+    struct hash<std::pair<A, B> > : public std::unary_function<std::pair<A, B>, size_t> {
+      size_t operator()(const std::pair<A, B> &v) const {
+        std::size_t seed = 0;
+
+        seed ^= hash<A>()(v.first);
+        seed ^= hash<B>()(v.second) + (seed<<6) + (seed>>2);
+
+        return seed;
+      }
+    };
+  }
+
+
+
+  template <typename Key, typename T,
+            typename Hash = tr1::hash<Key>,
+            typename Pred = std::equal_to<Key> >
+  class unordered_map : public std::tr1::unordered_map<Key, T, Hash, Pred> {
+  public:
+    typedef T data_type;
+  };
+
+  template <typename Value,
+            typename Hash = tr1::hash<Value>,
+            typename Pred = std::equal_to<Value> >
+  class unordered_set : public std::tr1::unordered_set<Value, Hash, Pred> {
+  public:
+  };
+
+}
+
+#undef UNORDERED_COLLECTIONS_SUPPORT_RESIZE
diff --git a/extern/carve/include/carve/collection/unordered/vcpp_impl.hpp b/extern/carve/include/carve/collection/unordered/vcpp_impl.hpp
new file mode 100644 (file)
index 0000000..825edad
--- /dev/null
@@ -0,0 +1,65 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+
+#pragma once
+
+#include <hash_map>
+#include <hash_set>
+
+namespace std {
+
+  namespace {
+
+    template<class Value, class Hash> class hash_traits {
+      Hash hash_value;
+      std::less<Value> comp;
+    public:
+      enum {
+        bucket_size = 4,
+        min_buckets = 8
+      };
+      // hash _Keyval to size_t value
+      size_t operator()(const Value& v) const {
+        return ((size_t)hash_value(v));
+      }
+      // test if _Keyval1 ordered before _Keyval2
+      bool operator()(const Value& v1, const Value& v2) const {
+        return (comp(v1, v2));
+      }
+    };
+
+  }
+
+  template <typename Key, typename T, typename Hash = stdext::hash_compare<Key, less<Key> >, typename Pred = std::equal_to<Key> >
+  class unordered_map 
+    : public stdext::hash_map<Key, T, hash_traits<Key, Hash> > {
+    typedef stdext::hash_map<Key, T, hash_traits<Key, Hash> > super;
+  public:
+    unordered_map() : super() {}
+  };
+
+  template <typename Value, typename Hash = stdext::hash_compare<Key, less<Key> >, typename Pred = std::equal_to<Value> >
+  class unordered_set
+    : public stdext::hash_set<Value, hash_traits<Value, Hash> > {
+    typedef stdext::hash_set<Value, hash_traits<Value, Hash> > super;
+  public:
+    unordered_set() : super() {}
+  };
+
+}
+
+#undef UNORDERED_COLLECTIONS_SUPPORT_RESIZE
diff --git a/extern/carve/include/carve/collection_types.hpp b/extern/carve/include/carve/collection_types.hpp
new file mode 100644 (file)
index 0000000..997d581
--- /dev/null
@@ -0,0 +1,63 @@
+
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+
+#pragma once
+
+#include <carve/carve.hpp>
+
+#include <carve/mesh.hpp>
+
+namespace carve {
+  namespace csg {
+
+    typedef std::pair<
+      carve::mesh::MeshSet<3>::vertex_t *,
+      carve::mesh::MeshSet<3>::vertex_t *> V2;
+
+    typedef std::pair<
+      carve::mesh::MeshSet<3>::face_t *,
+      carve::mesh::MeshSet<3>::face_t *> F2;
+
+    static inline V2 ordered_edge(
+      carve::mesh::MeshSet<3>::vertex_t *a,
+      carve::mesh::MeshSet<3>::vertex_t *b) {
+      return V2(std::min(a, b), std::max(a, b));
+    }
+
+    static inline V2 flip(const V2 &v) {
+      return V2(v.second, v.first);
+    }
+
+    // include/carve/csg.hpp include/carve/faceloop.hpp
+    // lib/intersect.cpp lib/intersect_classify_common_impl.hpp
+    // lib/intersect_classify_edge.cpp
+    // lib/intersect_classify_group.cpp
+    // lib/intersect_classify_simple.cpp
+    // lib/intersect_face_division.cpp lib/intersect_group.cpp
+    // lib/intersect_half_classify_group.cpp
+    typedef std::unordered_set<V2> V2Set;
+
+    // include/carve/csg.hpp include/carve/polyhedron_decl.hpp
+    // lib/csg_collector.cpp lib/intersect.cpp
+    // lib/intersect_common.hpp lib/intersect_face_division.cpp
+    // lib/polyhedron.cpp
+    typedef std::unordered_map<
+      carve::mesh::MeshSet<3>::vertex_t *,
+      carve::mesh::MeshSet<3>::vertex_t *> VVMap;
+  }
+}
diff --git a/extern/carve/include/carve/colour.hpp b/extern/carve/include/carve/colour.hpp
new file mode 100644 (file)
index 0000000..420f8f7
--- /dev/null
@@ -0,0 +1,47 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+
+#pragma once
+
+#include <carve/carve.hpp>
+#include <carve/geom.hpp>
+
+namespace carve {
+  namespace colour {
+    static inline void HSV2RGB(float H, float S, float V, float &r, float &g, float &b) {
+      H = 6.0f * H;
+      if (S < 5.0e-6) {
+        r = g = b = V; return;
+      } else {
+        int i = (int)H;
+        float f = H - i;
+        float p1 = V * (1.0f - S);
+        float p2 = V * (1.0f - S * f);
+        float p3 = V * (1.0f - S * (1.0f - f));
+        switch (i) {
+        case 0:  r = V;  g = p3; b = p1; return;
+        case 1:  r = p2; g = V;  b = p1; return;
+        case 2:  r = p1; g = V;  b = p3; return;
+        case 3:  r = p1; g = p2; b = V;  return;
+        case 4:  r = p3; g = p1; b = V;  return;
+        case 5:  r = V;  g = p1; b = p2; return;
+        }
+      }
+      r = g = b = 0.0;
+    }
+  }
+}
diff --git a/extern/carve/include/carve/config.h b/extern/carve/include/carve/config.h
new file mode 100644 (file)
index 0000000..fdae2d2
--- /dev/null
@@ -0,0 +1,12 @@
+#define CARVE_VERSION "2.0.0a"
+
+#undef CARVE_DEBUG
+#undef CARVE_DEBUG_WRITE_PLY_DATA
+
+#if defined(__GNUC__)
+#  if !defined(HAVE_BOOST_UNORDERED_COLLECTIONS)
+#    define HAVE_TR1_UNORDERED_COLLECTIONS
+#  endif
+
+#  define HAVE_STDINT_H
+#endif
diff --git a/extern/carve/include/carve/convex_hull.hpp b/extern/carve/include/carve/convex_hull.hpp
new file mode 100644 (file)
index 0000000..bcb7c97
--- /dev/null
@@ -0,0 +1,52 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+
+#pragma once
+
+#include <list>
+#include <vector>
+#include <algorithm>
+
+#include <carve/carve.hpp>
+
+#include <carve/geom2d.hpp>
+
+namespace carve {
+  namespace geom {
+    std::vector<int> convexHull(const std::vector<carve::geom2d::P2> &points);
+
+    template<typename project_t, typename polygon_container_t>
+    std::vector<int> convexHull(const project_t &project, const polygon_container_t &points) {
+      std::vector<carve::geom2d::P2> proj;
+      proj.reserve(points.size());
+      for (typename polygon_container_t::const_iterator i = points.begin(); i != points.end(); ++i) {
+        proj.push_back(project(*i));
+      }
+      return convexHull(proj);
+    }
+
+    template<typename project_t, typename iter_t>
+    std::vector<int> convexHull(const project_t &project, iter_t beg, iter_t end, size_t size_hint = 0) {
+      std::vector<carve::geom2d::P2> proj;
+      if (size_hint) proj.reserve(size_hint);
+      for (; beg != end; ++beg) {
+        proj.push_back(project(*beg));
+      }
+      return convexHull(proj);
+    }
+  }
+}
diff --git a/extern/carve/include/carve/csg.hpp b/extern/carve/include/carve/csg.hpp
new file mode 100644 (file)
index 0000000..db32273
--- /dev/null
@@ -0,0 +1,498 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+
+#pragma once
+
+#include <list>
+#include <vector>
+#include <algorithm>
+
+#include <carve/carve.hpp>
+
+#include <carve/geom3d.hpp>
+
+#include <carve/mesh.hpp>
+
+#include <carve/collection_types.hpp>
+#include <carve/classification.hpp>
+#include <carve/iobj.hpp>
+#include <carve/faceloop.hpp>
+#include <carve/intersection.hpp>
+#include <carve/rtree.hpp>
+
+namespace carve {
+  namespace csg {
+
+    class VertexPool {
+      typedef carve::mesh::MeshSet<3>::vertex_t vertex_t;
+
+      const static unsigned blocksize = 1024;
+      typedef std::list<std::vector<vertex_t> > pool_t;
+      pool_t pool;
+    public:
+      void reset();
+      vertex_t *get(const vertex_t::vector_t &v = vertex_t::vector_t::ZERO());
+      bool inPool(vertex_t *v) const;
+
+      VertexPool();
+      ~VertexPool();
+    };
+
+
+
+    namespace detail {
+      struct Data;
+      class LoopEdges;
+    }
+
+    /** 
+     * \class CSG
+     * \brief The class responsible for the computation of CSG operations.
+     * 
+     */
+    class CSG {
+    private:
+
+    public:
+      typedef carve::mesh::MeshSet<3> meshset_t;
+
+      struct Hook {
+        /** 
+         * \class Hook
+         * \brief Provides API access to intermediate steps in CSG calculation.
+         * 
+         */
+        virtual void intersectionVertex(const meshset_t::vertex_t * /* vertex */,
+                                        const IObjPairSet & /* intersections */) {
+        }
+        virtual void processOutputFace(std::vector<meshset_t::face_t *> & /* faces */,
+                                       const meshset_t::face_t * /* orig_face */,
+                                       bool /* flipped */) {
+        }
+        virtual void resultFace(const meshset_t::face_t * /* new_face */,
+                                const meshset_t::face_t * /* orig_face */,
+                                bool /* flipped */) {
+        }
+
+        virtual ~Hook() {
+        }
+      };
+
+        /** 
+         * \class Hooks
+         * \brief Management of API hooks.
+         * 
+         */
+      class Hooks {
+      public:
+        enum {
+          RESULT_FACE_HOOK         = 0,
+          PROCESS_OUTPUT_FACE_HOOK = 1,
+          INTERSECTION_VERTEX_HOOK = 2,
+          HOOK_MAX                 = 3,
+
+          RESULT_FACE_BIT          = 0x0001,
+          PROCESS_OUTPUT_FACE_BIT  = 0x0002, 
+          INTERSECTION_VERTEX_BIT  = 0x0004
+       };
+
+        std::vector<std::list<Hook *> > hooks;
+
+        bool hasHook(unsigned hook_num);
+
+        void intersectionVertex(const meshset_t::vertex_t *vertex,
+                                const IObjPairSet &intersections);
+
+        void processOutputFace(std::vector<meshset_t::face_t *> &faces,
+                               const meshset_t::face_t *orig_face,
+                               bool flipped);
+
+        void resultFace(const meshset_t::face_t *new_face,
+                        const meshset_t::face_t *orig_face,
+                        bool flipped);
+
+        void registerHook(Hook *hook, unsigned hook_bits);
+        void unregisterHook(Hook *hook);
+
+        void reset();
+
+        Hooks();
+        ~Hooks();
+      };
+
+        /** 
+         * \class Collector
+         * \brief Base class for objects responsible for selecting result from which form the result polyhedron.
+         * 
+         */
+      class Collector {
+        Collector(const Collector &);
+        Collector &operator=(const Collector &);
+
+      protected:
+
+      public:
+        virtual void collect(FaceLoopGroup *group, CSG::Hooks &) =0;
+        virtual meshset_t *done(CSG::Hooks &) =0;
+
+        Collector() {}
+        virtual ~Collector() {}
+      };
+
+    private:
+      typedef carve::geom::RTreeNode<3, carve::mesh::Face<3> *> face_rtree_t;
+      typedef std::unordered_map<carve::mesh::Face<3> *, std::vector<carve::mesh::Face<3> *> > face_pairs_t;
+
+      /// The computed intersection data.
+      Intersections intersections;
+
+      /// A map from intersection point to a set of intersections
+      /// represented by pairs of intersection objects.
+      VertexIntersections vertex_intersections;
+
+      /// A pool from which temporary vertices are allocated. Also
+      /// provides testing for pool membership.
+      VertexPool vertex_pool;
+
+      void init();
+
+      void makeVertexIntersections();
+
+      void groupIntersections();
+
+      void _generateVertexVertexIntersections(carve::mesh::MeshSet<3>::vertex_t *va,
+                                              carve::mesh::MeshSet<3>::edge_t *eb);
+      void generateVertexVertexIntersections(carve::mesh::MeshSet<3>::face_t *a,
+                                             const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
+
+      void _generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::vertex_t *va,
+                                            carve::mesh::MeshSet<3>::edge_t *eb);
+      void generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a,
+                                           const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
+
+      void _generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::edge_t *ea,
+                                          carve::mesh::MeshSet<3>::edge_t *eb);
+      void generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a,
+                                         const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
+
+      void _generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa,
+                                            carve::mesh::MeshSet<3>::edge_t *eb);
+      void generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *a,
+                                           const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
+
+      void _generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa,
+                                          carve::mesh::MeshSet<3>::edge_t *eb);
+      void generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *a,
+                                         const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
+
+      void generateIntersectionCandidates(carve::mesh::MeshSet<3> *a,
+                                          const face_rtree_t *a_node,
+                                          carve::mesh::MeshSet<3> *b,
+                                          const face_rtree_t *b_node,
+                                          face_pairs_t &face_pairs,
+                                          bool descend_a = true);
+      /** 
+       * \brief Compute all points of intersection between poly \a a and poly \a b
+       * 
+       * @param a Polyhedron a.
+       * @param b Polyhedron b.
+       */
+      void generateIntersections(meshset_t *a,
+                                 const face_rtree_t *a_node,
+                                 meshset_t *b,
+                                 const face_rtree_t *b_node,
+                                 detail::Data &data);
+
+      /** 
+       * \brief Generate tables of intersecting pairs of faces.
+       *
+       * @param[out] data Internal data-structure holding intersection info.
+       */
+      void intersectingFacePairs(detail::Data &data);
+
+      /** 
+       * \brief Divide edges in \a edges that are intersected by polyhedron \a poly
+       * 
+       * @param edges The edges to divide.
+       * @param[in] poly The polyhedron to divide against.
+       * @param[in,out] data Intersection information.
+       */
+      void divideEdges(
+        const std::vector<meshset_t::edge_t> &edges,
+        meshset_t *poly,
+        detail::Data &data);
+
+      void divideIntersectedEdges(detail::Data &data);
+
+      /** 
+       * \brief From the intersection points of pairs of intersecting faces, compute intersection edges.
+       * 
+       * @param[out] eclass Classification information about created edges.
+       * @param[in,out] data Intersection information.
+       */
+      void makeFaceEdges(
+        EdgeClassification &eclass,
+        detail::Data &data);
+
+      friend void classifyEasyFaces(
+        FaceLoopList &face_loops,
+        VertexClassification &vclass,
+        meshset_t *other_poly,
+        int other_poly_num,
+        CSG &csg,
+        CSG::Collector &collector);
+
+      size_t generateFaceLoops(
+        meshset_t *poly,
+        const detail::Data &data,
+        FaceLoopList &face_loops_out);
+
+
+
+      // intersect_group.cpp
+
+      /** 
+       * \brief Build a loop edge mapping from a list of face loops.
+       * 
+       * @param[in] loops A list of face loops.
+       * @param[in] edge_count A hint as to the number of edges in \a loops.
+       * @param[out] edge_map The calculated map of edges to loops.
+       */
+      void makeEdgeMap(
+        const FaceLoopList &loops,
+        size_t edge_count,
+        detail::LoopEdges &edge_map);
+
+      /** 
+       * \brief Divide a list of face loops into groups that are connected by at least one edge not present in \a no_cross.
+       * 
+       * @param[in] src The source mesh from which these loops derive.
+       * @param[in,out] face_loops The list of loops (will be emptied as a side effect)
+       * @param[in] loop_edges A loop edge map used for traversing connected loops.
+       * @param[in] no_cross A set of edges not to cross.
+       * @param[out] out_loops A list of grouped face loops.
+       */
+      void groupFaceLoops(
+        carve::mesh::MeshSet<3> *src,
+        FaceLoopList &face_loops,
+        const detail::LoopEdges &loop_edges,
+        const V2Set &no_cross,
+        FLGroupList &out_loops);
+
+      /** 
+       * \brief Find the set of edges shared between two edge maps.
+       * 
+       * @param[in] edge_map_a The first edge map.
+       * @param[in] edge_map_b The second edge map.
+       * @param[out] shared_edges The resulting set of common edges.
+       */
+      void findSharedEdges(
+        const detail::LoopEdges &edge_map_a,
+        const detail::LoopEdges &edge_map_b,
+        V2Set &shared_edges);
+
+
+      // intersect_classify_edge.cpp
+
+      /** 
+       * 
+       * 
+       * @param shared_edges 
+       * @param vclass 
+       * @param poly_a 
+       * @param a_loops_grouped 
+       * @param a_edge_map 
+       * @param poly_b 
+       * @param b_loops_grouped 
+       * @param b_edge_map 
+       * @param collector 
+       */
+      void classifyFaceGroupsEdge(
+        const V2Set &shared_edges,
+        VertexClassification &vclass,
+        meshset_t *poly_a,
+        const face_rtree_t *poly_a_rtree,
+        FLGroupList &a_loops_grouped,
+        const detail::LoopEdges &a_edge_map,
+        meshset_t *poly_b,
+        const face_rtree_t *poly_b_rtree,
+        FLGroupList &b_loops_grouped,
+        const detail::LoopEdges &b_edge_map,
+        CSG::Collector &collector);
+
+      // intersect_classify_group.cpp
+
+      /** 
+       * 
+       * 
+       * @param shared_edges 
+       * @param vclass 
+       * @param poly_a 
+       * @param a_loops_grouped 
+       * @param a_edge_map 
+       * @param poly_b 
+       * @param b_loops_grouped 
+       * @param b_edge_map 
+       * @param collector 
+       */
+      void classifyFaceGroups(
+        const V2Set &shared_edges,
+        VertexClassification &vclass,
+        meshset_t *poly_a, 
+        const face_rtree_t *poly_a_rtree,
+        FLGroupList &a_loops_grouped,
+        const detail::LoopEdges &a_edge_map,
+        meshset_t *poly_b,
+        const face_rtree_t *poly_b_rtree,
+        FLGroupList &b_loops_grouped,
+        const detail::LoopEdges &b_edge_map,
+        CSG::Collector &collector);
+
+      // intersect_half_classify_group.cpp
+
+      /** 
+       * 
+       * 
+       * @param shared_edges 
+       * @param vclass 
+       * @param poly_a 
+       * @param a_loops_grouped 
+       * @param a_edge_map 
+       * @param poly_b 
+       * @param b_loops_grouped 
+       * @param b_edge_map 
+       * @param FaceClass 
+       * @param b_out 
+       */
+      void halfClassifyFaceGroups(
+        const V2Set &shared_edges,
+        VertexClassification &vclass,
+        meshset_t *poly_a, 
+        const face_rtree_t *poly_a_rtree,
+        FLGroupList &a_loops_grouped,
+        const detail::LoopEdges &a_edge_map,
+        meshset_t *poly_b,
+        const face_rtree_t *poly_b_rtree,
+        FLGroupList &b_loops_grouped,
+        const detail::LoopEdges &b_edge_map,
+        std::list<std::pair<FaceClass, meshset_t  *> > &b_out);
+
+      // intersect.cpp
+
+      /** 
+       * \brief The main calculation method for CSG.
+       * 
+       * @param[in] a Polyhedron a
+       * @param[in] b Polyhedron b
+       * @param[out] vclass 
+       * @param[out] eclass 
+       * @param[out] a_face_loops 
+       * @param[out] b_face_loops 
+       * @param[out] a_edge_count 
+       * @param[out] b_edge_count 
+       */
+      void calc(
+        meshset_t  *a,
+        const face_rtree_t *a_rtree,
+        meshset_t  *b,
+        const face_rtree_t *b_rtree,
+        VertexClassification &vclass,
+        EdgeClassification &eclass,
+        FaceLoopList &a_face_loops,
+        FaceLoopList &b_face_loops,
+        size_t &a_edge_count,
+        size_t &b_edge_count);
+
+    public:
+      /**
+       * \enum OP
+       * \brief Enumeration of the supported CSG operations.
+       */
+      enum OP {
+        UNION,                  /**< in a or b. */
+        INTERSECTION,           /**< in a and b. */
+        A_MINUS_B,              /**< in a, but not b. */
+        B_MINUS_A,              /**< in b, but not a. */
+        SYMMETRIC_DIFFERENCE,   /**< in a or b, but not both. */
+        ALL                     /**< all split faces from a and b */
+      };
+
+      /**
+       * \enum CLASSIFY_TYPE
+       * \brief The type of classification algorithm to use.
+       */
+      enum CLASSIFY_TYPE {
+        CLASSIFY_NORMAL,        /**< Normal (group) classifier. */
+        CLASSIFY_EDGE           /**< Edge classifier. */
+      };
+
+      CSG::Hooks hooks;         /**< The manager for calculation hooks. */
+
+      CSG();
+      ~CSG();
+
+      /** 
+       * \brief Compute a CSG operation between two polyhedra, \a a and \a b.
+       * 
+       * @param a Polyhedron a
+       * @param b Polyhedron b
+       * @param collector The collector (determines the CSG operation performed)
+       * @param shared_edges A pointer to a set that will be populated with shared edges (if not NULL).
+       * @param classify_type The type of classifier to use.
+       * 
+       * @return 
+       */
+      meshset_t *compute(
+        meshset_t *a,
+        meshset_t *b,
+        CSG::Collector &collector,
+        V2Set *shared_edges = NULL,
+        CLASSIFY_TYPE classify_type = CLASSIFY_NORMAL);
+
+      /** 
+       * \brief Compute a CSG operation between two closed polyhedra, \a a and \a b.
+       * 
+       * @param a Polyhedron a
+       * @param b Polyhedron b
+       * @param op The CSG operation (A collector is created automatically).
+       * @param shared_edges A pointer to a set that will be populated with shared edges (if not NULL).
+       * @param classify_type The type of classifier to use.
+       * 
+       * @return 
+       */
+      meshset_t *compute(
+        meshset_t *a,
+        meshset_t *b,
+        OP op,
+        V2Set *shared_edges = NULL,
+        CLASSIFY_TYPE classify_type = CLASSIFY_NORMAL);
+
+      void slice(
+        meshset_t *a,
+        meshset_t *b,
+        std::list<meshset_t  *> &a_sliced,
+        std::list<meshset_t  *> &b_sliced,
+        V2Set *shared_edges = NULL);
+
+      bool sliceAndClassify(
+        meshset_t *closed,
+        meshset_t *open,
+        std::list<std::pair<FaceClass, meshset_t *> > &result,
+        V2Set *shared_edges = NULL);
+    };
+  }
+}
diff --git a/extern/carve/include/carve/csg_triangulator.hpp b/extern/carve/include/carve/csg_triangulator.hpp
new file mode 100644 (file)
index 0000000..7405855
--- /dev/null
@@ -0,0 +1,434 @@
+// Begin License:
+// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
+// All rights reserved.
+//
+// This file is part of the Carve CSG Library (http://carve-csg.com/)
+//
+// This file may be used under the terms of the GNU General Public
+// License version 2.0 as published by the Free Software Foundation
+// and appearing in the file LICENSE.GPL2 included in the packaging of
+// this file.
+//
+// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE.
+// End:
+
+#include <carve/csg.hpp>
+#include <carve/tag.hpp>
+#include <carve/poly.hpp>
+#include <carve/triangulator.hpp>
+#include <deque>
+
+namespace carve {
+  namespace csg {
+
+    namespace detail {
+      template<bool with_improvement>
+      class CarveTriangulator : public csg::CSG::Hook {
+
+      public:
+        CarveTriangulator() {
+        }
+
+        virtual ~CarveTriangulator() {
+        }
+
+        virtual void processOutputFace(std::vector<carve::mesh::MeshSet<3>::face_t *> &faces,
+                                       const carve::mesh::MeshSet<3>::face_t *orig,
+                                       bool flipped) {
+          std::vector<carve::mesh::MeshSet<3>::face_t *> out_faces;
+
+          size_t n_tris = 0;
+          for (size_t f = 0; f < faces.size(); ++f) {
+            CARVE_ASSERT(faces[f]->nVertices() >= 3);
+            n_tris += faces[f]->nVertices() - 2;
+          }
+
+          out_faces.reserve(n_tris);
+
+          for (size_t f = 0; f < faces.size(); ++f) {
+            carve::mesh::MeshSet<3>::face_t *face = faces[f];
+
+            if (face->nVertices() == 3) {
+              out_faces.push_back(face);
+              continue;
+            }
+
+            std::vector<triangulate::tri_idx> result;
+
+            std::vector<carve::mesh::MeshSet<3>::vertex_t *> vloop;
+            face->getVertices(vloop);
+
+            triangulate::triangulate(
+                carve::mesh::MeshSet<3>::face_t::projection_mapping(face->project),
+                vloop,
+                result);
+
+            if (with_improvement) {
+              triangulate::improve(
+                  carve::mesh::MeshSet<3>::face_t::projection_mapping(face->project),
+                  vloop,
+                  carve::mesh::vertex_distance(),
+                  result);
+            }
+
+            std::vector<carve::mesh::MeshSet<3>::vertex_t *> fv;
+            fv.resize(3);
+            for (size_t i = 0; i < result.size(); ++i) {
+              fv[0] = vloop[result[i].a];
+              fv[1] = vloop[result[i].b];
+              fv[2] = vloop[result[i].c];
+              out_faces.push_back(face->create(fv.begin(), fv.end(), false));
+            }
+            delete face;
+          }
+          std::swap(faces, out_faces);
+        }
+      };
+    }
+
+    typedef detail::CarveTriangulator<false> CarveTriangulator;
+    typedef detail::CarveTriangulator<true> CarveTriangulatorWithImprovement;
+
+    class CarveTriangulationImprover : public csg::CSG::Hook {
+    public:
+      CarveTriangulationImprover() {
+      }
+
+      virtual ~CarveTriangulationImprover() {
+      }
+
+      virtual void processOutputFace(std::vector<carve::mesh::MeshSet<3>::face_t *> &faces,
+                                     const carve::mesh::MeshSet<3>::face_t *orig,
+                                     bool flipped) {
+        if (faces.size() == 1) return;
+
+        // doing improvement as a separate hook is much messier than
+        // just incorporating it into the triangulation hook.
+
+        typedef std::map<carve::mesh::MeshSet<3>::vertex_t *, size_t> vert_map_t;
+        std::vector<carve::mesh::MeshSet<3>::face_t *> out_faces;
+        vert_map_t vert_map;
+
+        out_faces.reserve(faces.size());
+
+
+        carve::mesh::MeshSet<3>::face_t::projection_mapping projector(faces[0]->project);
+
+        std::vector<triangulate::tri_idx> result;
+
+        for (size_t f = 0; f < faces.size(); ++f) {
+          carve::mesh::MeshSet<3>::face_t *face = faces[f];
+          if (face->nVertices() != 3) {
+            out_faces.push_back(face);
+          } else {
+            triangulate::tri_idx tri;
+            for (carve::mesh::MeshSet<3>::face_t::edge_iter_t i = face->begin(); i != face->end(); ++i) {
+              size_t v = 0;
+              vert_map_t::iterator j = vert_map.find(i->vert);
+              if (j == vert_map.end()) {
+                v = vert_map.size();
+                vert_map[i->vert] = v;
+              } else {
+                v = (*j).second;
+              }
+              tri.v[i.idx()] = v;
+            }
+            result.push_back(tri);
+            delete face;
+          }
+        }
+
+        std::vector<carve::mesh::MeshSet<3>::vertex_t *> verts;
+        verts.resize(vert_map.size());
+        for (vert_map_t::iterator i = vert_map.begin(); i != vert_map.end(); ++i) {
+          verts[(*i).second] = (*i).first;
+        }
+        triangulate::improve(projector, verts, carve::mesh::vertex_distance(), result);
+
+        std::vector<carve::mesh::MeshSet<3>::vertex_t *> fv;
+        fv.resize(3);
+        for (size_t i = 0; i < result.size(); ++i) {
+          fv[0] = verts[result[i].a];
+          fv[1] = verts[result[i].b];
+          fv[2] = verts[result[i].c];
+          out_faces.push_back(orig->create(fv.begin(), fv.end(), false));
+        }
+
+        std::swap(faces, out_faces);
+      }
+    };
+
+    class CarveTriangulationQuadMerger : public csg::CSG::Hook {
+      // this code is incomplete.
+      typedef std::map<V2, F2> edge_map_t;
+
+    public:
+      CarveTriangulationQuadMerger() {
+      }
+
+      virtual ~CarveTriangulationQuadMerger() {
+      }
+
+      double scoreQuad(edge_map_t::iterator i, edge_map_t &edge_map) {
+        if (!(*i).second.first || !(*i).second.second) return -1;
+        return 0;
+      }
+
+      carve::mesh::MeshSet<3>::face_t *mergeQuad(edge_map_t::iterator i, edge_map_t &edge_map) {
+        return NULL;
+      }
+
+      void recordEdge(carve::mesh::MeshSet<3>::vertex_t *v1,
+                      carve::mesh::MeshSet<3>::vertex_t *v2,
+                      carve::mesh::MeshSet<3>::face_t *f,
+                      edge_map_t &edge_map) {
+        if (v1 < v2) {
+          edge_map[V2(v1, v2)].first = f;
+        } else {
+          edge_map[V2(v2, v1)].second = f;
+        }
+      }
+
+      virtual void processOutputFace(std::vector<carve::mesh::MeshSet<3>::face_t *> &faces,
+                                     const carve::mesh::MeshSet<3>::face_t *orig,
+                                     bool flipped) {
+        if (faces.size() == 1) return;
+
+        std::vector<carve::mesh::MeshSet<3>::face_t *> out_faces;
+        edge_map_t edge_map;
+
+        out_faces.reserve(faces.size());
+
+        poly::p2_adapt_project<3> projector(faces[0]->project);
+
+        for (size_t f = 0; f < faces.size(); ++f) {
+          carve::mesh::MeshSet<3>::face_t *face = faces[f];
+          if (face->nVertices() != 3) {
+            out_faces.push_back(face);
+          } else {
+            carve::mesh::MeshSet<3>::face_t::vertex_t *v1, *v2, *v3;
+            v1 = face->edge->vert;
+            v2 = face->edge->next->vert;
+            v3 = face->edge->next->next->vert;
+            recordEdge(v1, v2, face, edge_map);
+            recordEdge(v2, v3, face, edge_map);
+            recordEdge(v3, v1, face, edge_map);
+          }
+        }
+
+        for (edge_map_t::iterator i = edge_map.begin(); i != edge_map.end();) {
+          if ((*i).second.first && (*i).second.second) {
+            ++i;
+          } else {
+            edge_map.erase(i++);
+          }
+        }
+
+        while (edge_map.size()) {
+          edge_map_t::iterator i = edge_map.begin();
+          edge_map_t::iterator best = i;
+          double best_score = scoreQuad(i, edge_map);
+          for (++i; i != edge_map.end(); ++i) {
+            double score = scoreQuad(i, edge_map);
+            if (score > best_score) best = i;
+          }
+          if (best_score < 0) break;
+          out_faces.push_back(mergeQuad(best, edge_map));
+        }
+
+        if (edge_map.size()) {
+          tagable::tag_begin();
+          for (edge_map_t::iterator i = edge_map.begin(); i != edge_map.end(); ++i) {
+            carve::mesh::MeshSet<3>::face_t *a = const_cast<carve::mesh::MeshSet<3>::face_t *>((*i).second.first);
+            carve::mesh::MeshSet<3>::face_t *b = const_cast<carve::mesh::MeshSet<3>::face_t *>((*i).second.first);
+            if (a && a->tag_once()) out_faces.push_back(a);
+            if (b && b->tag_once()) out_faces.push_back(b);
+          }
+        }
+
+        std::swap(faces, out_faces);
+      }
+    };
+
+    class CarveHoleResolver : public csg::CSG::Hook {
+
+    public:
+      CarveHoleResolver() {
+      }
+
+      virtual ~CarveHoleResolver() {
+      }
+
+      bool findRepeatedEdges(const std::vector<carve::mesh::MeshSet<3>::vertex_t *> &vertices,
+                             std::list<std::pair<size_t, size_t> > &edge_pos) {
+        std::map<V2, size_t> edges;
+        for (size_t i = 0; i < vertices.size() - 1; ++i) {
+          edges[std::make_pair(vertices[i], vertices[i+1])] = i;
+        }
+        edges[std::make_pair(vertices[vertices.size()-1], vertices[0])] = vertices.size() - 1;
+
+        for (std::map<V2, size_t>::iterator i = edges.begin(); i != edges.end(); ++i) {
+          V2 rev = V2((*i).first.second, (*i).first.first);
+          std::map<V2, size_t>::iterator j = edges.find(rev);
+          if (j != edges.end()) {
+            edge_pos.push_back(std::make_pair((*i).second, (*j).second));
+          }
+        }
+        return edge_pos.size() > 0;
+      }
+
+      void flood(size_t t1,
+                 size_t t2,
+                 size_t old_grp,
+                 size_t new_grp_1,
+                 size_t new_grp_2,
+                 std::vector<size_t> &grp,
+                 const std::vector<triangulate::tri_idx> &tris,
+                 const std::map<std::pair<size_t, size_t>, size_t> &tri_edge) {
+        grp[t1] = new_grp_1;
+        grp[t2] = new_grp_2;
+
+        std::deque<size_t> to_visit;
+        to_visit.push_back(t1);
+        to_visit.push_back(t2);
+        std::vector<std::pair<size_t, size_t> > rev;
+        rev.resize(3);
+        while (to_visit.size()) {
+          size_t curr = to_visit.front();
+          to_visit.pop_front();
+          triangulate::tri_idx ct = tris[curr];
+          rev[0] = std::make_pair(ct.b, ct.a);
+          rev[1] = std::make_pair(ct.c, ct.b);
+          rev[2] = std::make_pair(ct.a, ct.c);
+
+          for (size_t i = 0; i < 3; ++i) {
+            std::map<std::pair<size_t, size_t>, size_t>::const_iterator adj = tri_edge.find(rev[i]);
+            if (adj == tri_edge.end()) continue;
+            size_t next = (*adj).second;
+            if (grp[next] != old_grp) continue;
+            grp[next] = grp[curr];
+            to_visit.push_back(next);
+          }
+        }
+      }
+
+      void findPerimeter(const std::vector<triangulate::tri_idx> &tris,
+                         const std::vector<carve::mesh::MeshSet<3>::vertex_t *> &verts,
+                         std::vector<carve::mesh::MeshSet<3>::vertex_t *> &out) {
+        std