00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GU_Detail_h__
00022 #define __GU_Detail_h__
00023
00024 #include "GU_API.h"
00025 #include <UT/UT_PtrArray.h>
00026 #include <UT/UT_PtrMatrix.h>
00027 #include <UT/UT_Matrix3.h>
00028 #include <UT/UT_RefArray.h>
00029 #include <UT/UT_RefMatrix.h>
00030
00031 #include <UT/UT_BitArray.h>
00032 #include <GEO/GEO_Detail.h>
00033 #include <GEO/GEO_PrimType.h>
00034 #include <GEO/GEO_SurfaceType.h>
00035 #include <GEO/GEO_Primitive.h>
00036 #include <GB/GB_NUBBasis.h>
00037 #include <GB/GB_Parameterization.h>
00038
00039 #include "GU_Types.h"
00040 #include "GU_Prim.h"
00041 #include "GU_Error.h"
00042 #include "GU_ClothSeam.h"
00043
00044 class IMG_Raster;
00045 class UT_Interrupt;
00046 class UT_Vector4Array;
00047 class UT_StringArray;
00048
00049 class GB_BreakpointGroup;
00050 class GB_EdgeGroup;
00051 class GB_VertexGroup;
00052 class GEO_Face;
00053 class GEO_PrimMesh;
00054 class GEO_PrimPoly;
00055 class GEO_SoftTransformPointCache;
00056 class GEO_SoftTransformVertexCache;
00057 class GEO_TPSurf;
00058 class GEO_Hull;
00059 class GEO_AttributeHandle;
00060 class GEO_IOTranslator;
00061 class GEO_PointRefArray;
00062
00063 class GU_SplitLoc;
00064 class GU_Curve;
00065 class GU_MetaSurfCache;
00066 class GU_Selection;
00067 class GU_SelectionList;
00068 class GU_OldOBBTree;
00069 class GU_TPSurf;
00070
00071 class GU_PrimPoly;
00072 class GU_PrimMesh;
00073 class GU_PrimPart;
00074 class GU_PrimSphere;
00075 class GU_PrimTube;
00076 class GU_PrimBlob;
00077 class GU_PrimNURBCurve;
00078 class GU_PrimNURBSurf;
00079 class GU_PrimRBezSurf;
00080
00081
00082 class GU_AlignParms;
00083 class GU_ArmParms;
00084 class GU_ArmAngles;
00085 class GU_CameraParms;
00086 class GU_CapParms;
00087 class GU_CapOptions;
00088 class GU_ConvertParms;
00089 class GU_CreepParms;
00090 class GU_CurveClayParms;
00091 class GU_CurveNetworkParms;
00092 class GU_EdgeCreaseParms;
00093 class GU_ExtrudeParms;
00094 class GU_FilletParms;
00095 class GU_GridParms;
00096 class GU_JoinParms;
00097 class GU_JointParms;
00098 class GU_LimbAngles;
00099 class GU_LimbParms;
00100 class GU_LoftParms;
00101 class GU_LSystemParms;
00102 class GU_MagnetParms;
00103 class GU_ClothMatchSeamsParms;
00104 class GU_MetaSurfCacheParms;
00105 class GU_OffsetParms;
00106 class GU_PolyExtrudeParms;
00107 class GU_PolypatchParms;
00108 class GU_PolyReduceParms;
00109 class GU_PolysplineParms;
00110 class GU_RailParms;
00111 class GU_RevolveParms;
00112 class GU_RoundFilletParms;
00113 class GU_RuledParms;
00114 class GU_SkinParms;
00115 class GU_SkinCache;
00116 class GU_StitchParms;
00117 class GU_SuperQuadParms;
00118 class GU_SweepParms;
00119 class GU_TorusParms;
00120 class GU_TraceParms;
00121 class GU_TriMeshCache;
00122 class GU_TriMeshCacheParms;
00123 class GU_TrimFilletParms;
00124 class GU_TriStripParms;
00125 class GU_TwistParms;
00126 class GU_WarpParms;
00127
00128 typedef UT_PtrArray<GU_SplitLoc *> GU_SplitLocPtrArray;
00129
00130 #define FOR_ALL_ADDED_POINTS(gdp, firstpt, ppt) \
00131 for(ppt = firstpt; ppt; ppt = gdp->points().next(ppt))
00132
00133 #define FOR_ALL_ADDED_PRIMS(gdp, firstprim, lastprim, pprim) \
00134 for(pprim = firstprim; pprim && pprim != lastprim; \
00135 pprim = gdp->primitives().next(pprim))
00136
00137 class GU_API GU_DetailFlags
00138 {
00139 public:
00140 GU_DetailFlags() {
00141 cached = 0;
00142 cacheable = 1;
00143 }
00144 unsigned cached:1,
00145 cacheable:1;
00146 };
00147
00148 class GU_API GU_Detail : public GEO_Detail
00149 {
00150 public:
00151 GU_Detail() : GEO_Detail()
00152 {
00153 mySelection = 0;
00154 myMetaSurfCache = 0;
00155 myCacheableCount = 0;
00156 myMetaCacheCount =-1;
00157 myMetaCacheEnable = 1;
00158 myTriMeshCache = 0;
00159 }
00160 explicit GU_Detail(GU_Detail *src, GB_PrimitiveGroup *primGroup = 0)
00161 : GEO_Detail()
00162 {
00163 mySelection = 0;
00164 myMetaSurfCache = 0;
00165 myCacheableCount = 0;
00166 myMetaCacheCount =-1;
00167 myMetaCacheEnable = 1;
00168 myTriMeshCache = 0;
00169 merge(*src, primGroup);
00170 }
00171
00172 virtual ~GU_Detail();
00173
00174 virtual void clearAndDestroy();
00175
00176 void duplicate(const GU_Detail& gdp, int doselection = 0);
00177
00178
00179 int cached(void) const { return myFlags.cached; }
00180 void cached(int onoff=1) { myFlags.cached = onoff; }
00181 int cacheable(void) const { return myFlags.cacheable; }
00182 void cacheOn(void) { myFlags.cacheable = 1; }
00183 void cacheOff(void) { myFlags.cacheable = 0; }
00184
00185 void destroyCache(void);
00186 void notifyCache(int type);
00187 void notifyCache(int type, const GEO_Point &ppt);
00188 void notifyCache(int type, const GB_PointGroup &grp);
00189
00190 void setTriMeshCache(GU_TriMeshCache *cache)
00191 { myTriMeshCache = cache; }
00192 GU_TriMeshCache *getTriMeshCache() const { return myTriMeshCache; }
00193
00194
00195 void notifyMetaSurfCache(int type);
00196 void notifyMetaSurfCache(int type, const GEO_Point &ppt);
00197 void notifyMetaSurfCache(int type, const GB_PointGroup &);
00198
00199 int buildMetaSurfCache(GU_MetaSurfCacheParms &parms);
00200 GU_MetaSurfCache *getMetaSurfCache() const { return myMetaSurfCache; }
00201
00202 void incrementCacheables() { myCacheableCount++; }
00203 void decrementCacheables() { myCacheableCount--; }
00204 int getNumCacheables() const { return myCacheableCount; }
00205
00206 void incrementMetaCacheCount() { myMetaCacheCount++; }
00207 int getMetaCacheCount() const { return myMetaCacheCount; }
00208
00209 int metaCacheEnable() const { return myMetaCacheEnable;}
00210 void metaCacheEnable(int onoff)
00211 { myMetaCacheEnable = (char)onoff;}
00212
00213
00214
00215
00216
00217
00218
00219 void findBoundaryPoints(UT_IntArray &isboundary,
00220 bool checkuv);
00221
00222
00223
00224
00225
00226 void findSelectionBoundaryPoints(
00227 const UT_IntArray &pointselection,
00228 UT_IntArray &isboundary);
00229
00230
00231 void buildRingZeroPoints(
00232 UT_PtrArray<UT_PtrArray<GEO_Point *> *> &ringzero,
00233 UT_IntArray *ringvalence) const;
00234
00235 void buildRingZeroPrimitives(
00236 UT_PtrArray<UT_IntArray *> &ringzero) const;
00237
00238
00239
00240
00241
00242
00243
00244 GU_PrimPoly *cube(float xmin = -1, float xmax = 1,
00245 float ymin = -1, float ymax = 1,
00246 float zmin = -1, float zmax = 1,
00247 int xdiv = 0, int ydiv = 0, int zdiv = 0,
00248 int enforcementBars = 0,
00249 int doConsolidatePoints = 0);
00250
00251 GU_PrimNURBSurf *nurbCube(int xdiv, int ydiv, int zdiv,
00252 int orderx = 4, int ordery = 4, int orderz=4,
00253 float xmin = -0.5F, float xmax = 0.5F,
00254 float ymin = -0.5F, float ymax = 0.5F,
00255 float zmin = -0.5F, float zmax = 0.5F,
00256 GEO_SurfaceType type = GEO_PATCH_QUADS,
00257 bool consolidate = false);
00258
00259 GU_PrimRBezSurf *bezCube(int xdiv, int ydiv, int zdiv,
00260 int orderx = 4, int ordery = 4, int orderz=4,
00261 float xmin = -0.5F, float xmax = 0.5F,
00262 float ymin = -0.5F, float ymax = 0.5F,
00263 float zmin = -0.5F, float zmax = 0.5F,
00264 GEO_SurfaceType type = GEO_PATCH_QUADS,
00265 bool consolidate = false);
00266
00267 GU_PrimMesh *meshCube(int xdiv, int ydiv, int zdiv,
00268 float xmin = -0.5F, float xmax = 0.5F,
00269 float ymin = -0.5F, float ymax = 0.5F,
00270 float zmin = -0.5F, float zmax = 0.5F,
00271 GEO_SurfaceType type = GEO_PATCH_QUADS,
00272 bool consolidate = false);
00273
00274 GU_PrimPoly *polymeshCube(int xdiv, int ydiv, int zdiv,
00275 float xmin = -0.5F, float xmax = 0.5F,
00276 float ymin = -0.5F, float ymax = 0.5F,
00277 float zmin = -0.5F, float zmax = 0.5F,
00278 GEO_SurfaceType type = GEO_PATCH_QUADS,
00279 bool consolidate = false);
00280
00281
00282 GEO_Primitive *buildGrid(GU_GridParms &parms,
00283 GU_GridType type = GU_GRID_MESH);
00284
00285 GU_PrimPoly *polyGrid(int rows, int cols,
00286 float xsize=1, float ysize=1,
00287 float xc = 0, float yc = 0, float zc = 0,
00288 GU_OrientationType = GU_PLANE_XY,
00289 GEO_SurfaceType type = GEO_PATCH_QUADS);
00290 GU_PrimMesh *meshGrid(int rows, int cols,
00291 float xsize=1, float ysize=1,
00292 float xc = 0, float yc = 0, float zc = 0,
00293 GU_OrientationType = GU_PLANE_XY,
00294 GEO_SurfaceType type = GEO_PATCH_QUADS,
00295 int wrapu = 0, int wrapv = 0);
00296 GU_PrimNURBSurf *nurbGrid(int rows, int cols,
00297 int orderu = 4, int orderv = 4,
00298 int interpEndsU = 1, int interpEndsV = 1,
00299 float xsize=1, float ysize=1,
00300 float xc = 0, float yc = 0, float zc = 0,
00301 GU_OrientationType = GU_PLANE_XY,
00302 GEO_SurfaceType type = GEO_PATCH_QUADS,
00303 int wrapu = 0, int wrapv = 0);
00304 GU_PrimRBezSurf *bezGrid(int rows, int cols,
00305 int orderu = 4, int orderv = 4,
00306 float xsize=1, float ysize=1,
00307 float xc = 0, float yc = 0, float zc = 0,
00308 GU_OrientationType = GU_PLANE_XY,
00309 GEO_SurfaceType type = GEO_PATCH_QUADS,
00310 int wrapu = 0, int wrapv = 0);
00311
00312 void torus(unsigned type, GU_TorusParms &parms);
00313
00314
00315 GU_PrimPoly *polyIsoSurface(float (*ptOutside)(const UT_Vector3 &),
00316 const UT_BoundingBox &bbox,
00317 int xdiv, int ydiv, int zdiv);
00318
00319
00320
00321 void buildMetaSurface(GU_Detail *src, float lod,
00322 GB_PrimitiveGroup *primGroup = 0);
00323
00324 void buildMetaSurface(GU_Detail *src,
00325 int divx, int divy, int divz,
00326 GB_PrimitiveGroup *primGroup = 0);
00327
00328
00329
00330 void buildMetaXsection(GU_Detail *src, int nsections,
00331 int axis = 2, int maxdepth = 4,
00332 GB_PrimitiveGroup *primGroup = 0);
00333
00334
00335
00336
00337
00338
00339
00340 void orient(const GB_PrimitiveGroup *group = 0);
00341
00342
00343 void extrude(GU_ExtrudeParms &parms);
00344
00345
00346 void blend(const GU_Detail *source, float weight,
00347 int doPos, int doClr, int doNml, int doTxt);
00348
00349
00350
00351
00352
00353 int blend(const GU_Detail *gdps[], const float weights[],
00354 int size, int doPos, int doClr,
00355 int doNml, int doTxt,
00356 const GB_PointGroup *ptGroup = 0);
00357
00358
00359 void creep(GU_CreepParms &parms);
00360
00361
00362
00363
00364
00365
00366 int consolidatePoints(float distance,
00367 const GB_PointGroup *ptGrp=0,
00368 int forceConsAll = 0, int mark = 0);
00369
00370
00371
00372
00373 int fastConsolidatePoints(float distance,
00374 const GB_PointGroup *ptGrp=0,
00375 int mark = 0);
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387 enum OnlyConsGroupPropagateType
00388 {
00389 ONLYCONS_GRP_PROP_LEAST = 0,
00390 ONLYCONS_GRP_PROP_UNION,
00391 ONLYCONS_GRP_PROP_INTERSECT
00392 };
00393
00394
00395
00396
00397
00398 int onlyConsolidatePoints(float distance,
00399 const GB_PointGroup *ptgrp = 0,
00400 int mark = 0,
00401 bool deleteconsolidated = false,
00402 OnlyConsGroupPropagateType
00403 grouppropagate =
00404 ONLYCONS_GRP_PROP_LEAST);
00405
00406 int consolidateNormals(float distance,
00407 const GB_PointGroup *ptGrp=0,
00408 int forceConsAll = 0);
00409 int fastConsolidateNormals(float distance,
00410 const GB_PointGroup *ptGrp = 0);
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421 int fastConsolidatePointUVs(float distance,
00422 const GB_PointGroup &ptGrp,
00423 const GU_MetricType metric,
00424 int method,
00425 UT_Vector3 &uvw);
00426 int fastConsolidateVertexUVs(float distance,
00427 const GB_VertexGroup &vtxGrp,
00428 const GU_MetricType metric,
00429 int method,
00430 UT_Vector3 &uvw);
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445 int snapPoints(int type, float distance,
00446 const GB_PointGroup *ptgrp=0,
00447 bool snapptpos = true,
00448 bool snapptattribs = false,
00449 UT_PtrArray<GEO_AttributeHandle *>
00450 *ptattribhandles = 0);
00451
00452
00453
00454
00455
00456
00457 enum SnapAttributesType
00458 {
00459 SNAP_ATTRIBUTES_AVERAGE = 0,
00460 SNAP_ATTRIBUTES_INDEX
00461 };
00462
00463
00464
00465
00466
00467
00468
00469
00470 void snapPointAttributes(const UT_PtrArray<GEO_Point *>
00471 &snaplist,
00472 const UT_PtrArray<GEO_AttributeHandle *>
00473 &attribhandles,
00474 SnapAttributesType type,
00475 int snapindex = 0);
00476
00477
00478
00479
00480
00481
00482 void snapGrid(int type,
00483 float xlines, float ylines, float zlines,
00484 float xoff, float yoff, float zoff,
00485 float tol,
00486 const GB_PointGroup *ptGrp=0);
00487
00488 void snapGridPointUVs(int type,
00489 float xlines, float ylines, float zlines,
00490 float xoff, float yoff, float zoff,
00491 float tol,
00492 const GB_PointGroup *ptGrp=0);
00493 void snapGridVertexUVs(int type,
00494 float xlines, float ylines, float zlines,
00495 float xoff, float yoff, float zoff,
00496 float tol,
00497 const GB_VertexGroup *vtxGrp=0);
00498
00499
00500
00501
00502 int buildHoles(float dist = 0.001F, float angle = 0.2F,
00503 int snapFace=0,
00504 const GB_PrimitiveGroup *primGroup=0);
00505
00506
00507 void unHole(const GB_PrimitiveGroup *primGroup=0);
00508
00509
00510
00511
00512
00513 void uniquePoints(const GB_Group *group=0, int useMark=0);
00514
00515
00516
00517 void uniquePrimitive(GEO_Primitive *prim);
00518
00519
00520
00521
00522
00523
00524 int cleanData (const GB_PrimitiveGroup *primGrp=0,
00525 int removeRepPoints = 0,
00526 float tol = 0.001F, bool deletePoints = false);
00527
00528
00529
00530
00531
00532 int getDirtyData (GB_PrimitiveGroup *returnGrp,
00533 const GB_PrimitiveGroup *primGrp=0,
00534 int checkRepPoints = 0,
00535 float tol = 0.001F);
00536
00537
00538
00539
00540 virtual int normal(int internal=0,
00541 GB_PrimitiveGroup *primgroup = 0);
00542 virtual void normal(UT_Vector3Array &output,
00543 bool use_internaln = true) const;
00544
00545
00546
00547
00548 void applyTexture(GU_TextureType type, GU_AxisType axis,
00549 const GB_PrimitiveGroup *primGroup=0,
00550 int applyToVertex = -1, int fixPolySeams = 0,
00551 const GU_CameraParms *userData = 0);
00552
00553
00554
00555 void scaleTexture(float umult = 1, float uoff = 0,
00556 float vmult = 1, float voff = 0,
00557 float wmult = 1, float woff = 0,
00558 const GB_PrimitiveGroup *primGroup=0);
00559 void rotateTexture(float angle,
00560 const GB_PrimitiveGroup *primGroup=0);
00561
00562
00563 void transformPointTexture(const UT_Matrix4& mat,
00564 const GB_PointGroup *ptGroup,
00565 GEO_Delta *geodelta=0);
00566
00567
00568
00569
00570 void computeSoftTransformPointTextureCache(
00571 GEO_SoftTransformPointCache &cache,
00572 const GB_PointGroup *ptgroup,
00573 const GEO_Rolloff &rolloff,
00574 const GU_MetricType metric);
00575 void softTransformPointTexture(
00576 const UT_XformOrder &order,
00577 float tx, float ty, float tz,
00578 float rx, float ry, float rz,
00579 float sx, float sy, float sz,
00580 float s_xy, float s_xz, float s_yz,
00581 float px, float py, float pz,
00582 const GEO_SoftTransformPointCache &cache,
00583 const GEO_Rolloff &rolloff,
00584 GEO_Delta *geodelta = 0);
00585
00586 void transformVertexTexture(const UT_Matrix4& mat,
00587 const GB_VertexGroup *vertexGroup,
00588 GEO_Delta *geodelta=0);
00589
00590
00591
00592
00593
00594
00595 void computeSoftTransformVertexTextureCache(
00596 GEO_SoftTransformVertexCache &cache,
00597 const GB_VertexGroup *vtxgroup,
00598 const GEO_Rolloff &rolloff,
00599 const GU_MetricType metric,
00600 bool ignore_uv_connectivity);
00601 void softTransformVertexTexture(
00602 const UT_XformOrder &order,
00603 float tx, float ty, float tz,
00604 float rx, float ry, float rz,
00605 float sx, float sy, float sz,
00606 float s_xy, float s_xz, float s_yz,
00607 float px, float py, float pz,
00608 const GEO_SoftTransformVertexCache &cache,
00609 const GEO_Rolloff &rolloff,
00610 GEO_Delta *geodelta = 0);
00611
00612
00613 void reversePolys(const GB_PrimitiveGroup *prmGrp=0);
00614
00615
00616
00617 void convert(GU_ConvertParms &parms);
00618 void convertNew(GU_ConvertParms &parms);
00619
00620
00621
00622
00623
00624
00625
00626
00627 void sortPoints(UT_PtrArray<GB_Element *>& array,
00628 GU_AxisType axis = GU_XAXIS);
00629 void sortVertices(UT_PtrArray<GEO_Vertex *>& array,
00630 GU_AxisType axis = GU_XAXIS);
00631 void sortPrims(UT_PtrArray<GB_Element *>& array,
00632 GU_AxisType axis = GU_XAXIS);
00633 void sortPointList(GU_AxisType axis)
00634 {
00635 sortPoints(points(), axis);
00636 renumberPoints();
00637 }
00638 void sortPrimitiveList(GU_AxisType axis)
00639 {
00640 sortPrims(primitives(), axis);
00641 renumberPrimitives();
00642 }
00643
00644
00645 void sortPoints(UT_PtrArray<GB_Element *>& array,
00646 const UT_Vector3 &o, const UT_Vector3 &d);
00647 void sortPrims(UT_PtrArray<GB_Element *>& array,
00648 const UT_Vector3 &o, const UT_Vector3 &d);
00649 void sortPointList(const UT_Vector3 &o, const UT_Vector3 &d)
00650 {
00651 sortPoints(points(), o, d);
00652 renumberPoints();
00653 }
00654 void sortPrimitiveList(const UT_Vector3 &o,
00655 const UT_Vector3 &d)
00656 {
00657 sortPrims(primitives(), o, d);
00658 renumberPrimitives();
00659 }
00660
00661
00662 void sortPoints(UT_PtrArray<GB_Element *>&array, int seed);
00663 void sortPrims(UT_PtrArray<GB_Element *>&array, int seed);
00664 void sortPointList(int seed)
00665 {
00666 sortPoints(points(), seed);
00667 renumberPoints();
00668 }
00669 void sortPrimitiveList(int seed)
00670 {
00671 sortPrims(primitives(), seed);
00672 renumberPrimitives();
00673 }
00674
00675
00676 void sortElements(UT_PtrArray<GB_Element *>&array,
00677 float *order);
00678 void sortPointList(float *order)
00679 {
00680 sortElements(points(), order);
00681 renumberPoints();
00682 }
00683 void sortPrimitiveList(float *order)
00684 {
00685 sortElements(primitives(), order);
00686 renumberPrimitives();
00687 }
00688
00689
00690 void shift(int uoffset, int voffset,
00691 GB_PrimitiveGroup *group=0);
00692 void shiftPoints(UT_PtrArray<GB_Element *>&, int offset);
00693 void shiftPrims(UT_PtrArray<GB_Element *>&, int offset);
00694 void shiftPointList(int aoffset)
00695 {
00696 shiftPoints(points(), aoffset);
00697 renumberPoints();
00698 }
00699 void shiftPrimitiveList(int aoffset)
00700 {
00701 shiftPrims(primitives(), aoffset);
00702 renumberPrimitives();
00703 }
00704
00705
00706 void reverse(GB_PrimitiveGroup *group=0);
00707 void reversePoints(UT_PtrArray<GB_Element *>& array);
00708 void reversePrims(UT_PtrArray<GB_Element *>& array);
00709 void reversePointList()
00710 {
00711 reversePoints(points());
00712 renumberPoints();
00713 }
00714 void reversePrimitiveList()
00715 {
00716 reversePrims(primitives());
00717 renumberPrimitives();
00718 }
00719
00720
00721 void proximityPoints(UT_PtrArray<GB_Element*>& array,
00722 const UT_Vector3 &point);
00723 void proximityPrims(UT_PtrArray<GB_Element*>& array,
00724 const UT_Vector3 &point);
00725 void proximityToPointList(const UT_Vector3 &point)
00726 {
00727 proximityPoints(points(), point);
00728 renumberPoints();
00729 }
00730 void proximityToPrimitiveList(const UT_Vector3 &point)
00731 {
00732 proximityPrims(primitives(), point);
00733 renumberPrimitives();
00734 }
00735
00736 void vertexOrder(UT_PtrArray<GB_Element*>& array);
00737 void sortByVertexOrder()
00738 {
00739 vertexOrder(points());
00740 renumberPoints();
00741 }
00742
00743 #ifdef OTHERSORTS
00744
00745 void sortPoints(UT_PtrArray<GB_Element *>& array,
00746 GU_VertexOrder vert);
00747
00748 void sortPoints(UT_PtrArray<GB_Element *>&, int prox = 0);
00749 #endif
00750
00751
00752
00753 void superEllipsoid(const GU_SuperQuadParms &parms);
00754
00755 #if 0
00756
00757 unsigned isPolyConvex(GU_PrimPoly *pp);
00758 #endif
00759
00760
00761
00762 unsigned isPolyConvex(GB_PrimitiveGroup*primGroup = 0) const;
00763
00764
00765
00766 void convexPoly(GU_PrimPoly *pp, unsigned maxpts = 3, const GU_Detail *restgdp=0);
00767 void convex(unsigned maxpts=3, GB_PrimitiveGroup *primGroup=0, const GU_Detail *restgdp=0);
00768
00769
00770
00771 int findNonPlanar(GB_PrimitiveGroup *group, float tol = 0.0001F,
00772 GB_PrimitiveGroup *primGroup = 0);
00773
00774
00775
00776 void clip(UT_Vector3 &normal, float d = 0, int normlize = 0,
00777 const GB_PrimitiveGroup *primGroup = 0);
00778
00779
00780
00781 void crease(UT_Vector3 &normal, float d = 0,
00782 int normlize = 0, int outputGroups = 0,
00783 GB_PrimitiveGroup *above = 0,
00784 GB_PrimitiveGroup *below = 0,
00785 const GB_PrimitiveGroup *creaseGroup = 0);
00786
00787
00788 void fractalize(int seed = 1, float roughness = 0.6F,
00789 float scaleby=1, int divs=1,
00790 int fixedBoundry = 1, int useVtxNorms = 0,
00791 float nx = 0, float ny = 0, float nz = 1,
00792 const GB_PrimitiveGroup *fractalGroup = 0);
00793
00794
00795
00796
00797
00798 int nonLinearDeform(GU_DeformType type,const GU_TwistParms &parms,
00799 int &pasted);
00800
00801
00802 GEO_Hull *offset(const GU_OffsetParms &parms);
00803
00804
00805
00806
00807
00808
00809
00810
00811 GEO_Hull *gordon(GEO_SurfaceType surftype, int accurate,
00812 const GB_PrimitiveGroup &ufaces,
00813 const GB_PrimitiveGroup &vfaces,
00814 int reparameterize = 0);
00815 GEO_Hull *gordon(GEO_SurfaceType surftype, int accurate,
00816 const UT_PtrArray<GEO_Primitive*> &uprims_in,
00817 const UT_PtrArray<GEO_Primitive*> &vprims_in,
00818 GU_SkinCache& skin_cache,
00819 int reparameterize = 0);
00820
00821
00822
00823
00824 GEO_Hull *coons(GEO_SurfaceType surftype,
00825 const GEO_Face &uface1, const GEO_Face &vface1,
00826 const GEO_Face *uface2 = 0, const GEO_Face *vface2 = 0);
00827
00828
00829
00830
00831
00832
00833
00834
00835 GEO_Hull *skin(GU_SkinParms &parms, GU_SkinCache& skin_cache);
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845 GEO_Hull *skin(const GB_PrimitiveGroup &ucfaces,
00846 GEO_SurfaceType surftype = GEO_PATCH_QUADS,
00847 unsigned vorder = 0, int vwrap = 0,
00848 int doskin = 1, int nprims = -1,
00849 const UT_Vector *vParmValues = 0);
00850 GEO_Hull *skin(const UT_PtrArray<GEO_Primitive*> & prims_in, GU_SkinCache& skin_cache,
00851 GEO_SurfaceType surftype = GEO_PATCH_QUADS,
00852 unsigned vorder = 0, int vwrap = 0,
00853 int doskin = 1, int nprims = -1,
00854 const UT_Vector *vParmValues = 0);
00855
00856
00857
00858
00859 int ruled( GEO_Hull *&surface, const GU_RuledParms &p,
00860 const GU_CapOptions &caps);
00861
00862
00863
00864
00865
00866 int curveNetwork(GEO_Hull *&hull, GU_CurveNetworkParms &p,
00867 int &count, GU_SkinCache& skin_cache);
00868
00869 GU_ERROR sweep( GU_SweepParms parms );
00870 void rails( GU_RailParms parms );
00871
00872
00873 GEO_Primitive *join( GU_JoinParms &p, int &count);
00874
00875
00876 GEO_Hull *filletTrims(GU_TrimFilletParms &parms, int &count);
00877
00878
00879 GEO_Hull *filletRound(GU_RoundFilletParms &parms);
00880 void filletRoundNetwork(UT_RefMatrix<void*>,
00881 GU_RoundFilletParms &parms);
00882
00883
00884 void joint(const GU_JointParms &p);
00885
00886
00887
00888
00889
00890 int fillet(GU_FilletParms &parms, int &count);
00891
00892
00893
00894 int loft(GU_LoftParms &p, const GB_PointGroup &g1,
00895 const GB_PointGroup &g2);
00896
00897 int loft(GU_LoftParms &p,
00898 const GB_PrimitiveGroup *group = 0);
00899
00900
00901
00902
00903
00904
00905 int revolve( const GU_RevolveParms &parms,
00906 const GU_CapOptions &caps, int &count);
00907
00908
00909 int warp(GU_WarpParms &parms);
00910
00911
00912 GU_ERROR curveClay(const GU_CurveClayParms &ccparm);
00913
00914
00915 int endCap(GEO_Hull &hull, const GU_CapParms &parms);
00916 int endCap(GEO_Face &face, const GU_CapParms &parms);
00917
00918
00919 int setCaps(GEO_Hull &hull, const GU_CapOptions &parms, int &count);
00920 int setCaps(GEO_Face &face, const GU_CapOptions &parms, int &count);
00921
00922
00923
00924
00925
00926
00927
00928
00929 int lattice(const GU_Detail *source, const GU_Detail *rest,
00930 const GU_Detail *deform, int xdiv, int ydiv, int zdiv,
00931 const GB_PointGroup *ptgroup = 0,
00932 UT_BitArray *deform_history = NULL,
00933 GU_LatticeType type = GU_LATTICE_BEZIER);
00934
00935
00936
00937
00938 int magnet( const GU_MagnetParms &parms );
00939
00940
00941 float trace(GU_TraceParms *parms);
00942
00943
00944 void applyTraceTexture(float xres, float yres, float resolution);
00945
00946
00947
00948 void fit2DCurve(const GU_Detail *source, float error_squared,
00949 GB_PrimitiveGroup *primGroup = 0);
00950
00951
00952 GU_Curve *interpCurveBreakpoints(const GEO_Face &face,
00953 unsigned type=GEOPRIMNURBCURVE,
00954 int order=4,
00955 GB_ParmType parmType=GB_PARM_CHORD);
00956 GU_Curve *interpCurveBreakpoints(const UT_PtrArray<GEO_Point*> &gpData,
00957 unsigned type=GEOPRIMNURBCURVE,
00958 int order=4, int wrapped=0,
00959 GB_ParmType parmType=GB_PARM_CHORD);
00960 GU_Curve *interpCurveBreakpoints(const UT_Vector4Array &v4Data,
00961 unsigned type=GEOPRIMNURBCURVE,
00962 int order=4, int wrapped=0,
00963 GB_ParmType parmType=GB_PARM_CHORD);
00964
00965
00966 GU_Curve *interpCurveGlobal(const GEO_Face &face,
00967 unsigned type=GEOPRIMNURBCURVE,
00968 int order=4,
00969 GB_ParmType parmType=GB_PARM_CHORD,
00970 GB_KnotSpaceType knotSpaceType=GB_KNOT_AVERAGING);
00971 GU_Curve *interpCurveGlobal(const UT_PtrArray<GEO_Point *> &gpData,
00972 unsigned type=GEOPRIMNURBCURVE,
00973 int order=4, int wrapped=0,
00974 GB_ParmType parmType=GB_PARM_CHORD,
00975 GB_KnotSpaceType knotSpaceType=GB_KNOT_AVERAGING);
00976 GU_Curve *interpCurveGlobal(const UT_Vector4Array &v4Data,
00977 unsigned type=GEOPRIMNURBCURVE,
00978 int order=4, int wrapped=0,
00979 GB_ParmType parmType=GB_PARM_CHORD,
00980 GB_KnotSpaceType knotSpaceType=GB_KNOT_AVERAGING);
00981 GU_Curve *interpCurveLocal(const GEO_Face &face,
00982 unsigned type=GEOPRIMBEZCURVE,
00983 int order = 4, int corner=0);
00984 GU_Curve *interpCurveLocal(const UT_PtrArray<GEO_Point *> &gpData,
00985 unsigned type=GEOPRIMBEZCURVE,
00986 int order = 4, int wrapped=0, int corner=0);
00987 GU_Curve *interpCurveLocal(const UT_Vector4Array &v4Data,
00988 unsigned type=GEOPRIMBEZCURVE,
00989 int order = 4, int wrapped=0, int corner=0);
00990
00991 GU_TPSurf *interpSurfGlobal(const GEO_Hull &mesh,
00992 unsigned type=GEOPRIMNURBSURF,
00993 int uOrder=4, int vOrder=4,
00994 GEO_SurfaceType sType=GEO_PATCH_QUADS,
00995 GB_ParmType uParmType=GB_PARM_CHORD,
00996 GB_ParmType vParmType=GB_PARM_CHORD,
00997 GB_KnotSpaceType uKnotSpaceType=GB_KNOT_AVERAGING,
00998 GB_KnotSpaceType vKnotSpaceType=GB_KNOT_AVERAGING,
00999 const UT_Vector *uParmValues = 0,
01000 const UT_Vector *vParmValues = 0);
01001
01002 GU_TPSurf *interpSurfGlobal(const UT_PtrMatrix<GEO_Point *> &gpMesh,
01003 unsigned type=GEOPRIMNURBSURF,
01004 int uOrder=4, int vOrder=4,
01005 int uWrapped=0, int vWrapped=0,
01006 GEO_SurfaceType sType=GEO_PATCH_QUADS,
01007 GB_ParmType uParmType=GB_PARM_CHORD,
01008 GB_ParmType vParmType=GB_PARM_CHORD,
01009 GB_KnotSpaceType uKnotSpaceType=GB_KNOT_AVERAGING,
01010 GB_KnotSpaceType vKnotSpaceType=GB_KNOT_AVERAGING,
01011 const UT_Vector *uParmValues = 0,
01012 const UT_Vector *vParmValues = 0);
01013
01014 GU_TPSurf *interpSurfBreakpoints(const GEO_Hull &mesh,
01015 unsigned type=GEOPRIMNURBSURF,
01016 int uOrder=4, int vOrder=4,
01017 GEO_SurfaceType sType=GEO_PATCH_QUADS,
01018 GB_ParmType uParmType=GB_PARM_CHORD,
01019 GB_ParmType vParmType=GB_PARM_CHORD,
01020 GB_KnotSpaceType uKnotSpaceType=GB_KNOT_AVERAGING,
01021 GB_KnotSpaceType vKnotSpaceType=GB_KNOT_AVERAGING,
01022 const UT_Vector *uParmValues = 0,
01023 const UT_Vector *vParmValues = 0);
01024
01025 GU_TPSurf *interpSurfBreakpoints(const UT_PtrMatrix<GEO_Point *> &gpMesh,
01026 unsigned type=GEOPRIMNURBSURF,
01027 int uOrder=4, int vOrder=4,
01028 int uWrapped=0, int vWrapped=0,
01029 GEO_SurfaceType sType=GEO_PATCH_QUADS,
01030 GB_ParmType uParmType=GB_PARM_CHORD,
01031 GB_ParmType vParmType=GB_PARM_CHORD,
01032 GB_KnotSpaceType uKnotSpaceType=GB_KNOT_AVERAGING,
01033 GB_KnotSpaceType vKnotSpaceType=GB_KNOT_AVERAGING,
01034 const UT_Vector *uParmValues = 0,
01035 const UT_Vector *vParmValues = 0);
01036
01037
01038
01039
01040 GU_Curve *approxCurveGlobal(const GEO_Face &face,
01041 unsigned type=GEOPRIMNURBCURVE,
01042 int order=4,
01043 float tol=1e-1F, float smooth=0.0F,
01044 int noMultipleKnots=1);
01045 GU_Curve *approxCurveGlobal(const UT_Vector4Array &v4Data,
01046 unsigned type=GEOPRIMNURBCURVE,
01047 int order=4, int wrapped=0,
01048 float tol=1e-1F, float smooth=0.0F,
01049 int noMultipleKnots=1);
01050
01051 GU_TPSurf *approxSurfGlobal(const GEO_Hull &mesh,
01052 unsigned type=GEOPRIMNURBSURF,
01053 int uOrder=4, int vOrder=4,
01054 GEO_SurfaceType sType=GEO_PATCH_QUADS,
01055 float tol=1e-1F, float smooth=0.0F,
01056 int uNoMultipleKnots=1,
01057 int vNoMultipleKnots=1);
01058 GU_TPSurf *approxSurfGlobal(const UT_PtrMatrix<GEO_Point *> &gpMesh,
01059 unsigned type=GEOPRIMNURBSURF,
01060 int uOrder=4, int vOrder=4,
01061 int uWrapped=0, int vWrapped=0,
01062 GEO_SurfaceType sType=GEO_PATCH_QUADS,
01063 float tol=1e-1F, float smooth=0.0F,
01064 int uNoMultipleKnots=1,
01065 int vNoMultipleKnots=1);
01066
01067
01068
01069
01070 void refine(float *uunit, int ulen,
01071 float *vunit, int vlen,
01072 int countu=1, int countv=1,
01073 int arcspacing = 0,
01074 const GB_PrimitiveGroup *primGroup = 0);
01075
01076 void unrefine(float umin, float umax,
01077 float vmin, float vmax,
01078 int countu=1, int countv=1,
01079 float utol=0.001F, float vtol=0.001F,
01080 const GB_PrimitiveGroup *primGroup = 0);
01081
01082 void subdivide(float *uunit, int ulen,
01083 float *vunit, int vlen,
01084 int arcspacing = 0,
01085 const GB_PrimitiveGroup *primGroup = 0);
01086
01087
01088 int extract(float *uunit, int ulen,
01089 float *vunit, int vlen,
01090 const GB_PrimitiveGroup *primGroup = 0,
01091 GB_PointGroup *newPoints = 0,
01092 int op = 0, int keepOriginal = 0,
01093 int atbreakpoints = 0, int use_arc_length = 0);
01094
01095 void extractIsoParms(float *uunit, int ulen,
01096 float *vunit, int vlen,
01097 GB_PrimitiveGroup *newPrims = 0,
01098 const GB_PrimitiveGroup *primGroup = 0);
01099
01100 void extractPoints(float *uunit, int ulen,
01101 float *vunit, int vlen,
01102 GB_PointGroup *newPoints = 0,
01103 const GB_PrimitiveGroup *primGroup = 0);
01104
01105 void extractProfiles(float *uunit, int ulen,
01106 float *vunit, int vlen,
01107 const GB_PrimitiveGroup *primGroup = 0);
01108
01109 void extractIsoParmsAtBreak(float *uunit, int ulen,
01110 float *vunit, int vlen,
01111 GB_PrimitiveGroup *newPrims = 0,
01112 const GB_PrimitiveGroup *primGroup = 0);
01113
01114 void extractPointsAtBreak(float *uunit, int ulen,
01115 float *vunit, int vlen,
01116 GB_PointGroup *newPoints = 0,
01117 const GB_PrimitiveGroup *primGroup = 0);
01118
01119 void extractProfilesAtBreak(float *uunit, int ulen,
01120 float *vunit, int vlen,
01121 const GB_PrimitiveGroup *primGroup = 0);
01122
01123
01124 int cut(float *uunit, int ulen,
01125 float *vunit, int vlen,
01126 const GB_PrimitiveGroup *primGroup = 0,
01127 int keepin=1, int keepout=0, int atbreakpoints = 0,
01128 int allU = 0, int allV = 0, int use_arc_length = 0);
01129
01130
01131
01132 void polySpline(GU_PolysplineParms &parms,
01133 const GB_PrimitiveGroup *primGroup = 0,
01134 bool deleteAll = true);
01135
01136
01137
01138 int polyPatch(GU_PolypatchParms &parms,
01139 const GB_PrimitiveGroup *primGroup = 0);
01140
01141
01142 int polyReduce(GU_PolyReduceParms &parms,
01143 const GB_PrimitiveGroup *primGroup = 0,
01144 int *pointIndexTable = 0);
01145
01146
01147 int triStrip( GU_TriStripParms &parms );
01148
01149
01150 void lsystem(GU_LSystemParms &lp);
01151
01152
01153 int info(ostream &os, int maxlines = 15) const;
01154 int64 getMemoryUsage(void) const;
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165 GEO_Primitive *intersectRay(const UT_Vector3 &o, const UT_Vector3 &d,
01166 float tmax = 1E17F, float tol = 1E-12F,
01167 float *dist = 0, UT_Vector3 *pos = 0,
01168 UT_Vector3 *nml = 0, int accurate = 0,
01169 float *u = 0, float *v = 0,
01170 int ignoretrim = 1) const;
01171
01172
01173
01174
01175
01176
01177
01178 int commonFaceConfig(const GB_PrimitiveGroup &faceGroup,
01179 unsigned &type, int &order, int &open,
01180 int &ends) const;
01181 int commonFaceConfig(const UT_PtrArray<GEO_Primitive*> &faces_in,
01182 unsigned &type, int &order, int &open,
01183 int &ends) const;
01184 int commonSurfaceConfig(const GB_PrimitiveGroup &surfs,
01185 unsigned &type, int &orderu, int &orderv,
01186 int &openu, int &openv, int &endsu,
01187 int &endsv) const;
01188
01189
01190
01191
01192
01193
01194
01195 int makeFacesCompatible(const GB_PrimitiveGroup &infaces,
01196 GB_PrimitiveGroup &outfaces,
01197 int mustopen=0, int mustends=0,
01198 int nonrational=0,
01199 unsigned *extratype = 0,
01200 int equalcvs = 1);
01201 int makeFacesCompatible(const UT_PtrArray<GEO_Primitive*> &prims_in,
01202 UT_PtrArray<GEO_Primitive*>& prims_out,
01203 int mustopen=0, int mustends=0,
01204 int nonrational=0,
01205 unsigned *extratype = 0,
01206 int equalcvs = 1);
01207 int makeFacesCompatible(const GB_PrimitiveGroup &infacesU,
01208 const GB_PrimitiveGroup &infacesV,
01209 GB_PrimitiveGroup &outfacesU,
01210 GB_PrimitiveGroup &outfacesV,
01211 int mustopen=0, int mustends=0,
01212 int nonrational=0,
01213 unsigned *extratype = 0,
01214 int equalcvs = 1);
01215 int makeFacesCompatible(const UT_PtrArray<GEO_Primitive*> &ufaces_array,
01216 const UT_PtrArray<GEO_Primitive*> &vfaces_array,
01217 UT_PtrArray<GEO_Primitive*> &ucfaces_array,
01218 UT_PtrArray<GEO_Primitive*> &vcfaces_array,
01219 int mustopen=0, int mustends=0,
01220 int nonrational=0,
01221 unsigned *extratype = 0,
01222 int equalcvs = 1);
01223
01224
01225
01226
01227
01228 static int loftHulls(GEO_Hull *left, GEO_Hull *right,
01229 float lwidth1, float lwidth2,
01230 float rwidth1, float rwidth2,
01231 int sharp, int &lstart, int &rstart,
01232 int &lmax, int &rmax,
01233 int loftU, GB_NUBBasis *nubbasis);
01234
01235
01236
01237
01238
01239 static int getSubdividedCV(GEO_Hull *hull, int udir, float unit);
01240 static int getSubdividedCV(GEO_Face *face, float unit);
01241
01242
01243 static void registerIOTranslator(GEO_IOTranslator *trans);
01244 static void unregisterIOTranslator(GEO_IOTranslator *trans);
01245
01246
01247
01248
01249
01250 virtual int save(const char *, int binary,
01251 const UT_Options *options) const;
01252 virtual int save(ostream& os, int binary,
01253 const UT_Options *options) const;
01254 virtual int load(const char *, const UT_Options *options);
01255 virtual bool load(UT_IStream &is, const UT_Options *options);
01256
01257
01258
01259 void align(GU_AlignParms &parms);
01260
01261
01262
01263
01264
01265
01266 int stitch(GU_StitchParms &parms);
01267
01268
01269
01270
01271 int arm(GU_ArmParms &parms, GU_ArmAngles &ret_angles);
01272
01273
01274
01275 void limb(GU_LimbParms &parms, GU_LimbAngles &ret_angles);
01276
01277
01278
01279
01280
01281
01282 int makeSurfacesCompatible(
01283 const GB_PrimitiveGroup &insurfs,
01284 GB_PrimitiveGroup &outsurfs,
01285 int mustopenu=0, int mustopenv=0,
01286 int mustendsu=0, int mustendsv=0,
01287 int equalcvsu=1, int equalcvsv=1,
01288 unsigned *extratype = 0);
01289
01290
01291
01292
01293 GB_PrimitiveGroup *getPastedSurfaces(const char *n = "__gu_all_pasted__");
01294 GB_PrimitiveGroup *getPastedSurfaces(GB_PrimitiveGroup *&used,
01295 const char *n = "__gu_all_pasted__",
01296 const char *u = "__gu_used_pasted__");
01297 void updatePastedDisplacement(const GEO_Point &ppt,
01298 const GB_PrimitiveGroup *all,
01299 GB_PrimitiveGroup *used);
01300 int updatePastedDisplacements(void);
01301 int updatePastedDependents(GB_PrimitiveGroup *all,
01302 GB_PrimitiveGroup *used);
01303
01304
01305
01306
01307
01308 GU_ERROR error() const
01309 {
01310 return UTgetErrorManager()->getSeverity();
01311 }
01312
01313 void addError(UT_Error *e) const
01314 {
01315 UTgetErrorManager()->append(e);
01316 }
01317 void addMessage(GU_ErrorCodes code,
01318 const char *msg = 0) const
01319 {
01320 UTgetErrorManager()->addMessage("GU", code, msg);
01321 }
01322 void addWarning(GU_ErrorCodes code,
01323 const char *msg = 0) const
01324 {
01325 UTgetErrorManager()->addWarning("GU", code, msg);
01326 }
01327 void addError(GU_ErrorCodes code, const char *msg = 0) const
01328 {
01329 UTgetErrorManager()->addError("GU", code, msg);
01330 }
01331
01332
01333
01334
01335 void selection(GU_Selection *s) { mySelection = s; }
01336 GU_Selection *selection(void) const { return mySelection;}
01337 void destroySelection();
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349
01350 GU_SelectionList &getOrCreateSelectionList(int &instance);
01351 const GU_SelectionList &getSelectionList(int instance) const;
01352 int getNumSelectionListInstances() const;
01353 void destroySelectionLists();
01354
01355
01356
01357 void copySelectionLists(const GU_Detail &src_gdp);
01358
01359
01360 void addSelectionToTemp(const GU_Detail &src_gdp,
01361 const GU_Selection &src_sel,
01362 int &sel_inst, int sel_index,
01363 bool dirty_gdp = true);
01364
01365
01366
01367 void dirtySelectionTopologyData();
01368
01369
01370
01371
01372
01373
01374
01375 void preserveGroups(const GEO_Primitive *oldprim,
01376 const GEO_Primitive *newprim)
01377 {
01378 preservePrimitiveGroups(oldprim, newprim);
01379 preservePointGroups(oldprim, newprim);
01380 }
01381 void preservePrimitiveGroups(const GEO_Primitive *oldprim,
01382 const GEO_Primitive *newprim);
01383 void preservePointGroups(const GEO_Primitive *oldprim,
01384 const GEO_Primitive *newprim);
01385
01386
01387
01388 void removeInlinePoints(float tol,
01389 const GB_PrimitiveGroup *prims);
01390
01391
01392
01393 void getRBDParams( GU_OldOBBTree &tree,
01394 UT_Matrix3 &ibody,
01395 UT_Matrix3 &ibodyinv,
01396 int samples,
01397 float lod ) const;
01398
01399
01400
01401 int removeZeroAreaFaces(GB_PrimitiveGroup *grpp,
01402 int ignoreOpenFaces = 0,
01403 float tolerance = 0.001F,
01404 int onlyPolys = 1);
01405 int removeZeroAreaFaces(const UT_IntArray &primlist,
01406 int ignoreOpenFaces = 0,
01407 float tolerance = 0.001F,
01408 int onlyPolys = 1);
01409
01410
01411
01412 void deleteGroupGeometry(GB_BaseGroup &group);
01413
01414
01415 void deleteEdges(GB_EdgeGroup &edgegroup,
01416 bool del_inline_points,
01417 float inlinetol,
01418 bool del_unused_points = true);
01419
01420
01421 void flipEdges(GB_EdgeGroup &edgegroup, int rotations = 1,
01422 bool rotattribs = false,
01423 GB_EdgeGroup *outedges = 0);
01424
01425
01426
01427
01428
01429
01430
01431
01432 void edgeSplit(const GU_SplitLocPtrArray &splitlocs,
01433 bool quadcut = false,
01434 bool forcecut = true,
01435 GB_EdgeGroup *outedges = 0,
01436 float tolerance = FP32_TOLERANCE);
01437
01438
01439 void divideEdges(GB_EdgeGroup &edgegroup, int numdivs = 1,
01440 bool applytoall = true,
01441 bool use_shared_points = false,
01442 GB_EdgeGroup *outedges = 0,
01443 UT_PtrArray<GEO_Point*> *new_points = 0,
01444 GEO_PointRefArray *prefarr = 0,
01445 bool preserve_edge_dir = false);
01446 void divideEdges(GB_EdgeGroup &edgegroup,
01447 int numdivs,
01448 bool applytoall,
01449 bool use_shared_points,
01450 GB_EdgeGroup *outedges,
01451 UT_PtrArray<GEO_Point*> *new_points,
01452 GEO_PointRefArray *prefarr,
01453 bool preserve_edge_dir,
01454 float fraction);
01455
01456
01457 void transformBreakpoints(const UT_Matrix4 &mat,
01458 const GB_BreakpointGroup *grp = 0,
01459 int quickxform = 0);
01460
01461
01462
01463 void smoothNonPolygons(int iterations, GU_WeightingType type,
01464 float lambda, float mu,
01465 const GB_PrimitiveGroup *primgrp = 0,
01466 bool useptattribs=false,
01467 int attriboffset=-1,
01468 int attribsize = 0);
01469
01470
01471 void polyExtrude(const GU_PolyExtrudeParms &parms);
01472
01473
01474 void edgeCollapse(const GB_EdgeGroup &edgegroup,
01475 bool removedegen = true,
01476 bool updatenmls = true,
01477 GB_PointGroup *outpoints = 0);
01478
01479
01480 void edgeCrease(const GU_EdgeCreaseParms &parms);
01481
01482
01483 void pointInset(const GB_PointGroup *ptgroup,
01484 float insetdist, float nmldist);
01485
01486
01487
01488
01489
01490
01491
01492 void getOBBox(const GB_PrimitiveGroup *grp,
01493 UT_Matrix4 &transform,
01494 UT_Vector3 &radii) const;
01495
01496
01497 int makePrimsPlanar(const GB_PrimitiveGroup *grp = 0);
01498
01499
01500
01501
01502 void setSeamPointAttributes(const GB_PointGroup &group_a,
01503 const GB_PointGroup &group_b);
01504
01505 int getNumClothSeams() const;
01506
01507
01508 void getClothSeamAttribName(UT_WorkBuffer& attrib_name,
01509 int seam_number,
01510 int seam_half) const;
01511
01512
01513
01514 int getClothSeamAttribOffset(int seam_number,
01515 int seam_half) const;
01516
01517
01518 void appendSeamPoints(
01519 UT_RefArray<GU_ClothStitchPair> &seam_points,
01520 int seam_number) const;
01521
01522
01523 void matchClothSeams(const GU_ClothMatchSeamsParms &parms);
01524
01525 protected:
01526 GEO_Primitive *newPrimitive(unsigned type);
01527
01528 private:
01529
01530 void getPointsInGeo (UT_Vector3 *ptArray,
01531 int numpts) const;
01532
01533 int twist (const GU_TwistParms &parms, int &p);
01534 int bend (const GU_TwistParms &parms, int &p);
01535 int squashStretch (const GU_TwistParms &parms, int &p);
01536 int shear (const GU_TwistParms &parms, int &p);
01537 int taper (const GU_TwistParms &parms, int &p);
01538 int linearTaper (const GU_TwistParms &parms, int &p);
01539
01540 void fillGrid(GEO_Hull &hull, int rows, int cols,
01541 float x_size, float y_size,
01542 float x_center, float y_center,
01543 float z_center,
01544 GU_OrientationType plane);
01545
01546 void convertPolysToHull(GU_ConvertParms &parms,
01547 int convertNew);
01548
01549 void convertVolumesToPolys(GU_ConvertParms &parms,
01550 bool convertnew);
01551
01552 void convertMetasToPolys(GU_ConvertParms &parms,
01553 int convertNew);
01554
01555 void doConversion(GU_ConvertParms &parms,
01556 int convertNew);
01557
01558 void orientPoly(GEO_PointRefArray &ptRefArray,
01559 GEO_PrimPoly *poly,
01560 UT_BitArray &process,
01561 UT_BitArray &reverse);
01562
01563 GEO_Primitive *surfCube(int xdiv, int ydiv, int zdiv,
01564 int orderx, int ordery, int orderz,
01565 float xmin, float xmax,
01566 float ymin, float ymax,
01567 float zmin, float zmax,
01568 GEO_SurfaceType type, int kind,
01569 bool consolidate);
01570
01571
01572 bool isDirtySinglePrimitive(GEO_Primitive *prim,
01573 int checkRepPoints,
01574 float tol);
01575
01576 GU_Selection *mySelection;
01577 GU_MetaSurfCache *myMetaSurfCache;
01578 GU_TriMeshCache *myTriMeshCache;
01579 GU_DetailFlags myFlags;
01580 int myCacheableCount;
01581
01582
01583 UT_PtrArray<GU_SelectionList *> mySelectionLists;
01584
01585 int myMetaCacheCount;
01586 char myMetaCacheEnable;
01587
01588
01589 int primToPlane(GEO_Primitive *pprim,
01590 UT_Vector4Array* fixedPoints = 0);
01591 };
01592
01593 #endif