00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GU_RayRBezCurve_h__
00022 #define __GU_RayRBezCurve_h__
00023
00024 #include "GU_API.h"
00025 #include <UT/UT_Matrix4.h>
00026 #include <UT/UT_Matrix3.h>
00027 #include <UT/UT_Vector3.h>
00028 #include <UT/UT_Vector4Array.h>
00029 #include <UT/UT_Matrix.h>
00030 #include <UT/UT_BoundingBox.h>
00031
00032 #include "GU_RayIntersect.h"
00033
00034 class GEO_Point;
00035 class GEO_Primitive;
00036 class GU_RayInfo;
00037 class GU_MinInfo;
00038 class GU_RayRBezCurve;
00039 class GU_RayRBezSurf;
00040 class TS_MetaExpression;
00041 class UT_BoundingRect;
00042 class GU_IsectCurveSet;
00043 class GU_IsectCurve;
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 class GU_API GU_RayRBezCurve
00055 {
00056 public:
00057 void init(int order, float uStart, float uLength, int isRational);
00058 void buildBBox();
00059 int intersect(const UT_Vector3 &org,
00060 const UT_Vector3 &dir,
00061 GU_RayInfo &hitInfo, int depth) const;
00062 int intersect(const UT_Vector3 &p,
00063 GU_RayInfo &hitInfo, int depth) const;
00064 int intersect(const GU_RayRBezCurve &curve,
00065 GU_RayInfo &hitInfo, int depth) const;
00066 int intersect(GU_RayRBezSurf &surf, GU_RayInfo &hitInfo,
00067 int depth) const;
00068 int intersectQR(GU_RayRBezSurf &surf, GU_RayInfo &hitInfo,
00069 int depth) const;
00070 int intersectAP(GU_RayRBezSurf &surf, GU_RayInfo &hitInfo);
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 int intersectFirstPointZone(const UT_Vector3 &org,
00086 const UT_Vector3 &dir,
00087 GU_RayInfo &hit_info) const;
00088 int intersectLastPointZone(const UT_Vector3 &org,
00089 const UT_Vector3 &dir,
00090 GU_RayInfo &hit_info) const;
00091
00092
00093 int polishCurveSurf(const GU_RayRBezSurf &surf,
00094 UT_Matrix &C1, UT_Matrix &C2, UT_Matrix &R,
00095 UT_Matrix &tmp, float start, float end,
00096 UT_RefArray<GU_RayInfoHit> &hits,
00097 GU_RayFindType findType,
00098 int firstiter = 3, float firsttol = 1e-2F,
00099 int finaliter = 50, float finaltol = 1e-6F,
00100 float ttol = 1e-3F);
00101
00102 int minimum(const UT_Vector3 &p,
00103 GU_MinInfo &mininfo, int depth) const;
00104 int minimum(const GU_RayRBezCurve &curve,
00105 GU_MinInfo &mininfo, int depth,
00106 int noBBoxTest = 0) const;
00107
00108 void split(GU_RayRBezCurve *left, GU_RayRBezCurve *right,
00109 float tol) const;
00110
00111 void carve(float ustart, float uend);
00112 void evaluate(float t, UT_Vector3 &pos) const;
00113 void evaluate(float t, UT_Vector3 &pos,
00114 UT_Vector3 &der) const;
00115 void evaluate(float t, UT_Vector3 &pos,
00116 UT_Vector3 &der, UT_Vector3 &der2) const;
00117
00118 void print() const;
00119
00120 public:
00121 UT_BoundingBox myBBox;
00122 UT_Vector4Array myCV;
00123 float myUStart, myULength;
00124 int myRational;
00125 };
00126
00127 #endif
00128