11 #ifndef __GU_PolyExtrude2_h__
12 #define __GU_PolyExtrude2_h__
39 template<
typename T,
bool B>
class GA_EdgeT;
50 bool split_all =
false);
55 bool split_all =
false);
61 PRIM_OR_EDGE_NORMAL = 0,
78 bool isTrivial()
const;
81 { myExtrusionMode = m; }
83 { myMorphMethod = m; }
90 { myUseExistingNormal =
b; }
93 { mySuppliedPointNormal = ptnml; }
96 { myAddFrontPrimGroup = grp; }
99 { myAddFrontEdgeGroup = grp; }
102 { myAddBackPrimGroup = grp; }
105 { myAddBackEdgeGroup = grp; }
108 { myAddSidePrimGroup = grp; }
111 { myAddFrontSeamGroup = grp; }
114 { myAddBackSeamGroup = grp; }
117 { myPrimSelection = grp; }
120 { myEdgeSelection = grp; }
132 { myDeviationToleranceCos = SYScos(a); }
136 { myExtSpineSrcBlend =
s; myExtSpineDstBlend = d; }
139 bool is_global =
false);
142 { myExternalSpine = curve; }
146 { myThicknessAttrib = attrib; }
149 { myTwistAttrib = attrib; }
152 { mySpineStart =
s; mySpineEnd = e; }
156 { mySrcMagnitude =
s; myDstMagnitude = d; }
159 { mySrcStiffness =
s; myDstStiffness = d; }
161 void addVertexNormals(
fpreal cusp_angle_degrees,
162 bool cusp_front,
bool cusp_back);
165 { mySpineSampleMethod = m; }
168 { myLimitInset = limit;
169 myCommonInsetLimit = common_limit; }
171 void setLocalXDirAttrib(
const char *attrib_name);
172 void setLocalZDirAttrib(
const char *attrib_name);
173 void setLocalCtrAttrib(
const char *attrib_name);
174 void setLocalDistScaleAttrib(
const char *attrib_name);
175 void setLocalInsetScaleAttrib(
const char *attrib_name);
176 void setLocalTwistScaleAttrib(
const char *attrib_name);
177 void setLocalDivsScaleAttrib(
const char *attrib_name);
185 fpreal getCompInsetScale(
int k);
186 fpreal getCompDistScale(
int k);
187 fpreal getCompTwistScale(
int k);
188 fpreal getCompDivsScale(
int k);
198 void computeOpenPolyNormals();
200 void buildPrimFront();
201 void buildEdgeFront(
bool generate_edge_polys);
203 void setupGroupsAndAttribs();
205 void buildPrimExtrusionMaps();
207 void buildEdgeExtrusionMap();
208 void calculatePathNormals(
bool trivial);
210 void transformEdgeFront(
bool trivial);
231 void transformPrimFront(
bool trivial);
232 void insetPrimFront();
238 void bridgePrimComponents(
int batch_size = -1);
239 void bridgeEdgeComponents(
int batch_size = -1);
241 void buildPrimSeams();
242 void buildEdgeSeams();
244 void calcPrimLocalFrames();
245 void calcPrimCompLocalFrame(
int k);
247 void calcEdgeLocalFrames();
248 void calcEdgeCompLocalFrame(
int k);
250 void calcCenterAndNormal(
int component_id,
253 bool add_extrusion =
false,
254 bool collect_from_attributes =
false);
259 void updateAffectedNormals();
263 void fillOutputGroups();
265 fpreal getRescaleFactor()
const;
267 void buildHandleSpaceChangMat();
269 void saveEdgeGroupToDetailArray(
const GA_EdgeGroup *grp,
270 const char *attrib_name);
274 bool isFrontXformTrivial()
const;
277 int numCompFrontPts(
int k)
278 {
return (myCompFrontFirstPt(k + 1) -
279 myCompFrontFirstPt(k)); }
283 {
return myFrontPts(myCompFrontFirstPt(k) + i); }
286 int numCompFrontPrims(
int k)
287 {
return (myCompFrontFirstPrim(k + 1) -
288 myCompFrontFirstPrim(k)); }
292 {
return myFrontPrims(myCompFrontFirstPrim(k) + i); }
297 int frontPtIdx(
int k,
int i)
298 {
return (myCompFrontFirstPt(k) + i); }
302 {
return myFrontPtExtrusion(frontPtIdx(k, i)); }
306 {
return myFrontPtPathNormal(frontPtIdx(k, i)); }
311 int frontBdIdx(
int k,
int j)
312 {
return (myCompFrontFirstBd(k) + j); }
316 int frontBdVtxIdx(
int j,
int i)
317 {
return (myFrontBdFirstVtx(j) + i); }
322 {
return myFrontBdVtxs(i); }
327 {
return myFrontBdVtxs(frontBdVtxIdx(j, i)); }
331 GA_Offset &compFrontBdVtx(
int k,
int j,
int i)
332 {
return frontBdVtx(frontBdIdx(k, j), i); }
337 {
return int(myCompFrontFirstBd.size() - 1); }
341 int numCompFrontBds(
int k)
342 {
return (myCompFrontFirstBd(k + 1)
343 - myCompFrontFirstBd(k)); }
347 {
return int(myFrontBdVtxs.size()); }
351 int numFrontBdVtxs(
int j)
352 {
return (myFrontBdFirstVtx(j + 1)
353 - myFrontBdFirstVtx(j)); }
357 int numCompFrontBdVtxs(
int k,
int j)
358 {
return numFrontBdVtxs(frontBdIdx(k, j)); }
363 {
return GA_Offset(myFrontToBackVtxMap.get(v)); }
368 {
return GA_Offset(myFrontToBackPtMap.get(pt)); }
372 int bdComp(
int j) {
return myBdComp(j); }
376 bool isFrontCompClosed(
int k)
377 {
return myFrontCompClosed.getBitFast(k); }
381 {
return myHip->srcPoint(h); }
385 {
return myHip->dstPoint(h); }
389 {
return myHip->srcVertex(h); }
393 {
return myHip->dstVertex(h); }
397 {
return myGdp->vertexPrimitive(vtx); }
402 {
return myHip->findHedgeWithEndpoints(p0, p1); }
406 {
return myHip->sym(h); }
410 {
return myHip->lnext(h); }
414 {
return myHip->lprev(h); }
418 {
return { myGdp->getPos3(pt) }; }
422 {
return myHip->isValidHedge(h); }
426 {
return { myPointNormal.get(pt) }; }
430 {
return { myPolyNormal.get(pt) }; }
456 fpreal myDeviationToleranceCos = 0.984807753012208;
457 fpreal mySrcMagnitude = 1.0;
458 fpreal myDstMagnitude = 1.0;
459 fpreal mySrcStiffness = 1.0;
460 fpreal myDstStiffness = 1.0;
461 fpreal myExtSpineSrcBlend, myExtSpineDstBlend;
466 PolyPatches *myPolyPatches =
nullptr;
467 EdgePaths *myEdgePaths =
nullptr;
492 int myNumFrontPts = 0;
494 MorphMethod myMorphMethod = MorphMethod::LINEAR;
496 bool myOutputFront =
true;
497 bool myOutputBack =
false;
498 bool myReverseBack =
true;
499 bool myOutputSide =
true;
500 bool myStraightSpine =
true;
501 bool myPreserveGroups =
true;
502 bool myReverseSpine =
false;
503 bool myUseExistingNormal =
false;
505 bool myAddVertexNormal =
false;
506 bool myCuspFront =
true;
507 bool myCuspBack =
true;
509 bool myWranglePt =
false;
510 bool myWranglePrim =
false;
511 bool myWrangleVtx =
false;
513 bool myXformIsTrivial =
true;
514 bool myTrivialNormal =
true;
516 bool myLimitInset =
true;
517 bool myCommonInsetLimit =
true;
519 fpreal myCuspAngleDegrees = 60.06;
524 fpreal myThicknessScale = 1.0;
526 UT_Ramp *myTwistRamp =
nullptr;
527 UT_Ramp *myThicknessRamp =
nullptr;
529 const GEO_Face *myExternalSpine =
nullptr;
533 fpreal mySpineStart = 0.0;
535 fpreal myAxialRotation = 0.0;
555 int myNumComponents = 0;
556 int myNumCompBoundaries = 0;
558 SpineSampleMethod mySpineSampleMethod;
565 bool myXformIsGlobal =
false;
void setReverseSpine(bool b)
void setTwistScale(fpreal s)
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
SYS_FORCE_INLINE GA_Offset srcPoint(const GA_Detail *gdp, GEO_Hedge h)
Definition of a geometry attribute.
GA_API const UT_StringHolder div
UT_Array< IndexPair > IndexPairArray
UT_Array< IndexPair > IndexPairArray
void setExternalSpine(const GEO_Face *curve)
void limitInset(bool limit, bool common_limit)
void setStiffnesses(fpreal s, fpreal d)
GA_Offset srcVertex(GEO_Hedge)
GLboolean GLboolean GLboolean GLboolean a
void setOutputSide(bool b)
void setPointNormalAttrib(GA_ROHandleV3 ptnml)
void setSpineSampleMethod(SpineSampleMethod m)
void setDivisions(int div)
UT_Vector3 getDraggerDir() const
void setThicknessScale(fpreal s)
void setTwistAttrib(GA_Attribute *attrib)
void setBackGroup(GA_EdgeGroup *grp)
void setPreserveGroups(bool b)
void setOutputBack(bool b)
void setSideGroup(GA_PrimitiveGroup *grp)
GEO_Hedge encapsulates a half-edge (hedge) which is the restriction of.
void setFrontGroup(GA_EdgeGroup *grp)
void setMorphMethod(MorphMethod m)
void setThicknessRamp(UT_Ramp *r)
UT_Vector3 getDraggerStart() const
void setFrontGroup(GA_PrimitiveGroup *grp)
void setMagnitudes(fpreal s, fpreal d)
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
GLboolean GLboolean GLboolean b
SYS_FORCE_INLINE GA_Offset dstVertex(T &iface, GEO_Hedge h)
UT_UniquePtr< GA_Attribute > GA_AttributeUPtr
void setBackSeamGroup(GA_EdgeGroup *grp)
void setSpineRange(fpreal s, fpreal e)
void setAxialRotation(fpreal r)
GLfloat GLfloat GLfloat GLfloat h
void setThicknessAttrib(GA_Attribute *attrib)
GEO_Hedge findHedgeWithEndpoints(T &iface, GA_Offset p0, GA_Offset p1)
void setDeviationTolerance(fpreal a)
void setTwistRamp(UT_Ramp *r)
void setExtrusionMode(ExtrusionMode m)
Utility class for containing a color ramp.
void setExtSpineBlend(fpreal s, fpreal d)
void setBackGroup(GA_PrimitiveGroup *grp)
void setOutputFront(bool b)
GU_Spine::SampleMode SpineSampleMethod
void setSelectionGroup(GA_EdgeGroup *grp)
void setUseExistingPointNormal(bool b)
const GEO_DetachedHedgeInterface HedgeInterface
UT_UniquePtr< GA_PointGroup > GA_PointGroupUPtr
SIM_API const UT_StringHolder distance
void setStraightSpine(bool b)
void setSelectionGroup(GA_PrimitiveGroup *grp)
void setInset(float inset)
void setFrontSeamGroup(GA_EdgeGroup *grp)
SYS_FORCE_INLINE GA_Offset dstPoint(T &iface, GEO_Hedge h)