46 using namespace HDK_Sample;
48 #define PRM_MENU_CHOICES (PRM_ChoiceListType)(PRM_CHOICELIST_EXCLUSIVE |\
49 PRM_CHOICELIST_REPLACE)
95 1, &sop_names[1], 0, &sopOpMenu),
144 myRayHitPressure = 1.0f;
148 myStrokeChanged =
false;
180 default: iop = 0;
break;
235 const bool BUILD_HAIR =
false;
241 changed_input =
true;
242 changed_group =
true;
260 if (attrib.isInvalid())
269 myHairlenFound =
false;
285 myStrokeChanged =
false;
313 polygonsizes.
append(2, n);
323 pos.
y() += attrib.get(oldptoff);
327 if (ptwrangler.getNumAttributes() > 0)
328 ptwrangler.copyAttributeValues(newptoff, oldptoff);
331 polygonpointnumbers(2*i ) =
int(oldptoff - relativetooffset);
332 polygonpointnumbers(2*i + 1) =
int(newptoff - relativetooffset);
373 myHairlenFound =
true;
390 float newhair = (myUseFore ?
FGR(myTime) :
BGR(myTime));
397 float oldhair = myHairlenHandle.
get(ptoff);
400 myHairlenHandle.
set(ptoff,
SYSlerp(oldhair, newhair, alpha));
static PRM_ChoiceList primGroupMenu
GDT_Detail * myCurrentDelta
const GU_Detail * getCookedGeo(OP_Context &, int forced=0)
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
Iteration over a range of elements.
~SOP_BrushHairLen() override
PRM_API const PRM_Type PRM_STRING
fpreal BGR(fpreal t) override
GA_Attribute * addFloatTuple(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringHolder &name, int tuple_size, const GA_Defaults &defaults=GA_Defaults(0.0), const UT_Options *creation_args=0, const GA_AttributeOptions *attribute_options=0, GA_Storage storage=GA_STORE_REAL32, const GA_ReuseStrategy &reuse=GA_ReuseStrategy())
virtual void endChange()=0
SOP_BrushOp OP() override
static PRM_SpareData * getGroupSelectButton(GA_GroupType group_type, const char *group_type_parm=NULL, int input_index=0, PRM_SpareData *merge_spare_data=NULL, const char *assoc_groups=NULL, GroupSelectAsOrdered ordered=GroupSelectAsOrdered::AUTO, const char *use_name_attr=nullptr, const char *select_script=nullptr)
void brushOpCallback(fpreal t, GA_Offset pt, const UT_Array< GA_Offset > *ptneighbour, GA_Offset vtx, const UT_Array< GA_Offset > *vtxneighbour, float alpha, GEO_Delta *delta, const GU_Detail *gdp) override
This is the callback triggered when a BRUSHOP_CALLBACK is used:
OP_ERROR cookMySop(OP_Context &context) override
PRM_API const PRM_Type PRM_ORD
GA_Attribute * getP()
Convenience method to access the P attribute.
const GU_Detail * getIsectGdp(fpreal t) override
Public methods needed by MSS:
PRM_API PRM_Default PRMpointOneDefaults[]
bool addOperator(OP_Operator *op, std::ostream *err=nullptr)
SYS_FORCE_INLINE UT_Vector3 getPos3(GA_Offset ptoff) const
The ptoff passed is the point offset.
UT_Matrix2T< T > SYSlerp(const UT_Matrix2T< T > &v1, const UT_Matrix2T< T > &v2, S t)
SYS_FORCE_INLINE bool GAisValid(GA_Size v)
exint GA_Size
Defines the bit width for index and offset types in GA.
void applyVisualizeStencil(GU_Detail *gdp)
A range of elements in an index-map.
bool hasStyleChanged(fpreal t) override
const GA_IndexMap & getPointMap() const
void eraseAttributes(GEO_Delta *old, GEO_Delta *change)
OP_ERROR duplicateChangedSource(unsigned idx, OP_Context &ctx, int *changed=0, bool force=false)
Only duplicates the source if the source has changed since the last call to this method.
SYS_FORCE_INLINE GA_Offset appendPointBlock(GA_Size npoints)
Append new points, returning the first offset of the contiguous block.
void bumpDataId()
Use this to mark primitives or their intrinsic data as dirty.
static OP_Node * myConstructor(OP_Network *net, const char *name, OP_Operator *entry)
void newSopOperator(OP_OperatorTable *table)
GA_AttributeSet & getAttributes()
OP_Node * getInput(unsigned idx, bool mark_used=false) const
Returns the node connected to a particular input (may be null).
bool checkChangedSource(unsigned idx, OP_Context &ctx)
SYS_FORCE_INLINE GA_Offset getNumPointOffsets() const
GLfloat GLfloat GLfloat alpha
SYS_FORCE_INLINE T get(GA_Offset off, int comp=0) const
GLuint const GLchar * name
SYS_FORCE_INLINE bool isInvalid() const
PRM_API const PRM_Type PRM_FLT_J
GLenum GLenum GLsizei void * table
void setManagesDataIDs(bool onOff)
const GA_Attribute * findFloatTuple(GA_AttributeOwner owner, GA_AttributeScope scope, const UT_StringRef &name, int min_size=1, int max_size=-1) const
PRM_API PRM_Default PRMoneDefaults[]
static PRM_Template myTemplateList[]
SYS_FORCE_INLINE void setPos3(GA_Offset ptoff, const UT_Vector3 &pos)
Set P from a UT_Vector3.
SYS_FORCE_INLINE void set(GA_Offset off, const T &val) const
static GA_AttributeFilter selectStandard(const GA_Attribute *exclude=0)
Class factories.
void setInt(int parmi, int vectori, fpreal t, exint value)
void append(GA_Size size, GA_Size count=1)
virtual void beginPointAttributeChange(const GEO_Detail &gdp, GA_Offset pt)=0
GA_RWHandleT< fpreal32 > GA_RWHandleF
static GA_AttributeFilter selectGroup()
const GA_PrimitiveList & getPrimitiveList() const
GDT_Detail * myPermanentDelta
static GA_Offset buildBlock(GA_Detail *detail, const UT_Vector3 *points, const GA_Size npoints, const GEO_PolyCounts &polygonsizelist, const int *polygonpointnumbers, const bool closed=true)
virtual OP_ERROR processBrushOp(OP_Context &context, bool changed_input, bool changed_group)
void bumpAllDataIds(GA_AttributeOwner owner)
Bumps all data IDs of attributes of the specified owner.
exint evalInt(int pi, int vi, fpreal t) const
static GA_AttributeFilter selectOr(const GA_AttributeFilter &f0, const GA_AttributeFilter &f1, bool single_match=false)
void addVariableName(const char *attr, const char *varname)
constexpr SYS_FORCE_INLINE T & y() noexcept
PRM_API PRM_Default PRMzeroDefaults[]
SOP_BrushHairLen(OP_Network *net, const char *, OP_Operator *entry)
fpreal FGR(fpreal t) override
void setBrushOp(SOP_BrushOp op) override
SYS_FORCE_INLINE GA_Size getNumPoints() const
Return the number of points.
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
bool isParmDirty(int idx, fpreal t)
OP_ERROR duplicateSource(unsigned index, OP_Context &context, GU_Detail *gdp, bool clean=true)