HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ROP_Node.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: ROP Library (C++)
7  *
8  * COMMENTS: The base class for all Render Operators
9  *
10  */
11 
12 #ifndef __ROP_Node_h__
13 #define __ROP_Node_h__
14 
15 #include "ROP_API.h"
16 #include <OP/OP_Network.h>
17 #include <CH/CH_Manager.h>
18 #include "ROP_Verbose.h"
19 #include "ROP_RenderItem.h"
20 
21 class OP_OperatorTable;
22 class OP_TemplatePair;
23 class IMG_Raster;
24 class UT_Interrupt;
25 class UT_IStream;
26 
27 class ROP_Verbose;
28 class ROP_Node;
29 class ROP_ExecuteContext;
30 class ROP_IFD;
31 class ROP_IFDBase;
32 class ROP_SohoOp;
33 class ROP_RenderCmdParms;
34 class ROP_RenderItem;
35 class ROP_RenderList;
36 class ROP_RenderDepParms;
37 class GU_DetailHandle;
38 class TAKE_Take;
39 class TIL_Sequence;
40 class IMG_Format;
41 class IMG_TileOptions;
42 class IMG_FileParms;
43 
44 extern "C" {
46 };
47 
49 {
50  ROP_ABORT_RENDER = 0, // Stop rendering
51  ROP_CONTINUE_RENDER = 1, // Go on to the next frame
52  ROP_RETRY_RENDER = 2 // Retry this frame (primarily for network)
53 };
54 
56 {
66 };
67 
69 {
76 };
77 
78 enum
79 {
87 };
88 
89 typedef void (*ROP_ExecuteOverride)(ROP_Node *me, fpreal time, void *data);
91 typedef bool (*ROP_RenderEventCallback)(
92  ROP_Node *node,
94  fpreal time,
95  void *data);
96 
97 #define FLT_PARM(name, vi, t) \
98  { return evalFloat(name, vi, t); }
99 #define FLT_SET(name, vi, t, val) \
100  { setFloat(name, vi, t, val); }
101 #define INT_SET(name, vi, t, val) \
102  { setInt(name, vi, t, val); }
103 
104 #define INT_PARM(name, vi, t) \
105  { return evalInt(name, vi, t); }
106 
107 #define INT_SET(name, vi, t, val) \
108  { setInt(name, vi, t, val); }
109 
110 #define STR_PARM(name, vi, t) \
111  { evalString(str, name, vi, t); }
112 
113 //___________________________________________________________________________
114 
115 class ROP_SohoOutput;
116 class SOHO_IPRList;
117 class ROP_OpenGL;
118 
120 {
121 public:
122  // Standard OP_Network stuff:
123  static const char *theChildTableName;
124  const char *getChildType() const override;
125  const char *getOpType() const override;
126 
127  OP_OpTypeId getChildTypeID() const override;
128  OP_OpTypeId getOpTypeID() const override;
129 
130  // Nobody should have to override this, but it's public for other people
131 
132  bool updateParmsFlags() override;
133  OP_DataType getCookedDataType() const override;
134  void *getCookedData(const OP_Context &context) override;
135 
136  // The castToROPIFD() method returns a pointer to an IFD node or NULL
137  // if the ROP is not an IFD ROP. If a pointer is returned it may be
138  // a representative node, and care must be taken to not confuse the
139  // returned node with the node on which the method was called.
140  // TODO: check places that store the return of this function.
141  virtual ROP_IFD *castToROPIFD();
142  virtual ROP_IFDBase *castToROPIFDBase();
143  virtual ROP_SohoOp *castToROPSoho();
144  virtual ROP_OpenGL *castToROPOpenGL();
145 
146  virtual bool hasImageOutput();
147 
148  // Returns true if rendering will overwrite any existing files.
149  virtual bool detectIfExistingOutputFiles();
150  // Runs through the output sequence deleting any matching files.
151  virtual void deleteExistingOutputFiles();
152 
153  static void buildOperatorTable(OP_OperatorTable &table);
154  static OP_Operator *getManagementOperator();
155  static OP_Operator *getCHOPManagementOperator();
156  static OP_Operator *getCOP2ManagementOperator();
157  static OP_Operator *getCOPManagementOperator();
158  static OP_Operator *getDOPManagementOperator();
159  static void addSOPManagementOperators(OP_OperatorTable *table);
160  static OP_Operator *getLOPSaveOperator();
161  static OP_Operator *getLOPRenderOperator();
162  static void buildGameOperatorTable(OP_OperatorTable &table);
163  static void initSimulationOPs();
164  //
165  // The following method will return 1 if the raster was successfully
166  // generated. Otherwise, it will return 0.
167  // If the OP is incapable of generating a raster, an error will be
168  // generated.
169  int renderFile(OP_Context &ctx, float aspect,
170  const char *file);
171 
172  /// Reference one parameter. However, for ROPs, we don't want to
173  /// reference the render button.
175  int parm_idx,
176  const char *relative_path = NULL) override;
177 
178  OP_ERROR execute(fpreal now, ROP_Verbose *verbose=NULL);
179  OP_ERROR executeSingle(fpreal time,
180  ROP_Verbose *verbose=NULL,
181  SOHO_IPRList *ipr=0,
182  ROP_SohoOutput *out=0,
183  bool generate=false);
184 
185  // Execute full will perform a render for the viewport or render menu.
186  // 1) If not a sequence render, force background rendering
187  // 2) Call the render manager to execute the render network
188  // 3) Restore things
189  OP_ERROR executeFull(fpreal now, bool sequence = false);
190 
191  // These calling mechanisms allow us to start an execute, then call
192  // nextExecute() on our own time, finishing with endExecute(). This allows
193  // callers to do things between renders...
194  ROP_ExecuteContext *getExecuteContext() { return myEContext; }
195  void setExecuteContext(ROP_ExecuteContext *c)
196  { myEContext = c; }
197 
199  { myExecuteOverride = f;
200  myExecuteOverrideData = d;
201  }
203  { myPreExecuteOverride = f;
204  myPreExecuteOverrideData = d;
205  }
207  { myPostExecuteOverride = f;
208  myPostExecuteOverrideData = d;
209  }
210  OP_ERROR startExecute(fpreal now, ROP_Verbose *verbose = NULL);
211  OP_ERROR nextExecute(int &again);
212  OP_ERROR endExecute(int &again);
213 
215  {
216  myRenderMode = mode;
217  }
218 
220  {
221  return myRenderMode;
222  }
223 
224  void setRenderOutput(UT_String &);
225  UT_String &getRenderOutput();
226  UT_String &getRenderDevice();
227  UT_String &getRenderSuffix();
228  void setRenderResX(int x);
229  void setRenderResY(int y);
230  int getRenderResX();
231  int getRenderResY();
232  void setRenderAspect(float aspect);
233  float getRenderAspect();
234 
235  virtual void getRenderedImageInfo(TIL_Sequence &seq);
236 
237  // The following methods have to be public for Remote
238  virtual void SETDORANGE(int val)
239  { INT_SET("trange", 0, 0, val) }
240  virtual int DORANGE()
241  {
242  if(myOverrideFrameRangeFlag)
243  return 1;
244  initRenderDependencyVars(CHgetEvalTime());
245  return myCachedDoRange;
246  }
247 
248  virtual fpreal FSTART()
249  {
250  if(myOverrideFrameRangeFlag)
251  return myOverrideStartFrame;
252  initRenderDependencyVars(CHgetEvalTime());
253  return myCachedStart;
254  }
255  virtual fpreal FEND()
256  {
257  if(myOverrideFrameRangeFlag)
258  return myOverrideEndFrame;
259  initRenderDependencyVars(CHgetEvalTime());
260  return myCachedEnd;
261  }
262 
263  virtual fpreal FINC()
264  {
265  if(myOverrideFrameRangeFlag)
266  return myOverrideFrameInc;
267  initRenderDependencyVars(CHgetEvalTime());
268  return myCachedInc;
269  }
270  virtual bool SETROPCOOK();
271 
272 
273  static int doRenderCback(void *data, int index,
274  fpreal time,
275  const PRM_Template *);
276 
277  static int doRenderBackgroundCback(void *data, int index,
278  fpreal time,
279  const PRM_Template *);
280  static int doRenderDialog(void *data, int index,
281  fpreal time,
282  const PRM_Template *);
283 
284  static PRM_Template *getROPbaseTemplate();
285  static PRM_Template *getROPscriptTemplate();
286  static OP_TemplatePair *getROPcop2Template();
287  static OP_TemplatePair *getROPcopTemplate();
288  static CH_LocalVariable myVariableList[];
289 
290  bool executePreRenderScript(fpreal ttime);
291  bool executePreFrameScript(fpreal ttime);
292  bool executePostFrameScript(fpreal ttime);
293  bool executePostWriteScript(fpreal ttime);
294  bool executePostRenderScript(fpreal ttime);
295  bool executeIPRStopScript(fpreal ttime);
296 
297  static void buildRibVersionMenu(PRM_Name *menu, int max,
298  bool for_archive=false);
299 
300  //Absolute Width
301  fpreal getW() const override;
302  //Absolute Height
303  fpreal getH() const override;
304 
305  // This adds render items to a ordered list. The list is traversed from
306  // 1 -> entries to render.
307  virtual void buildRenderDependencies(const ROP_RenderDepParms &p);
308 
309  virtual void postProcessList( ROP_RenderList &list,
310  const ROP_RenderDepParms &p);
311 
312  virtual void initRenderDependencies();
313  virtual void cleanupRenderDependencies();
314 
315  void addJobFrames(const char *job_name,
316  const char *frame_string);
317 
318  static void setDependencyRenderFlag(bool f);
319  static bool getDependencyRenderFlag();
320 
321  static void setFrameByFrameFlag(bool f);
322  static bool getFrameByFrameFlag();
323 
324  static void setRenderScriptFlag(bool enable);
325  static bool getRenderScriptFlag();
326 
327  static void setOutputResolutionScale(fpreal xscale,fpreal yscale);
328  static void getOutputResolutionScale(float &xs, float &ys);
329 
330  virtual bool getOutputResolution(int &x, int &y)
331  { x = y = 0; return false; }
332  virtual void getOutputFile(UT_String & /*name*/) { }
333 
334  // three levels - 0 = low/fastest, 1 = med/fast, 2 = normal
335  static void setRenderQuality(int quality);
336  int getRenderQuality();
337 
338  // Override the frame range used by this node
339  void overrideFrameRange(bool enable,
340  fpreal s=1.0, fpreal e=1.0,
341  fpreal i=1.0);
342 
343 
344  // Return true if the output is currently overridden
345  bool isOutputOverridden() const
346  { return myOverrideOutputFlag; }
347 
348  // Override the output filename for this node. Used by the hscript render
349  // -o command.
350  virtual void overrideOutput(bool enable, const char *fname=0);
351 
352  // Return the overriden filename. 'fname' is NOT modified if this function
353  // returns false. Deprecated, use getOutputOverrideEx() instead.
354  bool getOutputOverride(
355  UT_String &fname,
356  fpreal t,
357  bool expand = true) const;
358 
359  // getOutputOverrideEx() differs from getOutputOverride() in that it will
360  // perform the necessary parm evaluation as well so that we string result
361  // will always returned. Since this requires expansion, it will always call
362  // getOutputOverride(...,expand=true).
363  //
364  // For compatibility, it returns true if the result was overridden, false
365  // otherwise. Method is non-const since it may add warnings upon failure to
366  // create the output directory.
367  bool getOutputOverrideEx(
368  UT_String &result,
369  fpreal t,
370  const char *output_parm_name,
371  const char *mkdir_parm_name);
372 
373  virtual void overrideDevice(bool enable, bool interactive=false,
374  const char *devicestr=0);
375  bool getDeviceOverride(UT_String &str, fpreal t,
376  bool expand = true) const;
377 
378  static void setRenderButtonCB(ROP_RenderButtonCB cb);
379 
380  void inputConnectChanged(int which) override;
381 
382  void getNodeSpecificInfoText(OP_Context &context,
383  OP_NodeInfoParms &iparms) override;
385  const OP_NodeInfoTreeParms &parms) override;
386 
387  virtual bool getGeometryHandle(const char *path, fpreal t,
388  GU_DetailHandle &gdh,
389  UT_DMatrix4 &world_xform)
390  { return(false); }
391 
392  // forces a BG render in executeSingle().
393  void forceBackgroundRender(bool f = true)
394  { myForceBackgroundRender = f; }
396  { return myForceBackgroundRender; }
397 
398  // Add some additional inputs to the ROP (used by Fetch and Subnet).
400  { myTemporaryInputs = in; }
401  void clearTemporaryInputs() { myTemporaryInputs.entries(0);}
402 
403  /// Render this node using the parameters set in render_parms.
404  bool renderCommand(ROP_RenderCmdParms &render_parms);
405 
406  // Copy the errors from this node into an error manager. This method
407  // is used to save off errors before they're cleared.
408  void copyErrorsInto(UT_ErrorManager &error_manager)
409  { error_manager.stealErrors(*getLockedErrorManager()); }
410 
411  // Append the errors from an error manager into this node.
412  void copyErrorsFrom(UT_ErrorManager &error_manager)
413  { getLockedErrorManager()->stealErrors(error_manager); }
414 
415  // Get the last render dependency item that cooked in this node in the
416  // current cook.
418  { return myLastRenderItem; }
419 
420  /// Helper that appends the inputs and other rop nodes that
421  /// this node depends on to the give list.
422  virtual bool isRenderDependentOnNode(ROP_Node *node,
423  const ROP_RenderDepParms &parms);
424 
425  /// Adds a render event callback to the this node. The function will be
426  /// invoked after each of the render scripts, e.g. pre-render or post-fame.
427  void addRenderEventCallback(
428  ROP_RenderEventCallback callback,
429  void* data,
430  bool run_before_script);
431 
432  /// Removes a render event callback that was added previously
433  void removeRenderEventCallback(
434  ROP_RenderEventCallback callback,
435  void* data);
436 
437  static void setColorCorrectionIPGamma(bool enable, fpreal gamma);
438  static fpreal getColorCorrectionIPGamma();
439  static void setColorCorrectionIPLUT(bool enable, const char *lut);
440  static const char *getColorCorrectionIPLUT();
441 
442  static void setColorCorrectionEnvVariables(bool set);
443  static void setFPSVariable(bool do_set = 0, fpreal frame_inc = 1);
444 
445  virtual ROP_RENDER_CODE rerenderFrame();
446 
447 protected:
448  ROP_Node(OP_Network *parent, const char *name, OP_Operator *entry);
449  ~ROP_Node() override;
450 
451  // These OPs don't actually cook. No data, nothing. The renderFile()
452  // method is the closest thing to a cook.
453  OP_ERROR cookMe(OP_Context &context) override;
454  OP_ERROR bypassMe(OP_Context &context,
455  int &copied_input) override;
456  OP_ERROR initFrameRange(fpreal now, ROP_ExecuteContext &ctx);
457 
458  void onCreated() override;
459 
460 
461  void addSystemError(const char *msg = 0)
462  { getLockedErrorManager()->systemError(msg);}
463  void addError(int code, const char *msg = 0)
464  { getLockedErrorManager()->addError(ROP_OPTYPE_NAME, code, msg);}
465  void addWarning(int code, const char *msg = 0)
466  { getLockedErrorManager()->addWarning(ROP_OPTYPE_NAME, code, msg); }
467  void addMessage(int code, const char *msg = 0)
468  { getLockedErrorManager()->addMessage(ROP_OPTYPE_NAME, code, msg); }
469 
471  int thread) override
472  { return OP_Network::evalVariableValue(v, index, thread); }
473  bool evalVariableValue(fpreal &v, int index,
474  int thread) override;
475 
476  // The endRender() method will always be called if startRender succeeds.
477  virtual int startRender(int nframes, fpreal tstart,
478  fpreal tend);
479  virtual ROP_RENDER_CODE renderFrame(fpreal time,
480  UT_Interrupt *boss = 0);
481  virtual ROP_RENDER_CODE endRender();
482 
483 
484  TAKE_Take *applyRenderTake(const char *take);
485  void restorePreviousTake(TAKE_Take *take);
486 
487  void initRenderDependencyVars(fpreal t);
488  virtual void doInitRenderDependencyVars(fpreal t);
489 
490  // Internal helper method that simply traverses our inputs and calls
491  // buildRenderDependencies on them.
492  virtual void buildInputRenderDependencies(
493  const ROP_RenderDepParms &parms);
494 
495  bool matchingLastRenderParms(
496  const ROP_RenderDepParms &parms);
498  { myLastRenderItem = item; }
499  void clearLastRenderDep();
500 
501  // This method returns the image device required to render it to an
502  // interactive window (an mplay window, for example).
503  virtual const char *getInteractiveImageDevice() const { return ""; }
504 
505  virtual void FSTART_SET(fpreal val)
506  { FLT_SET("f", 0, 0, val); }
507  virtual void FEND_SET(fpreal val)
508  { FLT_SET("f", 1, 0, val); }
509  virtual void FINC_SET(fpreal val)
510  { FLT_SET("f", 2, 0, val); }
511  virtual void DORANGE_SET(int val)
512  { INT_SET("trange", 0, 0, val); }
513 
514  virtual void RENDER_TAKE(UT_String &take)
515  { evalString(take, "take", 0, 0.0f); }
516 
529 
531  { return myVerbose; }
532  std::ostream *getVerbose() const
533  { return myVerbose.getStream(); }
534  bool getAlfred() const
535  { return myVerbose.getAlfred(); }
536 
543 
544 protected:
545  //
546  // These virtuals are methods that nobody should override...
547  // Except IPR buffers which are now saved as cooked data
548  //
549  // I/O methods
550  //
551  void deleteCookedData() override;
552  int saveCookedData(const char *, OP_Context &) override;
553  int saveCookedData(std::ostream &os, OP_Context &,
554  int binary = 0) override;
555 
556  // If there is a problem executing the script, then an error will be set
557  // here.
558  // Note that this has to remain protected (and not be made private) because
559  // there are customers who inherit from ROP_Node and use this function.
560  OP_ERROR executeScript(
561  UT_String &str, CH_ScriptLanguage language, fpreal time);
562 
564  { return myTemporaryInputs.entries(); }
565 
567  { return myTemporaryInputs(i); }
568 
569  // Create all intermediate directories for the given file path. Returns
570  // false IFF it attempted to create the directories but failed to do so. In
571  // that case, a warning will be added.
572  bool makeFilePathDirs(const UT_String &path);
573 
574  /// Override if preview is supported by rendering to 'ip'.
575  virtual bool isPreviewAllowed() { return false; }
576 
577 
578  void applyImageFormatOptions(IMG_TileOptions &opts,
579  const IMG_Format *fmt,
580  fpreal t);
581  void applyImageFormatOptions(IMG_FileParms &parms,
582  const IMG_Format *fmt,
583  fpreal t);
584 
585 private:
586  struct EventCallbackEntry
587  {
588  ROP_RenderEventCallback myCallback;
589  void *myData;
590  bool myRunBeforeScript;
591  };
592 
593  const char *getFileExtension(int binary) const override;
594 
595  static void resetSimulation(OP_Node* node);
596 
597  ROP_ExecuteContext *myEContext;
598  ROP_Verbose myVerbose;
599  ROP_ExecuteOverride myExecuteOverride;
600  void *myExecuteOverrideData;
601  ROP_ExecuteOverride myPreExecuteOverride;
602  void *myPreExecuteOverrideData;
603  ROP_ExecuteOverride myPostExecuteOverride;
604  void *myPostExecuteOverrideData;
605 
606  bool myForceBackgroundRender;
607 
608  bool myOverrideFrameRangeFlag;
609  fpreal myOverrideStartFrame;
610  fpreal myOverrideEndFrame;
611  fpreal myOverrideFrameInc;
612 
613  bool myOverrideOutputFlag;
614  UT_String myOverrideOutputName;
615 
616  bool myOverrideDeviceFlag;
617  UT_String myOverrideDeviceName;
618 
619  bool myExecuteFull; // Recursion check
620  UT_ValArray<ROP_Node *> myTemporaryInputs;
621  ROP_RenderDepParms *myLastRenderParms;
622  ROP_RenderItemHandle myLastRenderItem;
623 
624  UT_Array<EventCallbackEntry> myRenderEventCallbacks;
625 
626  bool executeCallback(fpreal ttime,
627  ROP_RenderEventType event_type,
628  bool before_script);
629  bool executeParmScript(const char *parm_name,
630  fpreal ttime,
631  ROP_RenderEventType event_type);
632  bool executeParmScripts(const char *parm_name,
633  fpreal ttime,
634  ROP_RenderEventType event_type);
635 
636  static int doRenderCommand(CMD_Args &args, OP_Node *net,
637  bool showerrors);
638 
639  static void installCommands();
640  static void cmdRender(CMD_Args &args);
641  static void cmdRenderDeps(CMD_Args &args);
642 };
643 
644 // These are the parms to the buildRenderDependencies methods.
646 {
647 public:
649  myOrder(NULL),
650  myFullStart(0.0f),
651  myFullEnd(0.0f),
652  myFullFrameInc(0.0f),
653  myStart(0.0f),
654  myEnd(0.0f),
655  myFrameInc(0.0f),
656  myDoInputs(false),
657  myIgnoreBypass(true),
658  myIgnoreLocks(false),
659  myFrameMerge(true),
660  myRenderSerial(-1),
661  myDepParent(NULL),
662  myTopLevelRop(NULL),
663  myFirstFrameFlag(true) { }
664 
665  // copy constructor; some members are initilized to NULL rather than copied.
667  : myRenderSerial(-1)
668  {
669  *this = copy;
670  }
672  {
673  myDepParent = NULL;
674  }
675 
676  // Set/Get RenderList
677  void setOrder(ROP_RenderList &order) { myOrder = &order; }
678  ROP_RenderList &getOrder() const { UT_ASSERT(myOrder); return *myOrder; }
679 
680  // Set/Get Frame Range
682  { myFullStart = start; myFullEnd = end; myFullFrameInc = finc; }
684  { myStart = start; myEnd = end; myFrameInc = finc; }
685  fpreal getFullStart() const { return myFullStart; }
686  fpreal getFullEnd() const { return myFullEnd; }
687  fpreal getFullFrameInc() const { return myFullFrameInc; }
688  fpreal getStart() const { return myStart; }
689  fpreal getEnd() const { return myEnd; }
690  fpreal getFrameInc() const { return myFrameInc; }
691 
693  {
694  fpreal start = myFullStart;
695  fpreal end = myFullEnd;
696  fpreal finc = myFullFrameInc;
697  if(rop.DORANGE()==2)
698  {
699  start = rop.FSTART();
700  end = rop.FEND();
701  finc = rop.FINC();
702  }
703  if (start > end)
704  UTswap(start, end);
705  if (finc <= 0)
706  finc = 1.0;
707  setFrameRange(start, end, finc);
708  }
709 
710  // Set/Get Input traversal flags
711  void setDoInputsFlag(bool do_inputs) { myDoInputs = do_inputs; }
712  bool getDoInputs() const { return myDoInputs; }
713 
714  // Set/Get TopLevel ROP -- this is the top most ROP that is traversed. This
715  // is used to prevent subnet traversals to go outside this ROP. Only
716  // useful when DoInputs is off.
717  void setTopLevelRop(ROP_Node *rop) { myTopLevelRop = rop; }
718  ROP_Node *getTopLevelRop() const { return myTopLevelRop; }
719 
720  // Set/Get Ignore flags
721  void setIgnoreFlags(bool ignore_bypass, bool ignore_locks)
722  {
723  myIgnoreBypass = ignore_bypass;
724  myIgnoreLocks = ignore_locks;
725  }
726  bool getIgnoreBypass() const { return myIgnoreBypass; }
727  bool getIgnoreLocks() const { return myIgnoreLocks; }
728 
729  // Set/Get Render Serial number
730  void setRenderSerial(int render_serial)
731  { myRenderSerial = render_serial; }
732  int getRenderSerial() const { return myRenderSerial; }
733 
734  // Set/Get Dependency parent
735  void setDepParent(const ROP_RenderItemHandle &dep_parent)
736  { myDepParent = dep_parent; }
737  const ROP_RenderItemHandle &getDepParent() const { return myDepParent; }
738 
739  void setFirstFrame(bool first) { myFirstFrameFlag = first; }
740  bool isFirstFrame() const { return myFirstFrameFlag; }
741 
742  void setFrameMerge(bool merge) { myFrameMerge = merge; }
743  bool getFrameMerge() const { return myFrameMerge; }
744 
746  {
747  myOrder = copy.myOrder;
748  myDepParent = copy.myDepParent;
749  myTopLevelRop = copy.myTopLevelRop;
750  myFullStart = copy.myFullStart;
751  myFullEnd = copy.myFullEnd;
752  myFullFrameInc = copy.myFullFrameInc;
753  myStart = copy.myStart;
754  myEnd = copy.myEnd;
755  myFrameInc = copy.myFrameInc;
756  myRenderSerial = copy.myRenderSerial;
757  myDoInputs = copy.myDoInputs;
758  myIgnoreBypass = copy.myIgnoreBypass;
759  myIgnoreLocks = copy.myIgnoreLocks;
760  myFrameMerge = copy.myFrameMerge;
761  myFirstFrameFlag = copy.myFirstFrameFlag;
762  return *this;
763  }
765  {
766  return (myFullStart == copy.myFullStart &&
767  myFullEnd == copy.myFullEnd &&
768  myFullFrameInc == copy.myFullFrameInc &&
769  myStart == copy.myStart &&
770  myEnd == copy.myEnd &&
771  myFrameInc == copy.myFrameInc &&
772  myDoInputs == copy.myDoInputs &&
773  myIgnoreBypass == copy.myIgnoreBypass &&
774  myIgnoreLocks == copy.myIgnoreLocks &&
775  myFrameMerge == copy.myFrameMerge &&
776  myRenderSerial == copy.myRenderSerial);
777  }
778 
779 private:
780  ROP_RenderList *myOrder;
781  ROP_RenderItemHandle myDepParent;
782  ROP_Node *myTopLevelRop;
783  fpreal myFullStart;
784  fpreal myFullEnd;
785  fpreal myFullFrameInc;
786  fpreal myStart;
787  fpreal myEnd;
788  fpreal myFrameInc;
789  int myRenderSerial;
790  bool myDoInputs;
791  bool myIgnoreBypass;
792  bool myIgnoreLocks;
793  bool myFrameMerge;
794  bool myFirstFrameFlag;
795 };
796 
797 #undef FLT_PARM
798 #undef INT_PARM
799 #undef STR_PARM
800 #undef FLT_SET
801 #undef INT_SET
802 
803 #endif
virtual int saveCookedData(std::ostream &os, OP_Context &, int binary=0)=0
int myRenderY
Definition: ROP_Node.h:522
#define ROP_OPTYPE_NAME
Definition: OP_Node.h:294
GLint first
Definition: glcorearb.h:405
bool isOutputOverridden() const
Definition: ROP_Node.h:345
fpreal getFullFrameInc() const
Definition: ROP_Node.h:687
virtual bool updateParmsFlags()
void setDepParent(const ROP_RenderItemHandle &dep_parent)
Definition: ROP_Node.h:735
void setOrder(ROP_RenderList &order)
Definition: ROP_Node.h:677
static const char * theChildTableName
Definition: ROP_Node.h:123
fpreal getH() const override
Node position/scale is used by the UI.
virtual void getOutputFile(UT_String &)
Definition: ROP_Node.h:332
fpreal getW() const override
Node position/scale is used by the UI.
void addMessage(int code, const char *msg=0)
Definition: ROP_Node.h:467
uint64 OP_VERSION
Definition: OP_Version.h:6
ROP_RenderEventType
Definition: ROP_Node.h:68
fpreal getEnd() const
Definition: ROP_Node.h:689
virtual void FSTART_SET(fpreal val)
Definition: ROP_Node.h:505
ROP_RENDER_CODE
Definition: ROP_Node.h:48
void UTswap(T &a, T &b)
Definition: UT_Swap.h:35
void setFullFrameRange(fpreal start, fpreal end, fpreal finc)
Definition: ROP_Node.h:681
#define SYS_VISIBILITY_EXPORT
void
Definition: png.h:1083
virtual void FINC_SET(fpreal val)
Definition: ROP_Node.h:509
UT_String myRenderOutput
Definition: ROP_Node.h:517
bool myExecuteSingle
Definition: ROP_Node.h:526
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
const GLdouble * v
Definition: glcorearb.h:837
GLuint start
Definition: glcorearb.h:475
virtual void FEND_SET(fpreal val)
Definition: ROP_Node.h:507
virtual fpreal FEND()
Definition: ROP_Node.h:255
bool getAlfred() const
Definition: ROP_Node.h:534
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
void setExecuteOverride(ROP_ExecuteOverride f, void *d)
Definition: ROP_Node.h:198
int myCurrentFrame
Definition: ROP_Node.h:524
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
void addSystemError(const char *msg=0)
Definition: ROP_Node.h:461
bool isFirstFrame() const
Definition: ROP_Node.h:740
GLdouble s
Definition: glad.h:3009
UT_ErrorSeverity
Definition: UT_Error.h:25
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
OP_VERSION myCachedVersion
Definition: ROP_Node.h:541
GLint y
Definition: glcorearb.h:103
bool evalVariableValue(UT_String &v, int index, int thread) override
Definition: ROP_Node.h:470
ROP_RenderItemHandle getLastRenderDepItem() const
Definition: ROP_Node.h:417
fpreal myCachedTime
Definition: ROP_Node.h:542
**But if you need a result
Definition: thread.h:613
void clearTemporaryInputs()
Definition: ROP_Node.h:401
virtual void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &parms)
UT_String myRenderDevice
Definition: ROP_Node.h:518
virtual void SETDORANGE(int val)
Definition: ROP_Node.h:238
fpreal myCachedStart
Definition: ROP_Node.h:538
int myTotalFrames
Definition: ROP_Node.h:525
virtual OP_ERROR cookMe(OP_Context &context)=0
void setRenderSerial(int render_serial)
Definition: ROP_Node.h:730
#define ROP_API
Definition: ROP_API.h:10
fpreal getFullEnd() const
Definition: ROP_Node.h:686
std::ostream * getVerbose() const
Definition: ROP_Node.h:532
void setFirstFrame(bool first)
Definition: ROP_Node.h:739
struct _cl_event * event
Definition: glcorearb.h:2961
void setDoInputsFlag(bool do_inputs)
Definition: ROP_Node.h:711
const ROP_RenderDepParms & operator=(const ROP_RenderDepParms &copy)
Definition: ROP_Node.h:745
void setLastRenderDepItem(ROP_RenderItemHandle item)
Definition: ROP_Node.h:497
GLfloat f
Definition: glcorearb.h:1926
ROP_RenderDepParms(const ROP_RenderDepParms &copy)
Definition: ROP_Node.h:666
ROP_RenderMode getRenderMode()
Definition: ROP_Node.h:219
virtual const char * getInteractiveImageDevice() const
Definition: ROP_Node.h:503
virtual void DORANGE_SET(int val)
Definition: ROP_Node.h:511
virtual void RENDER_TAKE(UT_String &take)
Definition: ROP_Node.h:514
void forceBackgroundRender(bool f=true)
Definition: ROP_Node.h:393
virtual fpreal FSTART()
Definition: ROP_Node.h:248
ROP_Node * getTopLevelRop() const
Definition: ROP_Node.h:718
void evalString(UT_String &val, int pi, int vi, fpreal t) const
GLuint GLuint end
Definition: glcorearb.h:475
void setFullAscendingFrameRange(ROP_Node &rop)
Definition: ROP_Node.h:692
virtual bool getOutputResolution(int &x, int &y)
Definition: ROP_Node.h:330
bool getForceBackgroundRender() const
Definition: ROP_Node.h:395
void addWarning(int code, const char *msg=0)
Definition: ROP_Node.h:465
#define FLT_SET(name, vi, t, val)
Definition: ROP_Node.h:99
float myRenderAspect
Definition: ROP_Node.h:520
ROP_Node * getTemporaryInputs(int i) const
Definition: ROP_Node.h:566
void copyErrorsInto(UT_ErrorManager &error_manager)
Definition: ROP_Node.h:408
void addError(int code, const char *msg=0)
Definition: ROP_Node.h:463
GLdouble GLdouble GLint GLint order
Definition: glad.h:2676
void(* ROP_ExecuteOverride)(ROP_Node *me, fpreal time, void *data)
Definition: ROP_Node.h:89
#define INT_SET(name, vi, t, val)
Definition: ROP_Node.h:107
virtual bool referenceSingleParameter(OP_Parameters *from, int parm_idx, const char *relative_path=NULL)
OP_OpTypeId
Definition: OP_OpTypeId.h:18
fpreal CHgetEvalTime()
Definition: CH_Manager.h:2129
GLuint const GLchar * name
Definition: glcorearb.h:786
fpreal myCachedInc
Definition: ROP_Node.h:540
fpreal getFrameInc() const
Definition: ROP_Node.h:690
GLint GLenum GLint x
Definition: glcorearb.h:409
const ROP_RenderItemHandle & getDepParent() const
Definition: ROP_Node.h:737
virtual OP_DataType getCookedDataType() const =0
bool operator==(const ROP_RenderDepParms &copy)
Definition: ROP_Node.h:764
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
virtual OP_OpTypeId getOpTypeID() const
Definition: OP_Node.h:532
int getNumTemporaryInputs() const
Definition: ROP_Node.h:563
void setFrameRange(fpreal start, fpreal end, fpreal finc)
Definition: ROP_Node.h:683
void setTemporaryInputs(const UT_ValArray< ROP_Node * > &in)
Definition: ROP_Node.h:399
GLdouble t
Definition: glad.h:2397
bool getDoInputs() const
Definition: ROP_Node.h:712
GLenum mode
Definition: glcorearb.h:99
void setPreExecuteOverride(ROP_ExecuteOverride f, void *d)
Definition: ROP_Node.h:202
int stealErrors(UT_ErrorManager &victim, int rangestart=0, int rangeend=-1, UT_ErrorSeverity severity=UT_ERROR_NONE, bool borrow_only=false)
fpreal getFullStart() const
Definition: ROP_Node.h:685
virtual const char * getChildType() const
int myRenderX
Definition: ROP_Node.h:521
**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
void setExecuteContext(ROP_ExecuteContext *c)
Definition: ROP_Node.h:195
bool getIgnoreBypass() const
Definition: ROP_Node.h:726
virtual fpreal FINC()
Definition: ROP_Node.h:263
virtual const char * getFileExtension(int binary) const =0
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
void setIgnoreFlags(bool ignore_bypass, bool ignore_locks)
Definition: ROP_Node.h:721
virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms)
ROP_RenderList & getOrder() const
Definition: ROP_Node.h:678
UT_String myJobFrames
Definition: ROP_Node.h:528
void copyErrorsFrom(UT_ErrorManager &error_manager)
Definition: ROP_Node.h:412
fpreal64 fpreal
Definition: SYS_Types.h:277
GLuint index
Definition: glcorearb.h:786
File options for manipulating image data on load or save. This class allows you to modify the incomin...
Definition: IMG_FileParms.h:38
UT_String myRenderSuffix
Definition: ROP_Node.h:519
void setFrameMerge(bool merge)
Definition: ROP_Node.h:742
virtual const char * getOpType() const
void(* ROP_RenderButtonCB)(ROP_Node *, ROP_RenderMode)
Definition: ROP_Node.h:90
ROP_ExecuteContext * getExecuteContext()
Definition: ROP_Node.h:194
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLuint GLfloat * val
Definition: glcorearb.h:1608
ROP_RenderMode myRenderMode
Definition: ROP_Node.h:523
A global error manager scope.
ROP_RenderMode
Definition: ROP_Node.h:55
OP_DataType
Definition: OP_DataTypes.h:28
virtual OP_OpTypeId getChildTypeID() const =0
fpreal myCachedEnd
Definition: ROP_Node.h:539
**If you just want to fire and args
Definition: thread.h:609
virtual bool evalVariableValue(UT_String &val, int index, int thread)
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
void setTopLevelRop(ROP_Node *rop)
Definition: ROP_Node.h:717
bool getIgnoreLocks() const
Definition: ROP_Node.h:727
ROP_Verbose & getRopVerbose()
Definition: ROP_Node.h:530
void inputConnectChanged(int which) override
virtual void * getCookedData(const OP_Context &)
bool(* ROP_RenderEventCallback)(ROP_Node *node, ROP_RenderEventType event, fpreal time, void *data)
Definition: ROP_Node.h:91
bool getFrameMerge() const
Definition: ROP_Node.h:743
void setRenderMode(ROP_RenderMode mode)
Definition: ROP_Node.h:214
virtual int DORANGE()
Definition: ROP_Node.h:240
virtual bool isPreviewAllowed()
Override if preview is supported by rendering to 'ip'.
Definition: ROP_Node.h:575
SYS_VISIBILITY_EXPORT void newDriverOperator(OP_OperatorTable *table)
Definition: ROP_Dumper.C:173
virtual bool getGeometryHandle(const char *path, fpreal t, GU_DetailHandle &gdh, UT_DMatrix4 &world_xform)
Definition: ROP_Node.h:387
virtual OP_ERROR bypassMe(OP_Context &context, int &copied_input)=0
UT_LockedRawPtr< UT_ErrorManager, OP_Lock > getLockedErrorManager()
void setPostExecuteOverride(ROP_ExecuteOverride f, void *d)
Definition: ROP_Node.h:206
fpreal getStart() const
Definition: ROP_Node.h:688
Definition: format.h:895
CH_ScriptLanguage
int myCachedDoRange
Definition: ROP_Node.h:537
virtual void onCreated()
Overriden in VOPs.
Definition: OP_Node.h:3059
int getRenderSerial() const
Definition: ROP_Node.h:732
virtual void deleteCookedData()=0
UT_String myJobTag
Definition: ROP_Node.h:527