Field3D
StdMathLib.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------//
2 
3 /*
4  * Copyright (c) 2009 Sony Pictures Imageworks Inc
5  *
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution. Neither the name of Sony Pictures Imageworks nor the
18  * names of its contributors may be used to endorse or promote
19  * products derived from this software without specific prior written
20  * permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33  * OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 //----------------------------------------------------------------------------//
37 
38 #ifndef _INCLUDED_Field3D_StdMathLib_H_
39 #define _INCLUDED_Field3D_StdMathLib_H_
40 
41 // The version can reliably be found in this header file from OpenEXR,
42 // for both 2.x and 3.x:
43 #include <OpenEXR/OpenEXRConfig.h>
44 #define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
45  (100*OPENEXR_VERSION_MINOR) + \
46  OPENEXR_VERSION_PATCH)
47 
48 // There's just no easy way to have an `#include` that works in both
49 // cases, so we use the version to switch which set of include files we
50 // use.
51 #if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
52 # include <Imath/ImathBox.h>
53 # include <Imath/ImathBoxAlgo.h>
54 # include <Imath/ImathColor.h>
55 # include <Imath/ImathMatrix.h>
56 # include <Imath/ImathMatrixAlgo.h>
57 # include <Imath/ImathPlane.h>
58 # include <Imath/ImathRandom.h>
59 # include <Imath/ImathRoots.h>
60 # include <Imath/ImathVec.h>
61 # include <Imath/half.h>
62 #else
63  // OpenEXR 2.x, use the old locations
64 # include <OpenEXR/ImathBox.h>
65 # include <OpenEXR/ImathBoxAlgo.h>
66 # include <OpenEXR/ImathColor.h>
67 # include <OpenEXR/ImathHalfLimits.h>
68 # include <OpenEXR/ImathMatrix.h>
69 # include <OpenEXR/ImathMatrixAlgo.h>
70 # include <OpenEXR/ImathPlane.h>
71 # include <OpenEXR/ImathRandom.h>
72 # include <OpenEXR/ImathRoots.h>
73 # include <OpenEXR/ImathVec.h>
74 # include <OpenEXR/half.h>
75 #endif
76 //----------------------------------------------------------------------------//
77 
78 #include "ns.h"
79 
81 
82 //----------------------------------------------------------------------------//
83 
85 typedef Imath::V2i V2i;
86 typedef Imath::V2d V2d;
87 typedef Imath::C3f C3f;
88 typedef Imath::V3i V3i;
89 typedef Imath::Vec3<half> V3h;
90 typedef Imath::V3f V3f;
91 typedef Imath::V3d V3d;
95 typedef Imath::M44d M44d;
97 
98 #define FIELD3D_BOX_T Imath::Box
99 #define FIELD3D_MTX_T Imath::Matrix44
100 #define FIELD3D_VEC3_T Imath::Vec3
101 
102 #define FIELD3D_CLIP Imath::clip
103 #define FIELD3D_LERP Imath::lerp
104 #define FIELD3D_LERPFACTOR Imath::lerpfactor
105 #define FIELD3D_EXTRACT_SHRT Imath::extractSHRT
106 
107 #define FIELD3D_RAND48 Imath::Rand48
108 
109 //----------------------------------------------------------------------------//
110 
112 
113 //----------------------------------------------------------------------------//
114 
115 #endif // Include guard
#define FIELD3D_NAMESPACE_HEADER_CLOSE
Definition: ns.h:58
Imath::Box3d Box3d
Definition: StdMathLib.h:93
Imath::Vec3< half > V3h
Definition: StdMathLib.h:89
FIELD3D_NAMESPACE_OPEN typedef::half half
Definition: StdMathLib.h:84
Imath::V3d V3d
Definition: StdMathLib.h:91
Imath::M44d M44d
Definition: StdMathLib.h:95
Imath::V2d V2d
Definition: StdMathLib.h:86
Imath::V3i V3i
Definition: StdMathLib.h:88
Imath::V3f V3f
Definition: StdMathLib.h:90
Imath::Line3d Line3d
Definition: SpiMathLib.h:84
Imath::V2i V2i
Definition: StdMathLib.h:85
Imath::C3f C3f
Definition: StdMathLib.h:87
Imath::Line3d Ray3d
Definition: StdMathLib.h:94
Imath::Box3i Box3i
Definition: StdMathLib.h:92
Imath::Plane3d Plane3d
Definition: StdMathLib.h:96