00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __GEO_TPSurf_h__
00024 #define __GEO_TPSurf_h__
00025
00026 #include "GEO_API.h"
00027 #include <UT/UT_RefMatrix.h>
00028 #include <UT/UT_IntArray.h>
00029 #include <UT/UT_Interval.h>
00030 #include <GB/GB_Basis.h>
00031 #include <GB/GB_Parameterization.h>
00032 #include "GEO_Hull.h"
00033 #include "GEO_PrimType.h"
00034 #include "GEO_Greville.h"
00035
00036 class UT_Vector3;
00037 class UT_Vector4;
00038 class UT_FloatArray;
00039 class UT_BoundingRect;
00040 class GB_AttributeData;
00041 class GB_FloatOffsets;
00042 class GEO_WorkVertexBuffer;
00043 class GEO_Profiles;
00044 class GEO_PasteSurf;
00045 class GEO_Delta;
00046
00047 class GEO_API GEO_TPSurf : public GEO_Hull {
00048 public:
00049
00050
00051 GEO_TPSurf(GEO_Detail *d, int m = 0, int n = 0);
00052
00053
00054
00055
00056 virtual ~GEO_TPSurf();
00057
00058
00059 virtual GB_Element *getSecondary(int );
00060 virtual unsigned numSecondary(void);
00061
00062 virtual void changePointRef(GB_Element *from, GB_Element *to);
00063
00064
00065 virtual void copyPrimitive( const GEO_Primitive *src,
00066 GEO_Point **ptredirect);
00067 virtual GEO_Primitive *copy(int preserve_shared_pts = 0) const;
00068
00069
00070 void mergeProfiles(const GEO_TPSurf &tpsurf,
00071 int onlyvisible = 0);
00072
00073
00074
00075
00076 bool evaluate(fpreal u, fpreal v, GEO_Vertex &result,
00077 GEO_AttributeHandleList &hlist,
00078 unsigned du=0, unsigned dv=0,
00079 int uoffset=-1, int voffset=-1) const;
00080 int evaluate(float u, float v, UT_Vector4 &pos,
00081 unsigned du=0, unsigned dv=0,
00082 int uoffset=-1, int voffset=-1) const;
00083 int evaluateWAttrib(float u, float v, UT_Vector4 &pos,
00084 GB_AttributeData &adata,
00085 const GB_FloatOffsets &foffsets,
00086 unsigned du=0, unsigned dv=0,
00087 int uoffset=-1, int voffset=-1) const;
00088
00089
00090
00091
00092
00093
00094 virtual int evaluateBasisDerivs(float u, float v,
00095 float ubmatx[][GB_MAXORDER],
00096 float vbmatx[][GB_MAXORDER],
00097 int &rowoffset, int &coloffset,
00098 unsigned du=0, unsigned dv=0,
00099 int uoffset=-1, int voffset=-1) const = 0;
00100
00101
00102
00103
00104
00105 virtual int evaluateBasis(float u, float v, float *ubvals,
00106 float *vbvals, int &rowoffset,
00107 int &coloffset,
00108 unsigned du=0, unsigned dv=0,
00109 int uoffset=-1, int voffset=-1) const = 0;
00110 virtual int evaluateUBasis(float u, float *ubvals, int &coloffset,
00111 unsigned du=0, int uoffset=-1) const = 0;
00112 virtual int evaluateVBasis(float v, float *vbvals, int &rowoffset,
00113 unsigned dv=0, int voffset=-1) const = 0;
00114
00115
00116
00117
00118
00119 float computeUBValue(float u, int uoff, int row = 0) const;
00120 float computeVBValue(float v, int voff, int col = 0) const;
00121 float computeBValue (float u,float v,int uoff,int voff)const;
00122
00123
00124
00125
00126
00127
00128
00129 virtual int evaluateMesh(float *uArr, unsigned uArrLen,
00130 float *vArr, unsigned vArrLen,
00131 UT_Vector4 *pos,
00132 unsigned du=0, unsigned dv=0
00133 ) const;
00134 virtual bool evaluateMesh(float uStart, float uStop,
00135 unsigned nu, float vStart, float vStop,
00136 unsigned nv, GEO_Vertex **results,
00137 GEO_AttributeHandleList &hlist,
00138 unsigned du=0, unsigned dv=0) const;
00139 virtual int evaluateMesh(float uStart, float uStop, unsigned nu,
00140 float vStart, float vStop, unsigned nv,
00141 UT_Vector4 *pos,
00142 unsigned du=0, unsigned dv=0) const;
00143 virtual int evaluateMeshWAttrib(float uStart, float uStop,
00144 unsigned nu, float vStart, float vStop,
00145 unsigned nv, UT_Vector4 *pos,
00146 GB_AttributeData *adata,
00147 const GB_FloatOffsets &foffsets,
00148 unsigned du=0, unsigned dv=0) const;
00149
00150
00151
00152
00153
00154
00155
00156
00157 virtual int fillBreakMesh(int ustartidx, int ustopidx,
00158 int vstartidx, int vstopidx,
00159 int ulod, int vlod,
00160 UT_Vector4 *pos, int &vspans ,
00161 int vbreakidx = -1,
00162 unsigned du = 0, unsigned dv = 0,
00163 UT_FloatArray *uval = 0,
00164 UT_FloatArray *vval = 0) const;
00165 virtual int fillBreakMesh(int ustartidx, int ustopidx,
00166 int vstartidx, int vstopidx,
00167 int ulod, int vlod,
00168 GEO_Vertex **results,
00169 GEO_AttributeHandleList &hlist,
00170 int &vspans, int vbreakidx = -1,
00171 unsigned du = 0, unsigned dv = 0) const;
00172 virtual int fillBreakMeshWAttrib(int ustartidx, int ustopidx,
00173 int vstartidx, int vstopidx,
00174 int ulod, int vlod,
00175 UT_Vector4 *pos, GB_AttributeData *adata,
00176 const GB_FloatOffsets &foffsets,
00177 int &vspans , int vbreakidx = -1,
00178 unsigned du = 0, unsigned dv = 0) const;
00179
00180
00181
00182
00183
00184
00185
00186
00187 virtual int fillUCurves(int ustartidx, int ustopidx,
00188 int vstartidx, int vstopidx, int lod,
00189 UT_Vector4 *pos, int &uspans ,
00190 int ubreakidx = -1,
00191 unsigned du = 0, unsigned dv = 0) const;
00192 virtual int fillVCurves(int ustartidx, int ustopidx,
00193 int vstartidx, int vstopidx, int lod,
00194 UT_Vector4 *pos, int &vspans ,
00195 int vbreakidx = -1,
00196 unsigned du = 0, unsigned dv = 0) const;
00197 virtual int fillUCurves(int ustartidx, int ustopidx,
00198 int vstartidx, int vstopidx, int lod,
00199 GEO_Vertex **results,
00200 GEO_AttributeHandleList &hlist,
00201 int &uspans , int ubreakidx = -1,
00202 unsigned du = 0, unsigned dv = 0) const;
00203 virtual int fillVCurves(int ustartidx, int ustopidx,
00204 int vstartidx, int vstopidx, int lod,
00205 GEO_Vertex **results,
00206 GEO_AttributeHandleList &hlist,
00207 int &vspans , int vbreakidx = -1,
00208 unsigned du = 0, unsigned dv = 0) const;
00209 virtual int fillUCurvesWAttrib(int ustartidx, int ustopidx,
00210 int vstartidx, int vstopidx, int lod,
00211 UT_Vector4 *pos, GB_AttributeData *adata,
00212 const GB_FloatOffsets &foffsets,
00213 int &uspans , int ubreakidx = -1,
00214 unsigned du = 0, unsigned dv = 0) const;
00215 virtual int fillVCurvesWAttrib(int ustartidx, int ustopidx,
00216 int vstartidx, int vstopidx, int lod,
00217 UT_Vector4 *pos, GB_AttributeData *adata,
00218 const GB_FloatOffsets &foffsets,
00219 int &vspans , int vbreakidx = -1,
00220 unsigned du = 0, unsigned dv = 0) const;
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231 int applyBreakMesh(int ustartidx, int ustopidx,
00232 int vstartidx, int vstopidx,
00233 int ulod, int vlod, int &vspans ,
00234 int (*apply)(float ucrt, float vcrt,
00235 int arridx, void *data),
00236 void *data=0, int vbreakidx=-1) const;
00237
00238
00239
00240
00241
00242
00243 int computeUConstCVs(float u, GEO_Vertex **results,
00244 GEO_AttributeHandleList &hlist,
00245 int uoffset=-1) const;
00246 int computeUConstCVs(float u, UT_Vector4 *cvs,
00247 int uoffset=-1) const;
00248 int computeUConstCVsWAttrib(float u, UT_Vector4 *cvs,
00249 GB_AttributeData *acvs,
00250 const GB_FloatOffsets &foffsets,
00251 int uoffset=-1) const;
00252 int computeVConstCVs(float u, GEO_Vertex **results,
00253 GEO_AttributeHandleList &hlist,
00254 int uoffset=-1) const;
00255 int computeVConstCVs(float v, UT_Vector4 *cvs,
00256 int voffset=-1) const;
00257 int computeVConstCVsWAttrib(float v, UT_Vector4 *cvs,
00258 GB_AttributeData *acvs,
00259 const GB_FloatOffsets &foffsets,
00260 int voffset=-1) const;
00261
00262
00263
00264
00265
00266 int createUConstProfile(float u, float growtip = 0.0f);
00267 int createVConstProfile(float v, float growtip = 0.0f);
00268
00269
00270
00271
00272
00273
00274
00275 int chordUBasis(float v, GB_Basis &ub, int voff=-1) const;
00276 int chordVBasis(float u, GB_Basis &vb, int uoff=-1) const;
00277
00278
00279
00280
00281
00282
00283
00284 virtual bool evaluateIndex(fpreal iu, fpreal iv,
00285 GEO_Vertex &result,
00286 GEO_AttributeHandleList &hlist,
00287 unsigned du, unsigned dv) const;
00288 virtual int evaluateIndex(float iu, float iv, UT_Vector4 &pos,
00289 unsigned du=0, unsigned dv=0) const;
00290 virtual int evaluateIndexWAttrib(float iu, float iv,
00291 UT_Vector4 &pos, GB_AttributeData &adata,
00292 const GB_FloatOffsets &foffsets,
00293 unsigned du=0, unsigned dv=0) const;
00294
00295
00296
00297
00298
00299 virtual bool evaluatePoint( GEO_Vertex &result,
00300 GEO_AttributeHandleList &hlist,
00301 fpreal u, fpreal v, uint du, uint dv) const;
00302 virtual int evaluatePoint( UT_Vector4 &pos, float u, float v = 0,
00303 unsigned du=0, unsigned dv=0) const;
00304 virtual int evaluatePointWAttrib(UT_Vector4 &pos,
00305 GB_AttributeData &adata,
00306 const GB_FloatOffsets &foffsets,
00307 float u, float v = 0, unsigned du = 0,
00308 unsigned dv = 0) const;
00309
00310
00311
00312 virtual int evaluateNormal(float u,float v, UT_Vector3 &nml) const;
00313 virtual int normalIndex(float iu, float iv, UT_Vector3 &nml) const;
00314
00315
00316
00317 int curvature(float u, float v, float &curv) const;
00318
00319
00320
00321 float arcLength(float u0, float v0, float u1, float v1,
00322 int divs = 10) const;
00323
00324
00325
00326
00327 virtual int fillMesh(int nu, int nv, UT_Vector4 *pos) const=0;
00328
00329
00330
00331
00332 virtual int domainRangeOfCV(int i, int j, int &minuk,int &maxuk,
00333 int &minvk,int &maxvk) const=0;
00334
00335
00336
00337
00338
00339
00340 virtual int breakpointRangeOfCV(int i, int j, int &minbkpu,
00341 int &maxbkpu, int &minbkpv,
00342 int &maxbkpv) const = 0;
00343
00344
00345
00346 virtual void reparameterizeU(GB_ParmType ptype) = 0;
00347 virtual void reparameterizeV(GB_ParmType ptype) = 0;
00348
00349
00350
00351 virtual void reverseU(void);
00352 virtual void reverseV(void);
00353
00354
00355
00356 void mapUBasis(float orig, float len);
00357 void mapVBasis(float orig, float len);
00358
00359
00360
00361 virtual void validURange(float &ua, float &ub) const;
00362 virtual void validVRange(float &va, float &vb) const;
00363 virtual void validUInterval(int &a, int &b) const;
00364 virtual void validVInterval(int &a, int &b) const;
00365
00366
00367
00368
00369
00370 int uniformTexture (int txtoff = -1, int ptattrib = 1);
00371 int grevilleTexture(int txtoff = -1, int ptattrib = 1);
00372 int chordLenTexture(int txtoff = -1, int ptattrib = 1);
00373
00374
00375
00376
00377 int setGreville(unsigned int r, unsigned int c);
00378 int setGrevilles(void);
00379
00380
00381 virtual void spanRefineU(GEO_AttributeHandleList &hl, int ndivs=1);
00382 virtual void spanRefineU(int numdivs=1);
00383 virtual void spanRefineUWAttrib(const GB_FloatOffsets &offsets,
00384 int numdivs = 1);
00385 virtual void spanRefineV(GEO_AttributeHandleList &hl, int ndivs=1);
00386 virtual void spanRefineV(int numdivs=1);
00387 virtual void spanRefineVWAttrib(const GB_FloatOffsets &offsets,
00388 int numdivs = 1);
00389
00390
00391
00392
00393 int buildGreville (unsigned r, unsigned c);
00394 int buildGrevilles(int resize = 1);
00395
00396
00397
00398 void clearGrevilles(void) { grevMatx.resize(0,0); }
00399
00400
00401 const GEO_Greville& getGreville(unsigned int r, unsigned int c) const
00402 {
00403 return grevMatx(r,c);
00404 }
00405
00406
00407
00408 unsigned hasGreville(void) const { return grevMatx.usedRows()>0;}
00409
00410
00411
00412
00413
00414 int duApprox(int uIdx, int vIdx, UT_Vector3 &du,
00415 int normalize=1, float precision=0.008F) const;
00416 int dvApprox(int uIdx, int vIdx, UT_Vector3 &du,
00417 int normalize=1, float precision=0.008F) const;
00418
00419
00420
00421 int setCV(unsigned r, unsigned c, const UT_Vector4 &v);
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431 void weights(unsigned short onOff);
00432
00433
00434
00435
00436 int setWeight(unsigned int r, unsigned int c, float w);
00437
00438
00439 float getWeight(unsigned int r, unsigned int c) const;
00440
00441
00442 int isRational(void) const { return (int) theRational; }
00443
00444
00445
00446 virtual void unitToRealDomain(float u_unit, float v_unit,
00447 float &u_real, float &v_real) const;
00448 virtual void realToUnitDomain(float u_real, float v_real,
00449 float &u_unit, float &v_unit) const;
00450
00451
00452
00453 virtual void unitToRealSequenceU(float *uunit, float *ureal,
00454 int ulen) const;
00455
00456 virtual void unitToRealSequenceV(float *vunit, float *vreal,
00457 int vlen) const;
00458
00459
00460
00461
00462 void makeHomogeneous(int startrow = 0, int endrow = -1,
00463 int startcol = 0, int endcol = -1)
00464 {
00465 homogenize(startrow, endrow, startcol, endcol);
00466 theRational = 0;
00467 }
00468 void makeHomogeneous(GEO_AttributeHandleList &hlist,
00469 int startrow = 0, int endrow = -1,
00470 int startcol = 0, int endcol = -1)
00471 {
00472 homogenize(hlist, startrow, endrow,
00473 startcol, endcol);
00474 theRational = 0;
00475 }
00476 void makeHomogeneousWAttrib(const GB_FloatOffsets &foffsets,
00477 int startrow = 0, int endrow = -1,
00478 int startcol = 0, int endcol = -1)
00479 {
00480 homogenizeWAttrib(foffsets, startrow, endrow,
00481 startcol, endcol);
00482 theRational = 0;
00483 }
00484 void makeNonHomogeneous(int startrow = 0, int endrow = -1,
00485 int startcol = 0, int endcol = -1)
00486 {
00487 dehomogenize(startrow, endrow, startcol, endcol);
00488 theRational = 1;
00489 }
00490 void makeNonHomogeneous(GEO_AttributeHandleList &hlist,
00491 int startrow = 0, int endrow = -1,
00492 int startcol = 0, int endcol = -1)
00493 {
00494 dehomogenize(hlist, startrow, endrow,
00495 startcol, endcol);
00496 theRational = 1;
00497 }
00498 void makeNonHomogeneousWAttrib(
00499 const GB_FloatOffsets &foffsets,
00500 int startrow = 0, int endrow = -1,
00501 int startcol = 0, int endcol = -1)
00502 {
00503 dehomogenizeWAttrib(foffsets, startrow, endrow,
00504 startcol, endcol);
00505 theRational = 1;
00506 }
00507
00508
00509
00510
00511 void normalizeWeights();
00512
00513
00514
00515 void normalizeDomain(float len = 0.F,float *newuorigin = 0,
00516 float *newvorigin = 0);
00517
00518
00519
00520
00521
00522
00523
00524
00525 virtual int recordChange(unsigned r, unsigned c);
00526 virtual int recordChanges(unsigned short basisChange = 0,
00527 unsigned short sizeChange = 0);
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539 void refineRange(const UT_BoundingRect &rect, float tol,
00540 float *&uunits, float *&vunits,
00541 int &udivs, int &vdivs,
00542 UT_FloatArray &uunrefineranges,
00543 UT_FloatArray &vunrefineranges);
00544
00545
00546 void refineBelt(float ubwidth = 0.4F, float vbwidth = 0.4F,
00547 int ubdivs = 2, int vbdivs = 2);
00548
00549
00550
00551 virtual void changedVertices(void) = 0;
00552
00553
00554
00555
00556 int setUBasis(GB_Basis *ub)
00557 {
00558 if (ub && ub->validate((int)getNumCols(), (int)isWrappedU()))
00559 {
00560 delete uBasis; uBasis = ub;
00561 return 0;
00562 }
00563 else return -1;
00564 }
00565 int setVBasis(GB_Basis *vb)
00566 {
00567 if (vb && vb->validate((int)getNumRows(), (int)isWrappedV()))
00568 {
00569 delete vBasis; vBasis = vb;
00570 return 0;
00571 }
00572 else return -1;
00573 }
00574 GB_Basis* getUBasis(void) const { return uBasis; }
00575 GB_Basis* getVBasis(void) const { return vBasis; }
00576
00577
00578 unsigned getUOrder(void) const { return (unsigned)uBasis->getOrder(); }
00579 unsigned getVOrder(void) const { return (unsigned)vBasis->getOrder(); }
00580
00581
00582 unsigned getUDim(void) const { return (unsigned)uBasis->getDimension(); }
00583 unsigned getVDim(void) const { return (unsigned)vBasis->getDimension(); }
00584
00585
00586
00587
00588
00589 void getUGrevilles(UT_FloatArray &ugrevilles);
00590 void getVGrevilles(UT_FloatArray &vgrevilles);
00591
00592
00593 virtual int isDegenerate(void) const;
00594
00595
00596 virtual void getRangeBBox(const UT_Interval &u,
00597 const UT_Interval &v,
00598 UT_BoundingBox &bbox) const = 0;
00599
00600
00601 static void dehomogenizeData(GEO_Vertex **vertices,
00602 GEO_AttributeHandleList &hlist,
00603 int count);
00604 static void dehomogenizeData(UT_Vector4 *pos, int count);
00605 static void dehomogenizeDataWAttrib(UT_Vector4 *pos,
00606 GB_AttributeData *adata,
00607 const GB_FloatOffsets &foffsets,
00608 int count);
00609
00610
00611
00612 virtual int raiseOrderU (int neworder) = 0;
00613 virtual int raiseOrderU(int neworder,
00614 GEO_AttributeHandleList &hlist) = 0;
00615 virtual int raiseOrderUWAttrib(int neworder,
00616 const GB_FloatOffsets &foffsets) = 0;
00617 virtual int raiseOrderV (int neworder) = 0;
00618 virtual int raiseOrderV(int neworder,
00619 GEO_AttributeHandleList &hlist) = 0;
00620 virtual int raiseOrderVWAttrib(int neworder,
00621 const GB_FloatOffsets &foffsets) = 0;
00622
00623
00624
00625
00626
00627
00628 virtual int translateBreakpoints(const UT_IntArray &uindices,
00629 const UT_IntArray &vindices,
00630 const UT_Vector3 &delta,
00631 int fixbkpts = 1,
00632 GB_PointGroup *ptgroup=NULL,
00633 GEO_Delta *geodelta = 0) = 0;
00634
00635 virtual int transformBreakpoints(const UT_IntArray &uindices,
00636 const UT_IntArray &vindices,
00637 const UT_Matrix4 &matx,
00638 int fixbkpts = 1,
00639 GB_PointGroup *ptgroup=NULL,
00640 GEO_Delta *geodelta = 0) = 0;
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652 virtual int attachU(const GEO_Hull &hull, int blend = 1,
00653 float bias = 0.5f, float tolerance = 1.0f,
00654 int unrefine = 1, GB_PointGroup *ptgroup=0);
00655 virtual int attachV(const GEO_Hull &hull, int blend = 1,
00656 float bias = 0.5f, float tolerance = 1.0f,
00657 int unrefine = 1, GB_PointGroup *ptgroup=0);
00658
00659
00660
00661
00662 virtual GEO_TPSurf *extract(float ustart, float ustop,
00663 float vstart, float vstop) const = 0;
00664
00665
00666 virtual void subdivide(int numdivs, GB_PointGroup *ptgroup=0);
00667
00668
00669
00670 virtual int parametricBBox(float u, float v,
00671 float *u0, float *u1,
00672 float *v0, float *v1);
00673
00674
00675 int hasProfiles(void) const;
00676
00677
00678
00679 GEO_Profiles *profiles(int create = 1);
00680 GEO_Profiles *profiles(void) const { return theProfiles; }
00681
00682
00683 int isPasted(void) const { return thePasteSurf != 0; }
00684
00685
00686 GEO_PasteSurf *pastedSurface(void) const { return thePasteSurf; }
00687 void pastedSurface(GEO_PasteSurf *p) { thePasteSurf = p; }
00688
00689
00690
00691
00692 int updateDisplacement(const GEO_Point &ppt,
00693 int updatekids = 1);
00694
00695 virtual void isolate(void);
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706 int solveConstraints(const UT_Vector &uparam,
00707 const UT_Vector &vparam,
00708 const UT_IntArray &udervs,
00709 const UT_IntArray &vdervs,
00710 UT_Matrix &soln,
00711 UT_IntArray &cv_idx);
00712
00713
00714
00715
00716
00717
00718 int applyConstraints(UT_Matrix &changes,
00719 const UT_Vector &uparam,
00720 const UT_Vector &vparam,
00721 const UT_IntArray &udervs,
00722 const UT_IntArray &vdervs,
00723 const UT_IntArray &cv_index,
00724 const UT_Matrix &soln);
00725
00726
00727
00728
00729
00730 int solveAndApplyConstraints(const UT_Vector &uparam,
00731 const UT_Vector &vparam,
00732 const UT_IntArray &udervs,
00733 const UT_IntArray &vdervs,
00734 UT_Matrix &changes);
00735
00736 protected:
00737
00738
00739
00740
00741 GB_Basis *uBasis;
00742 GB_Basis *vBasis;
00743
00744
00745 virtual void copyOffsetPrimitive(const GEO_Primitive *src,
00746 int basept);
00747
00748
00749 virtual int savePrivate(ostream &os, int binary) const;
00750 virtual int saveExtra (ostream &, int binary) const;
00751 virtual bool loadPrivate(UT_IStream &is);
00752 virtual bool loadExtra (UT_IStream &);
00753
00754
00755
00756 virtual bool validate(void) const;
00757
00758
00759 void mergeAttachProfilesU(const GEO_TPSurf &tpsurf);
00760 void mergeAttachProfilesV(const GEO_TPSurf &tpsurf);
00761
00762
00763 float stepSize(float start, float stop, int count) const
00764 {
00765 return (count > 0) ? ((stop - start)/(float)count)
00766 : 0.0F;
00767 }
00768
00769
00770 void rational(int yesno) { theRational = (unsigned short)yesno; }
00771
00772
00773 virtual GB_Basis *newBasis(void) const = 0;
00774
00775
00776 private:
00777
00778 void copyBasisAndProfiles(const GEO_TPSurf *src);
00779
00780
00781
00782
00783
00784
00785 UT_RefMatrix<GEO_Greville> grevMatx;
00786
00787
00788
00789
00790 unsigned short theRational;
00791
00792
00793 GEO_Profiles *theProfiles;
00794
00795
00796 GEO_PasteSurf *thePasteSurf;
00797
00798
00799
00800
00801
00802
00803
00804 bool evaluateRational(fpreal u, fpreal v, GEO_Vertex &result,
00805 GEO_AttributeHandleList &hlist,
00806 unsigned du=0, unsigned dv=0,
00807 int uoffset=-1, int voffset=-1) const;
00808 int evaluateRational(float u, float v, UT_Vector4 &pos,
00809 unsigned du=0, unsigned dv=0,
00810 int uoffset=-1, int voffset=-1) const;
00811 int evaluateRationalWAttrib(float u, float v,
00812 UT_Vector4 &pos, GB_AttributeData &adata,
00813 const GB_FloatOffsets &foffsets,
00814 unsigned du=0, unsigned dv=0,
00815 int uoffset=-1, int voffset=-1) const;
00816
00817
00818
00819
00820
00821 int fillUCurve(float v,int vidx, int ustartidx,int ustopidx,
00822 int density, UT_Vector4 *pos, int puoffset,
00823 int rbound, unsigned du, unsigned dv) const;
00824 int fillVCurve(float u,int uidx, int vstartidx,int vstopidx,
00825 int density, UT_Vector4 *pos, int pvoffset,
00826 int rbound, unsigned du, unsigned dv) const;
00827 int fillUCurve(float v, int vidx, int ustartidx,
00828 int ustopidx, int density,
00829 GEO_Vertex **results,
00830 GEO_AttributeHandleList &hlist,
00831 int puoffset, int rbound,
00832 unsigned du, unsigned dv) const;
00833 int fillVCurve(float u, int uidx, int vstartidx,
00834 int vstopidx, int density,
00835 GEO_Vertex **results,
00836 GEO_AttributeHandleList &hlist,
00837 int pvoffset, int rbound,
00838 unsigned du, unsigned dv) const;
00839 int fillUCurveWAttrib(float v, int vidx, int ustartidx,
00840 int ustopidx, int density, UT_Vector4 *pos,
00841 GB_AttributeData *adata,
00842 const GB_FloatOffsets &foffsets,
00843 int puoffset, int rbound,
00844 unsigned du, unsigned dv) const;
00845 int fillVCurveWAttrib(float u, int uidx, int vstartidx,
00846 int vstopidx, int density, UT_Vector4 *pos,
00847 GB_AttributeData *adata,
00848 const GB_FloatOffsets &foffsets,
00849 int pvoffset, int rbound,
00850 unsigned du, unsigned dv) const;
00851
00852
00853
00854
00855
00856 int linearCombine(float ubmatx[][GB_MAXORDER],
00857 float vbmatx[][GB_MAXORDER],
00858 unsigned du, unsigned dv,
00859 int rowoffset, int coloffset,
00860 GEO_WorkVertexBuffer &vbuffer,
00861 GEO_AttributeHandleList &hlist,
00862 float wders[][GB_MAXORDER]) const;
00863 int linearCombine(float ubmatx[][GB_MAXORDER],
00864 float vbmatx[][GB_MAXORDER],
00865 unsigned du, unsigned dv,
00866 int rowoffset, int coloffset,
00867 UT_Vector4 aders[][GB_MAXORDER],
00868 float wders[][GB_MAXORDER]) const;
00869 int linearCombineWAttrib(float bmatx[][GB_MAXORDER],
00870 float vbmatx[][GB_MAXORDER],
00871 unsigned du, unsigned dv,
00872 int rowoffset, int coloffset,
00873 UT_Vector4 aders[][GB_MAXORDER],
00874 float wders[][GB_MAXORDER],
00875 GB_AttributeData attr_aders[][GB_MAXORDER],
00876 const GB_FloatOffsets &foffsets) const;
00877
00878 friend ostream &operator<<(ostream &os, const GEO_TPSurf &d)
00879 {
00880 d.save(os, 0);
00881 return os;
00882 }
00883 };
00884
00885 #endif