00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GU_PrimMesh_h__
00022 #define __GU_PrimMesh_h__
00023
00024 #include "GU_API.h"
00025 #include <GEO/GEO_PrimMesh.h>
00026 #include "GU_Detail.h"
00027 #include "GU_Prim.h"
00028
00029 class GB_EdgeGroup;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 class GU_API GU_PrimMesh : public GEO_PrimMesh, public GU_Primitive
00043 {
00044 public:
00045
00046
00047 GU_PrimMesh(GU_Detail *gdp) : GEO_PrimMesh(gdp), GU_Primitive()
00048 { }
00049
00050 ~GU_PrimMesh();
00051
00052
00053
00054 GEO_Primitive *convert(GU_ConvertParms &parms,
00055 GB_PointGroup *usedpts = 0);
00056 GEO_Primitive *convertNew(GU_ConvertParms &parms);
00057
00058
00059
00060
00061
00062
00063
00064 GU_PrimMesh *cutU(float u1, float u2,
00065 int &ind1, int &ind2, int keep);
00066 GU_PrimMesh *cutV(float v1, float v2,
00067 int &ind1, int &ind2, int keep);
00068
00069
00070 void openAtU(float u);
00071 void openAtV(float v);
00072
00073
00074 GEO_PrimPoly *extractU(float unitu, GU_Detail *parent = 0);
00075 GEO_PrimPoly *extractV(float unitV, GU_Detail *parent = 0);
00076
00077
00078
00079
00080 GEO_Hull *reconfigure(unsigned type, int orderu, int orderv,
00081 int openu, int openv) const;
00082
00083 void *castTo() const;
00084
00085 virtual void normal(int noff) const;
00086 virtual void normal(UT_Vector3Array &output) const;
00087 virtual int intersectRay(const UT_Vector3 &o, const UT_Vector3 &d,
00088 float tmax = 1E17F, float tol = 1E-12F,
00089 float *distance = 0, UT_Vector3 *pos = 0,
00090 UT_Vector3 *nml = 0, int accurate = 0,
00091 float *u = 0, float *v = 0,
00092 int ignoretrim = 1) const;
00093
00094
00095
00096
00097
00098
00099
00100
00101 static GU_PrimMesh *build( GU_Detail *gudp,
00102 int rows, int cols,
00103 GEO_SurfaceType type = GEO_PATCH_QUADS,
00104 int wrapu = 0, int wrapv = 0,
00105 int appendPoints=1);
00106
00107
00108
00109
00110
00111 int removeEdges(const GB_EdgeGroup &edges,
00112 UT_BitArray *remove_edges=0);
00113
00114
00115 virtual GU_RayIntersect *createRayCache(int &persistent);
00116
00117 virtual const GEO_Primitive *castToGeo(void) const;
00118
00119 virtual GU_DisplayMesh *getDisplayMesh(int noff, float lod);
00120
00121 protected:
00122 virtual GEO_Hull *getSubHull(int top, int left, int bottom, int right,
00123 GEO_SubHullFlags break_flags);
00124
00125 private:
00126
00127
00128
00129 int create(int rows, int cols,
00130 GEO_SurfaceType type = GEO_PATCH_QUADS,
00131 int wrapu = 0, int wrapv = 0,
00132 int appendPoints = 1);
00133
00134 void computeVertices(GEO_Hull &hull, int, int) const;
00135
00136 GEO_Primitive *doConversion(GU_ConvertParms &parms, int reusePoints);
00137
00138 };
00139
00140 #endif