00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __GU_Group_h__
00021 #define __GU_Group_h__
00022
00023 #include "GU_API.h"
00024
00025 class UT_String;
00026 class UT_Vector3;
00027 class GEO_Point;
00028 class UT_BoundingBox;
00029 class GU_Detail;
00030 class GU_RayIntersect;
00031 class GB_Group;
00032
00033
00034
00035
00036
00037
00038
00039 class GU_API GU_GroupParms {
00040 public:
00041 GU_GroupParms()
00042 {
00043 useBounding = 0;
00044 useNumbering = 0;
00045 useNormal = 0;
00046 useBackface = 0;
00047 useEdgeDist = 0;
00048 useDegenerate = 0;
00049 origptgroup = 0;
00050 edgedepth = 0;
00051 useNonPlanar = 0;
00052 isoOffset = 0.0;
00053 invertVolume = false;
00054 boundGdp = 0;
00055 }
00056 ~GU_GroupParms() {}
00057
00058 const char *pattern;
00059 int ordered;
00060 int start;
00061 int end;
00062 int incStart;
00063 int incEnd;
00064 float radx, rady, radz;
00065 float tx, ty, tz;
00066 float rx, ry, rz;
00067 float nx, ny, nz;
00068 UT_Vector3 eye;
00069 float spreadAngle;
00070 int boundingType;
00071 int numberingType;
00072 int useBounding;
00073 int useNumbering;
00074 int useNormal;
00075 int useBackface;
00076 int booleanType;
00077 int useEdgeDist;
00078 GB_PointGroup *origptgroup;
00079 int edgedepth;
00080 GU_RayIntersect *rayTree;
00081 const UT_String *group1;
00082 const UT_String *group2;
00083 int useNonPlanar;
00084 float nonPlanarTol;
00085 int useDegenerate;
00086 bool useDegenPrims;
00087 bool useZAF;
00088 bool doOpenZAF;
00089 float tolZAF;
00090 float isoOffset;
00091 bool invertVolume;
00092 const GU_Detail *boundGdp;
00093 };
00094
00095
00096
00097
00098
00099
00100
00101 enum GU_GroupBoolOp {
00102 GU_GROUP_BOOLOP_NONE = 0,
00103 GU_GROUP_BOOLOP_OR = 1,
00104 GU_GROUP_BOOLOP_AND = 2,
00105 GU_GROUP_BOOLOP_XOR = 3,
00106 GU_GROUP_BOOLOP_MINUS = 4
00107 };
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 class GU_API GU_Group {
00123 public:
00124 GU_Group(GU_Detail *gdp, unsigned mask = 0xffffffff);
00125 virtual ~GU_Group();
00126
00127 virtual GB_Group *newGroup(const char *) = 0;
00128 virtual GB_Group *find(const char *) const = 0;
00129 virtual void destroy(void) = 0;
00130
00131
00132
00133
00134 virtual bool boolean(GU_GroupBoolOp boolop,
00135 const UT_String &group1, bool negate1,
00136 const UT_String &group2, bool negate2) const;
00137
00138 virtual bool boolean(GU_GroupBoolOp boolop,
00139 GB_Group *group1, bool negate1,
00140 GB_Group *group2, bool negate2) const;
00141
00142 GB_Group *group() const { return theGroup; }
00143
00144 protected:
00145
00146 virtual void generateGroup(const GU_GroupParms &parms) = 0;
00147
00148
00149
00150
00151
00152
00153
00154 virtual void range(int, int, int, int, int, int) const=0;
00155 void getRangeValues(int, int &, int &,
00156 int &, int &) const;
00157
00158
00159
00160 virtual void pattern(char *pattern, int nelements,
00161 int order) const=0;
00162
00163
00164 virtual int boundingBox(float, float, float,
00165 float, float, float,
00166 float, float, float);
00167
00168
00169
00170 virtual void boundingSphere(float, float, float,
00171 float, float, float) const = 0;
00172
00173
00174
00175 virtual void normal(UT_Vector3 &nml, float angle) const = 0;
00176
00177
00178
00179
00180
00181 virtual void degenerate(bool degenerate, bool zaf,
00182 bool doOpen, float tol) const = 0;
00183
00184 int isBackface(const UT_Vector4 &pos,
00185 const UT_Vector3 &nml,
00186 const UT_Vector3 &eye) const;
00187
00188
00189
00190
00191 int pointInsideSphere(const GEO_Point *ppt,
00192 float a, float b, float c,
00193 float tx, float ty, float tz)
00194 const;
00195
00196
00197 GU_Detail *gdp() const { return theGdp; }
00198 unsigned mask() const { return theMask; }
00199 UT_BoundingBox *getBBox() const { return theBBox; }
00200
00201
00202 void setGroup(GB_Group *grp) { theGroup = grp; }
00203 void deleteBBox();
00204
00205
00206 private:
00207
00208 GB_Group *theGroup;
00209 UT_BoundingBox *theBBox;
00210 GU_Detail *theGdp;
00211 unsigned theMask;
00212 };
00213
00214 #endif