11 #ifndef __GU_AutoSeam_h__
12 #define __GU_AutoSeam_h__
32 void generateSeams(
fpreal grain_threshold,
42 fpreal connectivity_tolerance,
76 {
return myHip->srcVertex(h); }
80 {
return myHip->dstVertex(h); }
84 {
return myHip->srcPoint(h); }
88 {
return myHip->dstPoint(h); }
92 {
return myGdp->vertexPrimitive(
srcVertex(h)); }
96 {
return myGdp->getPos3(pt); }
112 void findSymmetryLines();
114 void calcPolyNormals();
115 void calcCurvatures();
118 {
return myPointCurvature.get(pt); }
122 {
return myPolyNormals(polyIndex(poly)).length(); }
127 auto n = myPolyNormals(polyIndex(poly));
133 fpreal curvature_threshold = -1.0);
136 void removeInnerSeams();
139 const ChainInfo &chain,
141 fpreal grain_threshold)
const;
144 const ChainInfo &chain,
146 fpreal merge_threshold)
const;
149 extractNodes(Partition *
partition)
const;
151 template <
typename T>
152 void growIslands(
T join_func,
157 bool symmetry_lin =
false);
161 void refreshChains(
exint i,
184 : myGdp->getPrimitiveRange();
191 && myGdp->getPrimitiveClosedFlag(prim)
192 && myGdp->getPrimitiveVertexCount(prim) > 2;
198 return isPoly(prim) && myGdp->getPrimitiveVertexCount(prim) == 4;
204 if (myTwinMap.isInvalid())
213 {
return twin(h) == sym(h); }
217 {
return myPolyIndex.isValid()
218 ?
int(myIndexPoly.size())
219 :
int(myGdp->getNumPrimitives()); }
223 {
return myPolyIndex.isValid()
224 ? myPolyIndex.get(poly)
225 :
int(myGdp->primitiveIndex(poly)); }
229 {
return myPolyIndex.isValid()
231 : myGdp->primitiveOffset(
GA_Index(i)); }
233 static fpreal calcL21MergeCost(
const IslandInfo &i,
234 const IslandInfo &
j);
236 static fpreal calcCovarianceMergeCost(
const IslandInfo &i,
237 const IslandInfo &
j);
239 void resetQuadLayout(
fpreal cutoff_curvature);
244 fpreal infinity()
const {
return 1e10; }
251 PartitionUptr myPartition;
255 fpreal myQuadLayoutGrainThreshold = -1.0;
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
SYS_FORCE_INLINE GA_Offset srcPoint(const GA_Detail *gdp, GEO_Hedge h)
Definition of a geometry attribute.
void partition(I begin, I middle, I end, const Pred &pred, I *out_eqbeg, I *out_eqend)
GA_OffsetListType< GA_Size > GA_OffsetList
GA_OffsetList is a map from index to offset.
GA_Offset srcVertex(GEO_Hedge)
bool isValid() const
Check whether range is valid (i.e. has an implementation)
GLuint GLsizei GLsizei * length
#define GEO_INVALID_HEDGE
An invalid hedge is sometimes returned if an operation is unsuccessful.
A range of elements in an index-map.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
UT_UniquePtr< const GA_PointGroup > GA_ConstPointGroupUPtr
GEO_Hedge encapsulates a half-edge (hedge) which is the restriction of.
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
SYS_FORCE_INLINE GA_Offset dstVertex(T &iface, GEO_Hedge h)
UT_UniquePtr< GA_Attribute > GA_AttributeUPtr
const HedgeInterface * getHedgeInterface() const
const GU_Detail * getDetail() const
GLfloat GLfloat GLfloat GLfloat h
UT_Array< GEO_Hedge > HedgeArray
const GEO_DetachedHedgeInterface HedgeInterface
SYS_FORCE_INLINE GA_Offset dstPoint(T &iface, GEO_Hedge h)