00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __HOM_hmath_h__
00020 #define __HOM_hmath_h__
00021
00022 #include "HOM_API.h"
00023 #include "HOM_Defines.h"
00024 #include "HOM_Errors.h"
00025 #include <SYS/SYS_Math.h>
00026 #include <vector>
00027 #include <map>
00028 class HOM_Matrix4;
00029 class HOM_Vector3;
00030
00031 SWIGOUT(%rename(hmath) HOM_hmath;)
00032
00033 class HOM_API HOM_hmath
00034 {
00035 public:
00036 virtual ~HOM_hmath()
00037 {}
00038
00039 virtual std::string __repr__() throw(HOM_Error) = 0;
00040
00041 SWIGOUT(%newobject identityTransform;)
00042 virtual HOM_Matrix4 *identityTransform() = 0;
00043
00044 SWIGOUT(%newobject buildTranslate;)
00045 virtual HOM_Matrix4 *buildTranslate(double tx, double ty, double tz) = 0;
00046 virtual HOM_Matrix4 *buildTranslate(const std::vector<double> &values) = 0;
00047 virtual HOM_Matrix4 *buildTranslate(HOM_Vector3 &values) = 0;
00048
00049 SWIGOUT(%newobject buildScale;)
00050 virtual HOM_Matrix4 *buildScale(double sx, double sy, double sz) = 0;
00051 virtual HOM_Matrix4 *buildScale(const std::vector<double> &values)
00052 throw(HOM_ValueError, HOM_Error) = 0;
00053 virtual HOM_Matrix4 *buildScale(HOM_Vector3 &values) = 0;
00054
00055 SWIGOUT(%newobject buildShear;)
00056 virtual HOM_Matrix4 *buildShear(double sxy, double sxz, double syz) = 0;
00057 virtual HOM_Matrix4 *buildShear(const std::vector<double> &values)
00058 throw(HOM_ValueError, HOM_Error) = 0;
00059 virtual HOM_Matrix4 *buildShear(HOM_Vector3 &values) = 0;
00060
00061 SWIGOUT(%newobject buildRotate;)
00062 virtual HOM_Matrix4 *buildRotate(
00063 double rx, double ry, double rz, const char *order="xyz")
00064 throw(HOM_ValueError, HOM_Error) = 0;
00065 virtual HOM_Matrix4 *buildRotate(
00066 const std::vector<double> &values, const char *order="xyz")
00067 throw(HOM_ValueError, HOM_Error) = 0;
00068 virtual HOM_Matrix4 *buildRotate(
00069 HOM_Vector3 &values, const char *order="xyz")
00070 throw(HOM_ValueError, HOM_Error) = 0;
00071
00072 SWIGOUT(%newobject buildRotateAboutAxis;)
00073 virtual HOM_Matrix4 *buildRotateAboutAxis(
00074 const std::vector<double> &axis, double angle_in_deg)
00075 throw(HOM_ValueError, HOM_Error)= 0;
00076 virtual HOM_Matrix4 *buildRotateAboutAxis(
00077 HOM_Vector3 &axis, double angle_in_deg) = 0;
00078
00079 virtual HOM_Matrix4* buildTransform(
00080 const std::map<std::string, std::vector<double> > &values_dict,
00081 const char *transform_order="srt",
00082 const char *rotate_order="xyz")
00083 throw(HOM_ValueError, HOM_TypeError, HOM_Error) = 0;
00084
00085
00086 virtual double degToRad(double degrees) = 0;
00087 virtual double radToDeg(double radians) = 0;
00088
00089 SWIGPYTHONOUT(%feature("autodoc",
00090 "noise1d(self, pos) -> float") noise1d;)
00091 virtual double noise1d(const std::vector<double> &pos) const = 0;
00092
00093 SWIGPYTHONOUT(%feature("autodoc",
00094 "noise3d(self, pos) -> Vector3") noise3d;)
00095 virtual HOM_Vector3 noise3d(const std::vector<double> &pos) const = 0;
00096
00097 SWIGPYTHONOUT(%feature("autodoc",
00098 "fit(self, value, oldmin, oldmax, newmin, newmax) -> float") fit;)
00099 double fit(
00100 double value, double oldmin, double oldmax,
00101 double newmin, double newmax)
00102 { return SYSfit(value, oldmin, oldmax, newmin, newmax); }
00103
00104 SWIGPYTHONOUT(%feature("autodoc",
00105 "fit01(self, value, newmin, newmax) -> float") fit01;)
00106 double fit01(double value, double newmin, double newmax)
00107 { return SYSfit(value, 0, 1, newmin, newmax); }
00108
00109 SWIGPYTHONOUT(%feature("autodoc",
00110 "fit10(self, value, newmin, newmax) -> float") fit10;)
00111 double fit10(double value, double newmin, double newmax)
00112 { return SYSfit(value, 1, 0, newmin, newmax); }
00113
00114 SWIGPYTHONOUT(%feature("autodoc",
00115 "fit11(self, value, newmin, newmax) -> float") fit11;)
00116 double fit11(double value, double newmin, double newmax)
00117 { return SYSfit(value, -1, 1, newmin, newmax); }
00118
00119 SWIGPYTHONOUT(%feature("autodoc", "sign(self, value) -> float") sign;)
00120 double sign(double value)
00121 { return value < 0 ? -1 : (value > 0); }
00122
00123 SWIGPYTHONOUT(%feature("autodoc",
00124 "clamp(self, value, min, max) -> float") clamp;)
00125 double clamp(double value, double min, double max)
00126 { return SYSclamp(value, min, max); }
00127
00128 SWIGPYTHONOUT(%feature("autodoc",
00129 "smooth(self, value, min, max) -> float") smooth;)
00130 double smooth(double value, double min, double max)
00131 {
00132
00133 return SYSsmooth(min, max, value);
00134 }
00135
00136 SWIGPYTHONOUT(%feature("autodoc",
00137 "wrap(self, value, min, max) -> float") wrap;)
00138 virtual double wrap(double value, double min, double max) const = 0;
00139
00140 SWIGPYTHONOUT(%feature("autodoc",
00141 "rand(self, seed) -> float") rand;)
00142 virtual double rand(double seed) const = 0;
00143 };
00144
00145 #endif