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 void buildBridge(
const GA_Offset *src_rep_vtx,
286 {
return int(myQuadSizeList.getNumPolygons()); }
289 {
return int(myQuadPtNums.size()); }
319 { setupEnds();
return mySrcCtr; }
322 { setupEnds();
return myDstCtr; }
325 { myWarningStream =
w; }
328 { mySpineThickness = attrib; }
331 { mySpineTwist = attrib; }
334 { myMorphMethod = m; }
337 { mySrcMagnitude =
s; myDstMagnitude = d; }
340 { mySrcStiffness =
s; myDstStiffness = d; }
343 { myAxialRotation =
r; }
346 { myExternalSpine = curve; }
349 { myThicknessRamp = ramp; }
352 { myTwistRamp = ramp; }
355 { mySrcDir = dir; mySrcDirGiven =
true; }
358 { myDstDir = dir; myDstDirGiven =
true; }
361 { mySrcCtr = ctr; mySrcCtrGiven =
true; }
364 { myDstCtr = ctr; myDstCtrGiven =
true; }
367 { myAttachToSrc = attach; }
370 { myAttachToDst = attach; }
373 { myThicknessUnit =
s; }
376 { myMinTwist =
min; myMaxTwist =
max; }
379 { myReverseSpine =
r; }
382 { mySrcDirSign =
t; }
385 { myDstDirSign =
t; }
388 { myClipStart =
s; myClipEnd = e; }
391 { myDoGenerateSpine =
b; }
394 { mySpinePointGroup = grp; }
397 { myDoGenerateMesh =
b; }
400 { myMeshPrimGroup = grp; }
403 { myTangentAttrib = attrib; }
406 { myNormalAttrib = attrib; }
409 { myBinormalAttrib = attrib; }
412 { myPairByEdgeCount =
b; }
415 { myPairingShift =
s; }
418 { mySpineStart =
s; mySpineEnd = e; }
421 { mySrcBlend =
s; myDstBlend = d; }
424 { mySpinePlacement = p; }
427 { mySpineSampleMethod = m; }
430 { myMiterJoints =
b; }
433 { myScaleInvariant =
b; }
439 { mySrcEdgeGroup = grp; }
442 { myDstEdgeGroup = grp; }
445 { mySrcRef = src_ref; myDstRef = dst_ref; }
448 { mySrcFrameUpDir = dir;
449 mySrcFrameUpDirGiven =
true; }
452 { myDstFrameUpDir = dir;
453 myDstFrameUpDirGiven =
true; }
456 {
return int(mySrcLoop.entries()); }
459 {
return int(myDstLoop.entries()); }
466 void setCollectedLinks(
bool user_links,
bool auto_links,
467 bool boundary_links);
469 void fillWrangleDetail(
GA_Offset base_offset,
477 TextureMode uv_style = INTERPOLATE,
478 TextureScaling uv_scaling = FIT_UNIT_SQUARE);
485 int src_divisions = 0,
486 int dst_divisions = 0,
497 int src_first,
int src_last,
499 int dst_first,
int dst_last,
501 bool do_full_circle);
504 int i,
int first = 0,
int last = -1)
const;
510 GU_Spine *sampleSpine(
int divisions);
517 bool calcDefaultPairingRefs();
518 void calcPositionsInEndFrames();
538 int start_cycle_ref,
int end_cycle_ref,
540 int path_prefix_end_ref,
541 int path_suffix_start_ref);
560 bool circular_first =
false,
561 bool circular_second =
false);
574 fpreal topple_bump_factor = 0.01);
588 TextureMode uv_style, TextureScaling uv_scaling,
592 void setWrangleDetailTextureCoords(
GA_Offset base_offset,
599 fpreal spineLength()
const {
return mySpineArcLength.last(); }
602 LINK_TYPE_NORMAL = 0,
610 int src_base_idx = 0,
611 int dst_base_idx = 0,
614 class FirstThenSecond
619 if (a.first == b.first)
620 return a.second < b.second;
622 return a.first < b.first;
627 class SecondThenFirst
632 if (a.second == b.second)
633 return a.first < b.first;
635 return a.second < b.second;
639 bool myEndsAreSetUp =
false;
640 bool myDirsAreSetUp =
false;
641 bool myHaveDefaultPairingRefs =
false;
642 bool myReverseSpine =
false;
643 bool myMiterJoints =
true;
645 bool mySrcDirGiven =
false;
646 bool myDstDirGiven =
false;
647 bool mySrcCtrGiven =
false;
648 bool myDstCtrGiven =
false;
650 bool mySrcFrameUpDirGiven =
false;
651 bool myDstFrameUpDirGiven =
false;
653 bool myDoGenerateSpine =
false;
654 bool myDoGenerateMesh =
true;
656 bool myPairByEdgeCount =
false;
658 bool mySrcClosed =
true;
659 bool myDstClosed =
true;
660 bool myAttachToSrc =
true;
661 bool myAttachToDst =
true;
663 bool myWranglePt =
true;
664 bool myWrangleVtx =
true;
665 bool myWranglePrim =
true;
667 bool myCollectUserLinks =
false;
668 bool myCollectAutoLinks =
false;
669 bool myCollectBoundaryLinks =
false;
671 bool mySpineIsStraight: 1;
672 bool myAllowCoincidentCentroids =
false;
673 bool myScaleInvariant =
true;
675 int myPairingShift = 0;
691 fpreal mySrcMagnitude = 1.0;
692 fpreal myDstMagnitude = 1.0;
693 fpreal mySrcStiffness = 0.0;
694 fpreal myDstStiffness = 0.0;
697 fpreal mySpineStart = 0.0;
707 UT_Vector3 mySrcLoopNormal = { 0.0, 0.0, 0.0 };
708 UT_Vector3 myDstLoopNormal = { 0.0, 0.0, 0.0 };
709 UT_Vector3 mySrcFrameUpDir = { 0.0, 0.0, 0.0 };
710 UT_Vector3 myDstFrameUpDir = { 0.0, 0.0, 0.0 };
717 MorphMethod myMorphMethod = ROTATING_FRAME;
719 UT_Ramp *myThicknessRamp =
nullptr;
720 fpreal myThicknessUnit = 1.0;
722 UT_Ramp *myTwistRamp =
nullptr;
726 const GEO_Face *myExternalSpine =
nullptr;
729 UT_Vector3 mySpineTranslate = { 0.0, 0.0, 0.0 };
731 fpreal myAxialRotation = 0.0;
734 DirectionSign mySrcDirSign = DIR_SIGN_POS;
735 DirectionSign myDstDirSign = DIR_SIGN_POS;
742 UT_Vector3 myStartClipP, myStartClipT, myStartClipN;
743 UT_Vector3 myEndClipP, myEndClipT, myEndClipN;
793 bool wrangle_pt_attribs =
true,
794 bool wrangle_prim_attribs =
true,
795 bool wrangle_vtx_attribs =
true,
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
void setWrangleVertex(bool w)
Definition of a geometry attribute.
void setDstCtr(UT_Vector3 ctr)
void setExtSpinePositioning(SpinePositioning p)
UT_Array< IndexPair > IndexPairArray
UT_Array< IndexPair > IndexPairArray
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
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)
void setWranglePoint(bool w)
#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)
GU_API void GUbatchBuildBridges(GU_Detail *gdp, GU_PolyBridge **bridges, 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)
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
void setWranglePrimitive(bool w)
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)