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