00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _TS_QUADRIC_H_
00023 #define _TS_QUADRIC_H_
00024
00025 #include "TS_API.h"
00026 #include <UT/UT_Vector3.h>
00027 #include <UT/UT_Matrix4.h>
00028 #include <UT/UT_DMatrix4.h>
00029 #include <UT/UT_BoundingBox.h>
00030
00031 class Conic;
00032
00033 class TS_API TS_Quadric {
00034 public:
00035 TS_Quadric();
00036 TS_Quadric(const UT_Matrix4 &);
00037 operator UT_Matrix4() const;
00038 TS_Quadric &operator*=(float rhs);
00039 TS_Quadric &operator+=(float rhs);
00040 TS_Quadric &operator/=(float rhs);
00041 TS_Quadric &operator-=(float rhs);
00042 void toMatrix4(UT_Matrix4 &m) const;
00043 void fromMatrix4(const UT_Matrix4 &m);
00044 void toMatrix4(UT_DMatrix4 &m) const;
00045 void fromMatrix4(const UT_DMatrix4 &m);
00046 void cylinder(const UT_Vector3 &p0, const UT_Vector3 &axis, float radius = 1.0F);
00047 void sphere(const UT_Vector3 ¢er, float radius = 1.0F);
00048 void planes(const UT_Vector3 &p0, const UT_Vector3 &n, float r);
00049 void transform(const UT_Matrix4 &m);
00050 void zeroTransform();
00051 int computeBound(UT_Vector3 &min, UT_Vector3 &max) const;
00052 int computeBound(UT_BoundingBox &bound) const;
00053 fpreal64 eval(const UT_Vector3 &) const;
00054 fpreal64 eval2(const UT_Vector3 &) const;
00055 fpreal64 evalMix(const UT_Vector3 &p0, const UT_Vector3 &p1) const;
00056 void evalGrad(const UT_Vector3 &p, UT_Vector3 &n) const;
00057
00058
00059 fpreal64 xx, yy, zz, xy, xz, yz, xw, yw, zw, ww;
00060 };
00061
00062
00063 #endif // _TS_QUADRIC_H_