Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

VL.h

Go to the documentation of this file.
00001 /*
00002     File:           VL.h
00003 
00004     Function:       Header file for the VL library. Provides macro definitions
00005                     so that the library can be templated by type.
00006                     
00007     Author(s):      Andrew Willmott
00008 
00009     Version         1.2.0
00010 
00011     Copyright:      (c) 1995-2000, Andrew Willmott
00012  */
00013 
00014 #ifndef __VL__
00015 #define __VL__
00016 
00017 #define VL_VERSION "1.2"
00018 #define VL_VER_NUM 10200
00019 
00020 /*
00021     This header file is included before any other when compiling VL. Its
00022     purpose is to translate the types that VL is templated on (TReal, TVec2,
00023     TVec3, etc.), replacing them with real types. In this way the same
00024     code can be used to compile float-based, double-based, and other
00025     type-based versions of the vector and matrix routines.
00026 
00027     VL.h expects VL_V_REAL and VL_M_REAL to be set to the element types for
00028     vectors and matrices respectively, and the VL_V_SUFF and VL_M_SUFF
00029     macros to append a suffix indicating the vector or matrix type to their
00030     arguments. If these macros are not defined, vectors and matrices will
00031     be based on the type 'Real', and there will be no suffixes.
00032 
00033     See VLf.h, VLfd.h, and SVL.h for examples of how this facility is used.
00034 
00035     The VL library used to use C++ templates rather than the current cpp
00036     macros. The state of both the C++ languange and its compilers made this
00037     unworkable, however, especially when targetting more than one compiler.
00038 */
00039 
00040 #include "cl/Basics.h"
00041 #include "vl/VLConfig.h"
00042 #include "vl/VLConstants.h"
00043 #include "vl/VLMath.h"
00044 
00045 #ifndef VL_V_REAL
00046 #define VL_V_REAL Real
00047 #define VL_M_REAL Real
00048 #endif
00049 
00050 #ifndef VL_V_SUFF
00051 #define VL_V_SUFF(X) X
00052 #define VL_M_SUFF(X) X
00053 #endif
00054 
00055 #ifndef VL_M_REAL
00056 #define VL_M_REAL VL_V_REAL
00057 #define VL_M_SUFF(X) VL_V_SUFF(X)
00058 #endif
00059 
00060 #define TVReal      VL_V_REAL
00061 #define TMReal      VL_M_REAL
00062 
00063 #define TVec2       VL_V_SUFF(Vec2)
00064 #define TMVec2      VL_M_SUFF(Vec2)
00065 #define TMat2       VL_M_SUFF(Mat2)
00066 
00067 #define TVec3       VL_V_SUFF(Vec3)
00068 #define TMVec3      VL_M_SUFF(Vec3)
00069 #define TMat3       VL_M_SUFF(Mat3)
00070 
00071 #define TVec4       VL_V_SUFF(Vec4)
00072 #define TQuaternion VL_M_SUFF(Vec4)
00073 #define TMVec4      VL_M_SUFF(Vec4)
00074 #define TMat4       VL_M_SUFF(Mat4)
00075 
00076 #define TVec        VL_V_SUFF(Vec)
00077 #define TMVec       VL_M_SUFF(Vec)
00078 #define TMat        VL_M_SUFF(Mat)
00079 #define TSubVec     VL_V_SUFF(SubVec)
00080 #define TMSubVec    VL_M_SUFF(SubVec)
00081 #define TSubMat     VL_M_SUFF(SubMat)
00082 
00083 #define TSparseVec  VL_V_SUFF(SparseVec)
00084 #define TSparseMat  VL_M_SUFF(SparseMat)
00085 #define TSubSVec    VL_V_SUFF(SubSVec)
00086 #define TMSubSVec   VL_M_SUFF(SubSVec)
00087 #define TSubSMat    VL_M_SUFF(SubSMat)
00088 
00089 #define TSparsePair VL_V_SUFF(SparsePair)
00090 #define TMSparseVec VL_M_SUFF(SparseVec)
00091 #define TSVIter     VL_V_SUFF(SVIter)
00092 #define TMSVIter    VL_M_SUFF(SVIter)
00093 
00094 #endif  

Generated at Sat Aug 5 00:16:49 2000 for Class Library by doxygen 1.1.0 written by Dimitri van Heesch, © 1997-2000