KWSys: Fix SystemTools environment memory handling (#13156)

The SystemTools::PutEnv function tries to provide the "putenv" API
without leaking memory.  However, the kwsysDeletingCharVector singleton
frees memory that may still be referenced by the environment table,
having been placed there by putenv.  If any static destruction or
processing by an external tool happens after the singleton is destroyed
and accesses the environment it will read invalid memory.

Replace use of putenv with setenv/unsetenv when available.  The latter
manage internal copies of the values passed instead of referencing the
original memory.  When setenv/unsetenv are not available use putenv with
a singleton that removes its values from the environment before freeing
their memory.  This requires an "unputenv" implementation.  On at least
some platforms it must be written in terms of "putenv" because other
APIs are not available and direct modification of the "environ" global
is not safe (e.g. on Windows there is interaction with "wenviron").
Fortunately either putenv("A=") or putenv("A") will remove "A" from the
environment on these platforms.  On other platforms fall back to direct
manipulation of "environ".

Also add UnPutEnv to the API and add a test for the behavior of both.

Change-Id: I1e546c03f1530a7ae8dfea73a3bfa7b3c2d023c2
KWSys: Remove dependencies on FundamentalType

The hash_fun.hxx header is configured whether FundamentalType is enabled
or not and so cannot depend on it.  Run the relevant platform tests
whether or not FundamentalType is on and configure the result directly
into hash_fun.  While at it, remove the dependence of SystemInformation
on FundamentalType too since it needs only information that we now
always compute.

Change-Id: I743795446ae0e7eca88aeed852fc9e6f06e52f60
Add performance test for vtkObject observations

Change-Id: Ia9af47bbe7946da67e67c65ef38c2c3fd4171ba7
Speed-up vtkObject::InvokeEvent()

Limit the number of times the visited list is browse through.
 a) initialization pass is not necessary.
Elem is added just before execution
 b) don't search if elem has been visited if it is not even a valid elem.
This is a big speedup when having observers on different Events.
 c) vector is more lightweight than a map.
N is typically small (<1000 observers on 1 object) so O(N) ~= O(log(N))

Change-Id: I9620d41c1805678281ae83e41ef91a193a8c98c0
ENH: Restore Rendering tcl tests.

Change-Id: I820f318a33ab588a676559a3a7ab6d917feec7b4
KWSys: Remove unused environ declaration from SystemTools

Commit "KWSys: Fix SystemTools environment memory handling" (2012-04-26)
added a _WIN32 case inside !KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H to dllimport
the "environ" global.  Howver, KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H is true
on every Windows toolchain we support so the case is never reached.
Furthermore, even if it were reached the use of dllimport is incorrect
because the toolchain might not be compiling with a dynamic runtime
library.  Remove the unused incorrect line and supporting conditionals.

Change-Id: Id8aeb9c060ae59d0cd7b05a3b4cfb9d0c1badf90
Fix a bug in parallel stream tracer in receiving point data

The symptom of the bug is shown by the two paraview tests:
- pvcs.SpyPlotHistoryReader.StreamTracerUpdates
- pvcrs.SpyPlotHistoryReader.StreamTracerUpdates

Change-Id: I1d0afa06949869c0d53ff01058068eb93f7ac1ab
BUG: Move vtkPythonConfigure.h into Wrapping/PythonCore.

Since Wrapping/PythonCore/vtkPython.h include's vtkPythonConfigure.h, anything
that includes vtkPython.h needs to also add /Wrapping/ to include_directories.  We
move the location of vtkPythonConfigure.h from /Wrapping/ to
/Wrapping/PythonCore/

This simplifies the CMake configuration, and fixes ITK's Python wrapping withe
VTK Bridge module.

Change-Id: I6f202afc1f5ec9c669204201fc22540480607d8e
Merge topic 'kwsys-update' into master

e7bf0a45 KWSys: Remove unused environ declaration from SystemTools
74f1006a KWSys: Remove dependencies on FundamentalType
752f526c KWSys: Fix SystemTools environment memory handling (#13156)
vtkPExodusIIWriter: Remove unused vtkWriter include

Since commit 28a2e2e9 (Refactored vtkPExodusIIWriter now derives from
vtkExodusIIWriter, 2012-05-15) vtkPExodusIIWriter derives from
vtkExodusIIWriter instead of vtkWriter.  Remove the unused include of
the old superclass header to fix vtkIOParallelExodus-HeaderTest.

Change-Id: I95bcfd51a31075ea67ca1e08da1eeea2bd50552e
BUG: Improper default for temp and data directories.

After modularization, the locatioon of the Testing/Python directory is
one level deeper. The default for VTK_DATA and VTK_BASELINE_ROOT need
to be adjusted.

Change-Id: I1c1592c11dba89da4e26724c3a12f2f87aa81f9c
Merge topic 'vtkPythonConfigureInclude' into master

6e21b6bc BUG: Move vtkPythonConfigure.h into Wrapping/PythonCore.
Merge topic 'RestoreRenderingTclTests' into master

127cc171 ENH: Restore Rendering tcl tests.
Merge topic 'PythonTestingDirDefaults' into master

b01a35c6 BUG: Improper default for temp and data directories.
BUGFIX: Add guards for empty input in Enzo reader

Added guards to short-circuit before calling the internal
readers. Calling the internal readers with an empty input
is causing a segfault in TestEmptyInput.tcl. This short-coming
is addressed in this commit by detecting if the reader is
ready and returning immediately before calling methods on
the internal readers.

Change-Id: I62d16dbe276d49f58078997106e6026386c43ac7
STYLE: Remove debug statements.

Change-Id: I84aa89f0d2637cb7715a925030dcb248a27eb560
Merge topic 'exoduswriter-vtk-refactor' into master

1149be45 vtkPExodusIIWriter: Remove unused vtkWriter include
Merge topic 'fix-pstream-tracer-bug-paraview-ctest-failure' into master

ff7da35e Fix a bug in parallel stream tracer in receiving point data
Merge topic 'fix-test-empty-input' into master

c3deb296 STYLE: Remove debug statements.
43bfbfbf BUGFIX: Add guards for empty input in Enzo reader
Merge topic 'observers-performance' into master

58687b53 Speed-up vtkObject::InvokeEvent()
8902ae89 Add performance test for vtkObject observations