00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __GU_PrimVolume__
00020 #define __GU_PrimVolume__
00021
00022 #include "GU_API.h"
00023
00024 #include <GEO/GEO_PrimVolume.h>
00025
00026 #include "GU_Detail.h"
00027 #include "GU_Prim.h"
00028
00029 class GU_PrimVolumeCache;
00030 class GU_PrimVolumeCacheParms;
00031
00032 class GU_API GU_PrimVolume: public GEO_PrimVolume, public GU_Primitive
00033 {
00034 public:
00035
00036
00037 GU_PrimVolume(GU_Detail *gdp) : GEO_PrimVolume(gdp), GU_Primitive()
00038 {
00039 myDisplayCache = 0;
00040 }
00041
00042
00043 ~GU_PrimVolume();
00044
00045 virtual void *castTo() const;
00046 virtual const GEO_Primitive *castToGeo(void) const;
00047
00048
00049 GEO_Primitive *convert(GU_ConvertParms &parms,
00050 GB_PointGroup *usedpts = 0);
00051 GEO_Primitive *convertNew(GU_ConvertParms &parms);
00052
00053 virtual void normal(int noff) const;
00054 virtual void normal(UT_Vector3Array &output) const;
00055
00056
00057
00058
00059
00060
00061 static GEO_Primitive *build(GU_Detail *gdp);
00062
00063
00064
00065
00066
00067 static GEO_Primitive *buildFromFunction(GU_Detail *gdp,
00068 float (*valAtPoint)(const UT_Vector3 &),
00069 const UT_BoundingBox &bbox,
00070 int xres, int yres, int zres);
00071
00072 virtual int intersectRay(const UT_Vector3 &o,
00073 const UT_Vector3 &d,
00074 float tmax = 1E17F, float tol = 1E-12F,
00075 float *distance = 0,
00076 UT_Vector3 *pos = 0,
00077 UT_Vector3 *nml = 0,
00078 int accurate = 0,
00079 float *u = 0, float *v = 0,
00080 int ignoretrim = 1) const;
00081
00082
00083 virtual GU_RayIntersect *createRayCache(int &persistent);
00084
00085
00086 virtual GU_DisplayCache *getDisplayCache(void) const;
00087 virtual int buildVolumeDisplayCache(GU_PrimVolumeCacheParms &parms);
00088
00089 virtual void destroyCache();
00090 virtual void notifyCache(int type);
00091 virtual void notifyCache(int type, const GEO_Point &ppt);
00092 virtual void notifyCache(int type, const GB_PointGroup &grp);
00093 virtual void notifyCache(int type, const UT_Matrix4 &xform,
00094 int push);
00095 virtual void notifyCache(int type, const UT_Vector3 &delta);
00096 private:
00097
00098 GU_PrimVolumeCache *myDisplayCache;
00099 };
00100
00101 #endif