13 #ifndef __GU_PolyBridge_h__
14 #define __GU_PolyBridge_h__
74 PARAMETER_UNIFORM = 0,
82 bool straight =
false);
89 fpreal axial_rotation = 0.0);
91 void sample(
int size, SampleMode sample_mode,
99 { mySrcStiffness = s0; myDstStiffness = s1; }
102 { mySrcBlend = b0; myDstBlend = b1; }
105 { myClipU0 = c0; myClipU1 = c1; }
123 void sampleParameter(SampleMode sample_mode,
130 void getPolyLineWeights(
fpreal u,
int &i0,
int &
i1,
134 void setupPolyLineSpineCurve();
146 ?
int(myCurve->getFastVertexCount())
154 myCurve->getDetail().getPos3(
155 myCurve->getPointOffset(i))) :
172 fpreal mySrcStiffness, myDstStiffness;
173 fpreal mySrcBlend, myDstBlend;
175 Positioning myPositioninig;
176 fpreal myAxialRotation = 0.0;
178 bool myIsPolyLine =
false;
179 bool myReverse =
false;
180 bool myStraight =
false;
181 bool myTrivial =
true;
182 bool myInternalSpine =
false;
204 GU_Spine::unitToRealDomain(
fpreal u_unit)
208 else if (u_unit > 1.0
f)
211 return u_unit *
fpreal(myNumCVs - 3);
240 bool src_chain_closed,
242 bool dst_chain_closed,
243 bool straight_bridge =
true,
244 bool allow_coincident_centroids =
false);
252 int src_divisions = 0,
253 int dst_divisions = 0,
260 dummy_dst_rep_fake_idx,
278 computeBridge(ptoff0,
295 {
return int(myQuadSizeList.getNumPolygons()); }
298 {
return int(myQuadPtNums.size()); }
328 { setupEnds();
return mySrcCtr; }
331 { setupEnds();
return myDstCtr; }
334 { myWarningStream =
w; }
337 { mySpineThickness = attrib; }
340 { mySpineTwist = attrib; }
343 { myMorphMethod = m; }
346 { mySrcMagnitude =
s; myDstMagnitude = d; }
349 { mySrcStiffness =
s; myDstStiffness = d; }
352 { myAxialRotation =
r; }
355 { myExternalSpine = curve; }
358 { myThicknessRamp = ramp; }
361 { myTwistRamp = ramp; }
364 { mySrcDir = dir; mySrcDirGiven =
true; }
367 { myDstDir = dir; myDstDirGiven =
true; }
370 { mySrcCtr = ctr; mySrcCtrGiven =
true; }
373 { myDstCtr = ctr; myDstCtrGiven =
true; }
376 { myAttachToSrc = attach; }
379 { myAttachToDst = attach; }
382 { myThicknessUnit =
s; }
385 { myMinTwist =
min; myMaxTwist =
max; }
388 { myReverseSpine =
r; }
391 { mySrcDirSign =
t; }
394 { myDstDirSign =
t; }
397 { myClipStart =
s; myClipEnd = e; }
400 { myDoGenerateSpine =
b; }
403 { mySpinePointGroup = grp; }
406 { myDoGenerateMesh =
b; }
409 { myMeshPrimGroup = grp; }
412 { myTangentAttrib = attrib; }
415 { myNormalAttrib = attrib; }
418 { myBinormalAttrib = attrib; }
421 { myPairByEdgeCount =
b; }
424 { myPairingShift =
s; }
427 { mySpineStart =
s; mySpineEnd = e; }
430 { mySrcBlend =
s; myDstBlend = d; }
433 { mySpinePlacement = p; }
436 { mySpineSampleMethod = m; }
439 { myMiterJoints =
b; }
442 { myScaleInvariant =
b; }
448 { mySrcEdgeGroup = grp; }
451 { myDstEdgeGroup = grp; }
454 { mySrcRef = src_ref; myDstRef = dst_ref; }
457 { mySrcFrameUpDir = dir;
458 mySrcFrameUpDirGiven =
true; }
461 { myDstFrameUpDir = dir;
462 myDstFrameUpDirGiven =
true; }
465 {
return int(mySrcLoop.entries()); }
468 {
return int(myDstLoop.entries()); }
470 void setCollectedLinks(
bool user_links,
bool auto_links,
471 bool boundary_links);
473 void fillWrangleDetail(
UT_Set<int> &dst_rep_fake_idx,
481 bool is_edge_extrusion,
483 TextureMode uv_style = INTERPOLATE,
484 TextureScaling uv_scaling = FIT_UNIT_SQUARE);
492 int src_divisions = 0,
493 int dst_divisions = 0,
504 int src_first,
int src_last,
506 int dst_first,
int dst_last,
508 bool do_full_circle);
511 int i,
int first = 0,
int last = -1)
const;
517 GU_Spine *sampleSpine(
int divisions);
524 bool calcDefaultPairingRefs();
525 void calcPositionsInEndFrames();
545 int start_cycle_ref,
int end_cycle_ref,
547 int path_prefix_end_ref,
548 int path_suffix_start_ref);
567 bool circular_first =
false,
568 bool circular_second =
false);
581 fpreal topple_bump_factor = 0.01);
595 TextureMode uv_style, TextureScaling uv_scaling,
599 void setWrangleDetailTextureCoords(
GA_Offset base_offset,
606 fpreal spineLength()
const {
return mySpineArcLength.last(); }
609 LINK_TYPE_NORMAL = 0,
617 int src_base_idx = 0,
618 int dst_base_idx = 0,
621 class FirstThenSecond
626 if (a.first == b.first)
627 return a.second < b.second;
629 return a.first < b.first;
634 class SecondThenFirst
639 if (a.second == b.second)
640 return a.first < b.first;
642 return a.second < b.second;
646 bool myEndsAreSetUp =
false;
647 bool myDirsAreSetUp =
false;
648 bool myHaveDefaultPairingRefs =
false;
649 bool myReverseSpine =
false;
650 bool myMiterJoints =
true;
652 bool mySrcDirGiven =
false;
653 bool myDstDirGiven =
false;
654 bool mySrcCtrGiven =
false;
655 bool myDstCtrGiven =
false;
657 bool mySrcFrameUpDirGiven =
false;
658 bool myDstFrameUpDirGiven =
false;
660 bool myDoGenerateSpine =
false;
661 bool myDoGenerateMesh =
true;
663 bool myPairByEdgeCount =
false;
665 bool mySrcClosed =
true;
666 bool myDstClosed =
true;
667 bool myAttachToSrc =
true;
668 bool myAttachToDst =
true;
670 bool myCollectUserLinks =
false;
671 bool myCollectAutoLinks =
false;
672 bool myCollectBoundaryLinks =
false;
674 bool mySpineIsStraight: 1;
675 bool myAllowCoincidentCentroids =
false;
676 bool myScaleInvariant =
true;
678 int myPairingShift = 0;
694 fpreal mySrcMagnitude = 1.0;
695 fpreal myDstMagnitude = 1.0;
696 fpreal mySrcStiffness = 0.0;
697 fpreal myDstStiffness = 0.0;
700 fpreal mySpineStart = 0.0;
710 UT_Vector3 mySrcLoopNormal = { 0.0, 0.0, 0.0 };
711 UT_Vector3 myDstLoopNormal = { 0.0, 0.0, 0.0 };
712 UT_Vector3 mySrcFrameUpDir = { 0.0, 0.0, 0.0 };
713 UT_Vector3 myDstFrameUpDir = { 0.0, 0.0, 0.0 };
720 MorphMethod myMorphMethod = ROTATING_FRAME;
722 UT_Ramp *myThicknessRamp =
nullptr;
723 fpreal myThicknessUnit = 1.0;
725 UT_Ramp *myTwistRamp =
nullptr;
729 const GEO_Face *myExternalSpine =
nullptr;
732 UT_Vector3 mySpineTranslate = { 0.0, 0.0, 0.0 };
734 fpreal myAxialRotation = 0.0;
737 DirectionSign mySrcDirSign = DIR_SIGN_POS;
738 DirectionSign myDstDirSign = DIR_SIGN_POS;
745 UT_Vector3 myStartClipP, myStartClipT, myStartClipN;
746 UT_Vector3 myEndClipP, myEndClipT, myEndClipN;
786 bool is_edge_extrusion,
797 bool wrangle_pt_attribs =
true,
798 bool wrangle_prim_attribs =
true,
799 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 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 writeGeometry(GA_Offset ptoff0, GA_Offset primoff0, const UT_Set< int > &dst_rep_fake_idx, 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 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)