HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_NodeVerb.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: SOP_NodeVerb.h ( SOP Library, C++)
7  *
8  * COMMENTS:
9  * Verb-based API for SOP cooking mechanisms. SOPs can return
10  * one of these objects to describe how they cook, allowing the
11  * cook engine to perform additional optimizations.
12  */
13 
14 #ifndef __SOP_NodeVerb_h__
15 #define __SOP_NodeVerb_h__
16 
17 #include "SOP_API.h"
18 #include "SOP_Node.h"
19 #include <OP/OP_Director.h>
20 #include <PRM/PRM_Parm.h>
21 #include <UT/UT_Array.h>
22 #include <UT/UT_Assert.h>
23 #include <SYS/SYS_Types.h>
24 
25 #include <initializer_list>
26 
27 #include <VEX/VEX_PodTypes.h>
28 template <VEX_Precision PREC> class CVEX_ContextT;
30 class CVEX_Function;
31 class DEP_MicroNode;
32 class SOP_GraphProxy;
33 
35 {
36 public:
37  int64 getMemoryUsage(bool inclusive) const
38  {
39  int64 mem = inclusive ? sizeof(*this) : 0;
40  mem += UTarrayDeepMemoryUsage(stringdata, false);
41  return mem;
42  }
43 
44 public:
45  fpreal32 floatdata[16];
48 };
49 
51 {
54 };
55 
56 
58 {
59 public:
61  {
62  myVexContext = 0;
63  myVexFunction = 0;
64  }
65  virtual ~SOP_NodeCache();
66 
67  virtual int64 getMemoryUsage(bool inclusive) const;
68 
69  CVEX_Context *getVexContext(const char *vexpression);
70  CVEX_Context *buildVexContext(const char *vexpression);
71  void setVexFunction(const CVEX_Function &function);
72  void clearVexContext();
73 
74 protected:
80  friend class SOP_NodeParms;
81 };
82 
84 {
85 public:
87  virtual ~SOP_NodeParms() {}
88 
90  {
91  public:
93  SOP_CookEngine cookengine,
94  const SOP_GraphProxy *graph,
95  exint nodeidx,
96  const OP_Context &context,
97  SOP_NodeCache *cache,
98  UT_ErrorManager *error,
99  DEP_MicroNode *depnode)
100  : myParms(parms)
101  , myCookEngine(cookengine)
102  , myGraph(graph)
103  , myNodeIdx(nodeidx)
104  , myContext(context)
105  , myCache(cache)
106  , myError(error)
107  , myDepNode(depnode)
108  {
109  }
110  virtual ~LoadParms();
111 
112  const OP_Node *node() const;
113  const SOP_GraphProxy *graph() const { return myGraph; }
114  exint nodeIdx() const { return myNodeIdx; }
115  template <typename T>
116  const T &parms() const
117  { return *UTverify_cast<const T*>(myParms); }
118  SOP_NodeCache *cache() const { return myCache; }
119  const OP_Context &context() const { return myContext; }
120  UT_ErrorManager *error() const { return myError; }
121  DEP_MicroNode *depnode() const { return myDepNode; }
122 
123  /// Methods to wire directly to the optional depnode.
124  void addExplicitInput(DEP_MicroNode &inp, bool check_dup)
125  { if (myDepNode) myDepNode->addExplicitInput(inp, check_dup); }
127  { addExplicitInput(inp, /*check_dup*/true); }
128 
129  /// Methods to add directly to any present error manager.
130  UT_ErrorSeverity addMessage (const char *type, int code, const char *msg=0,
131  const UT_SourceLocation *loc=0) const
132  { if (myError) return myError->addMessage(type, code, formatError(msg), loc);
133  return UT_ERROR_MESSAGE; }
134  UT_ErrorSeverity addWarning (const char *type, int code, const char *msg=0,
135  const UT_SourceLocation *loc=0) const
136  { if (myError) return myError->addWarning(type, code, formatError(msg), loc);
137  return UT_ERROR_WARNING; }
138  UT_ErrorSeverity addError (const char *type, int code, const char *msg=0,
139  const UT_SourceLocation *loc=0) const
140  { if (myError) return myError->addError(type, code, formatError(msg), loc);
141  return UT_ERROR_ABORT; }
142 
143  UT_ErrorSeverity sopAddMessage (int code, const char *msg=0,
144  const UT_SourceLocation *loc=0) const
145  { return addMessage("SOP", code, msg, loc); }
146  UT_ErrorSeverity sopAddWarning (int code, const char *msg=0,
147  const UT_SourceLocation *loc=0) const
148  { return addWarning("SOP", code, msg, loc); }
149  UT_ErrorSeverity sopAddError (int code, const char *msg=0,
150  const UT_SourceLocation *loc=0) const
151  { return addError("SOP", code, msg, loc); }
152 
154  bool borrow_only = false) const
155  { if (myError) myError->stealErrors(src,0, -1, UT_ERROR_NONE, borrow_only); }
156 
157  protected:
158  /// Prefix errors so we can get sensible results.
159  UT_StringHolder formatError(const char *msg) const;
160 
169  };
170 
171  void loadFromOp(const LoadParms &loadparms);
172 
173  bool applyVexpression(const char *vexpression,
174  const UT_Array<GU_ConstDetailHandle> &vexinputs,
175  const LoadParms &loadparm);
176 
177  /// Detects specially named parameters, cooks required inputs using
178  /// the traditional cook engine.
179  bool applyVexpressionFromNode(
180  SOP_Node *node, OP_Context &context,
181  SOP_NodeCache *cache);
182 
183  virtual void copyFrom(const SOP_NodeParms *src) { }
184 
185 
186  enum ParmType
187  {
200  PARM_UNSUPPORTED
201  };
202 
203  /// Marshalling interface to rest of world
204  /// These all use index based notation.
205  virtual exint getNumParms() const { return getNestNumParms({}); }
206  virtual const char *getParmName(exint idx) const { return getNestParmName({idx}); }
207  virtual ParmType getParmType(exint idx) const { return getNestParmType({idx}); }
208 
209  virtual void getParmValue(exint idx, exint &value) const
210  { getNestParmValue( {idx}, {}, value ); }
211  virtual void getParmValue(exint idx, fpreal &value) const
212  { getNestParmValue( {idx}, {}, value ); }
213  virtual void getParmValue(exint idx, UT_Vector2D &value) const
214  { getNestParmValue( {idx}, {}, value ); }
215  virtual void getParmValue(exint idx, UT_Vector3D &value) const
216  { getNestParmValue( {idx}, {}, value ); }
217  virtual void getParmValue(exint idx, UT_Vector4D &value) const
218  { getNestParmValue( {idx}, {}, value ); }
219  virtual void getParmValue(exint idx, UT_Matrix2D &value) const
220  { getNestParmValue( {idx}, {}, value ); }
221  virtual void getParmValue(exint idx, UT_Matrix3D &value) const
222  { getNestParmValue( {idx}, {}, value ); }
223  virtual void getParmValue(exint idx, UT_Matrix4D &value) const
224  { getNestParmValue( {idx}, {}, value ); }
225  virtual void getParmValue(exint idx, UT_StringHolder &value) const
226  { getNestParmValue( {idx}, {}, value ); }
227  virtual void getParmValue(exint idx, UT_SharedPtr<UT_Ramp> &value) const
228  { getNestParmValue( {idx}, {}, value ); }
229  virtual void getParmValue(exint idx, PRM_DataItemHandle &value) const
230  { getNestParmValue( {idx}, {}, value ); }
231 
232  virtual void setParmValue(exint idx, const exint &value)
233  { setNestParmValue( {idx}, {}, value ); }
234  virtual void setParmValue(exint idx, const fpreal &value)
235  { setNestParmValue( {idx}, {}, value ); }
236  virtual void setParmValue(exint idx, const UT_Vector2D &value)
237  { setNestParmValue( {idx}, {}, value ); }
238  virtual void setParmValue(exint idx, const UT_Vector3D &value)
239  { setNestParmValue( {idx}, {}, value ); }
240  virtual void setParmValue(exint idx, const UT_Vector4D &value)
241  { setNestParmValue( {idx}, {}, value ); }
242  virtual void setParmValue(exint idx, const UT_Matrix2D &value)
243  { setNestParmValue( {idx}, {}, value ); }
244  virtual void setParmValue(exint idx, const UT_Matrix3D &value)
245  { setNestParmValue( {idx}, {}, value ); }
246  virtual void setParmValue(exint idx, const UT_Matrix4D &value)
247  { setNestParmValue( {idx}, {}, value ); }
248  virtual void setParmValue(exint idx, const UT_StringHolder &value)
249  { setNestParmValue( {idx}, {}, value ); }
250  virtual void setParmValue(exint idx, const UT_SharedPtr<UT_Ramp> &value)
251  { setNestParmValue( {idx}, {}, value ); }
252  virtual void setParmValue(exint idx, const PRM_DataItemHandle &value)
253  { setNestParmValue( {idx}, {}, value ); }
254 
255  /// This makes a temporary index structure out of either an
256  /// initializer list or an exint array. It does *NOT* own
257  /// the data so should never be explicitly constructed.
258  class TempIndex
259  {
260  public:
261  TempIndex(std::initializer_list<exint> list)
262  {
263  if (list.size())
264  myVec = &*list.begin();
265  else
266  myVec = 0;
267  mySize = list.size();
268  }
270  {
271  myVec = list.data();
272  mySize = list.size();
273  }
274 
275  const exint *begin() const { return myVec; }
276  exint size() const { return mySize; }
277  exint operator[](const exint off) const
278  {
279  UT_ASSERT_P(off >= 0 && off < mySize);
280  return myVec[off];
281  }
282  protected:
283  const exint *myVec;
285  };
286 
287  virtual exint getNestNumParms(TempIndex idx) const { return 0; }
288  virtual const char *getNestParmName(TempIndex idx) const { return 0; }
289  virtual ParmType getNestParmType(TempIndex idx) const { return PARM_UNSUPPORTED; }
290 
291  virtual void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const {}
292  virtual void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const {}
293  virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const {}
294  virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const {}
295  virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const {}
296  virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const {}
297  virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const {}
298  virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const {}
299  virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const {}
300  virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const {}
301  virtual void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const {}
302 
303  virtual void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) {}
304  virtual void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) {}
305  virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) {}
306  virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) {}
307  virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) {}
308  virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) {}
309  virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) {}
310  virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) {}
311  virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) {}
312  virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) {}
313  virtual void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) {}
314 
315 protected:
316  virtual void loadFromOpSubclass(const LoadParms &loadparms) = 0;
317 
318  // Used for coercing one type to another
319  template <typename T, typename S>
320  void coerceValue(T &result, const S &src) const
321  {
322  result = T{};
323  }
324 
325 };
326 
327 template <>
328 void inline SOP_NodeParms::coerceValue(exint &result, const exint &src) const
329 { result = src; }
330 template <>
331 void inline SOP_NodeParms::coerceValue(bool &result, const exint &src) const
332 { result = src; }
333 template <>
334 void inline SOP_NodeParms::coerceValue(exint &result, const bool &src) const
335 { result = src; }
336 template <>
337 void inline SOP_NodeParms::coerceValue(bool &result, const bool &src) const
338 { result = src; }
339 template <>
340 void inline SOP_NodeParms::coerceValue(fpreal &result, const fpreal &src) const
341 { result = src; }
342 template <>
344 { result = src; }
345 template <>
347 { result = src; }
348 template <>
350 { result = src; }
351 template <>
353 { result = src; }
354 template <>
356 { result = src; }
357 template <>
359 { result = src; }
360 template <>
362 { result = src; }
363 template <>
365 { result = src; }
366 template <>
368 { result = src; }
369 template <>
371 { result = src; }
372 template <>
374 { result = src; }
375 template <>
377 { result = src; }
378 
379 ///
380 /// SOP_NodeVerb
381 ///
382 /// This should be a singleton class. Build it with the Register
383 /// template to allow it to be discoverable by name.
384 ///
386 {
387 public:
389  virtual ~SOP_NodeVerb() {}
390 
391  template <typename T>
392  class Register
393  {
394  public:
396  {
397  myVerb = new T();
399  }
401  {
403  delete myVerb;
404  }
405 
406  const T *get() const { return myVerb; }
407 
408  private:
409  T *myVerb;
410 
411  };
412 
413  virtual SOP_NodeCache *allocCache() const
414  { return new SOP_NodeCache; }
415 
416  virtual SOP_NodeParms *allocParms() const = 0;
417 
418  virtual UT_StringHolder name() const = 0;
419 
420  /// Finds a verb which matches the given name
421  static const SOP_NodeVerb *lookupVerb(const UT_StringRef &name);
422  static void listVerbs(UT_StringArray &verbnames);
423  static void registerVerb(SOP_NodeVerb *verb);
424  static void unregisterVerb(SOP_NodeVerb *verb);
425 
427  {
428  public:
429  void clear()
430  {
431  myExprInputs.clear();
432  myTimeDeps.clear();
433  }
435  const UT_IntArray &timedeps)
436  {
437  myExprInputs = inputs;
438  myTimeDeps = timedeps;
439  }
440  const UT_Array<GU_ConstDetailHandle> &exprinputs() const { return myExprInputs; }
441  const UT_IntArray &timedeps() const { return myTimeDeps; }
442 
443  protected:
446  };
447 
449 
450  /// During execution of a verb chain you may wish to disable
451  /// the traditional cooking of nodes. This provides a set of
452  /// nodes you do not want recursed into during the verb cook.
453  /// It will be NULL if there are none or this thread isn't in
454  /// a compiled execution path.
455  static const ForbiddenNodeMap *forbiddenNodes();
456  static const ForbiddenNodeMap *forbiddenNodes(int thread);
457 
458  /// This scope class will push the given list of nodes marking
459  /// them as inelligible for cooking in the traditional path.
460  /// Needless to say, the invoker needs to ensure the set's lifetime
461  /// persists.
463  {
464  public:
465  ScopeForbiddenNodes(const ForbiddenNodeMap *forbiddennodes);
467  protected:
469  };
470 
471  enum CookMode
472  {
473  // With in place the destination gdp will be the first input or
474  // a copy.
475  // The first input will be null.
477  // With duplicate, the destination gdp will be a copy of the
478  // first input. All inputs will be valid.
480  // With generator, the destination gdp is empty, possibly
481  // a stashAll(). All inputs will be valid.
483  // With instance, the destination gdp is invalid. All inputs
484  // will be valid.
486  // There will be a destination gdp, but its contents are unspecified
487  // It may contain the results of the last cook. All inputs are
488  // valid.
490  // If cookMode is pass through, the cook method will not be
491  // invoked at all. Instead, the first input will be passed through
492  // unchanged. If there is no first input, an empty gdp is
493  // created.
495  };
496 
498  {
499  public:
501  virtual ~NodeInputs() {}
502 
503  virtual exint nInputs() const = 0;
504  /// Returns if the input is wired.
505  virtual bool hasInput(exint idx) const = 0;
506 
507  /// Demands the input be cooked. After this, the inputGeo()
508  /// will return the contents.
509  /// Returns false if the cook failed for some reason.
510  virtual bool cookInput(exint idx) = 0;
511 
512  /// Returns an invalid handle if the input isn't wired or not yet cooked.
513  virtual GU_DetailHandle inputGeo(exint idx) = 0;
514 
515  /// Unlocks/forgets the given input. Returns an invalid handle if
516  /// not wired or not cooked.
517  virtual GU_DetailHandle unloadInput(exint idx, bool flushce) = 0;
518 
519  /// Marks the given input used. Needed if the input isn't cooked,
520  /// as unload will not mark it unused (as it must be marked such
521  /// ASAP to free up earlier nodes)
522  virtual void markInputUnused(exint idx) = 0;
523  };
524 
526  {
527  public:
529  : myGdps(gdps)
530  { }
531  ~PreCookedNodeInputs() override {}
532 
533  exint nInputs() const override { return myGdps.entries(); }
534  bool hasInput(exint idx) const override
535  {
536  if (idx < 0 || idx >= nInputs())
537  return false;
538  return myGdps(idx).gdp() != nullptr;
539  }
540 
541  bool cookInput(exint idx) override
542  {
543  // Precooked, so if we have it it successfully cooked.
544  return hasInput(idx);
545  }
546 
548  {
549  if (!hasInput(idx))
550  return GU_DetailHandle();
551  return myGdps(idx).castAwayConst();
552  }
553 
554  GU_DetailHandle unloadInput(exint idx, bool flushce) override
555  {
556  // It would make sense to clear out the gdp at this point,
557  // but we don't have ownership of the array.
558  return inputGeo(idx);
559  }
560 
561  void markInputUnused(exint idx) override {}
562  protected:
564  };
565 
567  {
568  public:
569  InputParms(NodeInputs &inputs, NodeInputs &exprinputs,
570  const SOP_NodeParms *parms,
571  SOP_NodeCache *cache,
572  UT_ErrorManager *error, DEP_MicroNode *depnode)
573  : myInputs(inputs)
574  , myExprInputs(exprinputs)
575  , myParms(parms)
576  , myCache(cache)
577  , myError(error)
578  , myDepNode(depnode)
579  {
580  }
581 
582  virtual ~InputParms() {}
583 
584  NodeInputs &inputs() const { return myInputs; }
585 
586  NodeInputs &exprinputs() const { return myExprInputs; }
587 
588  template <typename T>
589  const T &parms() const
590  { return *UTverify_cast<const T*>(myParms); }
591 
592  template <typename T>
593  T *cache() const
594  { return UTverify_cast<T *>(myCache); }
595 
596  UT_ErrorManager *error() const { return myError; }
597 
598  DEP_MicroNode *depnode() const { return myDepNode; }
599 
600  protected:
607  };
608 
609  class CookParms
610  {
611  public:
613  const UT_Array<GU_ConstDetailHandle> &inputs,
614  SOP_CookEngine cookengine,
615  OP_Node *node,
616  const OP_Context &context,
617  const SOP_NodeParms *parms,
618  SOP_NodeCache *cache,
619  UT_ErrorManager *error,
620  DEP_MicroNode *depnode)
621  : myDestGdh(destgdh)
622  , myInputs(inputs)
623  , myCookEngine(cookengine)
624  , myNode(CAST_SOPNODE(node))
625  , myContext(context)
626  , myParms(parms)
627  , myCache(cache)
628  , myError(error)
629  , myDepNode(depnode)
630  {}
631  virtual ~CookParms() {}
632 
633  /// The initial state of gdh depends on the cookMode()
634  GU_DetailHandle &gdh() const { return myDestGdh; }
635 
636  /// The currently cooking SOP. This is only non-null if in
637  /// the old cook path. When executing compiled nodes it will
638  /// be null as the verb is supposed to operate independently
639  /// of the original SOP.
640  SOP_Node *getNode() const { return (myCookEngine == SOP_COOK_TRADITIONAL) ? myNode : 0; }
641 
642  template <typename T>
643  T *getCookNode() const
644  { if (myCookEngine != SOP_COOK_TRADITIONAL)
645  return 0;
646  return UTverify_cast<T *>(myNode); }
647 
648  /// The node that generated this verb, if any...
649  SOP_Node *getSrcNode() const { return myNode; }
650  /// The getCwd() should be used to evaluate relative paths.
651  OP_Node *getCwd() const { if (myNode) return myNode; return OPgetDirector(); }
652  const OP_Context &getContext() const
653  { return myContext; }
655  { return myContext.getTime(); }
656 
657  /// Whether the underlying verb manages data ids. All new nodes
658  /// should manage data ids, this is purely for the
659  /// SOP_NodeParmsOptions wrapper.
660  bool getManagesDataIDs() const
661  {
662  if (!myNode) return true;
663  return myNode->getFlags().getManagesDataIDs();
664  }
665 
666  /// Accessors designed to simplify porting from old cook code.
667  /// Just becaues you have nInputs does not mean all are wired or
668  /// cooked. But, the number demanded by your OP_Operator shall
669  /// be present.
670  /// Inputs have been locked & preserve request set
671  exint nInputs() const { return myInputs.size(); }
672  bool hasInput(exint idx) const
673  {
674  if (idx < 0 || idx >= myInputs.size())
675  return false;
676  return myInputs(idx).isValid();
677  }
678  const GU_Detail *inputGeo(exint idx) const
679  {
680  if (!hasInput(idx)) return 0;
681  return myInputs(idx).gdp();
682  }
684  {
685  if (!hasInput(idx)) return GU_ConstDetailHandle();
686  return myInputs(idx);
687  }
688 
689  template <typename T>
690  const T &parms() const
691  { return *UTverify_cast<const T*>(myParms); }
692 
693  /// Cache may, or may not, persist between cooks. But it is
694  /// guaranteed this is the only thread using the cache.
695  SOP_NodeCache *cache() const { return myCache; }
696 
697  /// Error managers are not locked, so do not pass this to
698  /// something that forks.
699  UT_ErrorManager *error() const { return myError; }
700  DEP_MicroNode *depnode() const { return myDepNode; }
701 
702  /// Methods to wire directly to the optional depnode.
703  void addExplicitInput(DEP_MicroNode &inp, bool check_dup=true) const
704  { if (myDepNode) myDepNode->addExplicitInput(inp, check_dup); }
705 
706  /// Methods to add directly to any present error manager.
707  UT_ErrorSeverity addMessage (const char *type, int code, const char *msg=0,
708  const UT_SourceLocation *loc=0) const
709  { if (myError) return getLockedErrorManager()->addMessage(type, code, formatError(msg), loc);
710  return UT_ERROR_MESSAGE; }
711  UT_ErrorSeverity addWarning (const char *type, int code, const char *msg=0,
712  const UT_SourceLocation *loc=0) const
713  { if (myError) return getLockedErrorManager()->addWarning(type, code, formatError(msg), loc);
714  return UT_ERROR_WARNING; }
715  UT_ErrorSeverity addError (const char *type, int code, const char *msg=0,
716  const UT_SourceLocation *loc=0) const
717  { if (myError) return getLockedErrorManager()->addError(type, code, formatError(msg), loc);
718  return UT_ERROR_ABORT; }
719 
720  UT_ErrorSeverity sopAddMessage (int code, const char *msg=0,
721  const UT_SourceLocation *loc=0) const
722  { return addMessage("SOP", code, msg, loc); }
723  UT_ErrorSeverity sopAddWarning (int code, const char *msg=0,
724  const UT_SourceLocation *loc=0) const
725  { return addWarning("SOP", code, msg, loc); }
726  UT_ErrorSeverity sopAddError (int code, const char *msg=0,
727  const UT_SourceLocation *loc=0) const
728  { return addError("SOP", code, msg, loc); }
729 
730  void addTransformError(const OP_Node &node, const char *label=0) const
731  {
732  UT_String path;
733  node.getFullPath(path);
734  if (UTisstring(label))
735  {
736  path += "(as "; path += label; path += ")";
737  }
738  addError("OP", OP_ERR_TRANSFORM, path);
739  }
740 
742  bool borrow_only = false) const
743  { if (myError) getLockedErrorManager()->stealErrors(src,0, -1, UT_ERROR_NONE, borrow_only); }
744 
746  { if (getNode())
747  getNode()->select(gtype); }
748 
750  bool add_to_sel = false) const
751  { if (getNode())
752  getNode()->select(selection, add_to_sel); }
753 
754  // Select the group. opt use its type as sel type
755  void select(const GA_Group &group, bool use_gtype = true,
756  bool add_to_sel = false) const
757  { if (getNode())
758  getNode()->select(group, use_gtype, add_to_sel); }
759 
760  void select(const GEO_Primitive &prim, bool sel_prim = true,
761  bool add_to_sel = false) const
762  { if (getNode())
763  getNode()->select(prim, sel_prim, add_to_sel); }
764  void selectPrimitive(GA_Offset primoff, bool prim_sel = true,
765  bool add_to_sel = false) const
766  { if (getNode())
767  getNode()->selectPrimitive(primoff, prim_sel, add_to_sel); }
768  void selectPoint(GA_Offset ptoff, bool point_sel = true,
769  bool add_to_sel = false) const
770  { if (getNode())
771  getNode()->selectPoint(ptoff, point_sel, add_to_sel); }
772  void selectFrom(const GEO_Primitive &prim, bool sel_prim = true,
773  bool add_to_sel = false) const
774  { if (getNode())
775  getNode()->selectFrom(prim, sel_prim, add_to_sel); }
776  void selectPointsFrom(GA_Offset ptoff, bool point_sel = true,
777  bool add_to_sel = false) const
778  { if (getNode())
779  getNode()->selectPointsFrom(ptoff, point_sel, add_to_sel); }
780  void select(const GA_Range &range, bool use_rtype = true,
781  bool add_to_sel = false) const
782  { if (getNode())
783  getNode()->select(range, use_rtype, add_to_sel); }
784 
785  // Selects input based on the group supplied and the group type. If
786  // group is not null, then it's type is used, otherwise the group type
787  // is used.
789  GA_GroupType grouptype) const
790  { if (getNode())
791  getNode()->selectInputGroup(group, grouptype); }
792 
793  // If no selection is present, then create a new empty primitive cook
794  // selection group. Otherwise, clear the selection.
795  void clearSelection() const
796  { if (getNode())
797  getNode()->clearSelection(); }
798 
799  /// If the cook selection group is not of the given type, create an empty
800  /// cook selection group of that type. Otherwise, clear the existing cook
801  /// selection group.
802  void clearSelection(GA_GroupType gtype) const
803  { if (getNode())
804  getNode()->clearSelection(gtype); }
805 
806  // Blow away the selection and reinitialize it to 0. Much more radical
807  // than clearSelection(), which leaves behind a clean, empty selection.
808  // This method returns 1 if it had anything to destroy, else 0.
809  bool destroySelection() const
810  { if (getNode())
811  return getNode()->destroySelection();
812  return false;
813  }
814 
815  // Return 1 if selection is enabled, 0 if false.
816  bool selectionEnabled() const
817  {
818  if (!getNode())
819  return false;
820  return getNode()->getHighlight();
821  }
822 
823  /// Shims for local variables
824  bool setupLocalVars() const
825  { if (getNode()) return getNode()->setupLocalVars(); return false; }
826  void resetLocalVarRefs() const
827  { if (getNode()) getNode()->resetLocalVarRefs(); }
828  void setCurGdh(int index, const GU_DetailHandle &gdh) const
829  { if (getNode()) getNode()->setCurGdh(index, gdh); }
830  void clearCurGdh(int index) const
831  { if (getNode()) getNode()->clearCurGdh(index); }
832  void setCurPoint(int index, GA_Offset off) const
833  { if (getNode()) getNode()->setCurPoint(index, off); }
834  void clearCurPoint(int index) const
835  { if (getNode()) getNode()->clearCurPoint(index); }
836  void setCurVertex(int index, GA_Offset off) const
837  { if (getNode()) getNode()->setCurVertex(index, off); }
838  void clearCurVertex(int index) const
839  { if (getNode()) getNode()->clearCurVertex(index); }
840  void setCurPrim(int index, GA_Offset off) const
841  { if (getNode()) getNode()->setCurPrim(index, off); }
842  void clearCurPrim(int index) const
843  { if (getNode()) getNode()->clearCurPrim(index); }
844  void setCurVertexNum(int index, exint num) const
845  { if (getNode()) getNode()->setCurVertexNum(index, num); }
846  void clearCurVertexNum(int index) const
847  { if (getNode()) getNode()->clearCurVertexNum(index); }
848  void setVariableOrder(int detail, int prim,
849  int pt, int vtx) const
850  { if (getNode()) getNode()->setVariableOrder(detail, prim, pt, vtx); }
851 
852  /// Tracks if any local variables were accessed by op functions.
854  { if (getNode()) getNode()->myUsesSOPLocalVar = false; }
856  { if (!getNode()) return false;
857  return getNode()->myUsesSOPLocalVar; }
858 
859 
860  protected:
861  /// Prefix errors so we can get sensible results.
862  UT_StringHolder formatError(const char *msg) const
863  {
864  // Do not prefix with the path in traditional cook
865  // as it is properly assigned.
866  if (myCookEngine == SOP_COOK_TRADITIONAL)
867  return msg;
869  if (!msg || !*msg)
870  return result;
872  UT_String fullpath;
873  if (myNode)
874  myNode->getFullPath(fullpath);
875  else
876  fullpath = "<internal>";
877  buf.sprintf("%s: %s", (const char *) fullpath, msg);
878  result = buf;
879  return result;
880  }
881 
882  // NOTE: Do not hold onto the ptr object longer than necessary!
885  {
887  *myError, myErrorLock);
888  }
889 
900  };
901 
902  /// If doPartialInputCook is false, we do assume cookInputs() will
903  /// apply to all inputs regardless of node parameters. If local
904  /// variables require the inputs, it is required for this to be false
905  /// for the inputs to be available when parameters are evaluated.
906  virtual bool doPartialInputCook() const { return false; }
907  virtual bool cookInputs(const InputParms &parms) const
908  {
909  for (exint i = 0; i < parms.inputs().nInputs(); i++)
910  if (parms.inputs().hasInput(i))
911  {
912  if (!parms.inputs().cookInput(i))
913  return false;
914  }
915  return true;
916  }
917 
918  /// These are for the old-cook path to allow nodes to store relevant
919  /// local variable information inside the SOP for callbacks. The
920  /// evalVariableValue() should be guarded to ensure it doesn't
921  /// run from a forbidden node.
922  /// These can be used if the local variables depend only on the inputs
923  /// and are not change for every parameter. If they change for
924  /// every parameter, traditional cook paths will need to setup &
925  /// evaluate explicitly in the cook method.
926  virtual void setupLocalVariables(SOP_Node *sop, const UT_Array<GU_ConstDetailHandle> &inputs) const {}
927  virtual void resetLocalVariables(SOP_Node *sop) const {}
928 
929  /// Traditional nodes may evaluate parameters while cooking, this is
930  /// required for dynamic local variables. If this is true, no pre-cooking
931  /// of the parameter struture will be done in the traditional cook
932  /// path avoiding double cooking parameters. Remember other cook paths
933  /// will not have access to the sop so should use the parameter structure!
934  virtual bool evaluatesParametersDuringCook() const { return false; }
935 
936  virtual CookMode cookMode(const SOP_NodeParms *parms) const { return COOK_DUPLICATE; }
937 
938  /// Attributes can end up cached on the GPU. Some SOPs are able
939  /// to handle this. Some are ambivalent (such as switch or null)
940  /// And some expect all GPU buffers to be flushed prior to
941  /// operating. If a node requires a CE flush, all inputs
942  /// will be clean.
943  virtual bool requiresCEFlush() const { return true; }
944  virtual bool usesCE() const { return false; }
945 
946  /// Compute the output geometry.
947  virtual void cook(const CookParms &cookparms) const = 0;
948 
949  /// This is used to update handles, it only has an effect
950  /// if oldsop is non-null, ie, we are in the old cook path.
951  /// Neither the group nor the gdp have to persist beyond this call.
952  /// Pass -1 for the grouptype if there is no grouptype parameter.
953  void notifyGroupParmListeners(SOP_Node *oldsop,
954  int groupparm_idx,
955  int grouptype_idx,
956  const GU_Detail *gdp,
957  const GA_Group *group) const;
958 
959 protected:
960 };
961 
962 #endif
const OP_Context & myContext
Definition: SOP_NodeVerb.h:165
virtual void getParmValue(exint idx, UT_Matrix3D &value) const
Definition: SOP_NodeVerb.h:221
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const
Definition: SOP_NodeVerb.h:298
const T & parms() const
Definition: SOP_NodeVerb.h:589
exint nInputs() const override
Definition: SOP_NodeVerb.h:533
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const
Definition: SOP_NodeVerb.h:296
GT_API const UT_StringHolder selection
GLenum GLint * range
Definition: glew.h:3500
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:598
const UT_Array< GU_ConstDetailHandle > & exprinputs() const
Definition: SOP_NodeVerb.h:440
TempIndex(const UT_ExintArray &list)
Definition: SOP_NodeVerb.h:269
void setCurGdh(int index, const GU_DetailHandle &gdh) const
Definition: SOP_NodeVerb.h:828
exint nodeIdx() const
Definition: SOP_NodeVerb.h:114
static void registerVerb(SOP_NodeVerb *verb)
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:640
const ForbiddenNodeMap * myPrevNodes
Definition: SOP_NodeVerb.h:468
bool getManagesDataIDs() const
Definition: SOP_NodeVerb.h:660
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:700
GLuint const GLchar * name
Definition: glew.h:1814
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value)
Definition: SOP_NodeVerb.h:309
PreCookedNodeInputs(const UT_Array< GU_ConstDetailHandle > &gdps)
Definition: SOP_NodeVerb.h:528
Unsorted map container.
Definition: UT_Map.h:83
virtual ParmType getNestParmType(TempIndex idx) const
Definition: SOP_NodeVerb.h:289
UT_ErrorSeverity sopAddMessage(int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Definition: SOP_NodeVerb.h:720
virtual void getParmValue(exint idx, UT_Vector2D &value) const
Definition: SOP_NodeVerb.h:213
virtual void setParmValue(exint idx, const exint &value)
Definition: SOP_NodeVerb.h:232
void addTransformError(const OP_Node &node, const char *label=0) const
Definition: SOP_NodeVerb.h:730
UT_ErrorSeverity sopAddWarning(int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Definition: SOP_NodeVerb.h:723
SOP_NodeCache * myCache
Definition: SOP_NodeVerb.h:896
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const
Definition: SOP_NodeVerb.h:297
bool cookInput(exint idx) override
Definition: SOP_NodeVerb.h:541
exint operator[](const exint off) const
Definition: SOP_NodeVerb.h:277
GLuint index
Definition: glew.h:1814
void clearCurGdh(int index) const
Definition: SOP_NodeVerb.h:830
virtual void setParmValue(exint idx, const UT_Vector4D &value)
Definition: SOP_NodeVerb.h:240
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value)
Definition: SOP_NodeVerb.h:310
void stealErrors(UT_ErrorManager &src, bool borrow_only=false) const
Definition: SOP_NodeVerb.h:153
void selectPoint(GA_Offset ptoff, bool point_sel=true, bool add_to_sel=false) const
Definition: SOP_NodeVerb.h:768
UT_ErrorSeverity addMessage(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Methods to add directly to any present error manager.
Definition: SOP_NodeVerb.h:707
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const
Definition: SOP_NodeVerb.h:300
UT_ErrorSeverity addWarning(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Definition: SOP_NodeVerb.h:134
void clearCurVertexNum(int index) const
Definition: SOP_NodeVerb.h:846
int64 exint
Definition: SYS_Types.h:125
UT_ErrorSeverity addMessage(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Methods to add directly to any present error manager.
Definition: SOP_NodeVerb.h:130
void resetLocalVarRefs() const
Definition: SOP_NodeVerb.h:826
InputParms(NodeInputs &inputs, NodeInputs &exprinputs, const SOP_NodeParms *parms, SOP_NodeCache *cache, UT_ErrorManager *error, DEP_MicroNode *depnode)
Definition: SOP_NodeVerb.h:569
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:113
UT_ErrorSeverity
Definition: UT_Error.h:25
UT_Array< GU_ConstDetailHandle > myExprInputs
Definition: SOP_NodeVerb.h:444
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value)
Definition: SOP_NodeVerb.h:313
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value)
Definition: SOP_NodeVerb.h:304
void stealErrors(UT_ErrorManager &src, bool borrow_only=false) const
Definition: SOP_NodeVerb.h:741
OP_Node * getCwd() const
The getCwd() should be used to evaluate relative paths.
Definition: SOP_NodeVerb.h:651
UT_ErrorSeverity sopAddMessage(int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Definition: SOP_NodeVerb.h:143
void select(const GA_Range &range, bool use_rtype=true, bool add_to_sel=false) const
Definition: SOP_NodeVerb.h:780
virtual ParmType getParmType(exint idx) const
Definition: SOP_NodeVerb.h:207
TempIndex(std::initializer_list< exint > list)
Definition: SOP_NodeVerb.h:261
CVEX_Function * myVexFunction
Definition: SOP_NodeVerb.h:76
const UT_Array< GU_ConstDetailHandle > & myInputs
Definition: SOP_NodeVerb.h:892
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
Definition: UT_Assert.h:208
virtual void setParmValue(exint idx, const UT_Matrix3D &value)
Definition: SOP_NodeVerb.h:244
bool setupLocalVars() const
Shims for local variables.
Definition: SOP_NodeVerb.h:824
virtual void getParmValue(exint idx, UT_Vector4D &value) const
Definition: SOP_NodeVerb.h:217
float fpreal32
Definition: SYS_Types.h:200
exint size() const
Definition: UT_Array.h:458
static void unregisterVerb(SOP_NodeVerb *verb)
GU_DetailHandle & myDestGdh
Definition: SOP_NodeVerb.h:891
virtual bool doPartialInputCook() const
Definition: SOP_NodeVerb.h:906
NodeInputs & exprinputs() const
Definition: SOP_NodeVerb.h:586
UT_ErrorManager * error() const
Definition: SOP_NodeVerb.h:596
virtual void resetLocalVariables(SOP_Node *sop) const
Definition: SOP_NodeVerb.h:927
UT_StringHolder myVEXpression
Definition: SOP_NodeVerb.h:77
UT_ErrorManager * error() const
Definition: SOP_NodeVerb.h:120
void clearCurPoint(int index) const
Definition: SOP_NodeVerb.h:834
UT_ErrorSeverity sopAddError(int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Definition: SOP_NodeVerb.h:726
const UT_Array< GU_ConstDetailHandle > & myGdps
Definition: SOP_NodeVerb.h:563
A range of elements in an index-map.
Definition: GA_Range.h:42
DEP_MicroNode * myDepNode
Definition: SOP_NodeVerb.h:898
const SOP_NodeParms * myParms
Definition: SOP_NodeVerb.h:603
virtual void setParmValue(exint idx, const UT_Vector2D &value)
Definition: SOP_NodeVerb.h:236
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const
Definition: SOP_NodeVerb.h:293
GA_Size GA_Offset
Definition: GA_Types.h:639
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const
Definition: SOP_NodeVerb.h:299
virtual void getParmValue(exint idx, PRM_DataItemHandle &value) const
Definition: SOP_NodeVerb.h:229
virtual void getParmValue(exint idx, UT_Matrix4D &value) const
Definition: SOP_NodeVerb.h:223
virtual void getParmValue(exint idx, fpreal &value) const
Definition: SOP_NodeVerb.h:211
UT_ErrorSeverity addError(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Definition: SOP_NodeVerb.h:138
GU_DetailHandle unloadInput(exint idx, bool flushce) override
Definition: SOP_NodeVerb.h:554
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value)
Definition: SOP_NodeVerb.h:307
GU_ConstDetailHandle inputGeoHandle(exint idx) const
Definition: SOP_NodeVerb.h:683
const char * getFullPath(UT_String &str) const
Definition: PRM_ParmOwner.h:46
const T & parms() const
Definition: SOP_NodeVerb.h:690
const SOP_NodeParms * myParms
Definition: SOP_NodeVerb.h:895
virtual void setupLocalVariables(SOP_Node *sop, const UT_Array< GU_ConstDetailHandle > &inputs) const
Definition: SOP_NodeVerb.h:926
const exint * begin() const
Definition: SOP_NodeVerb.h:275
T * getCookNode() const
Definition: SOP_NodeVerb.h:643
void addExplicitInput(DEP_MicroNode &inp, bool check_dup=true) const
Methods to wire directly to the optional depnode.
Definition: SOP_NodeVerb.h:703
void selectPrimitive(GA_Offset primoff, bool prim_sel=true, bool add_to_sel=false) const
Definition: SOP_NodeVerb.h:764
virtual void setParmValue(exint idx, const UT_SharedPtr< UT_Ramp > &value)
Definition: SOP_NodeVerb.h:250
void setCurPrim(int index, GA_Offset off) const
Definition: SOP_NodeVerb.h:840
UT_ErrorManager * myError
Definition: SOP_NodeVerb.h:605
CVEX_Context * myVexContext
Definition: SOP_NodeVerb.h:75
bool destroySelection() const
Definition: SOP_NodeVerb.h:809
UT_Array< UT_StringHolder > stringdata
Definition: SOP_NodeVerb.h:47
void select(GU_SelectionHandle selection, bool add_to_sel=false) const
Definition: SOP_NodeVerb.h:749
virtual void setParmValue(exint idx, const fpreal &value)
Definition: SOP_NodeVerb.h:234
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
void addExplicitInput(DEP_MicroNode &inp)
Definition: SOP_NodeVerb.h:126
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const
Definition: SOP_NodeVerb.h:295
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:134
virtual exint nInputs() const =0
void selectFrom(const GEO_Primitive &prim, bool sel_prim=true, bool add_to_sel=false) const
Definition: SOP_NodeVerb.h:772
UT_ErrorManager * myError
Definition: SOP_NodeVerb.h:167
int hasInput() override
virtual const char * getNestParmName(TempIndex idx) const
Definition: SOP_NodeVerb.h:288
void clearSelection() const
Definition: SOP_NodeVerb.h:795
virtual bool usesCE() const
Definition: SOP_NodeVerb.h:944
SOP_Node * getSrcNode() const
The node that generated this verb, if any...
Definition: SOP_NodeVerb.h:649
bool hasInput(exint idx) const override
Returns if the input is wired.
Definition: SOP_NodeVerb.h:534
virtual void setParmValue(exint idx, const UT_Matrix2D &value)
Definition: SOP_NodeVerb.h:242
void setCurPoint(int index, GA_Offset off) const
Definition: SOP_NodeVerb.h:832
UT_Array< SOP_CVEXDataBacking > myWriteBacking
Definition: SOP_NodeVerb.h:79
void selectInputGroup(const GA_Group *group, GA_GroupType grouptype) const
Definition: SOP_NodeVerb.h:788
const UT_IntArray & timedeps() const
Definition: SOP_NodeVerb.h:441
virtual exint getNumParms() const
Definition: SOP_NodeVerb.h:205
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const
Definition: SOP_NodeVerb.h:294
void setExprInputs(const UT_Array< GU_ConstDetailHandle > &inputs, const UT_IntArray &timedeps)
Definition: SOP_NodeVerb.h:434
virtual bool hasInput(exint idx) const =0
Returns if the input is wired.
virtual SOP_NodeCache * allocCache() const
Definition: SOP_NodeVerb.h:413
virtual exint getNestNumParms(TempIndex idx) const
Definition: SOP_NodeVerb.h:287
void selectPointsFrom(GA_Offset ptoff, bool point_sel=true, bool add_to_sel=false) const
Definition: SOP_NodeVerb.h:776
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value)
Definition: SOP_NodeVerb.h:312
CookParms(GU_DetailHandle &destgdh, const UT_Array< GU_ConstDetailHandle > &inputs, SOP_CookEngine cookengine, OP_Node *node, const OP_Context &context, const SOP_NodeParms *parms, SOP_NodeCache *cache, UT_ErrorManager *error, DEP_MicroNode *depnode)
Definition: SOP_NodeVerb.h:612
long long int64
Definition: SYS_Types.h:116
void markInputUnused(exint idx) override
Definition: SOP_NodeVerb.h:561
const OP_Context & getContext() const
Definition: SOP_NodeVerb.h:652
*Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
UT_ErrorSeverity sopAddError(int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Definition: SOP_NodeVerb.h:149
void clearCurPrim(int index) const
Definition: SOP_NodeVerb.h:842
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value)
Definition: SOP_NodeVerb.h:305
virtual void setParmValue(exint idx, const UT_Vector3D &value)
Definition: SOP_NodeVerb.h:238
SOP_CookEngine
Definition: SOP_NodeVerb.h:50
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value)
Definition: SOP_NodeVerb.h:306
virtual void getParmValue(exint idx, exint &value) const
Definition: SOP_NodeVerb.h:209
virtual ~SOP_NodeParms()
Definition: SOP_NodeVerb.h:87
virtual bool evaluatesParametersDuringCook() const
Definition: SOP_NodeVerb.h:934
virtual void getParmValue(exint idx, UT_Vector3D &value) const
Definition: SOP_NodeVerb.h:215
void setCurVertexNum(int index, exint num) const
Definition: SOP_NodeVerb.h:844
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
void select(GA_GroupType gtype=GA_GROUP_PRIMITIVE) const
Definition: SOP_NodeVerb.h:745
LoadParms(SOP_NodeParms *parms, SOP_CookEngine cookengine, const SOP_GraphProxy *graph, exint nodeidx, const OP_Context &context, SOP_NodeCache *cache, UT_ErrorManager *error, DEP_MicroNode *depnode)
Definition: SOP_NodeVerb.h:92
UT_SharedPtr< GU_Selection > GU_SelectionHandle
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value)
Definition: SOP_NodeVerb.h:303
virtual bool cookInputs(const InputParms &parms) const
Definition: SOP_NodeVerb.h:907
UT_ErrorManager * error() const
Definition: SOP_NodeVerb.h:699
bool hasInput(exint idx) const
Definition: SOP_NodeVerb.h:672
GLuint GLsizei GLsizei GLchar * label
Definition: glew.h:8986
virtual void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const
Definition: SOP_NodeVerb.h:301
const OP_Context & myContext
Definition: SOP_NodeVerb.h:894
int sprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
virtual ~SOP_NodeVerb()
Definition: SOP_NodeVerb.h:389
virtual void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const
Definition: SOP_NodeVerb.h:292
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:121
GLsizei const GLchar *const * path
Definition: glew.h:6461
GU_DetailHandle inputGeo(exint idx) override
Returns an invalid handle if the input isn't wired or not yet cooked.
Definition: SOP_NodeVerb.h:547
void select(const GEO_Primitive &prim, bool sel_prim=true, bool add_to_sel=false) const
Definition: SOP_NodeVerb.h:760
UT_ErrorSeverity addWarning(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Definition: SOP_NodeVerb.h:711
UT_LockedRawPtr< UT_ErrorManager, OP_Lock > getLockedErrorManager() const
Definition: SOP_NodeVerb.h:884
void setCurVertex(int index, GA_Offset off) const
Definition: SOP_NodeVerb.h:836
UT_Array< SOP_CVEXDataBacking > myReadBacking
Definition: SOP_NodeVerb.h:78
void select(const GA_Group &group, bool use_gtype=true, bool add_to_sel=false) const
Definition: SOP_NodeVerb.h:755
A class holding a VEX function.
Definition: CVEX_Function.h:30
virtual void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const
Definition: SOP_NodeVerb.h:291
SYS_FORCE_INLINE bool UTisstring(const char *s)
Definition: UT_String.h:57
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value)
Definition: SOP_NodeVerb.h:311
GLuint num
Definition: glew.h:2690
fpreal64 fpreal
Definition: SYS_Types.h:277
const SOP_GraphProxy * myGraph
Definition: SOP_NodeVerb.h:163
SOP_NodeCache * cache() const
Definition: SOP_NodeVerb.h:118
T * data()
Definition: UT_Array.h:634
OP_API OP_Director * OPgetDirector()
bool selectionEnabled() const
Definition: SOP_NodeVerb.h:816
DEP_MicroNode * myDepNode
Definition: SOP_NodeVerb.h:606
UT_ErrorSeverity addError(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Definition: SOP_NodeVerb.h:715
GA_GroupType
An ordinal enum for the different types of groups in GA.
Definition: GA_Types.h:159
virtual const char * getParmName(exint idx) const
Definition: SOP_NodeVerb.h:206
UT_Map< const OP_Node *, NodeExecuteInfo > ForbiddenNodeMap
Definition: SOP_NodeVerb.h:448
UT_StringHolder formatError(const char *msg) const
Prefix errors so we can get sensible results.
Definition: SOP_NodeVerb.h:862
int64 getMemoryUsage(bool inclusive) const
Definition: SOP_NodeVerb.h:37
A global error manager scope.
void resetLocalVariableAccessed() const
Tracks if any local variables were accessed by op functions.
Definition: SOP_NodeVerb.h:853
#define SOP_API
Definition: SOP_API.h:10
const GU_Detail * inputGeo(exint idx) const
Definition: SOP_NodeVerb.h:678
void setVariableOrder(int detail, int prim, int pt, int vtx) const
Definition: SOP_NodeVerb.h:848
void clearCurVertex(int index) const
Definition: SOP_NodeVerb.h:838
virtual bool cookInput(exint idx)=0
SOP_NodeCache * cache() const
Definition: SOP_NodeVerb.h:695
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:654
virtual void setParmValue(exint idx, const UT_StringHolder &value)
Definition: SOP_NodeVerb.h:248
virtual void setParmValue(exint idx, const UT_Matrix4D &value)
Definition: SOP_NodeVerb.h:246
GLuint64EXT * result
Definition: glew.h:14007
void clearSelection(GA_GroupType gtype) const
Definition: SOP_NodeVerb.h:802
const T & parms() const
Definition: SOP_NodeVerb.h:116
NodeInputs & inputs() const
Definition: SOP_NodeVerb.h:584
virtual void getParmValue(exint idx, UT_SharedPtr< UT_Ramp > &value) const
Definition: SOP_NodeVerb.h:227
SOP_NodeCache * myCache
Definition: SOP_NodeVerb.h:166
bool wasLocalVariableAccessed() const
Definition: SOP_NodeVerb.h:855
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value)
Definition: SOP_NodeVerb.h:308
virtual bool requiresCEFlush() const
Definition: SOP_NodeVerb.h:943
virtual void getParmValue(exint idx, UT_Matrix2D &value) const
Definition: SOP_NodeVerb.h:219
UT_ErrorSeverity sopAddWarning(int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Definition: SOP_NodeVerb.h:146
Call VEX from C++.
Definition: CVEX_Context.h:175
GLenum GLuint GLsizei const GLchar * buf
Definition: glew.h:2580
void coerceValue(T &result, const S &src) const
Definition: SOP_NodeVerb.h:320
GLsizei const GLfloat * value
Definition: glew.h:1849
exint nInputs() const
Definition: SOP_NodeVerb.h:671
SOP_NodeParms * myParms
Definition: SOP_NodeVerb.h:162
const OP_Context & context() const
Definition: SOP_NodeVerb.h:119
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
virtual void setParmValue(exint idx, const PRM_DataItemHandle &value)
Definition: SOP_NodeVerb.h:252
virtual CookMode cookMode(const SOP_NodeParms *parms) const
Definition: SOP_NodeVerb.h:936
void addExplicitInput(DEP_MicroNode &inp, bool check_dup)
Methods to wire directly to the optional depnode.
Definition: SOP_NodeVerb.h:124
GU_DetailHandle & gdh() const
The initial state of gdh depends on the cookMode()
Definition: SOP_NodeVerb.h:634
UT_ErrorManager * myError
Definition: SOP_NodeVerb.h:897
virtual void copyFrom(const SOP_NodeParms *src)
Definition: SOP_NodeVerb.h:183
GLboolean GLuint group
Definition: glew.h:2745
DEP_MicroNode * myDepNode
Definition: SOP_NodeVerb.h:168
virtual void getParmValue(exint idx, UT_StringHolder &value) const
Definition: SOP_NodeVerb.h:225
SOP_NodeCache * myCache
Definition: SOP_NodeVerb.h:604