Mesh API: replace octree mirror with kdtree
Mesh API: rename 'octree' to 'spatial' since internally its using kdtree
HSL color wheel implementation.

This is a standard Hue - Saturation - Lightness model
(see for instance entry on wikipedia here: https://en.wikipedia.org/wiki/HSL_and_HSV)
Note though the difference between HSV and HSL saturation, which are not the same.

The advantage of having this color selection scheme is that artists can select
shades and tints of a color easily by using the lightness slider. Also colors
are arranged on (approximated) perceived lightness on the color wheel.

Beware, Old files opened with this preference saved will crash!

Reviewers: sergey, brecht, campbellbarton

Differential Revision: https://developer.blender.org/D385
Fix T39111: Boolean assert failure on widows

In fact we had this change a while ago, not sue what happened.
Code cleanup (tm): Some code deduplication for HSL
Fix possible (unlikely) use of uninitialized pointer in RNA resolving
Fix T39114: cycles lamp ray visibility not working.

Thanks to Thomas for finding the cause.
Followup for fix T38318: Add back previous fix and fix a glitch.

The previous fix 162d6c73e3d0 has been cancelled because it caused a
problem that mesh deform cages and so on mess up the preview. To avoid
the problem, viewport doesn't show mesh object if its draw type is
bounding box or wireframe.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D375
Anticipate future color picker types and don't crash (uiBut could be
NULL in some cases)
Code cleanup: de-duplicate switch statement, style edits
OSX/cmake: set DEBUG_INFORMATION_LEVEL to "line-tables-only" for cycles, clang 3.4 (xcode 5.1) would not link with RNA in debug else
Freestyle: avoid checking PyErr_Occurred and quiet warning
Code cleanup: quiet warning, 'else' would always crash (& never occurred)

also quiet waning clamping
Fix T39148: Image does not show while rendering

Own regression since partial buffer update refactor,
display buffer for exr tiles should happen in image
update callback.

This revision is to be merged to the final release.
Fix for possible (unlikely) uninitialized var use in BM_face_split
BMesh: minor changes for BM_face_split use
Fix for compilation error since previous fix for XCode
Fix T39151: Boolean modifier freeze

This re-applied patch from 25cbd13 which was lost at some point
since missing patchset in series.

This revision is to be back-ported to the final release.
Cmake: fix compile problem after own commit
Fix T39152: Blender crash when duplicate mesh with hooks and laplacian deform.

We can't simply dupalloc cache_system (LaplacianSystem), it has quite a few allocated data we'd need to dupalloc as well,
not to mention (nl) context... Much safer to just set it to NULL in new copy imho!

This commit is to be backported to 2.70 release!