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