10 #ifndef __GU_GroomUtils_h__
11 #define __GU_GroomUtils_h__
35 #include <type_traits>
41 findOrCreateFloatAttribute(
50 findOrCreateIntAttribute(
59 findOrCreateStringAttribute(
120 static void getPrimPointPositions(
127 static void setPrimPointPositions(
135 static float unitLengthToUnitDomain(
141 static float unitToUnitLengthDomain(
146 static float unitLengthToUnitDomain(
154 if (n <= 0 || !u_unit)
return 0.0f;
156 if (u_unit < 0.0
f) u_unit = 0.0f;
157 else if (u_unit > 1.0
f) u_unit = 1.0f;
159 return u_unit *
float(n-1);
167 return { {0.0f, 0.0f}, {-1, -1} };
172 return { {1.0f, 0.0f}, {0, -1} };
175 u = openCurveUnitToReal(n, u);
180 if (rem == 0 || vcrt == vseq) {
181 return { {1.0f, 0.0f}, {vcrt, -1} };
197 const T defaultvalue=
T(0.0
f));
220 for (
int i=0; i<offsets.
size(); ++i)
232 void setDim(
int pointcount,
int attribcount,
int guidecount)
234 myPointCount = pointcount;
235 myAttribCount = attribcount;
236 myGuideCount = guidecount;
237 myQuats.setSize(attribcount * pointcount * guidecount);
243 int index = pointindex * (myAttribCount * myGuideCount)
244 + attribindex * myGuideCount
254 int index = getLinearIndex(pointindex, attribindex, guideindex);
256 return myQuats[
index];
263 int index = getLinearIndex(pointindex, attribindex, guideindex);
265 myQuats[
index] = quat;
276 int myPointCount = 0;
277 int myAttribCount = 0;
278 int myGuideCount = 0;
289 const int guideindex,
290 const float guideweight,
301 const bool uniformguidesegments,
312 QuatInterpTempStorage &quattemp,
316 removeNonGuidesFromGroup(
321 removeHiddenPrimitivesFromGroup(
326 setGuideGroupMembers(
349 if (mode == SetLengthMode::SETMIN)
351 return SYSmin(prevlength, value);
353 else if (mode == SetLengthMode::SETMAX)
355 return SYSmax(prevlength, value);
357 else if (mode == SetLengthMode::ADD)
359 return (prevlength+value);
361 else if (mode == SetLengthMode::SUBTRACT)
363 return (prevlength-value);
365 else if (mode == SetLengthMode::SET)
401 circlePackRootPoints(
427 computeTangentFrames(
454 for(
GA_PageNum pagenum(0); pagenum < numpages; ++pagenum)
467 bool skinprimfail =
false;
469 ? constgdp.getPointRange(dynamic_cast<const GA_PointGroup*>(group))
470 : constgdp.getPrimitiveRange(dynamic_cast<const GA_PrimitiveGroup*>(group));
482 for (
GA_Offset off = startoff; off < endoff; ++off)
485 if (skinprimindex < 0 ||
495 return !skinprimfail;
505 GA_Attribute* keyattrib = findOrCreateStringArrayAttribute(
506 gdp, owner, name_attrib_name, 1);
508 GA_Attribute* weightattrib = findOrCreateFloatArrayAttribute(
509 gdp, owner, weight_attrib_name, 1);
521 GA_Attribute* keyattrib = findOrCreateIntArrayAttribute(
522 gdp, owner, name_attrib_name, 1);
524 GA_Attribute* weightattrib = findOrCreateFloatArrayAttribute(
525 gdp, owner, weight_attrib_name, 1);
543 return myAttribMissing;
548 return myAttribMissingWarning;
557 bool myAttribMissing =
false;
576 : myRayIntersect(rayintersect)
577 , mySkinGdp(*rayintersect.detail())
578 , mySkinP(mySkinGdp.getP())
584 : myRayIntersect(rayintersect)
585 , mySkinGdp(*rayintersect.detail())
586 , mySkinP(mySkinGdp.getP())
599 return myRayIntersect;
608 int hitcount = myRayIntersect.minimumPoint(pos, mininfo);
614 hitcount = myRayIntersect.minimumPoint(pos, mininfo);
623 int hits = myRayIntersect.sendRay(pos, dir, info);
670 return interpAttrib(mySkinP, interpcoords);
679 UT_Vector3 normal = interpAttrib(mySkinN, interpcoords);
693 if (!closestPointInfo(pos, mininfo))
696 computeVertWeights(mininfo, interpcoords);
698 pos = interpAttrib(mySkinP, interpcoords);
718 dist2s.setSize(size);
728 : myMaxPartLines(maxpartlines)
732 unsigned int maxpartlines,
734 : myMaxPartLines(maxpartlines)
767 computePartingWeight(
771 PerThreadData &threadvalues,
776 return myLineOffsets(2 *
id);
781 return myLineOffsets(2 *
id + 1);
786 int64 size(inclusive ?
sizeof(*
this) : 0);
788 size += myLineOffsets.getMemoryUsage(
true);
797 const unsigned int myMaxPartLines;
809 , mySrcGdp(srcgdp != nullptr ? *srcgdp : dstgdp)
810 , myAttribMap(myDstGdp, &mySrcGdp)
811 , myLengthScaledAttribMap(myDstGdp, &mySrcGdp)
818 addAttribToMap(myAttribMap, name);
824 addAttribToMap(myLengthScaledAttribMap, name);
846 srcpoly =
static_cast<const GEO_PrimPoly *
>(srcgeoprim);
848 sampleAttribs(dstprimpoly, *srcpoly, blend);
878 bool enable_multithreading=
true);
884 bool enable_multithreading=
true)
893 bool enable_multithreading=
true)
903 : myNumSamples(numsamples)
908 return mySamples == ramp.mySamples
909 && myNumSamples == ramp.myNumSamples
910 && myIsConstant == ramp.myIsConstant;
915 return !(*
this == ramp);
918 bool update(
const UT_Ramp *widthramp);
928 float us = u * (mySamples.size()-1);
930 if (indexA == mySamples.size()-1)
931 return mySamples(indexA);
932 int indexB = indexA + 1;
933 return SYSlerp(mySamples(indexA), mySamples(indexB), us - indexA);
940 exint(u * (mySamples.size()-1) + 0.5),
943 return mySamples(index);
951 bool myIsConstant =
false;
963 , destowner(destowner)
968 void addSourceAttribs(
970 const char *matchpattern,
998 mapAndCreateAttribs(map,
nullptr);
1002 void mapAndCreateAttrib(
1014 for (
int i = 0; i < sourceattribs.size(); ++i)
1015 mapAndCreateAttrib(map, changes, i);
1026 for (
int i = 0; i < sourceattribs.size(); ++i)
1027 if (
filter(*sourceattribs[i]))
1028 mapAndCreateAttrib(map, changes, i);
1036 static auto &&theFilter = [](
const GA_Attribute &attrib)
1041 mapAndCreateAttribs(map, changes, theFilter);
1049 static auto &&theFilter = [](
const GA_Attribute &attrib)
1054 mapAndCreateAttribs(map, changes, theFilter);
1062 CacheData* getCacheData()
const;
1081 bind(detail, attrib_owner, key_attrib_name, weight_attrib_name);
1172 if (!key_attrib || !weight_attrib)
1211 bind(detail, attrib_owner, key_attrib_name, weight_attrib_name);
1220 return bindImpl(detail, attrib_owner, key_attrib_name, weight_attrib_name);
1227 bindImpl(key_attrib, weight_attrib);
1282 : myWeightGeo(weightgeo)
1291 : myWeightGeo(weightgeo)
1293 myInputAttribs.
bind(
1297 weight_attrib_name);
1304 : myWeightGeo(weightgeo)
1306 myInputAttribs.
bind(
1316 return myInputAttribs.
bind(
1320 weight_attrib_name);
1344 return myInputAttribs;
1352 bool key_is_string =
false;
1369 gdp, owner, key_name, weight_name);
1375 gdp, owner, key_name, weight_name);
1378 myOutputAttribs.
bind(keyattrib, weightattrib);
1387 bool success =
false;
1388 if (myInputAttribs.
nameArray() !=
nullptr)
1424 template<
typename C>
1441 blended_weights_set);
1444 template<
typename C>
1450 const float *weights,
1451 const int weightcount,
1456 blended_weights_set.
clear();
1460 for (
int i=0; i<weightcount; ++i)
1463 float pw = weights[i];
1468 if constexpr(SYS_IsSame_v<C, UT_StringArray>)
1479 T key = out_keys[
j];
1480 float w = out_weights[
j];
1482 blended_weights_set[key] =
1483 blended_weights_set.
get(key, 0.0
f) + pw *
w;
1489 float inv_pw_sum = SYSsaferecip(pw_sum);
1491 out_keys.setSize(0);
1493 for (
auto &wpair : blended_weights_set)
1495 out_keys.append(wpair.first);
1496 out_weights.
append(inv_pw_sum * wpair.second);
1543 for (
GA_Offset elemoff = startoff; elemoff < endoff; ++elemoff)
1545 GA_Index skinprimindex = prim_handle.
get(elemoff);
1547 if (skinprimindex < 0 || skinprimindex >= num_weight_prims)
1555 pt_offsets, pt_weights,
1561 for (
int i=0; i<pt_offsets.
size(); ++i)
1562 pt_offsets[i] = myWeightGeo.
vertexPoint(pt_offsets[i]);
1566 pt_offsets, pt_weights,
1569 index_array->
set(&key_attrib, elemoff, indices);
1570 weight_array->
set(&weight_attrib, elemoff, weights);
1611 : myGuideGdp(guidegdp)
1612 , myInterpGdp(interpgdp)
1613 , myWeightArrayInterp(
1617 guidesattrib, weightsattrib)
1619 , myRootLookupPos(rootlookuppos)
1621 , myGuideMode(guidemode)
1622 , mySkinGuideLookupAttrib(skinguidelookupattrib)
1628 if (guideMode() == SkinGuideMode::WEIGHTARRAYS)
1630 return myWeightArrayInterp->isValid();
1639 if (myGuideMode != SkinGuideMode::WEIGHTARRAYS)
1644 for (
GA_Offset ptoff : myInterpGdp.getPointRange())
1646 auto handle = myWeightArrayInterp->getWeightArrayPairHandle();
1647 handle.indexArray()->get(handle.keyAttrib(), ptoff,
indices);
1666 GA_DataId topoid = interpMesh().getTopology().getDataId();
1667 GA_DataId primlistid = interpMesh().getPrimitiveList().getDataId();
1672 if (guideMode() == SkinGuideMode::WEIGHTARRAYS
1673 && myWeightArrayInterp->isValid())
1675 guidesarrayid = myWeightArrayInterp->keyAttrib()->getDataId();
1676 weightsarrayid = myWeightArrayInterp->weightAttrib()->getDataId();
1679 if (topoid != cache.myTopoId ||
1680 primlistid != cache.myPrimlistId ||
1681 guidesarrayid != cache.myGuidesArrayId ||
1682 weightsarrayid != cache.myWeightsArrayId)
1684 cache.myTopoId = topoid;
1685 cache.myPrimlistId = primlistid;
1686 cache.myGuidesArrayId = guidesarrayid;
1687 cache.myWeightsArrayId = weightsarrayid;
1710 myRayIntersect->minimumPoint(
1711 myRootLookupPos.get(sourceptoff), mininfo);
1715 auto skinprim = myInterpGdp.getGEOPrimitive(hitprim_offset);
1716 skinprim->computeInteriorPointWeights(
1718 mininfo.
u1, mininfo.
v1,
1734 if (guideMode() == SkinGuideMode::WEIGHTARRAYS)
1736 interpolateWeightArrays(
1755 void interpolateWeightArrays(
1763 myWeightArrayInterp->interpolate(
1775 myGuideGdp.primitiveOffset(
index));
1779 void interpolateGuides(
1793 if (mySkinGuideLookupAttrib.isValid())
1795 guideindex = mySkinGuideLookupAttrib.get(skinptoff);
1799 guideoffsets.
clear();
1800 guideweights.
clear();
1806 guideindex = interpMesh().pointIndex(skinptoff);
1809 GA_Offset guideprimoff = myGuideGdp.primitiveOffset(guideindex);
1811 guideoffsets(
j) = guideprimoff;
1812 guideweights(
j) = skinweights(
j);
1821 const SkinGuideMode myGuideMode;
GU_GroomCurveAttribSampler(GU_Detail &dstgdp, const GU_Detail *srcgdp=nullptr)
GA_Attribute * myWeightAttrib
SYS_FORCE_INLINE void bumpDataId()
SYS_FORCE_INLINE const GA_Detail & getDetail() const
void interpolate(const GA_OffsetArray &offsets, const UT_FloatArray &weights, GA_Offset &out_offset, TempData &tempdata) const
SYS_FORCE_INLINE const GA_PrimitiveGroup * findPrimitiveGroup(const UT_StringRef &name) const
Definition of a geometry attribute.
void UTparallelFor(const Range &range, const Body &body, const int subscribe_ratio=2, const int min_grain_size=1, const bool force_use_task_scope=true)
SYS_FORCE_INLINE GA_Offset getPrimitiveVertexOffset(GA_Offset primoff, GA_Size i) const
GU_GroomSourceAttribList(GU_Detail *dest, const GU_Detail *source, const GA_AttributeOwner destowner)
bool set(GA_Attribute *attrib, GA_Offset o, const UT_StringArray &v) const
void interpolate(C &out_keys, UT_Array< float > &out_weights, const GA_Offset *offsets, const float *weights, const int weightcount, UT_Map< typename C::value_type, float > &blended_weights_set) const
UT_Map< GA_Size, float > tempindexset
GU_WeightArrayInterpolate(const GEO_Detail &weightgeo, GA_AttributeOwner attrib_owner, const UT_StringRef &key_attrib_name, const UT_StringRef &weight_attrib_name)
GLsizei GLenum const void * indices
Generic Attribute Interface class to access an attribute as a array.
GA_Range getVertexRange(const GA_VertexGroup *group=0) const
Get a range of all vertices in the detail.
const GA_AIFNumericArray * weightArray() const
GA_Attribute * keyAttrib() const
Iteration over a range of elements.
bool bindInputAttribs(GA_AttributeOwner attrib_owner, const UT_StringRef &key_attrib_name, const UT_StringRef &weight_attrib_name)
static GA_Attribute * findOrCreateIntArrayAttribute(GU_Detail &gdp, GA_AttributeOwner owner, const UT_StringRef &name, int tsize, GA_Storage storage=GA_STORE_INT32)
Class which stores the default values for a GA_Attribute.
GU_GroomSkinIntersect(const GU_RayIntersect &rayintersect, const GA_Attribute &normal)
void bindImpl(GA_Attribute *key_attrib, GA_Attribute *weight_attrib)
virtual void computeInteriorPointWeights(UT_Array< GA_Offset > &vtxlist, UT_Array< float > &weightlist, fpreal u, fpreal v, fpreal w) const
getFileOption("OpenEXR:storage") storage
const DataType & getData() const
static GA_PrimitiveGroup * findGroup(GU_Detail &gdp)
GA_Offset getLineOffset1(int id) const
SYS_FORCE_INLINE const GA_IndexMap & getIndexMap() const
bool blockAdvance(GA_Offset &start, GA_Offset &end)
GLsizei const GLfloat * value
SYS_FORCE_INLINE bool closestPos(UT_Vector3 &pos, GU_MinInfo &mininfo, GU_GroomInterpCoords &interpcoords)
void mapAndCreateNonRealAttribs(GA_AttributeRefMap &map, const UT_ValArray< AttribChange > *changes) const
SYS_FORCE_INLINE T * SYSconst_cast(const T *foo)
SYS_FORCE_INLINE UT_Vector3 interpP(const GU_GroomInterpCoords &interpcoords) const
SYS_FORCE_INLINE bool isConstant()
constexpr SYS_FORCE_INLINE T & z() noexcept
SkinGuideMode guideMode() const
GU_GroomPartingLineLookup(unsigned int maxpartlines, GU_GroomSkinIntersect *skinintersect)
SYS_FORCE_INLINE void setValue(int pointindex, int attribindex, int guideindex, UT_QuaternionF &quat)
GU_WeightArrayInterpolate(const GEO_Detail &weightgeo, const GA_Attribute &keyattrib, const GA_Attribute &weightattrib)
void build(const GEO_Detail *gdp, const GA_PointGroup *ptgroup=NULL, bool enable_multithreading=true)
std::pair< GA_AttributeOwner, UT_StringHolder > AttribMatchTuple
SYS_FORCE_INLINE void setDim(int pointcount, int attribcount, int guidecount)
SYS_FORCE_INLINE const GA_PrimitiveTypeId & getTypeId() const
void setPageConstant(GA_PageNum pagenum, const BASETYPE *values) const
GEO_ConstPrimitiveP myPrim
static UT_Tuple< GA_Attribute *, GA_Attribute * > createNameAndWeightArrayAttributes(GU_Detail &gdp, GA_AttributeOwner owner, const UT_StringHolder &name_attrib_name, const UT_StringHolder &weight_attrib_name)
void setCapacity(exint new_capacity)
static GA_PrimitiveGroup & findOrCreateGroup(GU_Detail &gdp)
const GU_RayIntersect & rayIntersect()
void createOutputAttribs(GU_Detail &gdp, GA_AttributeOwner owner)
const GA_Attribute * weightAttrib() const
GA_Attribute * addStringArray(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringHolder &name, int tuple_size=1, const UT_Options *creation_args=0, const GA_AttributeOptions *attribute_options=0, GA_Storage storage=GA_STORE_STRING, const GA_ReuseStrategy &reuse=GA_ReuseStrategy())
GA_Offset getLineOffset2(int id) const
SYS_FORCE_INLINE const UT_QuaternionFArray & getData()
std::tuple< Types...> UT_Tuple
void addAttrib(const UT_StringRef &name)
void mapAndCreateAttribs(GA_AttributeRefMap &map) const
bool bind(const GEO_Detail &detail, GA_AttributeOwner attrib_owner, const UT_StringHolder &key_attrib_name, const UT_StringHolder &weight_attrib_name)
UT_Matrix2T< T > SYSlerp(const UT_Matrix2T< T > &v1, const UT_Matrix2T< T > &v2, S t)
#define GA_INVALID_DATAID
const GA_Attribute * weightAttrib() const
UT_UniquePtr< GU_GroomPartingLineAttribs > gu_PartingLineAttribsUPtr
V get(const key_type &key, const V &defval) const
GU_RWWeightArrayPairHandle()=default
bool containsIndex(GA_Index ai) const
static SYS_FORCE_INLINE void computeVertWeights(const GU_MinInfo &mininfo, GU_GroomInterpCoords &interpcoords)
void setSize(exint newsize)
exint GA_Size
Defines the bit width for index and offset types in GA.
#define GA_INVALID_OFFSET
A range of elements in an index-map.
bool bindImpl(GEO_Detail &detail, GA_AttributeOwner attrib_owner, const UT_StringHolder &key_attrib_name, const UT_StringHolder &weight_attrib_name)
GA_PrimitiveGroup * newPrimitiveGroup(const UT_StringHolder &name)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
void mapAndCreateAttribs(GA_AttributeRefMap &map, const UT_ValArray< AttribChange > *changes) const
GLuint GLsizei const GLuint const GLintptr * offsets
SYS_FORCE_INLINE const UT_StringHolder & getName() const
const GA_AIFNumericArray * myIndexArray
const GA_Attribute * findIntArray(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringRef &name, int min_size=1, int max_size=-1) const
SYS_FORCE_INLINE GEO_Primitive * getGEOPrimitive(GA_Offset primoff)
GA_Attribute * addFloatArray(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringHolder &name, int tuple_size=1, const UT_Options *creation_args=0, const GA_AttributeOptions *attribute_options=0, GA_Storage storage=GA_STORE_REAL32, const GA_ReuseStrategy &reuse=GA_ReuseStrategy())
const GA_ATINumeric * getAttribute() const
void mapAndCreateAttribs(GA_AttributeRefMap &map, const UT_ValArray< AttribChange > *changes, const std::function< bool(const GA_Attribute &)> &filter) const
static bool checkSkinPrimIndices(const GA_ROHandleI &skinprimattrib, const GU_Detail &skingdp, const GA_ElementGroup *group=nullptr)
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
static SYS_FORCE_INLINE GA_Offset primVertexOffset(const GU_Detail &gdp, GA_Offset primoff, GA_Size index=0)
static SYS_FORCE_INLINE void computeVertWeights(const GU_RayInfo &hitinfo, GU_GroomInterpCoords &interpcoords)
GA_Attribute * addIntArray(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringHolder &name, int tuple_size=1, const UT_Options *creation_args=0, const GA_AttributeOptions *attribute_options=0, GA_Storage storage=GA_STORE_INT32, const GA_ReuseStrategy &reuse=GA_ReuseStrategy())
GU_ROWeightArrayPairHandle(const GEO_Detail &detail, GA_AttributeOwner attrib_owner, const UT_StringHolder &key_attrib_name, const UT_StringHolder &weight_attrib_name)
static void vertexToPointOffsets(GA_OffsetArray &offsets, const GU_Detail &gdp)
const GA_Attribute * findStringArray(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringRef &name, int min_size=1, int max_size=-1) const
GA_Range getPointRange(const GA_PointGroup *group=0) const
Get a range of all points in the detail.
void addLengthScaledAttrib(const UT_StringRef &name)
GA_Range getGlobalRange() const
Get a range representing the global (detail) data.
const GU_ROWeightArrayPairHandle & getWeightArrayPairHandle() const
bool operator!=(const GU_GroomFastRamp &ramp) const
void sampleAttribs(const GEO_PrimPoly &dstprimpoly, GA_Offset sourceprimoff, float blend)
static SYS_FORCE_INLINE UT_PageNum numPages(IDX_T nelements)
const GA_Attribute * keyAttrib() const
const GA_Attribute * keyAttrib() const
SYS_FORCE_INLINE const UT_QuaternionF & getValue(int pointindex, int attribindex, int guideindex)
UT_Vector3T< T > SYSclamp(const UT_Vector3T< T > &v, const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
GLsizei GLsizei GLchar * source
GA_API const UT_StringHolder perimeter
bool checkGuides(const GA_PrimitiveGroup *guidegroup)
A specialization of GA_AIFStringArray to access "shared strings".
const GU_Detail & interpMesh() const
A handle to simplify manipulation of multiple attributes.
static float openCurveUnitToReal(int n, float u_unit)
virtual const GA_AIFSharedStringArray * getAIFSharedStringArray() const
Return the attribute's shared string array interface or NULL.
SYS_FORCE_INLINE int getLinearIndex(int pointindex, int attribindex, int guideindex)
GU_GroomInterpCoords interpcoords
SYS_FORCE_INLINE T get(GA_Offset off, int comp=0) const
SYS_FORCE_INLINE GA_Offset vertexPoint(GA_Offset vertex) const
Given a vertex, return the point it references.
UT_Map< UT_StringHolder, float > tempnameset
T interpAttrib(const GA_ROHandleT< T > &attrib, const GU_GroomInterpCoords &interpcoords) const
GLuint const GLchar * name
void build(const GEO_Detail *gdp, const GA_PointGroup *ptgroup, bool enable_multithreading=true)
void interpolate(const GU_Detail &geo, const GA_Attribute &prim_attrib, const GA_Attribute &primuv_attrib, GA_Attribute &key_attrib, GA_Attribute &weight_attrib) const
UT_UniquePtr< T > UTmakeUnique(REST &&...args)
SYS_FORCE_INLINE GA_Offset offset() const
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
static fpreal computeNewLength(fpreal prevlength, SetLengthMode mode, fpreal value)
void setArraySize(unsigned int size)
SYS_FORCE_INLINE UT_Vector3 interpN(const GU_GroomInterpCoords &interpcoords) const
bool bind(GEO_Detail &detail, GA_AttributeOwner attrib_owner, const UT_StringHolder &key_attrib_name, const UT_StringHolder &weight_attrib_name)
void interpolate(C &out_keys, UT_Array< float > &out_weights, const GA_OffsetArray &offsets, const UT_FloatArray &weights, UT_Map< typename C::value_type, float > &blended_weights_set) const
static UT_Tuple< UT_Vector2, UT_Vector2i > openCurvePointWeights(int n, fpreal u)
SYS_FORCE_INLINE const GU_Detail & detail()
GU_GroomPartingLineLookup(unsigned int maxpartlines)
GU_GroomFastRamp(int numsamples=1000)
bool updateCache(CacheData &cache)
const GA_AIFSharedStringArray * nameArray() const
int64 getMemoryUsage(bool inclusive) const
IMATH_NAMESPACE::V2f IMATH_NAMESPACE::Box2i std::string this attribute is obsolete as of OpenEXR v3 float
GA_Attribute * myKeyAttrib
const GA_AIFNumericArray * myWeightArray
void build(const GEO_Detail *gdp, const GA_PointGroup *ptgroup, const char *attrib, bool enable_multithreading=true)
GU_RWWeightArrayPairHandle(GEO_Detail &detail, GA_AttributeOwner attrib_owner, const UT_StringHolder &key_attrib_name, const UT_StringHolder &weight_attrib_name)
virtual bool get(const GA_Attribute *attrib, GA_Offset ai, UT_Array< fpreal16 > &data) const =0
static SYS_FORCE_INLINE GA_Offset primPointOffset(const GU_Detail &gdp, GA_Offset primoff, GA_Size index=0)
GLenum GLsizei GLsizei GLint * values
const UT_StringHolder & attribMissingWarning()
bool operator==(const GU_GroomFastRamp &ramp) const
GA_Attribute * weightAttrib() const
GU_ROWeightArrayPairHandle()=default
SYS_FORCE_INLINE GA_Offset primitiveOffset(GA_Index index) const
Given a primitive's index (in append order), return its data offset.
Utility class for containing a color ramp.
virtual bool set(GA_Attribute *attrib, GA_Offset ai, const UT_Span< const fpreal16 > &data) const =0
const GA_AIFNumericArray * indexArray() const
bool get(const GA_Attribute *attrib, GA_Offset o, UT_StringArray &v) const
UT_ValArray< GA_Size > outindices
SYS_FORCE_INLINE GA_Size getNumPrimitives() const
Return the number of primitives.
SYS_FORCE_INLINE float lookup(float u) const
const GA_Attribute * findFloatArray(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringRef &name, int min_size=1, int max_size=-1) const
SYS_FORCE_INLINE GA_AttributeOwner getOwner() const
const GA_AIFSharedStringArray * myNameArray
static fpreal getIndices(fpreal c, int &c1, int &c2, int max_index, int wrap)
GLubyte GLubyte GLubyte GLubyte w
static T interpAttrib(const GA_ROHandleT< T > &attrib, const GA_Offset &primoff, const GA_OffsetArray &vertoffsets, const UT_FloatArray &vertweights, const T defaultvalue=T(0.0f))
static GA_Attribute * findOrCreateStringArrayAttribute(GU_Detail &gdp, GA_AttributeOwner owner, const UT_StringRef &name, int tsize)
GU_SkinInterpolate(const GU_Detail &guidegdp, const GU_Detail &interpgdp, const GA_ROHandleV3 &rootlookuppos, SkinGuideMode guidemode, const GA_ROHandleI &skinguidelookupattrib, const UT_StringHolder &guidesattrib, const UT_StringHolder &weightsattrib)
static const GA_PrimitiveGroup * findGroup(const GU_Detail &gdp)
void computePointWeights(GA_Offset sourceptoff, GU_MinInfo &mininfo, GA_OffsetArray &offsets, UT_FloatArray &weights) const
void set(GA_Offset primoff, const UT_StringArray &names, const UT_FloatArray &weights)
static void setPagesConstant(GA_RWHandleF attribhandle, float value)
void interpolate(GA_OffsetArray &guideoffsets, UT_FloatArray &guideweights, const GA_OffsetArray &skinoffsets, const UT_FloatArray &skinweights, UT_ValArray< GA_Size > &tempindices, UT_Map< GA_Size, float > &tempset) const
void clear()
Resets list to an empty list.
constexpr SYS_FORCE_INLINE T & y() noexcept
GA_Range getPrimitiveRange(const GA_PrimitiveGroup *group=0) const
Get a range of all primitives in the detail.
void mapAndCreateRealAttribs(GA_AttributeRefMap &map, const UT_ValArray< AttribChange > *changes) const
static UT_Tuple< GA_Attribute *, GA_Attribute * > createIndexAndWeightArrayAttributes(GU_Detail &gdp, GA_AttributeOwner owner, const UT_StringHolder &name_attrib_name, const UT_StringHolder &weight_attrib_name)
static GA_Attribute * findOrCreateFloatArrayAttribute(GU_Detail &gdp, GA_AttributeOwner owner, const UT_StringRef &name, int tsize, GA_Storage storage=GA_STORE_REAL32)
GU_WeightArrayInterpolate(const GEO_Detail &weightgeo)
SYS_FORCE_INLINE bool hitPointInfo(UT_Vector3 pos, UT_Vector3 dir, GU_RayInfo &info)
SYS_FORCE_INLINE GA_Offset offsetSize() const
SYS_FORCE_INLINE bool closestPointInfo(const UT_Vector3 &pos, GU_MinInfo &mininfo) const
void bind(GA_Attribute *key_attrib, GA_Attribute *weight_attrib)
SYS_FORCE_INLINE float lookupNearest(float u) const
GU_GroomSkinIntersect(const GU_RayIntersect &rayintersect)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
constexpr SYS_FORCE_INLINE T & x() noexcept
void bind(const GA_Attribute *key_attrib, const GA_Attribute *weight_attrib)
virtual const GA_AIFNumericArray * getAIFNumericArray() const
Return the attribute's arraydata interface or NULL.