13 #ifndef __GU_PolyBridge_h__
14 #define __GU_PolyBridge_h__
73 PARAMETER_UNIFORM = 0,
81 bool straight =
false);
88 fpreal axial_rotation = 0.0);
90 void sample(
int size, SampleMode sample_mode,
98 { mySrcStiffness = s0; myDstStiffness = s1; }
101 { mySrcBlend = b0; myDstBlend = b1; }
104 { myClipU0 = c0; myClipU1 = c1; }
122 void sampleParameter(SampleMode sample_mode,
129 void getPolyLineWeights(
fpreal u,
int &i0,
int &
i1,
133 void setupPolyLineSpineCurve();
145 ?
int(myCurve->getFastVertexCount())
153 myCurve->getDetail().getPos3(
154 myCurve->getPointOffset(i))) :
171 fpreal mySrcStiffness, myDstStiffness;
172 fpreal mySrcBlend, myDstBlend;
174 Positioning myPositioninig;
175 fpreal myAxialRotation = 0.0;
177 bool myIsPolyLine =
false;
178 bool myReverse =
false;
179 bool myStraight =
false;
180 bool myTrivial =
true;
181 bool myInternalSpine =
false;
203 GU_Spine::unitToRealDomain(
fpreal u_unit)
207 else if (u_unit > 1.0
f)
210 return u_unit *
fpreal(myNumCVs - 3);
239 bool src_chain_closed,
241 bool dst_chain_closed,
242 bool straight_bridge =
true,
243 bool allow_coincident_centroids =
false);
251 int src_divisions = 0,
252 int dst_divisions = 0,
256 src_divisions, dst_divisions, 0, pairings);
269 computeBridge(ptoff0, primoff0, -1, -1, -1, num_twists,
nullptr, tgdp,
270 src_rep_vtx, dst_rep_vtx, pt_wrangler, prim_wrangler,
275 {
return int(myQuadSizeList.getNumPolygons()); }
278 {
return int(myQuadPtNums.size()); }
308 { setupEnds();
return mySrcCtr; }
311 { setupEnds();
return myDstCtr; }
314 { myWarningStream =
w; }
317 { mySpineThickness = attrib; }
320 { mySpineTwist = attrib; }
323 { myMorphMethod = m; }
326 { mySrcMagnitude =
s; myDstMagnitude = d; }
329 { mySrcStiffness =
s; myDstStiffness = d; }
332 { myAxialRotation =
r; }
335 { myExternalSpine = curve; }
338 { myThicknessRamp = ramp; }
341 { myTwistRamp = ramp; }
344 { mySrcDir = dir; mySrcDirGiven =
true; }
347 { myDstDir = dir; myDstDirGiven =
true; }
350 { mySrcCtr = ctr; mySrcCtrGiven =
true; }
353 { myDstCtr = ctr; myDstCtrGiven =
true; }
356 { myAttachToSrc = attach; }
359 { myAttachToDst = attach; }
362 { myThicknessUnit =
s; }
365 { myMinTwist =
min; myMaxTwist =
max; }
368 { myReverseSpine =
r; }
371 { mySrcDirSign =
t; }
374 { myDstDirSign =
t; }
377 { myClipStart =
s; myClipEnd = e; }
380 { myDoGenerateSpine =
b; }
383 { mySpinePointGroup = grp; }
386 { myDoGenerateMesh =
b; }
389 { myMeshPrimGroup = grp; }
392 { myTangentAttrib = attrib; }
395 { myNormalAttrib = attrib; }
398 { myBinormalAttrib = attrib; }
401 { myPairByEdgeCount =
b; }
404 { myPairingShift =
s; }
407 { mySpineStart =
s; mySpineEnd = e; }
410 { mySrcBlend =
s; myDstBlend = d; }
413 { mySpinePlacement = p; }
416 { mySpineSampleMethod = m; }
419 { myMiterJoints =
b; }
422 { myScaleInvariant =
b; }
428 { mySrcEdgeGroup = grp; }
431 { myDstEdgeGroup = grp; }
434 { mySrcRef = src_ref; myDstRef = dst_ref; }
437 { mySrcFrameUpDir = dir;
438 mySrcFrameUpDirGiven =
true; }
441 { myDstFrameUpDir = dir;
442 myDstFrameUpDirGiven =
true; }
445 {
return int(mySrcLoop.entries()); }
448 {
return int(myDstLoop.entries()); }
450 void setCollectedLinks(
bool user_links,
bool auto_links,
451 bool boundary_links);
453 void fillWrangleDetail(
GA_Offset base_offset,
460 bool is_edge_extrusion,
462 TextureMode uv_style = INTERPOLATE,
463 TextureScaling uv_scaling = FIT_UNIT_SQUARE);
470 int src_divisions = 0,
471 int dst_divisions = 0,
482 int src_first,
int src_last,
484 int dst_first,
int dst_last,
486 bool do_full_circle);
489 int i,
int first = 0,
int last = -1)
const;
495 GU_Spine *sampleSpine(
int divisions);
502 bool calcDefaultPairingRefs();
503 void calcPositionsInEndFrames();
523 int start_cycle_ref,
int end_cycle_ref,
525 int path_prefix_end_ref,
526 int path_suffix_start_ref);
545 bool circular_first =
false,
546 bool circular_second =
false);
559 fpreal topple_bump_factor = 0.01);
573 TextureMode uv_style, TextureScaling uv_scaling,
577 void setWrangleDetailTextureCoords(
GA_Offset base_offset,
584 fpreal spineLength()
const {
return mySpineArcLength.last(); }
587 LINK_TYPE_NORMAL = 0,
595 int src_base_idx = 0,
596 int dst_base_idx = 0,
599 class FirstThenSecond
604 if (a.first == b.first)
605 return a.second < b.second;
607 return a.first < b.first;
612 class SecondThenFirst
617 if (a.second == b.second)
618 return a.first < b.first;
620 return a.second < b.second;
624 bool myEndsAreSetUp =
false;
625 bool myDirsAreSetUp =
false;
626 bool myHaveDefaultPairingRefs =
false;
627 bool myReverseSpine =
false;
628 bool myMiterJoints =
true;
630 bool mySrcDirGiven =
false;
631 bool myDstDirGiven =
false;
632 bool mySrcCtrGiven =
false;
633 bool myDstCtrGiven =
false;
635 bool mySrcFrameUpDirGiven =
false;
636 bool myDstFrameUpDirGiven =
false;
638 bool myDoGenerateSpine =
false;
639 bool myDoGenerateMesh =
true;
641 bool myPairByEdgeCount =
false;
643 bool mySrcClosed =
true;
644 bool myDstClosed =
true;
645 bool myAttachToSrc =
true;
646 bool myAttachToDst =
true;
648 bool myCollectUserLinks =
false;
649 bool myCollectAutoLinks =
false;
650 bool myCollectBoundaryLinks =
false;
652 bool mySpineIsStraight: 1;
653 bool myAllowCoincidentCentroids =
false;
654 bool myScaleInvariant =
true;
656 int myPairingShift = 0;
672 fpreal mySrcMagnitude = 1.0;
673 fpreal myDstMagnitude = 1.0;
674 fpreal mySrcStiffness = 0.0;
675 fpreal myDstStiffness = 0.0;
678 fpreal mySpineStart = 0.0;
688 UT_Vector3 mySrcLoopNormal = { 0.0, 0.0, 0.0 };
689 UT_Vector3 myDstLoopNormal = { 0.0, 0.0, 0.0 };
690 UT_Vector3 mySrcFrameUpDir = { 0.0, 0.0, 0.0 };
691 UT_Vector3 myDstFrameUpDir = { 0.0, 0.0, 0.0 };
698 MorphMethod myMorphMethod = ROTATING_FRAME;
700 UT_Ramp *myThicknessRamp =
nullptr;
701 fpreal myThicknessUnit = 1.0;
703 UT_Ramp *myTwistRamp =
nullptr;
707 const GEO_Face *myExternalSpine =
nullptr;
710 UT_Vector3 mySpineTranslate = { 0.0, 0.0, 0.0 };
712 fpreal myAxialRotation = 0.0;
715 DirectionSign mySrcDirSign = DIR_SIGN_POS;
716 DirectionSign myDstDirSign = DIR_SIGN_POS;
723 UT_Vector3 myStartClipP, myStartClipT, myStartClipN;
724 UT_Vector3 myEndClipP, myEndClipT, myEndClipN;
764 bool is_edge_extrusion,
775 bool wrangle_pt_attribs =
true,
776 bool wrangle_prim_attribs =
true,
777 bool wrangle_vtx_attribs =
true,
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
Definition of a geometry attribute.
void setDstCtr(UT_Vector3 ctr)
void setExtSpinePositioning(SpinePositioning p)
UT_Array< IndexPair > IndexPairArray
UT_Array< IndexPair > IndexPairArray
GU_API void GUbatchBuildBridges(GU_Detail *gdp, GU_PolyBridge **bridges, bool is_edge_extrusion, int num_bridges, const GA_Offset *src_rep_vtxs=nullptr, const GA_Offset *dst_rep_vtxs=nullptr, GA_PrimitiveGroup *mesh_prims=nullptr, GA_OffsetArray *user_link_grp=nullptr, GA_OffsetArray *auto_link_grp=nullptr, GA_OffsetArray *boundary_link_grp=nullptr, GA_OffsetArray *src_chain_grp=nullptr, GA_OffsetArray *dst_chain_grp=nullptr, int num_twists=0, bool wrangle_pt_attribs=true, bool wrangle_prim_attribs=true, bool wrangle_vtx_attribs=true, GU_PolyBridge::TextureMode uv_style=GU_PolyBridge::INTERPOLATE, GU_PolyBridge::TextureScaling uv_scaling=GU_PolyBridge::FIT_UNIT_SQUARE)
void setAttachToSrc(bool attach)
void setSrcCtr(UT_Vector3 ctr)
UT_Vector3T< float > UT_Vector3
GLsizei const GLchar *const * path
UT_Vector3 getSrcCentroid()
void setThicknessRamp(UT_Ramp *ramp)
GLboolean GLboolean GLboolean GLboolean a
PUGI__FN void reverse(I begin, I end)
GLuint GLsizei GLsizei * length
void setAttachToDst(bool attach)
void setAxialRotation(fpreal r)
void setTangentAttrib(GA_Attribute *attrib)
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
void setGenerateSpine(bool b)
void setTwistRamp(UT_Ramp *ramp)
int getNumMeshPolyVtxs() const
UT_Vector3 getDstCentroid()
void writeGeometry(GA_Offset ptoff0, GA_Offset primoff0, int num_twists=0, const GU_Detail *tgdp=nullptr, const GA_Offset *src_rep_vtx=nullptr, const GA_Offset *dst_rep_vtx=nullptr, GA_PointWrangler *pt_wrangler=nullptr, GA_PrimitiveWrangler *prim_wrangler=nullptr, GA_VertexWrangler *vtx_wrangler=nullptr)
void setNormalAttrib(GA_Attribute *attrib)
void setThicknessScale(fpreal s)
#define GA_INVALID_OFFSET
GLuint GLsizei const GLuint const GLintptr * offsets
void setWarningStream(UT_StringStream *w)
void setMiterJoints(bool b)
void setClipRange(fpreal c0, fpreal c1)
void setReverseSpine(bool r)
void setChainRefs(int src_ref, int dst_ref)
void setClipRange(fpreal s, fpreal e)
int getNumDstLoopPts() const
void setTwistRange(fpreal min, fpreal max)
An bi-directional stream object that owns its own string buffer storage.
int getNumMeshPolys() const
void setMeshGroup(GA_PrimitiveGroup *grp)
A handle to simplify manipulation of multiple attributes.
void setSrcDir(UT_Vector3 dir)
void setExternalSpine(const GEO_Face *curve)
void setExtSpineBlend(fpreal s=0.0, fpreal d=0.0)
void setSrcEdgeGroup(GA_EdgeGroup *grp)
GLboolean GLboolean GLboolean b
void setScaleInvariant(bool b)
void setSrcFrameUpDir(UT_Vector3 dir)
void setBinormalAttrib(GA_Attribute *attrib)
void setBlend(fpreal b0, fpreal b1)
void setDstDirectionSign(DirectionSign t)
void setExtSpineRange(fpreal s, fpreal e)
__hostdev__ uint64_t last(uint32_t i) const
SYS_API double tan(double x)
void setSpineSampleMethod(SpineSampleMethod m)
void setSrcDirectionSign(DirectionSign t)
void setTwistAttrib(GA_Attribute *attrib)
void setDstEdgeGroup(GA_EdgeGroup *grp)
Utility class for containing a color ramp.
SIM_API const UT_StringHolder position
std::pair< exint, exint > IndexPair
void pairByEdgeCount(bool b)
int getNumSrcLoopPts() const
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
void setPairingShift(int s)
void setSpineGroup(GA_PointGroup *grp)
GU_API UT_Vector3 guRMFSlideFrame(UT_Vector3 x0, UT_Vector3 t0, UT_Vector3 n0, UT_Vector3 x1, UT_Vector3 t1)
void setPreTwist(fpreal t)
GLubyte GLubyte GLubyte GLubyte w
void setGenerateMesh(bool b)
void setThicknessAttrib(GA_Attribute *attrib)
void setMorphMethod(MorphMethod m)
GLsizei GLenum GLenum * types
void setDstFrameUpDir(UT_Vector3 dir)
void setDstDir(UT_Vector3 dir)
void setMagnitudes(fpreal s=1.0, fpreal d=1.0)
void setStiffness(fpreal s0, fpreal s1)
std::pair< int, int > IndexPair
void buildTopology(int divisions, int src_divisions=0, int dst_divisions=0, IndexPairArray *pairings=nullptr)
void setStiffnesses(fpreal s=0.0, fpreal d=0.0)