source: projectionDesigner/tag/ProjectionDesigner_1.1.5/projdesigner/include/gmtl/Defines.h @ 2

Last change on this file since 2 was 2, checked in by Torben Dannhauer, 14 years ago
File size: 3.0 KB
Line 
1/************************************************************** ggt-head beg
2 *
3 * GGT: Generic Graphics Toolkit
4 *
5 * Original Authors:
6 *   Allen Bierbaum
7 *
8 * -----------------------------------------------------------------
9 * File:          Defines.h,v
10 * Date modified: 2004/10/30 18:24:32
11 * Version:       1.9
12 * -----------------------------------------------------------------
13 *
14 *********************************************************** ggt-head end */
15/*************************************************************** ggt-cpr beg
16*
17* GGT: The Generic Graphics Toolkit
18* Copyright (C) 2001,2002 Allen Bierbaum
19*
20* This library is free software; you can redistribute it and/or
21* modify it under the terms of the GNU Lesser General Public
22* License as published by the Free Software Foundation; either
23* version 2.1 of the License, or (at your option) any later version.
24*
25* This library is distributed in the hope that it will be useful,
26* but WITHOUT ANY WARRANTY; without even the implied warranty of
27* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28* Lesser General Public License for more details.
29*
30* You should have received a copy of the GNU Lesser General Public
31* License along with this library; if not, write to the Free Software
32* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33*
34 ************************************************************ ggt-cpr end */
35#ifndef _GMTL_DEFINES_H
36#define _GMTL_DEFINES_H
37
38namespace gmtl
39{
40   /** use the values in this enum to index vector data
41    *  types (such as Vec, Point, Quat).
42    *
43    * <h3> "Example (access elements in a Vec3f):" </h3>
44    * \code
45    *    Vec3f vec;
46    *    vec[Xelt] = 1.0f;
47    *    vec[Yelt] = 3.0f;
48    *    vec[Zelt] = 2.0f;
49    * \endcode
50    * @ingroup Defines
51    */
52   enum VectorIndex { Xelt = 0, Yelt = 1, Zelt = 2, Welt = 3 };
53
54   /**
55    * Used to describe where a point lies in relationship to a plane.
56    * ON_PLANE means the point lies on the plane.
57    * POS_SIDE means the point lies on the same side as the surface normal.
58    * NEG_SIDE means the point lies on the opposite side as the ssurface normal.
59    * @ingroup Defines
60    */
61   enum PlaneSide
62   {
63      ON_PLANE,
64      POS_SIDE,
65      NEG_SIDE
66   };
67
68   /** @ingroup Defines
69    * @name Constants
70    * @{
71    */   
72   const float GMTL_EPSILON = 1.0e-6f;
73   const float GMTL_MAT_EQUAL_EPSILON = 0.001f;  // Epsilon for matrices to be equal
74   const float GMTL_VEC_EQUAL_EPSILON = 0.0001f; // Epsilon for vectors to be equal
75   /** @} */
76   
77#define GMTL_NEAR(x,y,eps) (gmtl::Math::abs((x)-(y))<(eps))
78
79};
80
81// Platform-specific settings.
82#if defined(__sun) || defined(__APPLE__) || defined(__hpux) ||  \
83    defined(_XOPEN_SOURCE)
84#define NO_ACOSF 1
85#define NO_ASINF 1
86#define NO_TANF 1
87#define NO_ATAN2F 1
88#define NO_COSF 1
89#define NO_SINF 1
90#define NO_TANF 1
91#define NO_SQRTF 1
92#define NO_LOGF 1
93#define NO_EXPF 1
94#define NO_POWF 1
95#define NO_CEILF 1
96#define NO_FLOORF 1
97#endif
98
99#if defined(_MSC_VER) && _MSC_VER < 1310
100#define GMTL_NO_METAPROG
101#endif
102
103
104#endif
Note: See TracBrowser for help on using the repository browser.