12 #ifndef __CHOP_Node_h__
13 #define __CHOP_Node_h__
37 #define CHOP_AUDIO_FLAG 'a'
38 #define CHOP_EXPORT_FLAG 'o'
55 const char *
source,
const char *dest);
64 #define CHOP_PARM_COUNT (8)
65 #define CHOP_TAB "Common"
66 #define NONE_TOKEN "none"
68 #define CHOP_OUT_CFUNC "_updateCParam"
69 #define CHOP_OUT_IFUNC "_updateIParam"
71 #define CHOP_OUT_CPARAM "params.cUpdate"
72 #define CHOP_OUT_IPARAM "params.iUpdate"
75 #define CHOP_SWITCHER(cnt, nm) \
76 static PRM_Default switcher[2] = \
78 PRM_Default(cnt, nm), \
79 PRM_Default(CHOP_PARM_COUNT, CHOP_TAB), \
82 #define CHOP_SWITCHER2(cnt1,nm1,cnt2, nm2) \
83 static PRM_Default switcher[3] = \
85 PRM_Default(cnt1, nm1), \
86 PRM_Default(cnt2, nm2), \
87 PRM_Default(CHOP_PARM_COUNT, CHOP_TAB), \
90 #define CHOP_SWITCHER3(cnt1,nm1,cnt2, nm2,cnt3,nm3) \
91 static PRM_Default switcher[4] = \
93 PRM_Default(cnt1, nm1), \
94 PRM_Default(cnt2, nm2), \
95 PRM_Default(cnt3, nm3), \
96 PRM_Default(CHOP_PARM_COUNT, CHOP_TAB), \
99 #define CHOP_SWITCHER4(cnt1,nm1,cnt2, nm2,cnt3,nm3,cnt4,nm4) \
100 static PRM_Default switcher[5] = \
102 PRM_Default(cnt1, nm1), \
103 PRM_Default(cnt2, nm2), \
104 PRM_Default(cnt3, nm3), \
105 PRM_Default(cnt4, nm4), \
106 PRM_Default(CHOP_PARM_COUNT, CHOP_TAB), \
109 #define CHOP_SWITCHER5(cnt1,nm1,cnt2, nm2,cnt3,nm3,cnt4,nm4,cnt5,nm5) \
110 static PRM_Default switcher[6] = \
112 PRM_Default(cnt1, nm1), \
113 PRM_Default(cnt2, nm2), \
114 PRM_Default(cnt3, nm3), \
115 PRM_Default(cnt4, nm4), \
116 PRM_Default(cnt5, nm5), \
117 PRM_Default(CHOP_PARM_COUNT, CHOP_TAB), \
120 #define CHOP_SWITCHER6(cnt1,nm1,cnt2, nm2,cnt3,nm3,cnt4,nm4,cnt5,nm5,cnt6,nm6) \
121 static PRM_Default switcher[7] = \
123 PRM_Default(cnt1, nm1), \
124 PRM_Default(cnt2, nm2), \
125 PRM_Default(cnt3, nm3), \
126 PRM_Default(cnt4, nm4), \
127 PRM_Default(cnt5, nm5), \
128 PRM_Default(cnt6, nm6), \
129 PRM_Default(CHOP_PARM_COUNT, CHOP_TAB), \
137 #define ARG_CHOP_SCOPE (myParmCommonBase + 0)
138 #define ARG_CHOP_MATCH (myParmCommonBase + 1)
139 #define ARG_CHOP_UNITS (myParmCommonBase + 2)
140 #define ARG_CHOP_REALTIME (myParmCommonBase + 3)
141 #define ARG_CHOP_UNLOAD (myParmCommonBase + 4)
142 #define ARG_CHOP_EXPORT_PATH (myParmCommonBase + 5)
143 #define ARG_CHOP_DCOLOR (myParmCommonBase + 6)
144 #define ARG_CHOP_COLSTEP (myParmCommonBase + 7)
169 bool setAudio(
bool on_off)
override;
177 bool fallback_to_flag =
true);
184 virtual void cookMyHandles(
OP_Context &context);
207 void globTracks(
const char *
pattern,
221 static fpreal getGlobalStart();
222 static fpreal getGlobalEnd();
224 static fpreal getGlobalSampleStep();
234 int putNote(
fpreal t,
const char *);
236 int putNote(
int index,
const char *);
238 const char *getNote(
fpreal t0)
const;
239 const char *getNote(
int index)
const;
246 void resampleFromFit();
252 int copyFitChannels();
256 static void addError(
int code,
const char *msg = 0)
264 static bool hasChannelMatchFailure(
PRM_Match match_by,
266 const char *name1,
const CL_Clip * source2,
const char *name2);
272 theConflictCallback =
func;
273 theConflictData =
data;
279 pattern = theConflictResolvePattern;
285 theConflictResolvePattern =
pattern;
305 virtual void realtimeInit(
fpreal t);
306 virtual void realtimeCleanup();
309 virtual int getModifiedRange(
int &
first,
int &
last,
int clear=1);
311 static void installCommands();
326 static void buildEditorMenu(
329 static void buildNetMenu(
332 static void buildNodeMenu(
341 {
return myLimitInfo; }
343 { myLimitInfo = limit_info; }
348 const char *
label = 0)
override;
366 virtual void updateExports();
371 const char *trackname,
374 int &vecidx)
override;
400 virtual void postCook();
406 void initCommonBaseParm();
416 const char *old_fullpath,
418 const char *old_chan_name)
override;
422 virtual void handleChanNameDependency(
const UT_String &chan_token,
424 const char *old_chan_name,
437 const char *old_chan_name,
442 void addParmReferences(
450 virtual int usesScope()
const;
451 virtual int usesSampleMatch()
const;
452 virtual int usesUnits();
466 void destroyHandles();
480 int data,
int slerps);
489 int end_width = 0)
const;
492 int end_width = 0)
const;
495 int end_width = 0)
const;
498 int end_width = 0)
const;
506 int relative,
int ref_input = 1);
509 int relative,
int ref_input = 1);
512 int relative,
int ref_input,
516 int relative,
int ref_input,
532 const char *pathPrefix,
536 const char *
path=0)
override;
540 void resetChangedSourceFlags();
550 return myInputChangeHelper.useInput(
551 *
this, idx, changed, force);
559 {
if(myScopeStringDirty)
562 myScopeStringDirty =
false;
564 return myScopeString;}
597 void getParmIntervalInSamples(
599 const char *range_parm = 0,
600 const char *start_parm = 0,
601 const char *end_parm = 0);
603 void upgradeRangeParm(
604 const char *old_version,
605 const char *cur_version,
606 const char *range_parm = 0);
612 static void getStaticInterval(
fpreal t,
int &istart,
int &iend,
619 static void buildScopeMenu(
643 virtual void EDITOR_PATH(
UT_String &str);
655 void getParmIntervalInSamples(
657 const char *range_parm = 0,
658 const char *start_parm = 0,
659 const char *end_parm = 0
663 const CL_Clip *inputClip(
int idx,
OP_Context &context,
bool add_extrainput,
bool force_recook_timedep);
672 void updateOverrides();
673 static void updateConflicts(
void *
data,
int replace);
678 void destroyScopePatterns();
680 fpreal getInputRate(
int input_idx);
681 static void initializeExpressions();
684 void getFitInterval(
int &istart,
int &iend);
688 void buildChannelMenu(
PRM_Name *menuEntries,
692 void destroyAllFitData();
693 void createFitCollection();
694 void destroyFitCollection();
696 bool haveSeenModification(
long counter );
701 bool myRequireUnload;
709 bool myScopeStringDirty;
722 int myRealtimeCookState;
724 static fpreal myMaxRealtimeSlice;
725 static int myTimeSliceDefault;
726 static int mySmartCookFlag;
728 static bool myLimitInfo;
733 static void *theConflictData;
736 char myConflictPending;
740 long myLastModification;
745 friend class CHOP_UndoFitDestroy;
virtual int saveCookedData(std::ostream &os, OP_Context &, int binary=0)=0
static const char * theChildTableName
static void setConflictCallback(CHOP_ConflictCallback func, void *data)
void EXPORT_PATH(UT_String &str) const
virtual bool updateParmsFlags()
static void setMaxSliceSize(fpreal size)
fpreal getH() const override
Node position/scale is used by the UI.
GLsizei GLenum const void * indices
GLuint GLsizei const GLchar * label
fpreal getW() const override
Node position/scale is used by the UI.
virtual void setMapping(int idx, int type, const char *label=0)
virtual int getNetOverviewColor(UT_Color &color)
static void addWarning(int code, const char *msg=0)
#define SYS_VISIBILITY_EXPORT
virtual void setFlag(char tag, int8 val)
static OP_TemplatePair myTemplatePair
virtual bool getAudio() const
const GLuint GLenum const void * binary
GLsizei const GLchar *const * path
void setLimitInfo(bool limit_info)
static void setTimeSliceDefault(int state)
CHOP_SampleMatch SAMPLE_MATCH() const
virtual void handleOpDependency(int referenced_op_id, const OP_Dependency &op_dep, OP_InterestType interest_type, bool &need_cook, const char *old_fullpath, const char *old_cwd, const char *old_chan_name)
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
virtual int isRealtimeCook()
bool useInputSource(unsigned idx, bool &changed, bool force)
Mark the given input as used for cooking by this node.
virtual int getMapping(int idx, const char *&label) const
static OP_VariablePair myVariablePair
virtual void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &parms)
virtual const orUnitList * getOverrideUnits() const
static int getTimeSliceDefault()
virtual OP_ERROR cookMe(OP_Context &context)=0
#define ARG_CHOP_EXPORT_PATH
static fpreal getMaxSliceSize()
virtual int usesRealtime()
virtual bool loadCookedData(UT_IStream &is, const char *path=0)
SYS_VISIBILITY_EXPORT void newChopOperator(OP_OperatorTable *table)
virtual bool evaluateTransformTracks(OP_Context &context, OP_EvaluateTransformTracksArgs &args)
int UNLOAD(int thread) const
virtual CH_Channel * getTrackChannel(const char *name)
virtual bool setAudio(bool on_off)
void buildOpDependencies() override
void evalString(UT_String &val, int pi, int vi, fpreal t) const
std::string OIIO_UTIL_API replace(string_view str, string_view pattern, string_view replacement, bool global=false)
void opChanged(OP_EventType reason, void *data=0) override
int64 getMemoryUsage(bool inclusive) const override
GLsizei GLsizei GLchar * source
virtual int bumpSourceCount(int d)
CHOP_HandleList myHandles
virtual bool findParmFromTrack(const OP_FollowChanRefsOptions &opt, const char *trackname, OP_NodeParmRefCycle &cycle, OP_Node *&node, PRM_Parm *&parm, int &vecidx)
void nodeUnlocked() override
virtual const CL_Clip * getClip(OP_Context *context=0)
png_const_structrp png_const_inforp int * unit
static int getSmartCook()
GLuint const GLchar * name
static void getConflictResolvePattern(UT_StringHolder &pattern)
#define ARG_CHOP_REALTIME
virtual bool getExport() const
virtual OP_DataType getCookedDataType() const =0
GLenum GLenum GLsizei void * table
virtual OP_OpTypeId getOpTypeID() const
void(* CHOP_ReplaceCallback)(void *data, int replace)
__hostdev__ uint64_t last(uint32_t i) const
virtual const char * getChildType() const
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
virtual const char * getFileExtension(int binary) const =0
const UT_String & SCOPE_STRING()
OP_TransformCallback CHOP_TransformCallback
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms)
bool hasTransformTracks() const override
SIM_API const UT_StringHolder force
void clearAndDestroy() override
exint evalIntT(int pi, int vi, fpreal t, int thread) const
virtual const char * getOpType() const
UT_API UT_ErrorSeverity UTaddWarning(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
virtual OP_OpTypeId getChildTypeID() const =0
virtual bool setExport(bool on_off)
**If you just want to fire and args
static void addError(int code, const char *msg=0)
bool load(UT_IStream &is, const char *ext="", const char *path=0) override
virtual OP_ERROR save(std::ostream &os, const OP_SaveFlags &flags, const char *path_prefix="", const UT_String &name_override=UT_String())
exint evalInt(int pi, int vi, fpreal t) const
void inputConnectChanged(int which) override
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T clip(const T &p, const Box< T > &box) IMATH_NOEXCEPT
virtual void stealOverrideUnits(orUnitList &)
virtual OP_ERROR bypassMe(OP_Context &context, int &copied_input)=0
static void setSmartCook(int f)
OIIO_UTIL_API std::string extension(string_view filepath, bool include_dot=true) noexcept
UT_API UT_ErrorSeverity UTaddError(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
virtual void deleteCookedData()=0
static void setConflictResolvePattern(const char *pattern)
void(* CHOP_ConflictCallback)(void *data, void *ldata, CHOP_ReplaceCallback func, const char *source, const char *dest)