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