00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GU_PrimMetaSQuad_h__
00022 #define __GU_PrimMetaSQuad_h__
00023
00024 #include "GU_API.h"
00025 #include <GEO/GEO_PrimMetaSQuad.h>
00026 #include "GU_Detail.h"
00027 #include "GU_Prim.h"
00028
00029 class GEO_Hull;
00030 class GU_PrimPoly;
00031 class GU_PrimMesh;
00032 class GU_PrimNURBSurf;
00033 class GU_PrimRBezSurf;
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 class GU_API GU_PrimMetaSQuadParms
00047 {
00048 public:
00049 GU_PrimMetaSQuadParms();
00050
00051 GU_Detail *gdp;
00052 GEO_Point *ppt;
00053 UT_Matrix4 xform;
00054 float weight;
00055 float xyExp;
00056 float zExp;
00057 };
00058
00059 class GU_API GU_PrimMetaSQuad : public GEO_PrimMetaSQuad, public GU_Primitive
00060 {
00061 public:
00062
00063
00064 GU_PrimMetaSQuad(GU_Detail *gdp) : GEO_PrimMetaSQuad(gdp), GU_Primitive()
00065 {
00066 gdp->incrementCacheables();
00067 }
00068
00069
00070 virtual ~GU_PrimMetaSQuad();
00071
00072
00073
00074 GEO_Primitive *convert(GU_ConvertParms &parms,
00075 GB_PointGroup *usedpts = 0);
00076
00077 GEO_Primitive *convertNew(GU_ConvertParms &parms);
00078
00079 virtual void normal(int noff) const;
00080 virtual void normal(UT_Vector3Array &output) const;
00081
00082 void *castTo() const;
00083
00084
00085 static GU_PrimMetaSQuad *build(const GU_PrimMetaSQuadParms &parms,
00086 const char *kernel="wyvill");
00087
00088 virtual int intersectRay(const UT_Vector3 &o, const UT_Vector3 &d,
00089 float tmax = 1E17F, float tol = 1E-12F,
00090 float *distance = 0, UT_Vector3 *pos = 0,
00091 UT_Vector3 *nml = 0, int accurate = 0,
00092 float *u = 0, float *v = 0,
00093 int ignoretrim = 1) const;
00094
00095
00096 virtual void notifyCache(int type);
00097 virtual void notifyCache(int type, const GEO_Point &ppt);
00098 virtual void notifyCache(int type, const GB_PointGroup &grp);
00099 virtual void notifyCache(int type, const UT_Matrix4 &xform,
00100 int push);
00101 virtual void notifyCache(int type, const UT_Vector3 &delta);
00102
00103
00104 virtual GU_RayIntersect *createRayCache(int &persistent);
00105
00106 virtual const GEO_Primitive *castToGeo(void) const;
00107
00108 private:
00109 void create(const UT_Matrix4 &xform,
00110 float weight, float xyExp, float zExp,
00111 const char *kernel = "wyvill",
00112 GEO_Point *ppt = 0);
00113 };
00114
00115 #endif