Updated SimpleCocoaVTK to actually build against VTK git master

-Before this, the Xcode project was referring to VTK5 library names.
-Upped requirements to OS X 10.7 / Xcode 4 or better.
-Updated Instructions.rtf
-Updated Xcode project and nibs to newer format
-Updated CMAKE_MINIMUM_REQUIRED to match VTK itself
-Although it now builds, there is still a crash at runtime...

Change-Id: Idc8c2bd668ea4cff3411cde026bd26a609a00843
Calculate the axis label positions.

Instead of using hard coded values for the label and title positions on
cubeAxesActor, calculate them.
This development is needed to correctly display oriented labels on axes.
I did my best to obtain a result as near as possible to the current result,
for non oriented labels.

Change-Id: I99d0b76b5e9228125ca0205ca8a63a641239d5f0
Fixing documentation.

Change-Id: I37dc28841fb991769543e3749aeba0f83c420a74
Rewrite the PrepareImageData methods to check extents, not dims.

The new rendering code using the extent coordinates to control where
drawing occurs. Simply checking the dimensions of the image is not
sufficient.

Change-Id: Ib8185affafdc345b760f6c2164584f8379982a13
Replace the power-of-two scaling with a clearer implementation.

This implementation is easier to read and performed using only integer
operations.

Change-Id: I97ea7e73e6bbaba14b7dc29d26e1db55e57136e4
Fix Derivative() calculation to use correct order of input data.

Change-Id: I116fe9bf54d50e36a5097a363ab174b94e3b2795
Eliminated (undefined) signed integer overflow

clang ubsan warned running some of the 'EnSightBlow' tests:

IO/EnSight/vtkEnSight6BinaryReader.cxx:2823:15: runtime error: signed integer overflow: -1358823424 * 4 cannot be represented in type 'int'

I just upcast to 64 bit so that the multiplication doesn't overflow.
The tests now pass with the ubsan check.

I have subtly changed the behaviour here, but believe the
intent is preserved.

Change-Id: I0a35789c169204f04d2a683a029e992e9b20ca65
Initialize ivars to 0 to prevent access of uninitialized data

With -fsanitize=signed-integer-overflow, the test
'vtkIOXMLPython-TestEmptyXML' gives:

IO/XML/vtkXMLPStructuredDataReader.cxx:62:35: runtime error: signed integer overflow: 591396864 * -536868871 cannot be represented in type 'int'

The reason being that 'PointDimensions' was never set and so contained
random values that happened to be pretty big. There probably should
be some better error checking somewhere, but it seems a good
defence to zero these things anyway, in case a client of the class
(incorrectly) invokes a method that accesses the uninitialized data,
at least we'll get consistent results.

Change-Id: I77f5ac68d4edad632931667ddf5e87f930f48b3f
Changed computations to uint64 to prevent signed overflow

With clang's -fsanitize=signed-integer-overflow, the test
'vtkFiltersGeneralCxx-TestYoungsMaterialInterface' gives:

IO/Geometry/vtkAVSucdReader.cxx:302:34: runtime error: signed integer overflow: 16 * 504823808 cannot be represented in type 'int'
IO/Geometry/vtkAVSucdReader.cxx:302:60: runtime error: signed integer overflow: 4 * 2019295232 cannot be represented in type 'int'
IO/Geometry/vtkAVSucdReader.cxx:303:35: runtime error: signed integer overflow: 12 * -1340538880 cannot be represented in type 'int'
IO/Geometry/vtkAVSucdReader.cxx:313:35: runtime error: signed integer overflow: 369098752 * 2019295248 cannot be represented in type 'int'

This code tries to guess endianness, and when it's wrong it
ends up multiplying large numbers, resulting in signed overflow.
Fix is to do computations as uint64, which may still overflow,
but at least unsigned overflow is defined to wrap.

Did other misc cleanup too. Notably, the code could go into an
infinite loop trying big then little endianness over and over
again if a file is corrupt.

Change-Id: I2b7d84dae275386dcd87fa496b7916945284bc30
Eliminated (undefined) negation of INT_MIN

clang ubsan warned running vtkRenderingAnnotationCxx-TestCubeAxes2DMode:

Rendering/Annotation/vtkCubeAxesActor.cxx:1315:30: runtime error: negation of -2147483648 cannot be represented in type 'int'

This happens when 'range' is exactly 0.0, and so log10() gives -infinity,
which when cast to int (apparently) becomes INT_MIN which cannot
be negated due to the asymmetry of two's compliment representation.

Now, check log10() result with newly-created vtkMath::IsFinite API.
If the result is not finite, return 0 from vtkCubeAxesActor::Digits(),
which I'm not sure is the correct thing to return.

Change-Id: I36fc832df98ccb96c1fdc951c42e7e2c6de9d4b4
Fixed many memory leaks, mostly in error branches

Various early return branches were not freeing memory.
Caught by 'cppcheck' tool.

Change-Id: I1840fd1a95aceb31275c35d4a004769333e3c17c
Merge topic 'sanitize-signed-integer-overflow' into master

38f76b82 Eliminated (undefined) negation of INT_MIN
07cd3906 Changed computations to uint64 to prevent signed overflow
743dc8aa Initialize ivars to 0 to prevent access of uninitialized data
e29cc816 Eliminated (undefined) signed integer overflow
Module macros cleanup.

Projects sometimes want to add modules directly i.e. have the vtk_module(..) and
vtk_module_library(..) calls directly added in the same CMakeLists.txt file
without using a module.cmake at all. This is needed especially for modules that
tend to depend on "all enabled" modules. This change ensures that
vtkModuleMacros work even when module.cmake is missing.

Change-Id: I11122a330cb31b3f8785435fddd44d44df9bd236
Merge topic 'extend_modules' into master

8a045b49 Module macros cleanup.
Fixed isnan compile error on some platforms

Add #include <math.h> to find C99 functions.
Thanks to David Gobbi.

Change-Id: Ia88708ab43fa5b4f26801449bbd910013077868f
Merge topic 'isnan-compile-fix' into master

ed8e013e Fixed isnan compile error on some platforms
Fixed (undefined) use of null object.

Added test against null, which was already being done
in the 'enabling' branch.

Caught by clang's ubsan.

Change-Id: I6ecb400103020b54dda18bd7062f43ba82854ac3
Fixed (undefined) use of null object.

Changed a probable typo from: newLines to newPolys

Caught by clang's ubsan.

Change-Id: I9a4a2aefb2d118d23bd0adb54a3332abc1eb500e
Merge topic 'sanitize-null' into master

fb8c7848 Fixed (undefined) use of null object.
6ffd3241 Fixed (undefined) use of null object.
Fixed many memory leaks, mostly in error branches.

Most leaks fixed by adding deallocation in the early exit branch,
some fixed by rearranging code to put the early exit before the
allocation. Also removed some unnecessary checks for null before
using delete.

Presumably none of these branches are covered by tests,
or valgrind would find the leaks.  cppcheck found them though!

Change-Id: Iecad8ca988abc560939d46bf0a5a9e7e5a1511a5