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  }
751  const int *inst,
752  UT_StringHolder &val, int vi, fpreal t,
753  int nestlevel = 1) const
754  {
755  return evalStringInstT(name, inst, val, vi,
756  t, SYSgetSTID(), nestlevel);
757  }
758  void evalStringInstT(const UT_StringRef &name,
759  const int *inst,
760  UT_String &val, int vi, fpreal t,
761  int thread, int nestlevel = 1) const;
762  void evalStringInstT(const UT_StringRef &name,
763  const int *inst,
764  UT_StringHolder &val, int vi, fpreal t,
765  int thread, int nestlevel = 1) const;
767  const int *inst,
768  UT_String &val, int vi, fpreal t,
769  int nestlevel = 1) const
770  {
771  return evalStringInstRawT(name, inst, val, vi,
772  t, SYSgetSTID(), nestlevel);
773  }
774  void evalStringInstRawT(const UT_StringRef &name,
775  const int *inst,
776  UT_String &val, int vi, fpreal t,
777  int thread,
778  int nestlevel = 1) const;
780  const int *inst, int vi,
781  fpreal t, int nestlevel = 1) const
782  {
783  return evalDataInstT(name, inst, vi, t,
784  SYSgetSTID(), nestlevel);
785  }
786  PRM_DataItemHandle evalDataInstT(const UT_StringRef &name,
787  const int *inst, int vi,
788  fpreal t, int thread,
789  int nestlevel = 1) const;
790  // @}
791 
792  /// @name Property evaluation
793  ///
794  /// Properties will be evaluated if the parameter is not found.
795  ///
796  /// - parm_name @n Parameter name token
797  /// - vec_index @n Component index of a parameter
798  /// - now @n Evaluation time
799  /// - thread @n Thread id (ie. return value from SYSgetSTID())
800  /// - parmptr @n optional source parameter return value
801  // @{
802  bool evalParameterOrProperty(const UT_StringRef &parm_name,
803  int vec_index,
804  fpreal now,
805  int &value,
806  PRM_Parm **parmptr = NULL) const
807  {
808  return evalParameterOrPropertyT(parm_name,
809  vec_index, now, value, SYSgetSTID(),
810  parmptr);
811  }
812  bool evalParameterOrPropertyT(const UT_StringRef &parm_name,
813  int vec_index,
814  fpreal now,
815  int &value,
816  int thread,
817  PRM_Parm **parmptr=NULL) const;
818  bool evalParameterOrProperty(const UT_StringRef &parm_name,
819  int vec_index,
820  fpreal now,
821  fpreal &values,
822  PRM_Parm **parmptr=NULL) const
823  {
824  return evalParameterOrPropertyT(parm_name,
825  vec_index, now, values, SYSgetSTID(),
826  parmptr);
827  }
828  bool evalParameterOrPropertyT(const UT_StringRef &parm_name,
829  int vec_index,
830  fpreal now,
831  fpreal &values, int thread,
832  PRM_Parm **parmptr=NULL) const;
833  bool evalParameterOrProperty(const UT_StringRef &parm_name,
834  int vec_index,
835  fpreal now,
836  UT_String &value,
837  PRM_Parm **parmptr=NULL) const
838  {
839  return evalParameterOrPropertyT(parm_name,
840  vec_index, now, value, SYSgetSTID(),
841  parmptr);
842  }
843  bool evalParameterOrPropertyT(const UT_StringRef &parm_name,
844  int vec_index,
845  fpreal now,
846  UT_String &value,
847  int thread,
848  PRM_Parm **parmptr=NULL) const;
850  const UT_StringRef &parm_name,
851  int vec_index,
852  fpreal now,
853  UT_String &value,
854  PRM_Parm **parmptr=NULL) const
855  {
856  return evalParameterOrPropertyRawT(parm_name,
857  vec_index, now, value, SYSgetSTID(),
858  parmptr);
859  }
860  bool evalParameterOrPropertyRawT(
861  const UT_StringRef &parm_name,
862  int vec_index,
863  fpreal now,
864  UT_String &value,
865  int thread,
866  PRM_Parm **parmptr=NULL) const;
868  const UT_StringRef &parm_name,
869  int vec_index,
870  fpreal now,
871  UT_String &value,
872  PRM_Parm **parmptr=NULL) const
873  {
874  return evalParameterOrPropertyExprT(parm_name,
875  vec_index, now, value, SYSgetSTID(),
876  parmptr);
877  }
878  bool evalParameterOrPropertyExprT(
879  const UT_StringRef &parm_name,
880  int vec_index,
881  fpreal now,
882  UT_String &value,
883  int thread,
884  PRM_Parm **parmptr=NULL) const;
885 
886  bool evalVectorProperty(const UT_StringRef &parm_name,
887  fpreal now,
888  int *values,
889  int vec_size,
890  PRM_Parm **parmptr = NULL) const
891  {
892  return evalVectorPropertyT(parm_name,
893  now, values, vec_size, SYSgetSTID(),
894  parmptr);
895  }
896  bool evalVectorPropertyT(const UT_StringRef &parm_name,
897  fpreal now,
898  int *values,
899  int vec_size,
900  int thread,
901  PRM_Parm **parmptr = NULL) const;
902  bool evalVectorProperty(const UT_StringRef &parm_name,
903  fpreal now,
904  fpreal *values,
905  int vec_size,
906  PRM_Parm **parmptr = NULL) const
907  {
908  return evalVectorPropertyT(parm_name,
909  now, values, vec_size, SYSgetSTID(),
910  parmptr);
911  }
912  bool evalVectorPropertyT(const UT_StringRef &parm_name,
913  fpreal now,
914  fpreal *values,
915  int vec_size,
916  int thread,
917  PRM_Parm **parmptr = NULL) const;
918  // @}
919 
920  /// @anchor OP_Node_SetParameters
921 
922  /// @name Setting parameter values
923  ///
924  /// - parmi @n Parameter index
925  /// - parmname @n Parameter name string
926  /// - vectori @n Component index of a parameter
927  /// - t @n Evaluation time
928  /// - value @n Value to set
929  /// - h @n If true, it will set a keyframe if the parameter
930  /// has a channel. If false, then the value will
931  /// need to committed first.
932  // @{
933  void setInt(int parmi, int vectori, fpreal t, exint value);
934  void setInt(const char *parmname, int vectori, fpreal t, exint value);
935  void setInt(const char *parmname, int &parmi, int vectori, fpreal t,
936  exint value);
937  void setFloat(int parmi, int vectori, fpreal t,
938  fpreal value,
940  void setFloat(const char *parmname, int vectori, fpreal t,
941  fpreal value,
943  void setFloat(const char *parmname, int &parmi, int vectori,
944  fpreal t, fpreal value,
946  void setString(const UT_StringRef &val,
947  CH_StringMeaning meaning,
948  int parmi, int vectori,
949  fpreal t);
950  void setString(const UT_StringRef &val,
951  CH_StringMeaning meaning,
952  const char *parmname, int vectori, fpreal t);
953  void setString(const UT_StringRef &val,
954  CH_StringMeaning meaning,
955  const char *parmname,
956  int &parmi, int vectori, fpreal t);
957  void setData(int parmi, int vectori, fpreal t,
958  const PRM_DataItemHandle &val);
959  void setData(const char *parmname, int vectori, fpreal t,
960  const PRM_DataItemHandle &val);
961  void setData(const char *parmname, int &parmi, int vectori, fpreal t,
962  const PRM_DataItemHandle &val);
963  // @}
964 
965  /// @name Setting parameter values, following channel references
966  ///
967  /// These functions will follow simple channel references first, and then
968  /// set the value on the destination parameter.
969  ///
970  /// - pi @n Parameter index
971  /// - pn @n Parameter name string
972  /// - vi @n Component index of a parameter
973  /// - t @n Time at which to set the value
974  /// - val @n Value to set
975  /// - add_key @n If PRM_AK_SET_KEY, it will set a keyframe if the
976  /// parameter has a channel and the current value differs.
977  /// If PRM_AK_FORCE_KEY, it will set a keyframe if the
978  /// parameter has a channel regardless of the current value.
979  /// If PRM_AK_MARK_PENDING, then the value will need to be
980  /// committed first.
981  /// - propagate @n If true, it notify observers
982  /// - thread @n Thread id (ie. return value from SYSgetSTID())
983  // @{
984  void setChRefInt(int pi, int vi, fpreal t, exint val,
986  bool propagate=true);
987  void setChRefInt(const char *pn, int vi, fpreal t, exint val,
989  bool propagate=true);
990  void setChRefFloat(int pi, int vi, fpreal t, fpreal val,
991  PRM_AddKeyType add_key=
993  bool propagate=true);
994  void setChRefFloat(const char *pn, int vi, fpreal t,
995  fpreal val,
996  PRM_AddKeyType add_key=
998  bool propagate=true);
999  void setChRefString(const UT_StringRef &val,
1000  CH_StringMeaning meaning,
1001  int pi, int vi,
1002  fpreal t,
1003  PRM_AddKeyType add_key=
1005  bool propagate=true);
1006  void setChRefString(int pi, int vi,
1007  fpreal t,
1008  const UT_StringRef &val,
1009  CH_StringMeaning meaning,
1010  PRM_AddKeyType add_key=
1012  bool propagate=true)
1013  {
1014  setChRefString(val, meaning, pi, vi, t,
1015  add_key, propagate);
1016  }
1017  void setChRefString(const UT_StringRef &val,
1018  CH_StringMeaning meaning,
1019  const char *pn,
1020  int vi, fpreal t,
1021  PRM_AddKeyType add_key=
1023  bool propagate=true);
1024  void setChRefString(const char *pn,
1025  int vi, fpreal t,
1026  const UT_StringRef &val,
1027  CH_StringMeaning meaning,
1028  PRM_AddKeyType add_key=
1030  bool propagate=true)
1031  {
1032  setChRefString(val, meaning, pn, vi, t,
1033  add_key, propagate);
1034  }
1035  // @}
1036 
1037  /// @name Setting property values
1038  ///
1039  /// The setParameterOrProperty methods will track down, not only channel
1040  /// references, but also property parameter references.
1041  /// The bool result indicates whether the parameter was actually set.
1042  /// Some possible causes of failure are:
1043  /// - Parameter or property not found
1044  /// - Permissions error
1045  /// - Locked parameter
1046  /// - Out of bounds vector index
1047  ///
1048  /// Parameters:
1049  /// - parm_name @n Parameter name string
1050  /// - vec_index @n Component index of a parameter
1051  /// - now @n Time at which to set the value
1052  /// - val @n Value to set
1053  /// - set_key @n If true, it will set a keyframe if the parameter
1054  /// has a channel. If false, then the value will
1055  /// need to committed first.
1056  /// - propagate @n If true, it notify observers
1057  // @{
1058  bool setParameterOrProperty(const char *parm_name,
1059  int vec_index,
1060  fpreal now,
1061  int32 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  int64 value,
1068  bool set_key=false,
1069  bool propagate=true);
1070  bool setParameterOrProperty(const char *parm_name,
1071  int vec_index,
1072  fpreal now,
1073  fpreal value,
1074  bool set_key=false,
1075  bool propagate=true);
1076  bool setParameterOrProperty(const char *parm_name,
1077  int vec_index,
1078  fpreal now,
1079  const char *value,
1080  CH_StringMeaning meaning,
1081  bool set_key=false,
1082  bool propagate=true);
1083  // @}
1084 
1085  /// @name Multi-Parameter evaluation
1086  ///
1087  /// - name @n Parameter name token
1088  /// - inst @n Array of instance indices to evaluate at
1089  /// - vectori @n Component index of a parameter
1090  /// - t @n Evaluation time
1091  /// - nestlevel @n Number of entries in 'inst'
1092  /// - value @n Value to set
1093  // @{
1094  void setIntInst(exint value, const char *parmname,
1095  const int *inst, int vectori, fpreal t,
1096  int nestlevel = 1);
1097  void setFloatInst(fpreal value, const char *parmname,
1098  const int *inst, int vectori, fpreal t,
1099  int nestlevel = 1);
1100  void setStringInst(const UT_StringRef &value,
1101  CH_StringMeaning meaning,
1102  const char *parmname,
1103  const int *inst, int vectori, fpreal t,
1104  int nestlevel = 1);
1105  void setDataInst(const PRM_DataItemHandle &value,
1106  const char *parmname, const int *inst,
1107  int vectori, fpreal t, int nestlevel = 1);
1108  // @}
1109 
1110  /// @name Setting parameter values silently
1111  ///
1112  /// These methods do not trigger additional events to notify observers
1113  ///
1114  /// - int pi @n Parameter index
1115  /// - const char *pn @n Parameter name string
1116  /// - int &pi @n Parameter index, returned from 'pn' lookup
1117  /// - int vi @n Component index of a parameter
1118  /// - fpreal t @n Time at which to set the value
1119  /// - value @n Value to set
1120  // @{
1121  void setSilentInt(int parmi, int vectori, fpreal t,
1122  exint value);
1123  void setSilentInt(const char *parmname, int vectori,
1124  fpreal t, exint value);
1125  void setSilentInt(const char *parmname, int &parmi,
1126  int vectori, fpreal t,exint value);
1127 
1128  void setSilentFloat(int parmi, int vectori, fpreal t,
1129  fpreal value,
1131  void setSilentFloat(const char *parmname, int vectori,
1132  fpreal t, fpreal value,
1134  void setSilentFloat(const char *parmname,
1135  int &parmi, int vectori,
1136  fpreal t, fpreal value,
1138 
1139  void setSilentString(const UT_StringRef &value,
1140  CH_StringMeaning meaning,
1141  int parmi, int vectori, fpreal t);
1142  void setSilentString(const UT_StringRef &value,
1143  CH_StringMeaning meaning,
1144  const char *parmname, int vectori, fpreal t);
1145  void setSilentString(const UT_StringRef &value,
1146  CH_StringMeaning meaning,
1147  const char *parmname,
1148  int &parmi, int vectori, fpreal t);
1149  void setSilentData(int parmi, int vectori, fpreal t,
1150  const PRM_DataItemHandle &value);
1151  void setSilentData(const char *parmname, int vectori,
1152  fpreal t, const PRM_DataItemHandle &value);
1153  void setSilentData(const char *parmname,
1154  int &parmi, int vectori, fpreal t,
1155  const PRM_DataItemHandle &value);
1156 
1157  void setSilentIntInst(exint value, const char *parmname,
1158  const int *inst, int vectori,
1159  fpreal t, int nestlevel = 1);
1160  void setSilentFloatInst(fpreal value, const char *parmname,
1161  const int *inst, int vectori,
1162  fpreal t, int nestlevel = 1);
1163  void setSilentStringInst(const UT_StringRef &value,
1164  CH_StringMeaning meaning,
1165  const char *parmname,
1166  const int *inst, int vectori,
1167  fpreal t, int nestlevel = 1);
1168  void setSilentDataInst(const PRM_DataItemHandle &value,
1169  const char *parmname, const int *inst,
1170  int vectori, fpreal t, int nestlevel = 1);
1171  // @}
1172 
1173  CH_StringMeaning getStringMeaning(int pi, int vi, fpreal t) const;
1174  CH_StringMeaning getStringMeaning(const char *pn, int vi,
1175  fpreal t) const;
1176  CH_StringMeaning getStringMeaningInst(const char *name, const int *inst,
1177  int vi, fpreal t, int nest_level = 1) const;
1178 
1179  // Batch setting of parameters. The value stored in the batch list will be
1180  // assigned to the operator/parameter which the parameter was last
1181  // evaluated from. This assumes that the parameter list has actually been
1182  // evaluated. Modifications will be done in block mode.
1183  static void setBatchParms(PRM_BatchList &list, fpreal now,
1184  bool set_key=false,
1185  bool create_channels=false);
1186  static bool canSetBatchParms(PRM_BatchList &list, fpreal now);
1187 
1188  // When a new expression is created it will use the node's expression
1189  // language.
1190  CH_ExprLanguage getExprLanguage() const override;
1191  void setExprLanguage(CH_ExprLanguage language);
1192 
1193  // multiparm manipulation
1194  void insertMultiParmItem(const char *pn, int i);
1195  void removeMultiParmItem(const char *pn, int i);
1196 
1197  /// updateMultiParmFromRamp() will follow simple channel references as
1198  /// necessary
1199  void updateMultiParmFromRamp(fpreal t, const UT_Ramp &ramp,
1200  PRM_Parm &m, bool add_wrap,
1202  void updateRampFromMultiParm(fpreal t, const PRM_Parm &m,
1203  UT_Ramp &ramp, bool *time_dep = NULL,
1204  DEP_MicroNode *depnode = NULL) const;
1205 
1206  // This method converts an obsolete animated parm to a string parm. It
1207  // will create the necessary backticks for expressions. It does not,
1208  // however, support keyframed channel data or multiple-segment channels,
1209  // in which case the evaluated value at the given time is returned.
1210  // It also does not support CHOP overrides.
1211  // When reset_obs is true, the obsolete parameter is reset to factory
1212  // defaults after the expression has been extracted.
1213  // Returns true if successful, and false otherwise. False is returned
1214  // if the obsolete is at the factory default.
1215  bool convertObsAnimatedToStringExpression(
1216  PRM_ParmList *obsolete_parms,
1217  const char *pn, int vi, fpreal t,
1218  UT_String &result, bool reset_obs);
1219 
1220  /// Expand expressions within string value.
1221  ///
1222  /// This method will expand backtick expressions and local/global
1223  /// variables by modifying the input string. Always use this method instead
1224  /// of calling CH_Manager::expandString() directly within node evaluation
1225  /// code paths in order to establish proper node dependencies.
1226  ///
1227  /// @param channel_name Channel name of the parameter from where val
1228  /// was obtained from. This is important for
1229  /// establishing data and time dependencies.
1230  ///
1231  bool expandString(UT_String &val, fpreal t, int thread,
1232  const char *channel_name = 0);
1233 
1234  virtual int findString(const char *str, bool fullword,
1235  bool usewildcards) const;
1236  virtual int changeString(const char *from, const char *to,
1237  bool fullword);
1238 
1239  // These methods check to see if the current value differs from
1240  // the cached ones. The time is the time to evaluate the parm at,
1241  // this does NOT support independent dirty flags for multiple times
1242  // (and likely you wouldn't want that anyways)
1243  // cacheParmValues ONLY saves those who had been tested for dirtiness
1244  //
1245  // NOTE: This is deprecated, please use the override the
1246  // OP_Node::parmListMicroNode() method to detect parm value changes.
1247  //
1248  // This legacy mechanism will cause your parameter to be evaluated
1249  // multiple times per cook.
1250  bool isParmDirty(int idx, fpreal t);
1251  bool isParmDirty(const char *n, fpreal t);
1252  bool isParmDirtyInst(const char *name, const int *inst,
1253  fpreal t, int nestlevel=1);
1254  void cacheParmValues(const OP_Context &context);
1255  void clearParmCache();
1256 
1257  /// Query if a parameter is time dependent, by parm index. If comp == -1,
1258  /// any vector component that is time dependent will return true for the
1259  /// parm.
1260  bool isParmTimeDependent(int idx, int comp = -1) const;
1261 
1262  /// Query if a parameter is time dependent, by parm name. If comp == -1,
1263  /// any vector component that is time dependent will return true for the
1264  /// parm.
1265  bool isParmTimeDependent(const char *name,
1266  int comp = -1) const;
1267 
1268  // error stuff
1269  int getErrorMessages(UT_String &messages,
1271  = UT_ERROR_NONE)
1272  {
1273  ensureErrorsAreUpdatedSubclass();
1274 
1275  OP_Lock::Scope lock(myErrorManagerLock);
1276  stealGlobalErrors();
1277  return myErrorManager.getErrorMessages(messages,
1278  severity);
1279  }
1280 
1281  virtual void getRawErrors(UT_Array<UT_Error> &errors, bool update);
1282 
1283  int findError(const char *type, int code) const
1284  {
1285  OP_Lock::Scope lock(myErrorManagerLock);
1286  return myErrorManager.findError(type, code);
1287  }
1288 
1289  int removeError(int idx)
1290  {
1291  OP_Lock::Scope lock(myErrorManagerLock);
1292  return myErrorManager.removeError(idx);
1293  }
1294 
1296  {
1297  OP_Lock::Scope lock(myErrorManagerLock);
1298  myErrorManager.pruneDuplicates();
1299  }
1300 
1301  void opMessage(int code, const char *m=0) const
1302  { UTaddMessage("OP",code,m);}
1303  void opWarning(int code, const char *m=0) const
1304  { UTaddWarning("OP",code,m);}
1305  void opError(int code, const char *m=0) const
1306  { UTaddError("OP", code, m);}
1307  void opFatal(int code, const char *m=0) const
1308  { UTaddFatal("OP", code, m);}
1309 
1310  void opLocalError(int code, const char *m=0)
1311  {
1312  OP_Lock::Scope lock(myErrorManagerLock);
1313  myErrorManager.addError("OP", code, m);
1314  }
1315  void opLocalWarning(int code, const char *m=0)
1316  {
1317  OP_Lock::Scope lock(myErrorManagerLock);
1318  myErrorManager.addWarning("OP",code,m);
1319  }
1321  {
1322  OP_Lock::Scope lock(myErrorManagerLock);
1323  myErrorManager.addDeadlockError();
1324  }
1325 
1326  /// appendError() adds a generic error *directly* to this node's error
1327  /// manager.
1328  void appendError(const char *type,
1329  int code, const char *m,
1330  UT_ErrorSeverity sev)
1331  {
1332  if (!UTgetErrorManager()->isDisabled())
1333  {
1334  OP_Lock::Scope lock(myErrorManagerLock);
1335  myErrorManager.addGeneric(type, code, m, sev);
1336  }
1337  }
1338 
1339  void clearErrors() // use error(OP_Context&) to avoid querying the current thread id
1340  {
1342  OP_Lock::Scope lock(myErrorManagerLock);
1343  myErrorManager.clearAndDestroyErrors();
1344  }
1345 
1347  {
1348  UTgetErrorManager(context.getThread())->clearAndDestroyErrors();
1349  OP_Lock::Scope lock(myErrorManagerLock);
1350  myErrorManager.clearAndDestroyErrors();
1351  }
1352 
1353  virtual OP_ERROR getErrorSeverity();
1354 
1355  bool hasDeadlockError() const
1356  {
1357  // We intentionally do NOT lock in this case
1358  return myErrorManager.hasDeadlockError();
1359  }
1360 
1362  {
1363  ensureErrorsAreUpdatedSubclass();
1364 
1365  UT_ErrorManager &mgr = *UTgetErrorManager(context.getThread());
1366  if (mgr.getNumErrors() > 0)
1367  {
1368  stealGlobalErrors();
1369  }
1370  else
1371  {
1372  // Even if we have no errors, we still need to
1373  // update the severity because error logging
1374  // might be disabled.
1375  myErrorManager.updateSeverity(
1376  mgr.getSeverity());
1377  }
1378  return myErrorManager.getSeverity();
1379  }
1380  virtual OP_ERROR error() // use error(OP_Context&) to avoid querying the current thread id
1381  {
1382  ensureErrorsAreUpdatedSubclass();
1383 
1385  if (mgr.getNumErrors() > 0)
1386  {
1387  stealGlobalErrors();
1388  }
1389  else
1390  {
1391  // Even if we have no errors, we still need to
1392  // update the severity because error logging
1393  // might be disabled.
1394  myErrorManager.updateSeverity(
1395  mgr.getSeverity());
1396  }
1397  return myErrorManager.getSeverity();
1398  }
1399  void stealErrors(UT_ErrorManager &src,
1400  bool borrow_only = false);
1401  OP_ERROR getSaveError();
1402  bool isGettingSaveError() const
1403  { return myIsGettingSaveError; }
1404 
1405  // This method should only be called from OP_Channels.
1406  void addChannelError(const char *type, int code,
1407  const char *msg = 0);
1408 
1409  void chChanged(CH_Channel *ch, CH_CHANGE_TYPE reason);
1410 
1411  virtual void saveParmsForUndo(bool scopedOnly = false,
1412  CH_Collection *collection = NULL);
1413  void saveSingleParmForUndo(PRM_Parm *parm);
1414  void saveParmForUndo(PRM_Parm *);
1415  virtual void saveKeyFrameForUndo(CH_Channel *chp, fpreal gtime);
1416 
1417  // Clear any undo flags for the node in question
1418  virtual void clearUndoFlags();
1419  virtual void setAnyUndoFlag();
1420  int getAnyUndoPending() const { return myAnyUndoFlagSet; }
1421 
1422  int canAccess(unsigned mask) const;
1423  bool canAccess(unsigned mask, const PRM_Parm *parm) const;
1424  bool canAccessChannel(uint mask,
1425  const CH_Channel *chp) const;
1426  void updateUserMask();
1427 
1428  bool canModifyFromUI(const PRM_Parm *parm, int vi) const;
1429 
1430  // If an OP references external files, this method should be implemented to
1431  // reload new data which is out of date with the external file. If data
1432  // was re-loaded, then the method should return 1 (otherwise 0).
1433  virtual int reloadNewFiles(fpreal time_now);
1434 
1435  void triggerOPChanged(OP_EventType reason, int index);
1436 
1437  void parmChanged( int parm_index );
1438  void parmExprChanged(int parm_index);
1439 
1440  // This is called when our OP_Operator is deleted before we are.
1441  void operatorDeleted();
1442 
1443  // These functions deal with the opparm command.
1444  void saveParmCommand(std::ostream &os, int values = 0,
1445  int defaultstoo = 1,
1446  bool spareparms = true) const;
1447  int loadParmCommand(int argc, const char *const argv[],
1448  int docallbacks, void *data,
1449  fpreal now, bool followchrefs,
1450  CMD_Args *args);
1451  void commandParmCallback(void *data, fpreal now,
1452  int argc, char *argv[],
1453  CMD_Args *args);
1454  void saveMultiParmInstanceCommand(
1455  std::ostream &os,
1456  const char *opname,
1457  bool spareparms) const;
1458 
1459  // Run the callback function for a particular parm, and the callbacks
1460  // of any parms linked to this parm. This function is implemented in
1461  // OP_Node.
1462  virtual bool triggerParmCallback(PRM_Parm *parmptr, fpreal now,
1463  int value, void *data,
1464  const UT_Options *options = 0) = 0;
1465 
1466  int64 getMemoryUsage(bool inclusive) const override;
1467 
1468  void bumpTakeReference(int dir)
1469  { myTakeReferences += dir; }
1470  int getTakeReferences() const
1471  { return myTakeReferences; }
1472 
1473 
1474  /// This method will create channel groups and populate them with
1475  /// channels from this operator. The channel groups created will
1476  /// correspond to the folders in this operator's parameters.
1477  /// Unless only_channels is specified, all auto-scoped parms will get
1478  /// included.
1479  void createChannelGroupsFromFolders(CH_Group &parent_group,
1480  bool only_channels,
1481  bool leaf_channels_only = false,
1482  bool only_unlocked = true);
1483 
1484  /// Returns a list of the autoscopeable channels for this node.
1485  /// if follow_layer_overrides is true, the channel references are followed but only for animation layers.
1486  /// if include_animated is true, channels without the auto scope flag but with animation will also be returned.
1487  void getAutoScopedChannels(CH_ChannelRefList &chlist,
1488  bool follow_layer_overrides=true,
1489  bool include_animated=false,
1490  bool follow_channel_refs=true,
1491  bool include_autoscope=true
1492  );
1493 
1494  // Returns command to chopscope CHOPed channels for this node.
1495  void getChopScopeChannels(UT_WorkBuffer &chopscope_cmd);
1496 
1497  // Returns true if the specified parameter is visible in the interface
1498  // templates. This accounts for visiblity of containing parm pages
1499  // as well as the parm itself.
1500  bool getParmIsVisible(const char *parmname);
1501 
1502  // Returns a pointer to the templates used in constructing dialogs for
1503  // this node.
1504  const PRM_Template *getInterfaceParmTemplates() const;
1505 
1506  const PRM_Template *getSpareParmTemplates() const;
1507  const PRM_ScriptImports *getSpareParmTemplateImports() const;
1508  const PRM_Template *getSpareParmLayoutTemplates() const;
1509  const PRM_ScriptImports *getSpareParmLayoutTemplateImports() const;
1510  int getSpareParmTemplatesId() const;
1511 
1512  /// The number of potential spare inputs created by spare
1513  /// parameters. These are spare_input0 and onwards. There may be holes.
1514  int numSpareInputs() const;
1515 
1516  // Get our multiparm instance info used by initMultiparmInstance.
1517  bool hasMultiparmInfo() const;
1518  OP_MultiparmInfo &getMultiparmInfo();
1519 
1520  // This function is caled when any multiparm has a new instance added.
1521  // It gives the parm owner a chance to initialize the multiparm values.
1522  void initMultiparmInstance(UT_ValArray<PRM_Parm *> &parms) override;
1523  // This function sends an opChanged notification of our multiparm change.
1524  void addOrRemoveMultiparmInstance() override;
1525 
1526  bool savePresetContents(std::ostream &os) override;
1527  bool loadPresetContents(const char *tok, UT_IStream &is) override;
1528 
1529  static void buildMParmInst(const PRM_Template *templates,
1530  UT_StringArray &mparm_inst,
1531  UT_IntArray &mparm_lvl,
1532  int level);
1533  static bool isMParmInstance(const char *chname,
1534  const UT_StringArray &mparm_inst,
1535  const UT_IntArray &mparm_lvl);
1536 
1537  // Retrieve Animation Layers from a Scoped Channel List
1538  static void getLayersFromScopedChannels(
1539  const CH_ChannelRefList &ori_refs,
1540  CH_ChannelRefList &layer_refs );
1541 
1542  // setChRef* methods with name resolution of the parameter index
1543  // @{
1544  void setChRefInt(const char *parmname, int &pi, int vi, fpreal t, exint val,
1546  bool propagate=true);
1547  void setChRefFloat(const char *parmname, int &pi, int vi, fpreal t, fpreal val,
1548  PRM_AddKeyType add_key=
1550  bool propagate=true);
1551  void setChRefString(const UT_StringRef &val,
1552  CH_StringMeaning meaning,
1553  const char *parmname, int &pi, int vi,
1554  fpreal t,
1555  PRM_AddKeyType add_key=
1557  bool propagate=true);
1558  // @}
1559 
1560  void createParmMicroNode(const UT_StringRef &pn, int *pi );
1561 
1562  /// Returns the name of the toggle parameter that controls the activation
1563  /// state of the parameter by the given name.
1564  static UT_StringHolder getParmActivationToggleName(
1565  const UT_StringRef &parm_name);
1566 
1567 protected:
1568  virtual void doGetFullPath(UT_WorkBuffer &str) const override;
1569 
1570  // Uses the specified conditional stored on the PRM_Template for the
1571  // specified parameter to check whether the specified parm should
1572  // be updated based on the conditional. Returns false if the parm state
1573  // doesn't change.
1574  bool updateParmDisableConditional(
1575  PRM_Parm &parm,
1576  bool force,
1577  const UT_StringArray *skip = 0);
1578 
1579  bool updateParmHideConditional(
1580  PRM_Parm &parm,
1581  const UT_StringArray *skip = 0);
1582 
1583  // Uses a toggle parameter that corresponds to the main paramter to decide
1584  // whether the main paramter is enabled/disabled. The correspondence
1585  // is implicit by parameter naming conventions.
1586  bool updateParmDisableIfInactive(PRM_Parm &parm);
1587 
1588  // Returns zero if no change was made. This function is overridden
1589  // by subclasses to disable parms specific to those nodes.
1590  // NOTE: Superseded by the updateParmsFlags() function.
1591  SYS_DEPRECATED(12.0)
1592  virtual unsigned disableParms();
1593 
1594  // This function is overridden by subclasses to update parm flags specific
1595  // to those nodes.
1596  // Returns false if no change was made.
1597  virtual bool updateParmsFlags() { return false; }
1598 
1599 
1600  void saveMultiParmForUndo(int index);
1601 
1602  void stealGlobalErrors();
1603  void stealErrors(OP_Parameters &src);
1604 
1605  // NOTE: Do not hold onto the ptr object longer than necessary!
1608  {
1610  myErrorManager, myErrorManagerLock);
1611  }
1612 
1613  virtual void permissionError(const char *chname = 0);
1614 
1615  // checkExpressionError() is split up into a checking part and an actual
1616  // error handling part, evaluationError() so that the checking part can
1617  // be inlined.
1619  const PRM_Parm *parm, int thread) const
1620  {
1621  int err = ev_GetErrNo(thread);
1622  if (err == EV_NOERROR)
1623  return false;
1624  evaluationError(parm, err, thread);
1625  return true;
1626  }
1627 
1628  void resetParmEventHandler();
1629 
1630  int *allocIndirect(int size=64);
1631 
1632  OP_Parameters(const char *name, OP_Operator *entry);
1633  OP_Parameters(const OP_Parameters &source, const char *name);
1634  virtual ~OP_Parameters();
1635 
1636  //
1637  // The "initializeParms" method must be called to provide the channel
1638  // collection and build the parameter list.
1639  //
1640  void initializeParms(OP_Channels *channels);
1641 
1642  // op dependencies
1643  virtual void buildOpDependencies()
1644  { }
1645  virtual void checkChannelDependencies(CH_Channel * /*ch*/,
1646  CH_CHANGE_TYPE /*reason*/)
1647  { }
1648 
1649  static bool isReservedOpName(const char *name);
1650 
1651  virtual int rename(const char *newname);
1652  virtual bool createSpareParameterFromChannel(const char *chname);
1653  virtual bool createSpareParametersFromChannels(
1655  const CH_ChannelList &channels);
1656 
1657  CH_LocalVariable *getVariable(int i) const;
1658  CH_LocalVariable *getVariable(const char *name) const;
1659 
1660  //
1661  //
1662  OP_ERROR saveChannels(std::ostream &os, int binary,
1663  bool compiled, int selected);
1664  OP_ERROR saveParmChannels(int parm_index, std::ostream &os,
1665  int binary, bool compiled);
1666  OP_ERROR saveParameters(std::ostream &os, int binary,
1667  bool compiled);
1668  OP_ERROR saveChannelAliases(std::ostream &os, int binary);
1669 
1670  bool loadChannels(UT_IStream &is, const char *path,
1671  CH_Collection *obsolete_channels);
1672  bool loadParameters(UT_IStream &is, const char *path,
1673  PRM_ParmList *obsolete_parms);
1674  bool loadChannelAliases(UT_IStream &is, const char *path=0);
1675  bool loadOldSpareParms(UT_IStream &is);
1676 
1677  // Allow our sub-class to be notified when something gets changed
1678  // Since the parameter only holds the name & the parameters, there
1679  // are only two types of events generated here...
1680  virtual void opChanged(OP_EventType type, void *dataptr = 0) = 0;
1681 
1682  /// This is a helper method to the setChannelScope method. It traverses
1683  /// the node's parameters and sets the scope on them according to the
1684  /// given pattern.
1685  virtual void traverseScope(const char *pattern, OP_ScopeOp scope_op,
1686  const OP_ScopeOptions &scope_options);
1687 
1688  // A virtual method to get access to the associated node flag. This would
1689  // probably be unnecessary if myTakeReferences were used.
1690  virtual int getHasTakeData() const { return 0 ;}
1691 
1692  /// Ensure that the node errors are up-to-date.
1693  /// This method gives our subclass a chance to insert any errors on-demand.
1695 
1696  /// Ensure that the spare parameter templates are up-to-date.
1697  /// This method gives our subclass a chance to update the spare parameters
1698  /// on-the-fly before returning them.
1700 
1703 
1704 private:
1705 
1706  // When the spare parameter definitions for a node changes, this function
1707  // is called to update the parameters to be in line with the new set of
1708  // templates. The old templates must still exist at this point.
1709  virtual void updateSpareParmTemplates(
1710  PRM_Template *newtemplates,
1711  bool leavedefaultsunchanged) = 0;
1712 
1713  template<class T>
1714  void traverseScopeT(const char *pattern, OP_ScopeOp scope_op,
1715  const OP_ScopeOptions &scope_options);
1716 
1717  // evaluationError() generates the appropriate call to opError() and then
1718  // clears the expression error state.
1719  void evaluationError(const PRM_Parm *parm, int err,
1720  int thread) const;
1721 
1722  // these methods are the actual instantiation of the set... and
1723  // setSilent... methods.
1724  void setFullInt(int parmi, int vectori, fpreal t,
1725  exint value, bool p);
1726  void setFullInt(const char *parmname, int vectori, fpreal t,
1727  exint value, bool p);
1728  void setFullInt(const char *parmname, int &parmi,
1729  int vectori, fpreal t, exint value, bool p);
1730 
1731 
1732  void setFullFloat(int pi, int vi, fpreal t, fpreal val,
1733  PRM_AddKeyType add_key, bool propagate);
1734  void setFullFloat(const char *pn, int vi, fpreal t,
1735  fpreal val, PRM_AddKeyType add_key,
1736  bool propagate);
1737  void setFullFloat(const char *pn, int &pi, int vi,
1738  fpreal t, fpreal val,
1739  PRM_AddKeyType add_key, bool propagate);
1740 
1741  void setFullString(const UT_StringRef &val,
1742  CH_StringMeaning meaning, int pi, int vi,
1743  fpreal t, bool ppropagate);
1744  void setFullString(const UT_StringRef &val,
1745  CH_StringMeaning meaning,
1746  const char *pn,
1747  int vi, fpreal t, bool propagate);
1748  void setFullString(const UT_StringRef &val,
1749  CH_StringMeaning meaning,
1750  const char *pn,
1751  int &pi, int vi, fpreal t,
1752  bool propagate);
1753 
1754  void setFullData(int pi, int vi, fpreal t,
1755  const PRM_DataItemHandle &val, bool p);
1756  void setFullData(const char *pn, int vi, fpreal t,
1757  const PRM_DataItemHandle &val, bool p);
1758  void setFullData(const char *pn, int &pi, int vi, fpreal t,
1759  const PRM_DataItemHandle &val, bool p);
1760 
1761  void setFullIntInst(exint value, const char *parmname,
1762  const int *inst, int vectori, fpreal t,
1763  int nestlevel, bool propagate);
1764  void setFullFloatInst(fpreal val, const char *name,
1765  const int *inst, int vi, fpreal t,
1766  int nestlevel, bool propagate);
1767  void setFullStringInst(const UT_StringRef &val,
1768  CH_StringMeaning meaning,
1769  const char *name,
1770  const int *inst, int vi, fpreal t,
1771  int nestlevel, bool propagate);
1772  void setFullDataInst(const PRM_DataItemHandle &val,
1773  const char *name, const int *inst,
1774  int vi, fpreal t, int nestlevel,
1775  bool propagate);
1776 
1777  // Set values given a parameter pointer (rather than a lookup index).
1778  // These all take add_key and propagate parameters.
1779  bool setFull(PRM_Parm &parm, int vectori, fpreal now,
1780  exint value, PRM_AddKeyType add_key,
1781  bool propgate);
1782  bool setFull(PRM_Parm &parm, int vectori, fpreal now,
1783  fpreal val, PRM_AddKeyType add_key,
1784  bool propgate);
1785  bool setFull(PRM_Parm &parm, int vectori, fpreal now,
1786  const char *value,
1787  CH_StringMeaning meaning,
1788  PRM_AddKeyType add_key, bool propgate);
1789  bool setFull(PRM_Parm &parm, int vectori, fpreal now,
1790  const PRM_DataItemHandle &val,
1791  PRM_AddKeyType add_key, bool propgate);
1792 
1793  bool determineParmVisibility(const char *parmname,
1794  const PRM_Template *prm,
1795  bool &visible);
1796 
1797  // Event handler
1798  static void changeEvent(void *, CH_CHANGE_TYPE, int);
1799 
1800  static void addLayerFromScopedChannels(
1801  const UT_StringRef &path,
1802  CH_ChannelRefList &chanrefs,
1803  UT_StringSet &scoped_layers);
1804 
1805  mutable OP_Lock myErrorManagerLock;
1806  UT_ErrorManager myErrorManager;
1807 
1808  UT_String myName;
1809  OP_Operator *myTableEntry;
1810  uint myTakeReferences;
1811 
1812  unsigned myUndoAllParmSavedFlag:1,
1813  myUndoScopedSavedFlag:1,
1814  myAnyUndoFlagSet:1,
1815  myIsGettingSaveError:1;
1816 
1817  OP_ParmCache *myParmCache;
1818 
1819  OP_SpareParms *mySpareParms;
1820  bool myChangingSpareParms;
1821 
1822  OP_MultiparmInfo *myMultiparmInfo;
1823 
1824  friend class OP_TakeParm;
1825  friend class OP_UndoParm;
1826  friend class OP_UndoSpareParm;
1827 };
1828 
1829 // helper functions
1830 
1831 OP_API PRM_Parm *OPgetParameterFromChannel( CH_Channel *chp, int *vecidx );
1835 
1836 #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
void evalStringInst(const UT_StringRef &name, const int *inst, UT_StringHolder &val, int vi, fpreal t, int nestlevel=1) 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()