Math Lib: increase epsilon for ortho_basis_v3v3_v3

passing in a unit length vector wouldn't always compute unit length vectors because the epsilon tested was too small.
Math Lib: optimize axis_dominant_v3_to_m3, approx 6x speedup

build the matrix directly rather then calculating with axis/angle

also remove unused function calc_poly_plane
Fix for half pixel offset rasterizing masks
Add Edge sharp/smooth to 3DView shading panel, as well as new Vert sharp/smooth.
Fix cycles standalone file saving not taking number of samples into account properly.
Fix related to new split normals draw code.

Tessellated split normals CDlayer had no swap func, hence ugly little test_index_face()
could not rotate its values correctly when rotating tessellated faces...

Extra-reported in T39735.
Fix T39750: Bones disappearing with strange transforms.

Fixed this issue and another similar one, and some minor optimizations.
Code cleanup: use bools & const args
Fix T39756: Extrude, immediate scale

While not exactly a bug, switching to scale isnt generally useful to keep normal constraint.
Fix Knife bug T39617: midpoint snap should affect intermediate points.

This reverts to the 2.69 behavior, where the snap-to-midpoint option
affected the intermediate crossed edges as well as the endpoints.
Cycles code refactor: use __launch_bounds__ instead of -maxrregcount for CUDA.

This makes it easier to have per kernel number of registers. Also, all the
tunable parameters for this are now in kernel.cu, rather than spread over cmake,
scons and device_cuda.cpp.
Cycles CUDA: enabled branched path kernel again, with more registers.
Fix for scons/CUDA build after recent commit.
Fix another compile error with recent commit on visual studio.
Bullet: better workaround for failing friction with clang 3.4, remove the obsolete compileflag magic
BGE - button for deactivate sensors, controllers and actuators

This change introduces a new checkbox to deactivate the sensors, controllers and/or actuators. It is useful during the development phase to avoid delete sensors, controllers or actuators if you want to test something new.

NOC: The wiki page is being updated (the images mostly), but the feature is already in the 2.71 release log.

{F61628}

Reviewers: moguri, dfelinto, campbellbarton, dingto, #user_interface, billrey

Reviewed By: moguri

CC: billrey

Differential Revision: https://developer.blender.org/D16
Fix T39768: GLOBAL_X/Y/Z don't exist for bpy.ops.armature.calculate_roll type enum
Fix T39767: Parent in Mask mode crashes
Freestyle: Fix for VC++ warnings about 'hypot' macro redefinitions (Part 1).

The issue was caused by including both Python.h and BLI_math.h.  Since the macro
definition in Python.h was unconditional, it was necessary to include it first and then
BLI_math.h.

Addressing the issue turned out to affect many Freestyle source files.  There were several
other coding flaws that complicated the situation:

1. intern/system/FreestyleConfig.h was abused just to include BLI_math.h which was in
fact unnecessary in FreestyleConfig.h.  While addressing this, inclusion of both math.h
and BLI_math.h had to be duly dealt with to avoid a compiler error about round().

2. #include <Python.h> was not properly put in the extern "C" { ... } construct.

3. intern/view_map/Interface0D.h and intern/python/Director.h, both of which included
Python.h, were included from within Freestyle header files that were almost or completely
independent of Python.  These non-Python header files were used everywhere in the
Freestyle code base, causing many cases of the reported macro redefinitions.

4. The Director.h file was also declaring 'using namespace Freestyle', which was causing
another scope issue in several Freestyle header files.

This commit is intended to address the first problem above.  Subsequent commits will deal
with the other three.
Freestyle: Fix for VC++ warnings about 'hypot' macro redefinitions (Part 2).

(See commit e1771e72fbbf828dbf5bed871b814288389f3611 for more detail of
the problem).

Fixed for #include <Python.h> not properly put in the extern "C" { ... } construct.

Also removed redundant inclusion of the header file in the Freestyle Python API code.