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