HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_Parameters.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: OP Library (C++)
7  *
8  * COMMENTS: OP_Parameters encapsulates the parameter lists used
9  * by the OP library.
10  *
11  */
12 
13 #ifndef __OP_Parameters_h__
14 #define __OP_Parameters_h__
15 
16 #include <iosfwd>
17 
18 #include <CH/CH_ExprLanguage.h>
19 #include <EXPR/EX_Error.h>
20 #include <PRM/PRM_ChanState.h>
21 #include <PRM/PRM_ParmList.h>
22 #include <PRM/PRM_ParmOwner.h>
23 #include <SYS/SYS_Types.h>
24 #include <UT/UT_Assert.h>
25 #include <UT/UT_Defines.h>
26 #include <UT/UT_LockedRawPtr.h>
27 #include <UT/UT_String.h>
28 #include <UT/UT_StringHolder.h>
29 #include <UT/UT_StringSet.h>
30 #include <UT/UT_Thread.h>
31 
32 #include "OP_API.h"
33 #include "OP_Error.h"
34 #include "OP_Lock.h"
35 #include "OP_Stat.h"
36 #include "OP_Value.h"
37 #include "OP_Context.h"
38 
39 class UT_BitArray;
40 class UT_Ramp;
41 class UT_JSONValueMap;
42 class PRM_Parm;
43 class PRM_ParmList;
44 class PRM_ScriptPage;
45 class PRM_ScriptImports;
46 class PRM_BatchList;
47 class CH_LocalVariable;
48 class CMD_Args;
49 class OP_Channels;
50 class OP_Operator;
51 class OP_ParmCache;
52 class OP_PostIt;
53 class OP_MultiparmInfo;
55 class OP_SpareParms;
56 
57 
58 enum OP_ScopeOp {
62  OP_SCOPE_NUM_OPS // sentinel
63 };
64 
70 };
71 
73 {
74 public:
75  // allow_nonchannels - determines whether or not we should scope parameters
76  // that don't have CH_Channel pointers associated with
77  // them.
78  //
79  // exclude_animated - determines whether or not to exclude channels that
80  // are time dependent.
81  //
82  // exclude_constant - determines whether or not to exclude channels that
83  // are not time dependent.
84  //
85  // include_only_nonint_keys - determines whether or not to include only
86  // those channels that have non integer
87  // keyframes.
88  // scoped_related_layers - scope the related animation layers
89  // scope_type - modify the scope or display flags
90  OP_ScopeOptions(bool allow_nonchannels, bool exclude_animated,
91  bool exclude_constant, bool include_only_nonint_keys,
92  bool scoped_related_layers,
93  OP_ScopeType scope_type) :
94  myAllowNonChannels(allow_nonchannels),
95  myExcludeAnimated(exclude_animated),
96  myExcludeConstant(exclude_constant),
97  myIncludeOnlyNonIntKeys(include_only_nonint_keys),
98  myScopedRelatedLayers(scoped_related_layers),
99  myScopeType( scope_type )
100  {}
101 
107 
109 };
110 
112 {
113 public:
115  : myTime(t)
116  , myFollowCHOPLayerOverrides(true)
117  , myFollowReferences(true)
118  , myStopAtEditabledHDA(false)
119  {
120  }
121 
126 };
127 
129 {
130 public:
131  const UT_String &getName() const { return myName; }
132  OP_Operator *getOperator() const { return myTableEntry; }
133 
134  // This function updates the hidden/disable flags on all parameters by
135  // asking both the conditionals and the overridden updateParmsFlags
136  // functions.
137  // Returns true if something was changed.
138  bool updateParmsAndSpareParmsFlags();
139 
140  // Clone a parameter by referencing all the parameters of the "from"
141  // OP_Parameters.
142  virtual unsigned referenceAllParameters(OP_Parameters *from,
143  bool relative_references = true);
144  /// Reference a single parameter from the @c from node. This builds a
145  /// channel reference for the given parameter index.
146  /// If the @c relative_path isn't specified, it will be computed as @code
147  /// from->getFullPath(frompath);
148  /// this->getFullPath(thispath);
149  /// relative_path.getRelativePath(thispath, frompath);
150  /// @endcode
151  virtual bool referenceSingleParameter(OP_Parameters *from,
152  int parm_idx,
153  const char *relative_path = NULL);
154 
155  // Methods for dealing with channels & key frames
156  void animate(unsigned idx);
157  void animate(const char *name);
158  void deAnimate(unsigned idx);
159  void deAnimate(const char *name);
160  CH_Channel *addChannel(const char *name);
161  CH_Channel *getChannel(const char *name);
162  const CH_Channel *getChannel(const char *name) const;
163  int destroyChannel(const char *name);
164 
165  bool isObsoleteChannel(const char *name) const;
166 
167  void takeActivateParm(uint idx, bool enable=true);
168  void takeActivateParm(const char *name, bool enable=true);
169  void takeActivateParm(PRM_Parm *parm, bool enable=true);
171  { takeActivateParm(idx, false); }
172  void takeDeactivateParm(const char *name)
173  { takeActivateParm(name, false); }
175  { takeActivateParm(parm, false); }
176 
177  bool takeIsActiveParm(uint idx);
178  bool takeIsActiveParm(const char *name);
179  bool takeIsActiveParm(const PRM_Parm *parm);
180 
181  // Activates the parm for the take if it should be automatically
182  // activated based on its current state and the current take state.
183  void takeAutoActivateParm(PRM_Parm *) override;
184 
185  fpreal findKey(fpreal t, int direction) const;
186 
187  PRM_ChanState getChanState(fpreal t, bool scoped_only) const;
189  { return getChanState(t, false); }
190  void updatePending(fpreal t);
191  bool isPending( fpreal t );
192 
193  OP_Channels *getChannels(void) const { return myChannels; }
194 
195  // This gets the variable value AS as string. Not the string corresponding
196  // to the specified index! Note that you should call the base class if you
197  // don't handle the given index.
198  virtual bool evalVariableValue(UT_String &val, int index,
199  int thread);
200  // Note that you should call the base class if you don't handle the given
201  // index.
202  virtual bool evalVariableValue(fpreal &val, int index, int thread);
203 
204  /// @deprecated Please override evalVariableValue() above instead
205  SYS_DEPRECATED(10.0)
206  virtual void getVariableString(int index, UT_String &value,
207  int thread);
208  /// @deprecated Please override the evalVariableValue() above instead
209  SYS_DEPRECATED(10.0)
210  virtual float getVariableValue(int index, int thread);
211 
212  int getNumParms() const
213  { return myParmList->getEntries(); }
214  int getParmIndex(const char *name) const
215  { return myParmList->getParmIndex(name); }
217  {
218  PRM_Parm *p = myParmList->getParmPtr(i);
219  UT_ASSERT(p);
220  return *p;
221  }
222  const PRM_Parm &getParm(int i) const
223  {
224  const PRM_Parm *p = myParmList->getParmPtr(i);
225  UT_ASSERT(p);
226  return *p;
227  }
228  PRM_Parm &getParm(const char *name)
229  {
230  PRM_Parm *p = myParmList->getParmPtr(name);
231  UT_ASSERT(p);
232  return *p;
233  }
234  const PRM_Parm &getParm(const char *name) const
235  {
236  const PRM_Parm *p = myParmList->getParmPtr(name);
237  UT_ASSERT(p);
238  return *p;
239  }
240  bool hasParm(const char *name) const
241  { return myParmList->getParmPtr(name) != 0; }
243  { return myParmList->getParmPtr(name); }
244  const PRM_Parm *getParmPtr(const UT_StringRef &name) const
245  { return myParmList->getParmPtr(name); }
246  PRM_Parm *getParmPtrInst(const char *name, const int *inst,
247  int nestlevel = 1);
248  const PRM_Parm *getParmPtrInst(const char *name, const int *inst,
249  int nestlevel = 1) const;
250 
251  // This function is called when our spare parm definition is changing.
252  // Parses the supplied dialog script and uses it to update the spare
253  // parms for this node.
254  virtual bool changeSpareParms(UT_IStream &ds, UT_String &errors);
255 
256  // Returns true if we are in the middle of chaning our spare parm
257  // definition. Lets us avoid handling certain events (such as multiparm
258  // change handling in OPUI_Dialog).
260  { return myChangingSpareParms; }
261 
262  // Utility for deleting all spare parms
263  void deleteAllSpareParms();
264 
265  // This is a secondary parm list where all obsolete parameters are
266  // placed (if any)
269  PRM_ParmList *&obsolete_parms) override;
270 
271  // After any call which might have loaded something into the ObsoleteList,
272  // we should call this to resolve those parameters:
273  virtual void resolveObsoleteParms(PRM_ParmList * /*obsolete_parms*/) { /*nothing at this level*/ }
274 
275  /// Sync the node assuming that it is currently at old_version to the
276  /// current_version.
277  virtual void syncNodeVersion(
278  const char *old_version,
279  const char *current_version,
280  bool *node_deleted)
281  { /*nothing at this level*/ }
282 
283  /// Track down the parameter associated with a given property
284  /// @{
285  virtual bool getParameterOrProperty(
286  const UT_StringRef &name,
287  fpreal now,
288  OP_Node *&op,
289  PRM_Parm *&parm,
290  bool create_missing_multiparms,
291  PRM_ParmList *obsolete=0);
292  virtual bool getParameterOrPropertyByChannel(
293  const UT_StringRef &chname,
294  fpreal now,
295  OP_Node *&op,
296  PRM_Parm *&parm,
297  int &vector_index,
298  PRM_ParmList *obsolete=0);
299  /// @}
300 
301  /// This just calls getParameterOrProperty() with
302  /// create_missing_multiparms=false and allows for const correctness.
304  const UT_StringRef &name,
305  fpreal now,
306  OP_Node *&op,
307  PRM_Parm *&parm,
308  PRM_ParmList *obsolete) const
309  {
310  return const_cast<OP_Parameters*>(this)->getParameterOrProperty(
311  name, now, op, parm, false, obsolete);
312  }
313 
314  /// Fill out the property lookup list with parameters.
315  /// Returns the total of found and resolved parameters in the list
316  /// (whether they were resolved by previous calls or this particular call,
317  /// ie, NOT the total of nodes found in this call)
318  virtual int findParametersOrProperties(fpreal now,
319  OP_PropertyLookupList &list);
320 
321  // Take a PRM_Parm pointer, and look at its value. If it is a simple
322  // channel reference, return the referenced node, parm, and vecidx.
324  OP_Node *&newop,
325  PRM_Parm *&newparm,
326  int &newvecidx)
327  {
328  return followChannelReferencesOneStepT(
329  opt, newop, newparm, newvecidx,
330  SYSgetSTID());
331  }
332  static bool followChannelReferencesOneStepT(const OP_FollowChanRefsOptions& opt,
333  OP_Node *&newop,
334  PRM_Parm *&newparm,
335  int &newvecidx,
336  int thread);
338  OP_Node *&newop,
339  PRM_Parm *&newparm,
340  int &newvecidx)
341  {
342  followChannelReferencesT(
343  opt, newop, newparm, newvecidx,
344  SYSgetSTID());
345  }
347  OP_Node *&newop,
348  PRM_Parm *&newparm,
349  int &newvecidx,
350  CH_Channel *chp
351  )
352  {
353  return followChannelReferencesWithDepsT(
354  opt, newop, newparm, newvecidx,
355  SYSgetSTID(), chp );
356  }
357  static void followChannelReferencesT(const OP_FollowChanRefsOptions& opt,
358  OP_Node *&newop,
359  PRM_Parm *&newparm,
360  int &newvecidx,
361  int thread);
362  static bool followChannelReferencesWithDepsT(const OP_FollowChanRefsOptions& opt,
363  OP_Node *&newop,
364  PRM_Parm *&newparm,
365  int &newvecidx,
366  int thread,
367  CH_Channel *chp
368  );
370  {
371  followChannelReferencesT(opt, ref, SYSgetSTID());
372  }
373  static void followChannelReferencesT(const OP_FollowChanRefsOptions& opt, CH_ChannelRef &ref,
374  int thread);
375 
376  static void getValueAsProcessedNodePaths(fpreal t,
377  UT_WorkBuffer &resultbuf,
378  PRM_Parm *parm, int index,
379  OP_Node *srcnode
380  );
381 
382  const OP_Stat &getStat() const { return myStats; }
383  OP_Stat &getStat() { return myStats; }
384 
385  // "vi" refers to the vector index. "pi" is the parameter index.
386  // "pn" refers to the parmeter name. "v" refers to the vector component.
387  // if v == -1, all components are affected.
388  bool enableParm(int pi, int state, int v = -1);
389  bool enableParm(const char *pn, int state, int v = -1);
390  bool enableParmInst(const char *name, const int *inst,
391  int state, int nestlevel = 1,
392  int v = -1);
393  unsigned getEnableState(int pi, int v = -1);
394  unsigned getEnableState(const char *pn, int v = -1);
395  unsigned getEnableStateInst(const char *name, const int *inst,
396  int nestlevel = 1, int v = -1);
397 
398  bool setVisibleState(int pi, bool state, int v = -1);
399  bool setVisibleState(const char *pn, bool state, int v = -1);
400  bool setVisibleStateInst(const char *name, const int *inst,
401  int state, int nestlevel = 1,
402  int v = -1);
403 
404  bool getVisibleState(int pi, int v = -1);
405  bool getVisibleState(const char *pn, int v = -1);
406 
407  /// @anchor OP_Node_EvalParameters
408 
409  /// @name Parameter evaluation
410  ///
411  /// - int pi @n Parameter index
412  /// - const char *pn @n Parameter name token
413  /// - int *pi @n Parameter index passed by reference, looked up
414  /// using 'pn'
415  /// - PRM_Parm *parm @n Parameter by reference
416  /// - int vi @n Component index of a parameter
417  /// - fpreal t @n Evaluation time
418  /// - int thread @n Thread id (ie. return value from SYSgetSTID())
419  // @{
420  exint evalInt(int pi, int vi, fpreal t) const
421  { return evalIntT(pi, vi, t, SYSgetSTID()); }
422  exint evalIntT(int pi, int vi, fpreal t, int thread) const;
423  exint evalInt(const UT_StringRef &pn, int vi, fpreal t) const
424  { return evalIntT(pn, vi, t, SYSgetSTID()); }
425  exint evalIntT(const UT_StringRef &pn, int vi, fpreal t,
426  int thread) const;
427  exint evalInt(const UT_StringRef &pn, int *pi, int vi,
428  fpreal t) const
429  { return evalIntT(pn, pi, vi, t, SYSgetSTID()); }
430  exint evalIntT(const UT_StringRef &pn, int *pi, int vi,
431  fpreal t, int thread) const;
432  exint evalInt(const PRM_Parm *parm, int vi, fpreal t) const
433  { return evalIntT(parm, vi, t, SYSgetSTID()); }
434  exint evalIntT(const PRM_Parm *parm, int vi, fpreal t,
435  int thread) const;
436 
437  fpreal evalFloat(int pi, int vi, fpreal t) const
438  { return evalFloatT(pi, vi, t, SYSgetSTID()); }
439  fpreal evalFloatT(int pi, int vi, fpreal t, int thread) const;
440  fpreal evalFloat(const UT_StringRef &pn, int vi,
441  fpreal t) const
442  { return evalFloatT(pn, vi, t, SYSgetSTID()); }
443  fpreal evalFloatT(const UT_StringRef &pn, int vi, fpreal t,
444  int thread) const;
445  fpreal evalFloat(const UT_StringRef &pn, int *pi, int vi,
446  fpreal t) const
447  { return evalFloatT(pn, pi, vi, t, SYSgetSTID()); }
448  fpreal evalFloatT(const UT_StringRef &pn, int *pi, int vi,
449  fpreal t, int thread) const;
450  fpreal evalFloat(const PRM_Parm *parm, int vi, fpreal t) const
451  { return evalFloatT(parm, vi, t, SYSgetSTID()); }
452  fpreal evalFloatT(const PRM_Parm *parm, int vi, fpreal t,
453  int thread) const;
454 
455  // Evaluate an array of floats
456  void evalFloats(int pi, fpreal64 *v, fpreal t) const
457  { return evalFloatsT(pi, v, t, SYSgetSTID()); }
458  void evalFloatsT(int pi, fpreal64 *v,
459  fpreal t, int thread) const;
460  void evalFloats(const UT_StringRef &pn, fpreal64 *v,
461  fpreal t) const
462  { return evalFloatsT(pn, v, t, SYSgetSTID()); }
463  void evalFloatsT(const UT_StringRef &pn, fpreal64 *v,
464  fpreal t, int thread) const;
465  void evalFloats(const UT_StringRef &pn, int *pi,
466  fpreal64 *v, fpreal t) const
467  { return evalFloatsT(pn, pi, v, t, SYSgetSTID()); }
468  void evalFloatsT(const UT_StringRef &pn, int *pi,
469  fpreal64 *v, fpreal t, int thread) const;
470  void evalFloats(const PRM_Parm *parm, fpreal64 *v, fpreal t) const
471  { return evalFloatsT(parm, v, t, SYSgetSTID()); }
472  void evalFloatsT(const PRM_Parm *parm, fpreal64 *v,
473  fpreal t, int thread) const;
474 
475  // @deprecated Please use the other evalFloats() versions
476  // @{
477  void evalFloatsT(int pi, fpreal32 *v,
478  fpreal t, int thread) const;
479  void evalFloats(int pi, fpreal32 *v, fpreal t) const
480  { return evalFloatsT(pi, v, t, SYSgetSTID()); }
481  void evalFloatsT(const UT_StringRef &pn, fpreal32 *v,
482  fpreal t, int thread) const;
483  void evalFloats(const UT_StringRef &pn, fpreal32 *v,
484  fpreal t) const
485  { return evalFloatsT(pn, v, t, SYSgetSTID()); }
486  void evalFloatsT(const UT_StringRef &pn, int *pi,
487  fpreal32 *v, fpreal t, int thread) const;
488  void evalFloats(const UT_StringRef &pn, int *pi,
489  fpreal32 *v, fpreal t) const
490  { return evalFloatsT(pn, pi, v, t, SYSgetSTID()); }
491  void evalFloatsT(const PRM_Parm *parm, fpreal32 *v,
492  fpreal t, int thread) const;
493  void evalFloats(const PRM_Parm *parm, fpreal32 *v,
494  fpreal t) const
495  { return evalFloatsT(parm, v, t, SYSgetSTID()); }
496  void evalFloatsInst(const UT_StringRef &name,
497  const int *inst,
498  fpreal32 *v, fpreal t,
499  int nestlevel = 1) const;
500  // @}
501 
502  // String evaluation, expanding any inline expressions (backticks) and
503  // variables
504  void evalString(UT_String &val, int pi, int vi,
505  fpreal t) const
506  { return evalStringT(val, pi, vi, t,SYSgetSTID()); }
507  void evalString(UT_StringHolder &val, int pi, int vi,
508  fpreal t) const
509  { return evalStringT(val, pi, vi, t,SYSgetSTID()); }
510  void evalStringT(UT_String &val, int pi, int vi, fpreal t,
511  int thread) const;
512  void evalStringT(UT_StringHolder &val, int pi, int vi,
513  fpreal t, int thread) const;
515  const UT_StringRef &pn, int vi,
516  fpreal t) const
517  { return evalStringT(val, pn, vi, t,SYSgetSTID()); }
519  const UT_StringRef &pn, int vi,
520  fpreal t) const
521  { return evalStringT(val, pn, vi, t,SYSgetSTID()); }
522  void evalStringT(UT_String &val,
523  const UT_StringRef &pn, int vi,
524  fpreal t, int thread) const;
525  void evalStringT(UT_StringHolder &val,
526  const UT_StringRef &pn, int vi,
527  fpreal t, int thread) const;
528  void evalString(UT_String &val, const char *pn, int *pi,
529  int vi, fpreal t) const
530  {
531  return evalStringT(val, pn, pi, vi, t,
532  SYSgetSTID());
533  }
535  const char *pn, int *pi,
536  int vi, fpreal t) const
537  {
538  return evalStringT(val, pn, pi, vi, t,
539  SYSgetSTID());
540  }
541  void evalStringT(UT_String &val,
542  const UT_StringRef &pn, int *pi,
543  int vi, fpreal t, int thread) const;
544  void evalStringT(UT_StringHolder &val,
545  const UT_StringRef &pn, int *pi,
546  int vi, fpreal t, int thread) const;
547  void evalString(UT_String &val, const PRM_Parm *parm,
548  int vi, fpreal t) const
549  {
550  return evalStringT(val, parm, vi, t,
551  SYSgetSTID());
552  }
554  int vi, fpreal t) const
555  {
556  return evalStringT(val, parm, vi, t,
557  SYSgetSTID());
558  }
559  void evalStringT(UT_String &val, const PRM_Parm *parm,
560  int vi, fpreal t, int thread) const;
561  void evalStringT(UT_StringHolder &val, const PRM_Parm *parm,
562  int vi, fpreal t, int thread) const;
563 
564  // String evaluation, with no expression or variable expansion
565  void evalStringRaw(UT_String &val, int pi, int vi,
566  fpreal t) const
567  {
568  return evalStringRawT(val, pi, vi, t,
569  SYSgetSTID());
570  }
571  void evalStringRawT(UT_String &val, int pi, int vi, fpreal t,
572  int thread) const;
574  const UT_StringRef &pn, int vi,
575  fpreal t) const
576  {
577  return evalStringRawT(val, pn, vi, t,
578  SYSgetSTID());
579  }
580  void evalStringRawT(UT_String &val,
581  const UT_StringRef &pn, int vi,
582  fpreal t, int thread) const;
584  int *pi, int vi, fpreal t) const
585  {
586  return evalStringRawT(val, pn, pi, vi, t,
587  SYSgetSTID());
588  }
589  void evalStringRawT(UT_String &val,
590  const UT_StringRef &pn, int *pi,
591  int vi, fpreal t, int thread) const;
592  void evalStringRaw(UT_String &val, const PRM_Parm *parm,
593  int vi, fpreal t) const
594  {
595  return evalStringRawT(val, parm, vi, t,
596  SYSgetSTID());
597  }
598  void evalStringRawT(UT_String &val, const PRM_Parm *parm,
599  int vi, fpreal t, int thread) const;
600 
601  PRM_DataItemHandle evalData(int pi, int vi, fpreal t) const
602  { return evalDataT(pi, vi, t, SYSgetSTID()); }
603  PRM_DataItemHandle evalDataT(int pi, int vi, fpreal t, int thread) const;
605  fpreal t) const
606  { return evalDataT(pn, vi, t, SYSgetSTID()); }
607  PRM_DataItemHandle evalDataT(const UT_StringRef &pn, int vi,
608  fpreal t, int thread) const;
609  PRM_DataItemHandle evalData(const UT_StringRef &pn, int *pi, int vi,
610  fpreal t) const
611  { return evalDataT(pn, pi, vi, t, SYSgetSTID()); }
612  PRM_DataItemHandle evalDataT(const UT_StringRef &pn, int *pi, int vi,
613  fpreal t, int thread) const;
614  PRM_DataItemHandle evalData(const PRM_Parm *parm, int vi, fpreal t) const
615  { return evalDataT(parm, vi, t, SYSgetSTID()); }
616  PRM_DataItemHandle evalDataT(const PRM_Parm *parm, int vi, fpreal t,
617  int thread) const;
618 
619  // JSON map evaluation, expanding any inline expressions (backticks) and
620  // variables
621  void evalJSONMap(UT_JSONValueMap &val, int pi, int vi,
622  fpreal t) const
623  { return evalJSONMapT(
624  val, pi, vi, t, SYSgetSTID()); }
625  void evalJSONMapT(UT_JSONValueMap &val, int pi, int vi,
626  fpreal t, int thread) const;
628  const UT_StringRef &pn,
629  int vi, fpreal t) const
630  { return evalJSONMapT(
631  val, pn, vi, t, SYSgetSTID()); }
632  void evalJSONMapT(UT_JSONValueMap &val,
633  const UT_StringRef &pn,
634  int vi, fpreal t, int thread) const;
636  const UT_StringRef &pn,
637  int *pi, int vi, fpreal t) const
638  {
639  return evalJSONMapT(
640  val, pn, pi, vi, t, SYSgetSTID());
641  }
642  void evalJSONMapT(UT_JSONValueMap &val,
643  const UT_StringRef &pn,
644  int *pi, int vi, fpreal t, int thread)
645  const;
647  const PRM_Parm *parm, int vi, fpreal t)
648  const
649  {
650  return evalJSONMapT(
651  val, parm, vi, t, SYSgetSTID());
652  }
653  void evalJSONMapT(UT_JSONValueMap &val,
654  const PRM_Parm *parm, int vi, fpreal t,
655  int thread) const;
656 
657  // JSON map evaluation, with no expression or variable expansion
658  void evalJSONMapRaw(UT_JSONValueMap &val, int pi, int vi,
659  fpreal t) const
660  {
661  return evalJSONMapRawT(
662  val, pi, vi, t, SYSgetSTID());
663  }
664  void evalJSONMapRawT(UT_JSONValueMap &val, int pi, int vi,
665  fpreal t, int thread) const;
667  const UT_StringRef &pn,
668  int vi, fpreal t) const
669  {
670  return evalJSONMapRawT(
671  val, pn, vi, t, SYSgetSTID());
672  }
673  void evalJSONMapRawT(UT_JSONValueMap &val,
674  const UT_StringRef &pn,
675  int vi, fpreal t, int thread) const;
677  const UT_StringRef &pn,
678  int *pi, int vi, fpreal t) const
679  {
680  return evalJSONMapRawT(
681  val, pn, pi, vi, t, SYSgetSTID());
682  }
683  void evalJSONMapRawT(UT_JSONValueMap &val,
684  const UT_StringRef &pn,
685  int *pi, int vi, fpreal t, int thread)
686  const;
688  const PRM_Parm *parm, int vi, fpreal t)
689  const
690  {
691  return evalJSONMapRawT(
692  val, parm, vi, t, SYSgetSTID());
693  }
694  void evalJSONMapRawT(UT_JSONValueMap &val,
695  const PRM_Parm *parm, int vi,
696  fpreal t, int thread) const;
697  // @}
698 
699  /// @name Multi-Parameter evaluation
700  ///
701  /// - name @n Parameter name token
702  /// - inst @n Array of instance indices to evaluate at
703  /// - vi @n Component index of a parameter
704  /// - t @n Evaluation time
705  /// - nestlevel @n Number of entries in 'inst'
706  /// - thread @n Thread id (ie. return value from SYSgetSTID())
707  // @{
709  const int *inst, int vi,
710  fpreal t, int nestlevel = 1) const
711  {
712  return evalIntInstT(name, inst, vi, t,
713  SYSgetSTID(), nestlevel);
714  }
715  exint evalIntInstT(const UT_StringRef &name,
716  const int *inst, int vi,
717  fpreal t, int thread,
718  int nestlevel = 1) const;
720  const int *inst, int vi,
721  fpreal t, int nestlevel = 1) const
722  {
723  return evalFloatInstT(name, inst, vi, t,
724  SYSgetSTID(), nestlevel);
725  }
726  fpreal evalFloatInstT(const UT_StringRef &name,
727  const int *inst, int vi,
728  fpreal t, int thread,
729  int nestlevel = 1) const;
731  const int *inst,
732  fpreal64 *v, fpreal t,
733  int nestlevel = 1) const
734  {
735  return evalFloatsInstT(name, inst, v, t,
736  SYSgetSTID(), nestlevel);
737  }
738  void evalFloatsInstT(const UT_StringRef &name,
739  const int *inst,
740  fpreal64 *v, fpreal t, int thread,
741  int nestlevel = 1) const;
743  const int *inst,
744  UT_String &val, int vi, fpreal t,
745  int nestlevel = 1) const
746  {
747  return evalStringInstT(name, inst, val, vi,
748  t, SYSgetSTID(), nestlevel);
749  }
750  void evalStringInstT(const UT_StringRef &name,
751  const int *inst,
752  UT_String &val, int vi, fpreal t,
753  int thread, int nestlevel = 1) const;
755  const int *inst,
756  UT_String &val, int vi, fpreal t,
757  int nestlevel = 1) const
758  {
759  return evalStringInstRawT(name, inst, val, vi,
760  t, SYSgetSTID(), nestlevel);
761  }
762  void evalStringInstRawT(const UT_StringRef &name,
763  const int *inst,
764  UT_String &val, int vi, fpreal t,
765  int thread,
766  int nestlevel = 1) const;
768  const int *inst, int vi,
769  fpreal t, int nestlevel = 1) const
770  {
771  return evalDataInstT(name, inst, vi, t,
772  SYSgetSTID(), nestlevel);
773  }
774  PRM_DataItemHandle evalDataInstT(const UT_StringRef &name,
775  const int *inst, int vi,
776  fpreal t, int thread,
777  int nestlevel = 1) const;
778  // @}
779 
780  /// @name Property evaluation
781  ///
782  /// Properties will be evaluated if the parameter is not found.
783  ///
784  /// - parm_name @n Parameter name token
785  /// - vec_index @n Component index of a parameter
786  /// - now @n Evaluation time
787  /// - thread @n Thread id (ie. return value from SYSgetSTID())
788  /// - parmptr @n optional source parameter return value
789  // @{
790  bool evalParameterOrProperty(const UT_StringRef &parm_name,
791  int vec_index,
792  fpreal now,
793  int &value,
794  PRM_Parm **parmptr = NULL) const
795  {
796  return evalParameterOrPropertyT(parm_name,
797  vec_index, now, value, SYSgetSTID(),
798  parmptr);
799  }
800  bool evalParameterOrPropertyT(const UT_StringRef &parm_name,
801  int vec_index,
802  fpreal now,
803  int &value,
804  int thread,
805  PRM_Parm **parmptr=NULL) const;
806  bool evalParameterOrProperty(const UT_StringRef &parm_name,
807  int vec_index,
808  fpreal now,
809  fpreal &values,
810  PRM_Parm **parmptr=NULL) const
811  {
812  return evalParameterOrPropertyT(parm_name,
813  vec_index, now, values, SYSgetSTID(),
814  parmptr);
815  }
816  bool evalParameterOrPropertyT(const UT_StringRef &parm_name,
817  int vec_index,
818  fpreal now,
819  fpreal &values, int thread,
820  PRM_Parm **parmptr=NULL) const;
821  bool evalParameterOrProperty(const UT_StringRef &parm_name,
822  int vec_index,
823  fpreal now,
824  UT_String &value,
825  PRM_Parm **parmptr=NULL) const
826  {
827  return evalParameterOrPropertyT(parm_name,
828  vec_index, now, value, SYSgetSTID(),
829  parmptr);
830  }
831  bool evalParameterOrPropertyT(const UT_StringRef &parm_name,
832  int vec_index,
833  fpreal now,
834  UT_String &value,
835  int thread,
836  PRM_Parm **parmptr=NULL) const;
838  const UT_StringRef &parm_name,
839  int vec_index,
840  fpreal now,
841  UT_String &value,
842  PRM_Parm **parmptr=NULL) const
843  {
844  return evalParameterOrPropertyRawT(parm_name,
845  vec_index, now, value, SYSgetSTID(),
846  parmptr);
847  }
848  bool evalParameterOrPropertyRawT(
849  const UT_StringRef &parm_name,
850  int vec_index,
851  fpreal now,
852  UT_String &value,
853  int thread,
854  PRM_Parm **parmptr=NULL) const;
856  const UT_StringRef &parm_name,
857  int vec_index,
858  fpreal now,
859  UT_String &value,
860  PRM_Parm **parmptr=NULL) const
861  {
862  return evalParameterOrPropertyExprT(parm_name,
863  vec_index, now, value, SYSgetSTID(),
864  parmptr);
865  }
866  bool evalParameterOrPropertyExprT(
867  const UT_StringRef &parm_name,
868  int vec_index,
869  fpreal now,
870  UT_String &value,
871  int thread,
872  PRM_Parm **parmptr=NULL) const;
873 
874  bool evalVectorProperty(const UT_StringRef &parm_name,
875  fpreal now,
876  int *values,
877  int vec_size,
878  PRM_Parm **parmptr = NULL) const
879  {
880  return evalVectorPropertyT(parm_name,
881  now, values, vec_size, SYSgetSTID(),
882  parmptr);
883  }
884  bool evalVectorPropertyT(const UT_StringRef &parm_name,
885  fpreal now,
886  int *values,
887  int vec_size,
888  int thread,
889  PRM_Parm **parmptr = NULL) const;
890  bool evalVectorProperty(const UT_StringRef &parm_name,
891  fpreal now,
892  fpreal *values,
893  int vec_size,
894  PRM_Parm **parmptr = NULL) const
895  {
896  return evalVectorPropertyT(parm_name,
897  now, values, vec_size, SYSgetSTID(),
898  parmptr);
899  }
900  bool evalVectorPropertyT(const UT_StringRef &parm_name,
901  fpreal now,
902  fpreal *values,
903  int vec_size,
904  int thread,
905  PRM_Parm **parmptr = NULL) const;
906  // @}
907 
908  /// @anchor OP_Node_SetParameters
909 
910  /// @name Setting parameter values
911  ///
912  /// - parmi @n Parameter index
913  /// - parmname @n Parameter name string
914  /// - vectori @n Component index of a parameter
915  /// - t @n Evaluation time
916  /// - value @n Value to set
917  /// - h @n If true, it will set a keyframe if the parameter
918  /// has a channel. If false, then the value will
919  /// need to committed first.
920  // @{
921  void setInt(int parmi, int vectori, fpreal t, exint value);
922  void setInt(const char *parmname, int vectori, fpreal t, exint value);
923  void setInt(const char *parmname, int &parmi, int vectori, fpreal t,
924  exint value);
925  void setFloat(int parmi, int vectori, fpreal t,
926  fpreal value,
928  void setFloat(const char *parmname, int vectori, fpreal t,
929  fpreal value,
931  void setFloat(const char *parmname, int &parmi, int vectori,
932  fpreal t, fpreal value,
934  void setString(const UT_StringRef &val,
935  CH_StringMeaning meaning,
936  int parmi, int vectori,
937  fpreal t);
938  void setString(const UT_StringRef &val,
939  CH_StringMeaning meaning,
940  const char *parmname, int vectori, fpreal t);
941  void setString(const UT_StringRef &val,
942  CH_StringMeaning meaning,
943  const char *parmname,
944  int &parmi, int vectori, fpreal t);
945  void setData(int parmi, int vectori, fpreal t,
946  const PRM_DataItemHandle &val);
947  void setData(const char *parmname, int vectori, fpreal t,
948  const PRM_DataItemHandle &val);
949  void setData(const char *parmname, int &parmi, int vectori, fpreal t,
950  const PRM_DataItemHandle &val);
951  // @}
952 
953  /// @name Setting parameter values, following channel references
954  ///
955  /// These functions will follow simple channel references first, and then
956  /// set the value on the destination parameter.
957  ///
958  /// - pi @n Parameter index
959  /// - pn @n Parameter name string
960  /// - vi @n Component index of a parameter
961  /// - t @n Time at which to set the value
962  /// - val @n Value to set
963  /// - add_key @n If PRM_AK_SET_KEY, it will set a keyframe if the
964  /// parameter has a channel and the current value differs.
965  /// If PRM_AK_FORCE_KEY, it will set a keyframe if the
966  /// parameter has a channel regardless of the current value.
967  /// If PRM_AK_MARK_PENDING, then the value will need to be
968  /// committed first.
969  /// - propagate @n If true, it notify observers
970  /// - thread @n Thread id (ie. return value from SYSgetSTID())
971  // @{
972  void setChRefInt(int pi, int vi, fpreal t, exint val,
974  bool propagate=true);
975  void setChRefInt(const char *pn, int vi, fpreal t, exint val,
977  bool propagate=true);
978  void setChRefFloat(int pi, int vi, fpreal t, fpreal val,
979  PRM_AddKeyType add_key=
981  bool propagate=true);
982  void setChRefFloat(const char *pn, int vi, fpreal t,
983  fpreal val,
984  PRM_AddKeyType add_key=
986  bool propagate=true);
987  void setChRefString(const UT_StringRef &val,
988  CH_StringMeaning meaning,
989  int pi, int vi,
990  fpreal t,
991  PRM_AddKeyType add_key=
993  bool propagate=true);
994  void setChRefString(int pi, int vi,
995  fpreal t,
996  const UT_StringRef &val,
997  CH_StringMeaning meaning,
998  PRM_AddKeyType add_key=
1000  bool propagate=true)
1001  {
1002  setChRefString(val, meaning, pi, vi, t,
1003  add_key, propagate);
1004  }
1005  void setChRefString(const UT_StringRef &val,
1006  CH_StringMeaning meaning,
1007  const char *pn,
1008  int vi, fpreal t,
1009  PRM_AddKeyType add_key=
1011  bool propagate=true);
1012  void setChRefString(const char *pn,
1013  int vi, fpreal t,
1014  const UT_StringRef &val,
1015  CH_StringMeaning meaning,
1016  PRM_AddKeyType add_key=
1018  bool propagate=true)
1019  {
1020  setChRefString(val, meaning, pn, vi, t,
1021  add_key, propagate);
1022  }
1023  // @}
1024 
1025  /// @name Setting property values
1026  ///
1027  /// The setParameterOrProperty methods will track down, not only channel
1028  /// references, but also property parameter references.
1029  /// The bool result indicates whether the parameter was actually set.
1030  /// Some possible causes of failure are:
1031  /// - Parameter or property not found
1032  /// - Permissions error
1033  /// - Locked parameter
1034  /// - Out of bounds vector index
1035  ///
1036  /// Parameters:
1037  /// - parm_name @n Parameter name string
1038  /// - vec_index @n Component index of a parameter
1039  /// - now @n Time at which to set the value
1040  /// - val @n Value to set
1041  /// - set_key @n If true, it will set a keyframe if the parameter
1042  /// has a channel. If false, then the value will
1043  /// need to committed first.
1044  /// - propagate @n If true, it notify observers
1045  // @{
1046  bool setParameterOrProperty(const char *parm_name,
1047  int vec_index,
1048  fpreal now,
1049  int32 value,
1050  bool set_key=false,
1051  bool propagate=true);
1052  bool setParameterOrProperty(const char *parm_name,
1053  int vec_index,
1054  fpreal now,
1055  int64 value,
1056  bool set_key=false,
1057  bool propagate=true);
1058  bool setParameterOrProperty(const char *parm_name,
1059  int vec_index,
1060  fpreal now,
1061  fpreal value,
1062  bool set_key=false,
1063  bool propagate=true);
1064  bool setParameterOrProperty(const char *parm_name,
1065  int vec_index,
1066  fpreal now,
1067  const char *value,
1068  CH_StringMeaning meaning,
1069  bool set_key=false,
1070  bool propagate=true);
1071  // @}
1072 
1073  /// @name Multi-Parameter evaluation
1074  ///
1075  /// - name @n Parameter name token
1076  /// - inst @n Array of instance indices to evaluate at
1077  /// - vectori @n Component index of a parameter
1078  /// - t @n Evaluation time
1079  /// - nestlevel @n Number of entries in 'inst'
1080  /// - value @n Value to set
1081  // @{
1082  void setIntInst(exint value, const char *parmname,
1083  const int *inst, int vectori, fpreal t,
1084  int nestlevel = 1);
1085  void setFloatInst(fpreal value, const char *parmname,
1086  const int *inst, int vectori, fpreal t,
1087  int nestlevel = 1);
1088  void setStringInst(const UT_StringRef &value,
1089  CH_StringMeaning meaning,
1090  const char *parmname,
1091  const int *inst, int vectori, fpreal t,
1092  int nestlevel = 1);
1093  void setDataInst(const PRM_DataItemHandle &value,
1094  const char *parmname, const int *inst,
1095  int vectori, fpreal t, int nestlevel = 1);
1096  // @}
1097 
1098  /// @name Setting parameter values silently
1099  ///
1100  /// These methods do not trigger additional events to notify observers
1101  ///
1102  /// - int pi @n Parameter index
1103  /// - const char *pn @n Parameter name string
1104  /// - int &pi @n Parameter index, returned from 'pn' lookup
1105  /// - int vi @n Component index of a parameter
1106  /// - fpreal t @n Time at which to set the value
1107  /// - value @n Value to set
1108  // @{
1109  void setSilentInt(int parmi, int vectori, fpreal t,
1110  exint value);
1111  void setSilentInt(const char *parmname, int vectori,
1112  fpreal t, exint value);
1113  void setSilentInt(const char *parmname, int &parmi,
1114  int vectori, fpreal t,exint value);
1115 
1116  void setSilentFloat(int parmi, int vectori, fpreal t,
1117  fpreal value,
1119  void setSilentFloat(const char *parmname, int vectori,
1120  fpreal t, fpreal value,
1122  void setSilentFloat(const char *parmname,
1123  int &parmi, int vectori,
1124  fpreal t, fpreal value,
1126 
1127  void setSilentString(const UT_StringRef &value,
1128  CH_StringMeaning meaning,
1129  int parmi, int vectori, fpreal t);
1130  void setSilentString(const UT_StringRef &value,
1131  CH_StringMeaning meaning,
1132  const char *parmname, int vectori, fpreal t);
1133  void setSilentString(const UT_StringRef &value,
1134  CH_StringMeaning meaning,
1135  const char *parmname,
1136  int &parmi, int vectori, fpreal t);
1137  void setSilentData(int parmi, int vectori, fpreal t,
1138  const PRM_DataItemHandle &value);
1139  void setSilentData(const char *parmname, int vectori,
1140  fpreal t, const PRM_DataItemHandle &value);
1141  void setSilentData(const char *parmname,
1142  int &parmi, int vectori, fpreal t,
1143  const PRM_DataItemHandle &value);
1144 
1145  void setSilentIntInst(exint value, const char *parmname,
1146  const int *inst, int vectori,
1147  fpreal t, int nestlevel = 1);
1148  void setSilentFloatInst(fpreal value, const char *parmname,
1149  const int *inst, int vectori,
1150  fpreal t, int nestlevel = 1);
1151  void setSilentStringInst(const UT_StringRef &value,
1152  CH_StringMeaning meaning,
1153  const char *parmname,
1154  const int *inst, int vectori,
1155  fpreal t, int nestlevel = 1);
1156  void setSilentDataInst(const PRM_DataItemHandle &value,
1157  const char *parmname, const int *inst,
1158  int vectori, fpreal t, int nestlevel = 1);
1159  // @}
1160 
1161  CH_StringMeaning getStringMeaning(int pi, int vi, fpreal t) const;
1162  CH_StringMeaning getStringMeaning(const char *pn, int vi,
1163  fpreal t) const;
1164  CH_StringMeaning getStringMeaningInst(const char *name, const int *inst,
1165  int vi, fpreal t, int nest_level = 1) const;
1166 
1167  // Batch setting of parameters. The value stored in the batch list will be
1168  // assigned to the operator/parameter which the parameter was last
1169  // evaluated from. This assumes that the parameter list has actually been
1170  // evaluated. Modifications will be done in block mode.
1171  static void setBatchParms(PRM_BatchList &list, fpreal now,
1172  bool set_key=false,
1173  bool create_channels=false);
1174  static bool canSetBatchParms(PRM_BatchList &list, fpreal now);
1175 
1176  // When a new expression is created it will use the node's expression
1177  // language.
1178  CH_ExprLanguage getExprLanguage() const override;
1179  void setExprLanguage(CH_ExprLanguage language);
1180 
1181  // multiparm manipulation
1182  void insertMultiParmItem(const char *pn, int i);
1183  void removeMultiParmItem(const char *pn, int i);
1184 
1185  /// updateMultiParmFromRamp() will follow simple channel references as
1186  /// necessary
1187  void updateMultiParmFromRamp(fpreal t, const UT_Ramp &ramp,
1188  PRM_Parm &m, bool add_wrap,
1190  void updateRampFromMultiParm(fpreal t, const PRM_Parm &m,
1191  UT_Ramp &ramp, bool *time_dep = NULL,
1192  DEP_MicroNode *depnode = NULL) const;
1193 
1194  // This method converts an obsolete animated parm to a string parm. It
1195  // will create the necessary backticks for expressions. It does not,
1196  // however, support keyframed channel data or multiple-segment channels,
1197  // in which case the evaluated value at the given time is returned.
1198  // It also does not support CHOP overrides.
1199  // When reset_obs is true, the obsolete parameter is reset to factory
1200  // defaults after the expression has been extracted.
1201  // Returns true if successful, and false otherwise. False is returned
1202  // if the obsolete is at the factory default.
1203  bool convertObsAnimatedToStringExpression(
1204  PRM_ParmList *obsolete_parms,
1205  const char *pn, int vi, fpreal t,
1206  UT_String &result, bool reset_obs);
1207 
1208  /// Expand expressions within string value.
1209  ///
1210  /// This method will expand backtick expressions and local/global
1211  /// variables by modifying the input string. Always use this method instead
1212  /// of calling CH_Manager::expandString() directly within node evaluation
1213  /// code paths in order to establish proper node dependencies.
1214  ///
1215  /// @param channel_name Channel name of the parameter from where val
1216  /// was obtained from. This is important for
1217  /// establishing data and time dependencies.
1218  ///
1219  bool expandString(UT_String &val, fpreal t, int thread,
1220  const char *channel_name = 0);
1221 
1222  virtual int findString(const char *str, bool fullword,
1223  bool usewildcards) const;
1224  virtual int changeString(const char *from, const char *to,
1225  bool fullword);
1226 
1227  // These methods check to see if the current value differs from
1228  // the cached ones. The time is the time to evaluate the parm at,
1229  // this does NOT support independent dirty flags for multiple times
1230  // (and likely you wouldn't want that anyways)
1231  // cacheParmValues ONLY saves those who had been tested for dirtiness
1232  //
1233  // NOTE: This is deprecated, please use the override the
1234  // OP_Node::parmListMicroNode() method to detect parm value changes.
1235  //
1236  // This legacy mechanism will cause your parameter to be evaluated
1237  // multiple times per cook.
1238  bool isParmDirty(int idx, fpreal t);
1239  bool isParmDirty(const char *n, fpreal t);
1240  bool isParmDirtyInst(const char *name, const int *inst,
1241  fpreal t, int nestlevel=1);
1242  void cacheParmValues(const OP_Context &context);
1243  void clearParmCache();
1244 
1245  /// Query if a parameter is time dependent, by parm index. If comp == -1,
1246  /// any vector component that is time dependent will return true for the
1247  /// parm.
1248  bool isParmTimeDependent(int idx, int comp = -1) const;
1249 
1250  /// Query if a parameter is time dependent, by parm name. If comp == -1,
1251  /// any vector component that is time dependent will return true for the
1252  /// parm.
1253  bool isParmTimeDependent(const char *name,
1254  int comp = -1) const;
1255 
1256  // error stuff
1257  int getErrorMessages(UT_String &messages,
1259  = UT_ERROR_NONE)
1260  {
1261  ensureErrorsAreUpdatedSubclass();
1262 
1263  OP_Lock::Scope lock(myErrorManagerLock);
1264  stealGlobalErrors();
1265  return myErrorManager.getErrorMessages(messages,
1266  severity);
1267  }
1268 
1269  virtual void getRawErrors(UT_Array<UT_Error> &errors, bool update);
1270 
1271  int findError(const char *type, int code) const
1272  {
1273  OP_Lock::Scope lock(myErrorManagerLock);
1274  return myErrorManager.findError(type, code);
1275  }
1276 
1277  int removeError(int idx)
1278  {
1279  OP_Lock::Scope lock(myErrorManagerLock);
1280  return myErrorManager.removeError(idx);
1281  }
1282 
1284  {
1285  OP_Lock::Scope lock(myErrorManagerLock);
1286  myErrorManager.pruneDuplicates();
1287  }
1288 
1289  void opMessage(int code, const char *m=0) const
1290  { UTaddMessage("OP",code,m);}
1291  void opWarning(int code, const char *m=0) const
1292  { UTaddWarning("OP",code,m);}
1293  void opError(int code, const char *m=0) const
1294  { UTaddError("OP", code, m);}
1295  void opFatal(int code, const char *m=0) const
1296  { UTaddFatal("OP", code, m);}
1297 
1298  void opLocalError(int code, const char *m=0)
1299  {
1300  OP_Lock::Scope lock(myErrorManagerLock);
1301  myErrorManager.addError("OP", code, m);
1302  }
1303  void opLocalWarning(int code, const char *m=0)
1304  {
1305  OP_Lock::Scope lock(myErrorManagerLock);
1306  myErrorManager.addWarning("OP",code,m);
1307  }
1309  {
1310  OP_Lock::Scope lock(myErrorManagerLock);
1311  myErrorManager.addDeadlockError();
1312  }
1313 
1314  /// appendError() adds a generic error *directly* to this node's error
1315  /// manager.
1316  void appendError(const char *type,
1317  int code, const char *m,
1318  UT_ErrorSeverity sev)
1319  {
1320  if (!UTgetErrorManager()->isDisabled())
1321  {
1322  OP_Lock::Scope lock(myErrorManagerLock);
1323  myErrorManager.addGeneric(type, code, m, sev);
1324  }
1325  }
1326 
1327  void clearErrors() // use error(OP_Context&) to avoid querying the current thread id
1328  {
1330  OP_Lock::Scope lock(myErrorManagerLock);
1331  myErrorManager.clearAndDestroyErrors();
1332  }
1333 
1335  {
1336  UTgetErrorManager(context.getThread())->clearAndDestroyErrors();
1337  OP_Lock::Scope lock(myErrorManagerLock);
1338  myErrorManager.clearAndDestroyErrors();
1339  }
1340 
1341  virtual OP_ERROR getErrorSeverity();
1342 
1343  bool hasDeadlockError() const
1344  {
1345  // We intentionally do NOT lock in this case
1346  return myErrorManager.hasDeadlockError();
1347  }
1348 
1350  {
1351  ensureErrorsAreUpdatedSubclass();
1352 
1353  UT_ErrorManager &mgr = *UTgetErrorManager(context.getThread());
1354  if (mgr.getNumErrors() > 0)
1355  {
1356  stealGlobalErrors();
1357  }
1358  else
1359  {
1360  // Even if we have no errors, we still need to
1361  // update the severity because error logging
1362  // might be disabled.
1363  myErrorManager.updateSeverity(
1364  mgr.getSeverity());
1365  }
1366  return myErrorManager.getSeverity();
1367  }
1368  virtual OP_ERROR error() // use error(OP_Context&) to avoid querying the current thread id
1369  {
1370  ensureErrorsAreUpdatedSubclass();
1371 
1373  if (mgr.getNumErrors() > 0)
1374  {
1375  stealGlobalErrors();
1376  }
1377  else
1378  {
1379  // Even if we have no errors, we still need to
1380  // update the severity because error logging
1381  // might be disabled.
1382  myErrorManager.updateSeverity(
1383  mgr.getSeverity());
1384  }
1385  return myErrorManager.getSeverity();
1386  }
1387  void stealErrors(UT_ErrorManager &src,
1388  bool borrow_only = false);
1389  OP_ERROR getSaveError();
1390  bool isGettingSaveError() const
1391  { return myIsGettingSaveError; }
1392 
1393  // This method should only be called from OP_Channels.
1394  void addChannelError(const char *type, int code,
1395  const char *msg = 0);
1396 
1397  void chChanged(CH_Channel *ch, CH_CHANGE_TYPE reason);
1398 
1399  virtual void saveParmsForUndo(bool scopedOnly = false,
1400  CH_Collection *collection = NULL);
1401  void saveSingleParmForUndo(PRM_Parm *parm);
1402  void saveParmForUndo(PRM_Parm *);
1403  virtual void saveKeyFrameForUndo(CH_Channel *chp, fpreal gtime);
1404 
1405  // Clear any undo flags for the node in question
1406  virtual void clearUndoFlags();
1407  virtual void setAnyUndoFlag();
1408  int getAnyUndoPending() const { return myAnyUndoFlagSet; }
1409 
1410  int canAccess(unsigned mask) const;
1411  bool canAccess(unsigned mask, const PRM_Parm *parm) const;
1412  bool canAccessChannel(uint mask,
1413  const CH_Channel *chp) const;
1414  void updateUserMask();
1415 
1416  bool canModifyFromUI(const PRM_Parm *parm, int vi) const;
1417 
1418  // If an OP references external files, this method should be implemented to
1419  // reload new data which is out of date with the external file. If data
1420  // was re-loaded, then the method should return 1 (otherwise 0).
1421  virtual int reloadNewFiles(fpreal time_now);
1422 
1423  void triggerOPChanged(OP_EventType reason, int index);
1424 
1425  void parmChanged( int parm_index );
1426  void parmExprChanged(int parm_index);
1427 
1428  // This is called when our OP_Operator is deleted before we are.
1429  void operatorDeleted();
1430 
1431  // These functions deal with the opparm command.
1432  void saveParmCommand(std::ostream &os, int values = 0,
1433  int defaultstoo = 1,
1434  bool spareparms = true) const;
1435  int loadParmCommand(int argc, const char *const argv[],
1436  int docallbacks, void *data,
1437  fpreal now, bool followchrefs,
1438  CMD_Args *args);
1439  void commandParmCallback(void *data, fpreal now,
1440  int argc, char *argv[],
1441  CMD_Args *args);
1442  void saveMultiParmInstanceCommand(
1443  std::ostream &os,
1444  const char *opname,
1445  bool spareparms) const;
1446 
1447  // Run the callback function for a particular parm, and the callbacks
1448  // of any parms linked to this parm. This function is implemented in
1449  // OP_Node.
1450  virtual bool triggerParmCallback(PRM_Parm *parmptr, fpreal now,
1451  int value, void *data,
1452  const UT_Options *options = 0) = 0;
1453 
1454  int64 getMemoryUsage(bool inclusive) const override;
1455 
1456  void bumpTakeReference(int dir)
1457  { myTakeReferences += dir; }
1458  int getTakeReferences() const
1459  { return myTakeReferences; }
1460 
1461 
1462  /// This method will create channel groups and populate them with
1463  /// channels from this operator. The channel groups created will
1464  /// correspond to the folders in this operator's parameters.
1465  /// Unless only_channels is specified, all auto-scoped parms will get
1466  /// included.
1467  void createChannelGroupsFromFolders(CH_Group &parent_group,
1468  bool only_channels,
1469  bool leaf_channels_only = false,
1470  bool only_unlocked = true);
1471 
1472  /// Returns a list of the autoscopeable channels for this node.
1473  /// if follow_layer_overrides is true, the channel references are followed but only for animation layers.
1474  /// if include_animated is true, channels without the auto scope flag but with animation will also be returned.
1475  void getAutoScopedChannels(CH_ChannelRefList &chlist,
1476  bool follow_layer_overrides=true,
1477  bool include_animated=false,
1478  bool follow_channel_refs=true,
1479  bool include_autoscope=true
1480  );
1481 
1482  // Returns command to chopscope CHOPed channels for this node.
1483  void getChopScopeChannels(UT_WorkBuffer &chopscope_cmd);
1484 
1485  // Returns true if the specified parameter is visible in the interface
1486  // templates. This accounts for visiblity of containing parm pages
1487  // as well as the parm itself.
1488  bool getParmIsVisible(const char *parmname);
1489 
1490  // Returns a pointer to the templates used in constructing dialogs for
1491  // this node.
1492  const PRM_Template *getInterfaceParmTemplates() const;
1493 
1494  const PRM_Template *getSpareParmTemplates() const;
1495  const PRM_ScriptImports *getSpareParmTemplateImports() const;
1496  const PRM_Template *getSpareParmLayoutTemplates() const;
1497  const PRM_ScriptImports *getSpareParmLayoutTemplateImports() const;
1498  int getSpareParmTemplatesId() const;
1499 
1500  /// The number of potential spare inputs created by spare
1501  /// parameters. These are spare_input0 and onwards. There may be holes.
1502  int numSpareInputs() const;
1503 
1504  // Get our multiparm instance info used by initMultiparmInstance.
1505  bool hasMultiparmInfo() const;
1506  OP_MultiparmInfo &getMultiparmInfo();
1507 
1508  // This function is caled when any multiparm has a new instance added.
1509  // It gives the parm owner a chance to initialize the multiparm values.
1510  void initMultiparmInstance(UT_ValArray<PRM_Parm *> &parms) override;
1511  // This function sends an opChanged notification of our multiparm change.
1512  void addOrRemoveMultiparmInstance() override;
1513 
1514  bool savePresetContents(std::ostream &os) override;
1515  bool loadPresetContents(const char *tok, UT_IStream &is) override;
1516 
1517  static void buildMParmInst(const PRM_Template *templates,
1518  UT_StringArray &mparm_inst,
1519  UT_IntArray &mparm_lvl,
1520  int level);
1521  static bool isMParmInstance(const char *chname,
1522  const UT_StringArray &mparm_inst,
1523  const UT_IntArray &mparm_lvl);
1524 
1525  // Retrieve Animation Layers from a Scoped Channel List
1526  static void getLayersFromScopedChannels(
1527  const CH_ChannelRefList &ori_refs,
1528  CH_ChannelRefList &layer_refs );
1529 
1530  // setChRef* methods with name resolution of the parameter index
1531  // @{
1532  void setChRefInt(const char *parmname, int &pi, int vi, fpreal t, exint val,
1534  bool propagate=true);
1535  void setChRefFloat(const char *parmname, int &pi, int vi, fpreal t, fpreal val,
1536  PRM_AddKeyType add_key=
1538  bool propagate=true);
1539  void setChRefString(const UT_StringRef &val,
1540  CH_StringMeaning meaning,
1541  const char *parmname, int &pi, int vi,
1542  fpreal t,
1543  PRM_AddKeyType add_key=
1545  bool propagate=true);
1546  // @}
1547 
1548  void createParmMicroNode(const UT_StringRef &pn, int *pi );
1549 
1550  /// Returns the name of the toggle parameter that controls the activation
1551  /// state of the parameter by the given name.
1552  static UT_StringHolder getParmActivationToggleName(
1553  const UT_StringRef &parm_name);
1554 
1555 protected:
1556  virtual void doGetFullPath(UT_WorkBuffer &str) const override;
1557 
1558  // Uses the specified conditional stored on the PRM_Template for the
1559  // specified parameter to check whether the specified parm should
1560  // be updated based on the conditional. Returns false if the parm state
1561  // doesn't change.
1562  bool updateParmDisableConditional(
1563  PRM_Parm &parm,
1564  bool force,
1565  const UT_StringArray *skip = 0);
1566 
1567  bool updateParmHideConditional(
1568  PRM_Parm &parm,
1569  const UT_StringArray *skip = 0);
1570 
1571  // Uses a toggle parameter that corresponds to the main paramter to decide
1572  // whether the main paramter is enabled/disabled. The correspondence
1573  // is implicit by parameter naming conventions.
1574  bool updateParmDisableIfInactive(PRM_Parm &parm);
1575 
1576  // Returns zero if no change was made. This function is overridden
1577  // by subclasses to disable parms specific to those nodes.
1578  // NOTE: Superseded by the updateParmsFlags() function.
1579  SYS_DEPRECATED(12.0)
1580  virtual unsigned disableParms();
1581 
1582  // This function is overridden by subclasses to update parm flags specific
1583  // to those nodes.
1584  // Returns false if no change was made.
1585  virtual bool updateParmsFlags() { return false; }
1586 
1587 
1588  void saveMultiParmForUndo(int index);
1589 
1590  void stealGlobalErrors();
1591  void stealErrors(OP_Parameters &src);
1592 
1593  // NOTE: Do not hold onto the ptr object longer than necessary!
1596  {
1598  myErrorManager, myErrorManagerLock);
1599  }
1600 
1601  virtual void permissionError(const char *chname = 0);
1602 
1603  // checkExpressionError() is split up into a checking part and an actual
1604  // error handling part, evaluationError() so that the checking part can
1605  // be inlined.
1607  const PRM_Parm *parm, int thread) const
1608  {
1609  int err = ev_GetErrNo(thread);
1610  if (err == EV_NOERROR)
1611  return false;
1612  evaluationError(parm, err, thread);
1613  return true;
1614  }
1615 
1616  void resetParmEventHandler();
1617 
1618  int *allocIndirect(int size=64);
1619 
1620  OP_Parameters(const char *name, OP_Operator *entry);
1621  OP_Parameters(const OP_Parameters &source, const char *name);
1622  virtual ~OP_Parameters();
1623 
1624  //
1625  // The "initializeParms" method must be called to provide the channel
1626  // collection and build the parameter list.
1627  //
1628  void initializeParms(OP_Channels *channels);
1629 
1630  // op dependencies
1631  virtual void buildOpDependencies()
1632  { }
1633  virtual void checkChannelDependencies(CH_Channel * /*ch*/,
1634  CH_CHANGE_TYPE /*reason*/)
1635  { }
1636 
1637  static bool isReservedOpName(const char *name);
1638 
1639  virtual int rename(const char *newname);
1640  virtual bool createSpareParameterFromChannel(const char *chname);
1641  virtual bool createSpareParametersFromChannels(
1643  const CH_ChannelList &channels);
1644 
1645  CH_LocalVariable *getVariable(int i) const;
1646  CH_LocalVariable *getVariable(const char *name) const;
1647 
1648  //
1649  //
1650  OP_ERROR saveChannels(std::ostream &os, int binary,
1651  bool compiled, int selected);
1652  OP_ERROR saveParmChannels(int parm_index, std::ostream &os,
1653  int binary, bool compiled);
1654  OP_ERROR saveParameters(std::ostream &os, int binary,
1655  bool compiled);
1656  OP_ERROR saveChannelAliases(std::ostream &os, int binary);
1657 
1658  bool loadChannels(UT_IStream &is, const char *path,
1659  CH_Collection *obsolete_channels);
1660  bool loadParameters(UT_IStream &is, const char *path,
1661  PRM_ParmList *obsolete_parms);
1662  bool loadChannelAliases(UT_IStream &is, const char *path=0);
1663  bool loadOldSpareParms(UT_IStream &is);
1664 
1665  // Allow our sub-class to be notified when something gets changed
1666  // Since the parameter only holds the name & the parameters, there
1667  // are only two types of events generated here...
1668  virtual void opChanged(OP_EventType type, void *dataptr = 0) = 0;
1669 
1670  /// This is a helper method to the setChannelScope method. It traverses
1671  /// the node's parameters and sets the scope on them according to the
1672  /// given pattern.
1673  virtual void traverseScope(const char *pattern, OP_ScopeOp scope_op,
1674  const OP_ScopeOptions &scope_options);
1675 
1676  // A virtual method to get access to the associated node flag. This would
1677  // probably be unnecessary if myTakeReferences were used.
1678  virtual int getHasTakeData() const { return 0 ;}
1679 
1680  /// Ensure that the node errors are up-to-date.
1681  /// This method gives our subclass a chance to insert any errors on-demand.
1683 
1684  /// Ensure that the spare parameter templates are up-to-date.
1685  /// This method gives our subclass a chance to update the spare parameters
1686  /// on-the-fly before returning them.
1688 
1691 
1692 private:
1693 
1694  // When the spare parameter definitions for a node changes, this function
1695  // is called to update the parameters to be in line with the new set of
1696  // templates. The old templates must still exist at this point.
1697  virtual void updateSpareParmTemplates(
1698  PRM_Template *newtemplates,
1699  bool leavedefaultsunchanged) = 0;
1700 
1701  template<class T>
1702  void traverseScopeT(const char *pattern, OP_ScopeOp scope_op,
1703  const OP_ScopeOptions &scope_options);
1704 
1705  // evaluationError() generates the appropriate call to opError() and then
1706  // clears the expression error state.
1707  void evaluationError(const PRM_Parm *parm, int err,
1708  int thread) const;
1709 
1710  // these methods are the actual instantiation of the set... and
1711  // setSilent... methods.
1712  void setFullInt(int parmi, int vectori, fpreal t,
1713  exint value, bool p);
1714  void setFullInt(const char *parmname, int vectori, fpreal t,
1715  exint value, bool p);
1716  void setFullInt(const char *parmname, int &parmi,
1717  int vectori, fpreal t, exint value, bool p);
1718 
1719 
1720  void setFullFloat(int pi, int vi, fpreal t, fpreal val,
1721  PRM_AddKeyType add_key, bool propagate);
1722  void setFullFloat(const char *pn, int vi, fpreal t,
1723  fpreal val, PRM_AddKeyType add_key,
1724  bool propagate);
1725  void setFullFloat(const char *pn, int &pi, int vi,
1726  fpreal t, fpreal val,
1727  PRM_AddKeyType add_key, bool propagate);
1728 
1729  void setFullString(const UT_StringRef &val,
1730  CH_StringMeaning meaning, int pi, int vi,
1731  fpreal t, bool ppropagate);
1732  void setFullString(const UT_StringRef &val,
1733  CH_StringMeaning meaning,
1734  const char *pn,
1735  int vi, fpreal t, bool propagate);
1736  void setFullString(const UT_StringRef &val,
1737  CH_StringMeaning meaning,
1738  const char *pn,
1739  int &pi, int vi, fpreal t,
1740  bool propagate);
1741 
1742  void setFullData(int pi, int vi, fpreal t,
1743  const PRM_DataItemHandle &val, bool p);
1744  void setFullData(const char *pn, int vi, fpreal t,
1745  const PRM_DataItemHandle &val, bool p);
1746  void setFullData(const char *pn, int &pi, int vi, fpreal t,
1747  const PRM_DataItemHandle &val, bool p);
1748 
1749  void setFullIntInst(exint value, const char *parmname,
1750  const int *inst, int vectori, fpreal t,
1751  int nestlevel, bool propagate);
1752  void setFullFloatInst(fpreal val, const char *name,
1753  const int *inst, int vi, fpreal t,
1754  int nestlevel, bool propagate);
1755  void setFullStringInst(const UT_StringRef &val,
1756  CH_StringMeaning meaning,
1757  const char *name,
1758  const int *inst, int vi, fpreal t,
1759  int nestlevel, bool propagate);
1760  void setFullDataInst(const PRM_DataItemHandle &val,
1761  const char *name, const int *inst,
1762  int vi, fpreal t, int nestlevel,
1763  bool propagate);
1764 
1765  // Set values given a parameter pointer (rather than a lookup index).
1766  // These all take add_key and propagate parameters.
1767  bool setFull(PRM_Parm &parm, int vectori, fpreal now,
1768  exint value, PRM_AddKeyType add_key,
1769  bool propgate);
1770  bool setFull(PRM_Parm &parm, int vectori, fpreal now,
1771  fpreal val, PRM_AddKeyType add_key,
1772  bool propgate);
1773  bool setFull(PRM_Parm &parm, int vectori, fpreal now,
1774  const char *value,
1775  CH_StringMeaning meaning,
1776  PRM_AddKeyType add_key, bool propgate);
1777  bool setFull(PRM_Parm &parm, int vectori, fpreal now,
1778  const PRM_DataItemHandle &val,
1779  PRM_AddKeyType add_key, bool propgate);
1780 
1781  bool determineParmVisibility(const char *parmname,
1782  const PRM_Template *prm,
1783  bool &visible);
1784 
1785  // Event handler
1786  static void changeEvent(void *, CH_CHANGE_TYPE, int);
1787 
1788  static void addLayerFromScopedChannels(
1789  const UT_StringRef &path,
1790  CH_ChannelRefList &chanrefs,
1791  UT_StringSet &scoped_layers);
1792 
1793  mutable OP_Lock myErrorManagerLock;
1794  UT_ErrorManager myErrorManager;
1795 
1796  UT_String myName;
1797  OP_Operator *myTableEntry;
1798  uint myTakeReferences;
1799 
1800  unsigned myUndoAllParmSavedFlag:1,
1801  myUndoScopedSavedFlag:1,
1802  myAnyUndoFlagSet:1,
1803  myIsGettingSaveError:1;
1804 
1805  OP_ParmCache *myParmCache;
1806 
1807  OP_SpareParms *mySpareParms;
1808  bool myChangingSpareParms;
1809 
1810  OP_MultiparmInfo *myMultiparmInfo;
1811 
1812  friend class OP_TakeParm;
1813  friend class OP_UndoParm;
1814  friend class OP_UndoSpareParm;
1815 };
1816 
1817 // helper functions
1818 
1819 OP_API PRM_Parm *OPgetParameterFromChannel( CH_Channel *chp, int *vecidx );
1823 
1824 #endif
OP_API void OPtakeAutoActivateChannel(CH_Channel *chp)
OP_ScopeType myScopeType
UT_ErrorSeverity getSeverity()
void evalFloats(const UT_StringRef &pn, int *pi, fpreal64 *v, fpreal t) const
GT_API const UT_StringHolder selection
PRM_AddKeyType
Definition: PRM_Parm.h:57
#define EV_NOERROR
Definition: EX_Error.h:18
void evalJSONMapRaw(UT_JSONValueMap &val, int pi, int vi, fpreal t) const
GLsizeiptr size
Definition: glew.h:1681
OP_ScopeOptions(bool allow_nonchannels, bool exclude_animated, bool exclude_constant, bool include_only_nonint_keys, bool scoped_related_layers, OP_ScopeType scope_type)
Definition: OP_Parameters.h:90
UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects.
GLenum src
Definition: glew.h:2410
GLenum GLint ref
Definition: glew.h:1845
void takeDeactivateParm(PRM_Parm *parm)
bool evalParameterOrPropertyRaw(const UT_StringRef &parm_name, int vec_index, fpreal now, UT_String &value, PRM_Parm **parmptr=NULL) const
#define SYS_DEPRECATED(__V__)
GLuint const GLchar * name
Definition: glew.h:1814
virtual OP_ERROR error()
virtual int64 getMemoryUsage(bool inclusive) const
virtual void checkChannelDependencies(CH_Channel *, CH_CHANGE_TYPE)
const UT_String & getName() const
bool evalVectorProperty(const UT_StringRef &parm_name, fpreal now, fpreal *values, int vec_size, PRM_Parm **parmptr=NULL) const
fpreal evalFloat(const UT_StringRef &pn, int *pi, int vi, fpreal t) const
CH_ExprLanguage
const Args & args
Definition: printf.h:628
void opWarning(int code, const char *m=0) const
void skip(T &in, int n)
Definition: ImfXdr.h:885
CH_StringMeaning
GLuint index
Definition: glew.h:1814
void evalFloats(int pi, fpreal32 *v, fpreal t) const
int getAnyUndoPending() const
IMF_EXPORT IMATH_NAMESPACE::V3f direction(const IMATH_NAMESPACE::Box2i &dataWindow, const IMATH_NAMESPACE::V2f &pixelPosition)
GLuint const GLfloat * val
Definition: glew.h:2794
OIIO_API bool rename(string_view from, string_view to, std::string &err)
UT_API UT_ErrorSeverity UTaddFatal(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
void evalJSONMap(UT_JSONValueMap &val, const PRM_Parm *parm, int vi, fpreal t) const
GLenum severity
Definition: glew.h:2579
GLint GLsizei const GLuint64 * values
Definition: glew.h:3612
PRM_DataItemHandle evalData(const UT_StringRef &pn, int vi, fpreal t) const
bool evalVectorProperty(const UT_StringRef &parm_name, fpreal now, int *values, int vec_size, PRM_Parm **parmptr=NULL) const
fpreal evalFloat(int pi, int vi, fpreal t) const
void evalFloatsInst(const UT_StringRef &name, const int *inst, fpreal64 *v, fpreal t, int nestlevel=1) const
UT_ErrorSeverity
Definition: UT_Error.h:25
GLsizei GLsizei GLchar * source
Definition: glew.h:1832
SYS_FORCE_INLINE bool checkExpressionError(const PRM_Parm *parm, int thread) const
UT_API UT_ErrorManager * UTgetErrorManager()
void evalJSONMap(UT_JSONValueMap &val, const UT_StringRef &pn, int *pi, int vi, fpreal t) const
void evalJSONMapRaw(UT_JSONValueMap &val, const PRM_Parm *parm, int vi, fpreal t) const
const GLdouble * m
Definition: glew.h:9124
const GLdouble * v
Definition: glew.h:1391
void opLocalDeadlockError()
GLenum GLint GLuint mask
Definition: glew.h:1845
void appendError(const char *type, int code, const char *m, UT_ErrorSeverity sev)
exint evalInt(const UT_StringRef &pn, int vi, fpreal t) const
void evalJSONMapRaw(UT_JSONValueMap &val, const UT_StringRef &pn, int *pi, int vi, fpreal t) const
UT_API UT_ErrorSeverity UTaddMessage(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
bool isGettingSaveError() const
void takeDeactivateParm(const char *name)
void clearErrors(OP_Context &context)
void bumpTakeReference(int dir)
OP_Channels * getChannels(void) const
virtual void takeAutoActivateParm(PRM_Parm *)=0
void clearDuplicateErrors()
virtual OP_ERROR error(OP_Context &context)
fpreal evalFloat(const UT_StringRef &pn, int vi, fpreal t) const
exint evalInt(const PRM_Parm *parm, int vi, fpreal t) const
PRM_DataItemHandle evalData(const PRM_Parm *parm, int vi, fpreal t) const
PRM_Parm & getParm(int i)
long long int64
Definition: SYS_Types.h:111
virtual bool savePresetContents(std::ostream &os)=0
bool evalParameterOrProperty(const UT_StringRef &parm_name, int vec_index, fpreal now, UT_String &value, PRM_Parm **parmptr=NULL) const
fpreal evalFloat(const PRM_Parm *parm, int vi, fpreal t) const
void opLocalError(int code, const char *m=0)
void evalJSONMapRaw(UT_JSONValueMap &val, const UT_StringRef &pn, int vi, fpreal t) const
CH_CHANGE_TYPE
void evalString(UT_String &val, const PRM_Parm *parm, int vi, fpreal t) const
static bool followChannelReferencesWithDeps(const OP_FollowChanRefsOptions &opt, OP_Node *&newop, PRM_Parm *&newparm, int &newvecidx, CH_Channel *chp)
void evalString(UT_String &val, const UT_StringRef &pn, int vi, fpreal t) const
PRM_Parm * getParmPtr(const UT_StringRef &name)
int64 exint
Definition: SYS_Types.h:120
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
void evalString(UT_String &val, int pi, int vi, fpreal t) const
const GLuint GLenum const void * binary
Definition: glew.h:3502
void evalFloats(int pi, fpreal64 *v, fpreal t) const
PRM_ChanState
Definition: PRM_ChanState.h:14
double fpreal64
Definition: SYS_Types.h:196
const PRM_Parm & getParm(int i) const
PRM_DataItemHandle evalDataInst(const UT_StringRef &name, const int *inst, int vi, fpreal t, int nestlevel=1) const
bool myScopedRelatedLayers
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void evalJSONMap(UT_JSONValueMap &val, int pi, int vi, fpreal t) const
void setChRefString(int pi, int vi, fpreal t, const UT_StringRef &val, CH_StringMeaning meaning, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING, bool propagate=true)
bool hasParm(const char *name) const
GLsizei n
Definition: glew.h:4040
void evalString(UT_StringHolder &val, int pi, int vi, fpreal t) const
virtual void resolveAndDeleteObsoleteParmList(PRM_ParmList *&obsolete_parms)=0
bool hasDeadlockError() const
OP_Channels * myChannels
fpreal evalFloatInst(const UT_StringRef &name, const int *inst, int vi, fpreal t, int nestlevel=1) 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 CH_ExprLanguage getExprLanguage() const =0
virtual void buildOpDependencies()
int int32
Definition: SYS_Types.h:39
bool myIncludeOnlyNonIntKeys
bool getIsChangingSpareParms() const
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
PRM_DataItemHandle evalData(int pi, int vi, fpreal t) const
void evalFloats(const PRM_Parm *parm, fpreal32 *v, fpreal t) const
virtual void addOrRemoveMultiparmInstance()=0
int removeError(int idx)
unsigned int uint
Definition: SYS_Types.h:44
void evalStringRaw(UT_String &val, int pi, int vi, fpreal t) const
int findError(const char *type, int code) const
OP_FollowChanRefsOptions(fpreal t)
PRM_ChanState isAtKey(fpreal t) const
void evalStringInstRaw(const UT_StringRef &name, const int *inst, UT_String &val, int vi, fpreal t, int nestlevel=1) const
virtual void ensureErrorsAreUpdatedSubclass()
static void followChannelReferences(const OP_FollowChanRefsOptions &opt, OP_Node *&newop, PRM_Parm *&newparm, int &newvecidx)
virtual void ensureSpareParmsAreUpdatedSubclass()
GLsizei const GLchar *const * path
Definition: glew.h:6461
void evalStringRaw(UT_String &val, const PRM_Parm *parm, int vi, fpreal t) const
exint evalInt(const UT_StringRef &pn, int *pi, int vi, fpreal t) const
GLfloat GLfloat p
Definition: glew.h:16321
void clearAndDestroyErrors()
PRM_Parm & getParm(const char *name)
double fpreal
Definition: SYS_Types.h:276
A map of string to various well defined value types.
Definition: UT_Options.h:42
void evalStringInst(const UT_StringRef &name, const int *inst, UT_String &val, int vi, fpreal t, int nestlevel=1) const
void opLocalWarning(int code, const char *m=0)
SYS_API int SYSgetSTID()
void evalString(UT_StringHolder &val, const UT_StringRef &pn, int vi, fpreal t) const
virtual void resolveObsoleteParms(PRM_ParmList *)
bool getParameterOrPropertyConst(const UT_StringRef &name, fpreal now, OP_Node *&op, PRM_Parm *&parm, PRM_ParmList *obsolete) const
void evalString(UT_StringHolder &val, const char *pn, int *pi, int vi, fpreal t) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
void evalJSONMap(UT_JSONValueMap &val, const UT_StringRef &pn, int vi, fpreal t) const
#define OP_API
Definition: OP_API.h:10
const PRM_Parm & getParm(const char *name) const
bool evalParameterOrProperty(const UT_StringRef &parm_name, int vec_index, fpreal now, int &value, PRM_Parm **parmptr=NULL) const
OP_API void OPsaveChannelForUndo(CH_Channel *chp)
void evalString(UT_String &val, const char *pn, int *pi, int vi, fpreal t) const
OP_API PRM_Parm * OPgetParameterFromChannel(CH_Channel *chp, int *vecidx)
void evalStringRaw(UT_String &val, const UT_StringRef &pn, int *pi, int vi, fpreal t) const
void evalFloats(const PRM_Parm *parm, fpreal64 *v, fpreal t) const
UT_API UT_ErrorSeverity UTaddWarning(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
virtual bool loadPresetContents(const char *token, UT_IStream &is)=0
virtual void initMultiparmInstance(UT_ValArray< PRM_Parm * > &p)=0
bool evalParameterOrPropertyExpr(const UT_StringRef &parm_name, int vec_index, fpreal now, UT_String &value, PRM_Parm **parmptr=NULL) const
void opMessage(int code, const char *m=0) const
OP_EventType
Definition: OP_Value.h:22
A global error manager scope.
const OP_Stat & getStat() const
static bool followChannelReferencesOneStep(const OP_FollowChanRefsOptions &opt, OP_Node *&newop, PRM_Parm *&newparm, int &newvecidx)
PRM_DataItemHandle evalData(const UT_StringRef &pn, int *pi, int vi, fpreal t) const
void takeDeactivateParm(uint idx)
int getErrorMessages(UT_String &messages, UT_ErrorSeverity severity=UT_ERROR_NONE)
GLuint64EXT * result
Definition: glew.h:14007
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
exint evalInt(int pi, int vi, fpreal t) const
OP_API void OPsaveChannelsForUndo(const CH_ChannelList &channels)
GLubyte * pattern
Definition: glew.h:5711
exint evalIntInst(const UT_StringRef &name, const int *inst, int vi, fpreal t, int nestlevel=1) const
virtual void syncNodeVersion(const char *old_version, const char *current_version, bool *node_deleted)
virtual void doGetFullPath(UT_WorkBuffer &buf) const =0
Compute the full path of the node.
OP_Operator * getOperator() const
void opError(int code, const char *m=0) const
void evalFloats(const UT_StringRef &pn, fpreal64 *v, fpreal t) const
const PRM_Parm * getParmPtr(const UT_StringRef &name) const
OP_ScopeOp
Definition: OP_Parameters.h:58
int getParmIndex(const char *name) const
int getThread() const
Definition: OP_Context.h:81
void evalFloats(const UT_StringRef &pn, fpreal32 *v, fpreal t) const
bool evalParameterOrProperty(const UT_StringRef &parm_name, int vec_index, fpreal now, fpreal &values, PRM_Parm **parmptr=NULL) const
GLsizei const GLfloat * value
Definition: glew.h:1849
void evalString(UT_StringHolder &val, const PRM_Parm *parm, int vi, fpreal t) const
float fpreal32
Definition: SYS_Types.h:195
GLint level
Definition: glew.h:1252
UT_LockedRawPtr< UT_ErrorManager, OP_Lock > getLockedErrorManager()
GLboolean enable
Definition: glew.h:2745
GLdouble GLdouble t
Definition: glew.h:1398
int getNumErrors() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:88
int getTakeReferences() const
static void followChannelReferences(const OP_FollowChanRefsOptions &opt, CH_ChannelRef &ref)
virtual int getHasTakeData() const
Definition: OP_PostIt.h:42
void evalStringRaw(UT_String &val, const UT_StringRef &pn, int vi, fpreal t) const
UT_API UT_ErrorSeverity UTaddError(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
void opFatal(int code, const char *m=0) const
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
void setChRefString(const char *pn, int vi, fpreal t, const UT_StringRef &val, CH_StringMeaning meaning, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING, bool propagate=true)
virtual PRM_ParmList * createObsoleteParmList()=0
OP_ScopeType
Definition: OP_Parameters.h:65
void evalFloats(const UT_StringRef &pn, int *pi, fpreal32 *v, fpreal t) const
OP_Stat & getStat()