39 using namespace HDK_Sample;
50 op =
new DOP_Operator(
"hdk_groupandapply",
"Group and Apply",
57 static PRM_Name theInputIndexName(
"inputindex",
"Input Index");
105 objects.
filter(filter, filtered);
108 for( i = 0; i < filtered.
entries(); i++ )
131 inputindex = INPUTINDEX(time) + 1;
132 if( inputindex != 0 &&
getInput(inputindex) )
145 addtogroup =
"applygroup_";
146 addtogroup += numstr;
154 relationship->
addGroup(filtered(i));
193 DOP_GroupAndApply::INPUTINDEX(
fpreal t)
195 return evalInt(theInputIndexName, 0, t);
void processObjectsSubclass(fpreal time, int foroutputidx, const SIM_ObjectArray &objects, DOP_Engine &engine) override
This default implementation does not affect incoming objects.
~DOP_GroupAndApply() override
DOP_API PRM_ChoiceList DOPgroupMenu
PRM_API const PRM_Type PRM_STRING
bool isActive(fpreal time)
GT_API const UT_StringHolder time
void filter(const SIM_DataFilter &filter, SIM_ObjectArray &filtered) const
DOP_API PRM_Name DOPgroupName
DOP_API PRM_Name DOPactivationName
bool addOperator(OP_Operator *op, std::ostream *err=nullptr)
PRM_API const PRM_Type PRM_INT_J
#define SIM_RELGROUP_DATANAME
void newDopOperator(OP_OperatorTable *table)
This declaration allows HDK users to write custom DOP operators.
void evalString(UT_String &val, int pi, int vi, fpreal t) const
Holds pointers to a number of SIM_Object objects.
DOP_GroupAndApply(OP_Network *net, const char *name, OP_Operator *op)
OP_Node * getInput(unsigned idx, bool mark_used=false) const
Returns the node connected to a particular input (may be null).
void setCurrentObject(int objectindex, int objectcount, const SIM_Object *object)
#define SIM_DATA_RETURN_EXISTING
GLuint const GLchar * name
GLenum GLenum GLsizei void * table
static int itoa(char *str, int64 i)
static PRM_Template myTemplateList[]
void getOutputInfoSubclass(int inputidx, DOP_InOutInfo &info) const override
This default implementation specifies the output sends out objects.
void applyDataFromInput(fpreal time, int inputidx, int inputidxforsuffix, SIM_RootData &rootdata, const char *parentdataname, DOP_Engine &engine, UT_StringArray *datanames, bool changeuniquenamesuffix)
static OP_Node * myConstructor(OP_Network *net, const char *name, OP_Operator *op)
This is the base class for all DOP nodes.
DOP_API PRM_Default DOPgroupDefault
exint evalInt(int pi, int vi, fpreal t) const
void addGroup(const SIM_ObjectArray &objects)
Adds a number of objects to the object group.
void addError(int code, const char *msg=0)
Adds an error from the DOP error file.
PRM_API PRM_Default PRMzeroDefaults[]
#define SIM_DATA_CREATE(Parent, DataName, DataClass, Flags)
DOP_API PRM_Default DOPactivationDefault
SIM_Relationship * addRelationship(const char *name, int creationflags)
void getInputInfoSubclass(int inputidx, DOP_InOutInfo &info) const override
This default implementation specifies the input accepts objects.
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter