Updates


August 19, 2014. Posted GeometricToolsEngine1p1.zip.
August 19, 2014. These modifications are related to getting the code, not including the Windows-specific graphics and application code, to compile on Linux and Macintosh OS X. The first batch of changes were consequences of trying to compile on Macintosh OS X. The second batch is due to Linux compilation, although changes in the first batch no doubt were needed anyway on Linux.

Hide the Windows-specific information from the other platforms. The compiler did not like the #pragma once in the precompiled header file. The LLVM compiler successfully compiled Delaunay2Mesh and Delaunay3Mesh in our header verification tool when you compile in a single file. However, when a build-project is initiated, LLVM attempted to use the template parameter Rational as if it were an actual type and complained when trying to instantiate Vector{2,3}::ComputeBarycentrics. In particular, we had a line if (std::abs(det) > epsilon) for which LLVM said std::abs is ambiguous and that it did not match any of the standard functions for floating-point types. For now, we modified the code for ComputeBarycentrics to use if (det < -epsilon || det > epsilon). LLVM does not have versions of the secure memcpy_s that Microsoft Visual Studio does. Added conditional compilation to handle this. Eliminated the typedef of Function. LLVM had difficulties with this in the derived classes. Removed the (WM5) using statements and added the explicit scoping by this->. Removed the explicit last parameter to ComputeBarycentrics. The default parameter has the same value. The file <iterator> needed to be included to access the definitions of std::begin, std::end, and std::reverse_iterator. Microsoft Visual Studio 2013 allowed the compilation without it, but not LLVM. The class had two member functions that required two implicit conversions to return values. One of them has to be explicit, and LLVM requires this. The definition of size_t appears to be built into Microsoft Visual Studio 2013. On LLVM, it is defined in <cstddef>, so this header file needed to be #include-d. The declaration for triangle barycentric coordinates was the incorrect size. The header needed to #include <set> because the class has a member using this container. We have an internal tool that #include-s each header file in a cpp file and tests whether it compiles. This is designed to expose a header file that might not #include any dependencies it has. If the header is for template classes or functions, we also explicitly instantiate those in order to trap any compiler errors. Naturally, the tool has precompiled headers disabled. Surprisingly, some code passed the tests when compiling with Microsoft Visual Studio 2013 but the same code failed compilation on LLVM. For example, the GetContainer function in GteContEllipsoid3.inl incorrectly had a Vector2 input when it should have been Vector3. This code passed the explicit instantiation compiler test using Microsoft Visual Studio 2013. Microsoft's compilers still violate the ANSI C++ standard that requires template derived classes to explicitly scope any access to template base class members or functions via this->mBaseMember and this->BaseFunction. [In Wild Magic, we chose the using statement in the derived-class headers but decided against this in GTEngine because of the potential change in access rights (public, protected, private).] Added typename modifiers to some variable declarations. Microsoft Visual Studio 2013 allowed the declarations without the modifiers, but not LLVM. BSNumber had a declaration to make BSRational a friend. Microsoft Visual Studio 2013 allowed the original code, but not LLVM. Forward declared the BSRational template and modified the friend statement. [The same mechanism had been used in Wild Magic to satisfy all compilers.] Microsoft Visual Studio 2013 allows you to make calls to math library functions such as std::abs and sqrt without #include-ing <cmath>. Added the #include to satisfy LLVM. Removed an incorrect static cast of a 32-bit value to a 64-bit value when the return value of the function is in fact 32-bit. The explicit instantiation of the oppositeSpace array required a template< > modifier. The explicit instantiation of image classes needed to be inside a namespace block. Removed the AlignedMemory class from the engine. It is not used, and the _aligned_malloc and _aligned_free calls do not exist on Macintosh OS X. The changes below were necessary after the previous ones to get the code to compile on Linux.

The explicit instantiations had to occur inside a namespace block. A 'using namespace gte' was not sufficient. The class uses the var-args system so needed to include <cstdarg>. The files use std::numeric_limits and needed to include <limits>. The files use memcpy or memset and needed to include <cstring>. The conditional compilation is now based on WIN32 (or not). The files use std::min, std::max, std::sort, or std::nth_element and needed to include <algorithms>.
August 17, 2014. These modifications are related to the porting of the Wild Magic interpolation code to GTEngine.

Ported most of the Wild Magic interpolation code to GTEngine. A sample application illustrates use of the interpolators for 2D height-field data. Added wrappers for the meshes produced by Delaunay triangulation and tetrahedralization. Access to the input vertices of the DelaunayN classes was required to support this. The wrappers allow the interpolators to interact with general triangles mesh that are not produced by the Delaunay code. (Wild Magic forced you to use Delaunay meshes.) Added a mesh creator for regular triangle meshes ("half" a rectangle mesh). When computing barycentric coordinates, replaced the separate Dot and Cross functions by the single calls to DotCross. Added functions AllocateMapN and DeallocateMapN for N = 2, 3, 4. This allows for wrapping an already existing 1-dimensional array with multidimensional array access.
August 15, 2014. Fixed a typographical error in Equation (14). (Thanks to Pierre Maxted for reporting this.) Replaced the LaTeX verbatim commands with lstlisting commands for more readable pseudocode.
August 13, 2014. The files were missing the #pragma once guards against multiple inclusions.
August 11, 2014. Posted GeometricToolsEngine1p0.zip.