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);
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  // appends direct render dependencies to the given array
313  virtual void appendDirectRenderDependenciesToList(
314  UT_Array<ROP_Node *> &nodes) const;
315  virtual void initRenderDependencies();
316  virtual void cleanupRenderDependencies();
317 
318  void addJobFrames(const char *job_name,
319  const char *frame_string);
320 
321  static void setDependencyRenderFlag(bool f);
322  static bool getDependencyRenderFlag();
323 
324  static void setFrameByFrameFlag(bool f);
325  static bool getFrameByFrameFlag();
326 
327  static void setRenderScriptFlag(bool enable);
328  static bool getRenderScriptFlag();
329 
330  static void setOutputResolutionScale(fpreal xscale,fpreal yscale);
331  static void getOutputResolutionScale(float &xs, float &ys);
332 
333  virtual bool getOutputResolution(int &x, int &y)
334  { x = y = 0; return false; }
335  virtual void getOutputFile(UT_String & /*name*/) { }
336 
337  // three levels - 0 = low/fastest, 1 = med/fast, 2 = normal
338  static void setRenderQuality(int quality);
339  int getRenderQuality();
340 
341  // Override the frame range used by this node
342  void overrideFrameRange(bool enable,
343  fpreal s=1.0, fpreal e=1.0,
344  fpreal i=1.0);
345 
346 
347  // Return true if the output is currently overridden
348  bool isOutputOverridden() const
349  { return myOverrideOutputFlag; }
350 
351  // Override the output filename for this node. Used by the hscript render
352  // -o command.
353  virtual void overrideOutput(bool enable, const char *fname=0);
354 
355  // Return the overriden filename. 'fname' is NOT modified if this function
356  // returns false. Deprecated, use getOutputOverrideEx() instead.
357  bool getOutputOverride(
358  UT_String &fname,
359  fpreal t,
360  bool expand = true) const;
361 
362  // getOutputOverrideEx() differs from getOutputOverride() in that it will
363  // perform the necessary parm evaluation as well so that we string result
364  // will always returned. Since this requires expansion, it will always call
365  // getOutputOverride(...,expand=true).
366  //
367  // For compatibility, it returns true if the result was overridden, false
368  // otherwise. Method is non-const since it may add warnings upon failure to
369  // create the output directory.
370  bool getOutputOverrideEx(
371  UT_String &result,
372  fpreal t,
373  const char *output_parm_name,
374  const char *mkdir_parm_name);
375 
376  virtual void overrideDevice(bool enable, bool interactive=false,
377  const char *devicestr=0);
378  bool getDeviceOverride(UT_String &str, fpreal t,
379  bool expand = true) const;
380 
381  static void setRenderButtonCB(ROP_RenderButtonCB cb);
382 
383  void inputConnectChanged(int which) override;
384 
385  void getNodeSpecificInfoText(OP_Context &context,
386  OP_NodeInfoParms &iparms) override;
388  const OP_NodeInfoTreeParms &parms) override;
389 
390  virtual bool getGeometryHandle(const char *path, fpreal t,
391  GU_DetailHandle &gdh,
392  UT_DMatrix4 &world_xform)
393  { return(false); }
394 
395  // forces a BG render in executeSingle().
396  void forceBackgroundRender(bool f = true)
397  { myForceBackgroundRender = f; }
399  { return myForceBackgroundRender; }
400 
401  // Add some additional inputs to the ROP (used by Fetch and Subnet).
403  { myTemporaryInputs = in; }
404  void clearTemporaryInputs() { myTemporaryInputs.entries(0);}
405 
406  /// Render this node using the parameters set in render_parms.
407  bool renderCommand(ROP_RenderCmdParms &render_parms);
408 
409  // Copy the errors from this node into an error manager. This method
410  // is used to save off errors before they're cleared.
411  void copyErrorsInto(UT_ErrorManager &error_manager)
412  { error_manager.stealErrors(*getLockedErrorManager()); }
413 
414  // Append the errors from an error manager into this node.
415  void copyErrorsFrom(UT_ErrorManager &error_manager)
416  { getLockedErrorManager()->stealErrors(error_manager); }
417 
418  // Get the last render dependency item that cooked in this node in the
419  // current cook.
421  { return myLastRenderItem; }
422 
423  /// Helper that appends the inputs and other rop nodes that
424  /// this node depends on to the give list.
425  virtual bool isRenderDependentOnNode(ROP_Node *node,
426  const ROP_RenderDepParms &parms);
427 
428  /// Adds a render event callback to the this node. The function will be
429  /// invoked after each of the render scripts, e.g. pre-render or post-fame.
430  void addRenderEventCallback(
431  ROP_RenderEventCallback callback,
432  void* data,
433  bool run_before_script);
434 
435  /// Removes a render event callback that was added previously
436  void removeRenderEventCallback(
437  ROP_RenderEventCallback callback,
438  void* data);
439 
440  static void setColorCorrectionIPGamma(bool enable, fpreal gamma);
441  static fpreal getColorCorrectionIPGamma();
442  static void setColorCorrectionIPLUT(bool enable, const char *lut);
443  static const char *getColorCorrectionIPLUT();
444 
445  static void setColorCorrectionEnvVariables(bool set);
446  static void setFPSVariable(bool do_set = 0, fpreal frame_inc = 1);
447 
448  virtual ROP_RENDER_CODE rerenderFrame();
449 
450 protected:
451  ROP_Node(OP_Network *parent, const char *name, OP_Operator *entry);
452  ~ROP_Node() override;
453 
454  // These OPs don't actually cook. No data, nothing. The renderFile()
455  // method is the closest thing to a cook.
456  OP_ERROR cookMe(OP_Context &context) override;
457  OP_ERROR bypassMe(OP_Context &context,
458  int &copied_input) override;
459  OP_ERROR initFrameRange(fpreal now, ROP_ExecuteContext &ctx);
460 
461  void onCreated() override;
462 
463 
464  void addSystemError(const char *msg = 0)
465  { getLockedErrorManager()->systemError(msg);}
466  void addError(int code, const char *msg = 0)
467  { getLockedErrorManager()->addError(ROP_OPTYPE_NAME, code, msg);}
468  void addWarning(int code, const char *msg = 0)
469  { getLockedErrorManager()->addWarning(ROP_OPTYPE_NAME, code, msg); }
470  void addMessage(int code, const char *msg = 0)
471  { getLockedErrorManager()->addMessage(ROP_OPTYPE_NAME, code, msg); }
472 
474  int thread) override
475  { return OP_Network::evalVariableValue(v, index, thread); }
476  bool evalVariableValue(fpreal &v, int index,
477  int thread) override;
478 
479  // The endRender() method will always be called if startRender succeeds.
480  virtual int startRender(int nframes, fpreal tstart,
481  fpreal tend);
482  virtual ROP_RENDER_CODE renderFrame(fpreal time,
483  UT_Interrupt *boss = 0);
484  virtual ROP_RENDER_CODE endRender();
485 
486 
487  TAKE_Take *applyRenderTake(const char *take);
488  void restorePreviousTake(TAKE_Take *take);
489 
490  void initRenderDependencyVars(fpreal t);
491  virtual void doInitRenderDependencyVars(fpreal t);
492 
493  // Internal helper method that simply traverses our inputs and calls
494  // buildRenderDependencies on them.
495  virtual void buildInputRenderDependencies(
496  const ROP_RenderDepParms &parms);
497 
498  bool matchingLastRenderParms(
499  const ROP_RenderDepParms &parms);
501  { myLastRenderItem = item; }
502 
503  // This method returns the image device required to render it to an
504  // interactive window (an mplay window, for example).
505  virtual const char *getInteractiveImageDevice() const { return ""; }
506 
507  virtual void FSTART_SET(fpreal val)
508  { FLT_SET("f", 0, 0, val); }
509  virtual void FEND_SET(fpreal val)
510  { FLT_SET("f", 1, 0, val); }
511  virtual void FINC_SET(fpreal val)
512  { FLT_SET("f", 2, 0, val); }
513  virtual void DORANGE_SET(int val)
514  { INT_SET("trange", 0, 0, val); }
515 
516  virtual void RENDER_TAKE(UT_String &take)
517  { evalString(take, "take", 0, 0.0f); }
518 
531 
533  { return myVerbose; }
534  std::ostream *getVerbose() const
535  { return myVerbose.getStream(); }
536  bool getAlfred() const
537  { return myVerbose.getAlfred(); }
538 
545 
546 protected:
547  //
548  // These virtuals are methods that nobody should override...
549  // Except IPR buffers which are now saved as cooked data
550  //
551  // I/O methods
552  //
553  void deleteCookedData() override;
554  int saveCookedData(const char *, OP_Context &) override;
555  int saveCookedData(std::ostream &os, OP_Context &,
556  int binary = 0) override;
557 
558  // If there is a problem executing the script, then an error will be set
559  // here.
560  // Note that this has to remain protected (and not be made private) because
561  // there are customers who inherit from ROP_Node and use this function.
562  OP_ERROR executeScript(
563  UT_String &str, CH_ScriptLanguage language, fpreal time);
564 
566  { return myTemporaryInputs.entries(); }
567 
569  { return myTemporaryInputs(i); }
570 
571  // Create all intermediate directories for the given file path. Returns
572  // false IFF it attempted to create the directories but failed to do so. In
573  // that case, a warning will be added.
574  bool makeFilePathDirs(const UT_String &path);
575 
576  /// Override if preview is supported by rendering to 'ip'.
577  virtual bool isPreviewAllowed() { return false; }
578 
579 
580  void applyImageFormatOptions(IMG_TileOptions &opts,
581  const IMG_Format *fmt,
582  fpreal t);
583  void applyImageFormatOptions(IMG_FileParms &parms,
584  const IMG_Format *fmt,
585  fpreal t);
586 
587 private:
588  struct EventCallbackEntry
589  {
590  ROP_RenderEventCallback myCallback;
591  void *myData;
592  bool myRunBeforeScript;
593  };
594 
595  const char *getFileExtension(int binary) const override;
596 
597  static void resetSimulation(OP_Node* node);
598 
599  ROP_ExecuteContext *myEContext;
600  ROP_Verbose myVerbose;
601  ROP_ExecuteOverride myExecuteOverride;
602  void *myExecuteOverrideData;
603  ROP_ExecuteOverride myPreExecuteOverride;
604  void *myPreExecuteOverrideData;
605  ROP_ExecuteOverride myPostExecuteOverride;
606  void *myPostExecuteOverrideData;
607 
608  bool myForceBackgroundRender;
609 
610  bool myOverrideFrameRangeFlag;
611  fpreal myOverrideStartFrame;
612  fpreal myOverrideEndFrame;
613  fpreal myOverrideFrameInc;
614 
615  bool myOverrideOutputFlag;
616  UT_String myOverrideOutputName;
617 
618  bool myOverrideDeviceFlag;
619  UT_String myOverrideDeviceName;
620 
621  bool myExecuteFull; // Recursion check
622  UT_ValArray<ROP_Node *> myTemporaryInputs;
623  ROP_RenderDepParms *myLastRenderParms;
624  ROP_RenderItemHandle myLastRenderItem;
625 
626  UT_Array<EventCallbackEntry> myRenderEventCallbacks;
627 
628  bool executeCallback(fpreal ttime,
629  ROP_RenderEventType event_type,
630  bool before_script);
631  bool executeParmScript(const char *parm_name,
632  fpreal ttime,
633  ROP_RenderEventType event_type);
634  bool executeParmScripts(const char *parm_name,
635  fpreal ttime,
636  ROP_RenderEventType event_type);
637 
638  static int doRenderCommand(CMD_Args &args, OP_Node *net,
639  bool showerrors);
640 
641  static void installCommands();
642  static void cmdRender(CMD_Args &args);
643  static void cmdRenderDeps(CMD_Args &args);
644 };
645 
646 // These are the parms to the buildRenderDependencies methods.
648 {
649 public:
651  myOrder(NULL),
652  myFullStart(0.0f),
653  myFullEnd(0.0f),
654  myFullFrameInc(0.0f),
655  myStart(0.0f),
656  myEnd(0.0f),
657  myFrameInc(0.0f),
658  myDoInputs(false),
659  myIgnoreBypass(true),
660  myIgnoreLocks(false),
661  myFrameMerge(true),
662  myRenderSerial(-1),
663  myDepParent(NULL),
664  myTopLevelRop(NULL),
665  myFirstFrameFlag(true) { }
666 
667  // copy constructor; some members are initilized to NULL rather than copied.
669  : myRenderSerial(-1)
670  {
671  *this = copy;
672  }
674  {
675  myDepParent = NULL;
676  }
677 
678  // Set/Get RenderList
679  void setOrder(ROP_RenderList &order) { myOrder = &order; }
680  ROP_RenderList &getOrder() const { UT_ASSERT(myOrder); return *myOrder; }
681 
682  // Set/Get Frame Range
684  { myFullStart = start; myFullEnd = end; myFullFrameInc = finc; }
686  { myStart = start; myEnd = end; myFrameInc = finc; }
687  fpreal getFullStart() const { return myFullStart; }
688  fpreal getFullEnd() const { return myFullEnd; }
689  fpreal getFullFrameInc() const { return myFullFrameInc; }
690  fpreal getStart() const { return myStart; }
691  fpreal getEnd() const { return myEnd; }
692  fpreal getFrameInc() const { return myFrameInc; }
693 
695  {
696  fpreal start = myFullStart;
697  fpreal end = myFullEnd;
698  fpreal finc = myFullFrameInc;
699  if(rop.DORANGE()==2)
700  {
701  start = rop.FSTART();
702  end = rop.FEND();
703  finc = rop.FINC();
704  }
705  if (start > end)
706  UTswap(start, end);
707  if (finc <= 0)
708  finc = 1.0;
709  setFrameRange(start, end, finc);
710  }
711 
712  // Set/Get Input traversal flags
713  void setDoInputsFlag(bool do_inputs) { myDoInputs = do_inputs; }
714  bool getDoInputs() const { return myDoInputs; }
715 
716  // Set/Get TopLevel ROP -- this is the top most ROP that is traversed. This
717  // is used to prevent subnet traversals to go outside this ROP. Only
718  // useful when DoInputs is off.
719  void setTopLevelRop(ROP_Node *rop) { myTopLevelRop = rop; }
720  ROP_Node *getTopLevelRop() const { return myTopLevelRop; }
721 
722  // Set/Get Ignore flags
723  void setIgnoreFlags(bool ignore_bypass, bool ignore_locks)
724  {
725  myIgnoreBypass = ignore_bypass;
726  myIgnoreLocks = ignore_locks;
727  }
728  bool getIgnoreBypass() const { return myIgnoreBypass; }
729  bool getIgnoreLocks() const { return myIgnoreLocks; }
730 
731  // Set/Get Render Serial number
732  void setRenderSerial(int render_serial)
733  { myRenderSerial = render_serial; }
734  int getRenderSerial() const { return myRenderSerial; }
735 
736  // Set/Get Dependency parent
737  void setDepParent(const ROP_RenderItemHandle &dep_parent)
738  { myDepParent = dep_parent; }
739  const ROP_RenderItemHandle &getDepParent() const { return myDepParent; }
740 
741  void setFirstFrame(bool first) { myFirstFrameFlag = first; }
742  bool isFirstFrame() const { return myFirstFrameFlag; }
743 
744  void setFrameMerge(bool merge) { myFrameMerge = merge; }
745  bool getFrameMerge() const { return myFrameMerge; }
746 
748  {
749  myOrder = copy.myOrder;
750  myDepParent = copy.myDepParent;
751  myTopLevelRop = copy.myTopLevelRop;
752  myFullStart = copy.myFullStart;
753  myFullEnd = copy.myFullEnd;
754  myFullFrameInc = copy.myFullFrameInc;
755  myStart = copy.myStart;
756  myEnd = copy.myEnd;
757  myFrameInc = copy.myFrameInc;
758  myRenderSerial = copy.myRenderSerial;
759  myDoInputs = copy.myDoInputs;
760  myIgnoreBypass = copy.myIgnoreBypass;
761  myIgnoreLocks = copy.myIgnoreLocks;
762  myFrameMerge = copy.myFrameMerge;
763  myFirstFrameFlag = copy.myFirstFrameFlag;
764  return *this;
765  }
767  {
768  return (myFullStart == copy.myFullStart &&
769  myFullEnd == copy.myFullEnd &&
770  myFullFrameInc == copy.myFullFrameInc &&
771  myStart == copy.myStart &&
772  myEnd == copy.myEnd &&
773  myFrameInc == copy.myFrameInc &&
774  myDoInputs == copy.myDoInputs &&
775  myIgnoreBypass == copy.myIgnoreBypass &&
776  myIgnoreLocks == copy.myIgnoreLocks &&
777  myFrameMerge == copy.myFrameMerge &&
778  myRenderSerial == copy.myRenderSerial);
779  }
780 
781 private:
782  ROP_RenderList *myOrder;
783  ROP_RenderItemHandle myDepParent;
784  ROP_Node *myTopLevelRop;
785  fpreal myFullStart;
786  fpreal myFullEnd;
787  fpreal myFullFrameInc;
788  fpreal myStart;
789  fpreal myEnd;
790  fpreal myFrameInc;
791  int myRenderSerial;
792  bool myDoInputs;
793  bool myIgnoreBypass;
794  bool myIgnoreLocks;
795  bool myFrameMerge;
796  bool myFirstFrameFlag;
797 };
798 
799 #undef FLT_PARM
800 #undef INT_PARM
801 #undef STR_PARM
802 #undef FLT_SET
803 #undef INT_SET
804 
805 #endif
virtual int saveCookedData(std::ostream &os, OP_Context &, int binary=0)=0
int myRenderY
Definition: ROP_Node.h:524
#define ROP_OPTYPE_NAME
Definition: OP_Node.h:308
GLint first
Definition: glcorearb.h:405
bool isOutputOverridden() const
Definition: ROP_Node.h:348
fpreal getFullFrameInc() const
Definition: ROP_Node.h:689
virtual bool updateParmsFlags()
void setDepParent(const ROP_RenderItemHandle &dep_parent)
Definition: ROP_Node.h:737
void setOrder(ROP_RenderList &order)
Definition: ROP_Node.h:679
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:335
fpreal getW() const override
Node position/scale is used by the UI.
void addMessage(int code, const char *msg=0)
Definition: ROP_Node.h:470
uint64 OP_VERSION
Definition: OP_Version.h:6
ROP_RenderEventType
Definition: ROP_Node.h:68
fpreal getEnd() const
Definition: ROP_Node.h:691
virtual void FSTART_SET(fpreal val)
Definition: ROP_Node.h:507
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:683
#define SYS_VISIBILITY_EXPORT
void
Definition: png.h:1083
virtual void FINC_SET(fpreal val)
Definition: ROP_Node.h:511
UT_String myRenderOutput
Definition: ROP_Node.h:519
bool myExecuteSingle
Definition: ROP_Node.h:528
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:509
virtual fpreal FEND()
Definition: ROP_Node.h:255
bool getAlfred() const
Definition: ROP_Node.h:536
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:526
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
void addSystemError(const char *msg=0)
Definition: ROP_Node.h:464
bool isFirstFrame() const
Definition: ROP_Node.h:742
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:543
GLint y
Definition: glcorearb.h:103
bool evalVariableValue(UT_String &v, int index, int thread) override
Definition: ROP_Node.h:473
ROP_RenderItemHandle getLastRenderDepItem() const
Definition: ROP_Node.h:420
fpreal myCachedTime
Definition: ROP_Node.h:544
**But if you need a result
Definition: thread.h:622
void clearTemporaryInputs()
Definition: ROP_Node.h:404
virtual void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &parms)
UT_String myRenderDevice
Definition: ROP_Node.h:520
virtual void SETDORANGE(int val)
Definition: ROP_Node.h:238
fpreal myCachedStart
Definition: ROP_Node.h:540
int myTotalFrames
Definition: ROP_Node.h:527
virtual OP_ERROR cookMe(OP_Context &context)=0
OutGridT const XformOp bool bool
constexpr auto in(type t, int set) -> bool
Definition: core.h:611
void setRenderSerial(int render_serial)
Definition: ROP_Node.h:732
#define ROP_API
Definition: ROP_API.h:10
fpreal getFullEnd() const
Definition: ROP_Node.h:688
std::ostream * getVerbose() const
Definition: ROP_Node.h:534
void setFirstFrame(bool first)
Definition: ROP_Node.h:741
struct _cl_event * event
Definition: glcorearb.h:2961
void setDoInputsFlag(bool do_inputs)
Definition: ROP_Node.h:713
const ROP_RenderDepParms & operator=(const ROP_RenderDepParms &copy)
Definition: ROP_Node.h:747
void setLastRenderDepItem(ROP_RenderItemHandle item)
Definition: ROP_Node.h:500
GLfloat f
Definition: glcorearb.h:1926
ROP_RenderDepParms(const ROP_RenderDepParms &copy)
Definition: ROP_Node.h:668
virtual bool referenceSingleParameter(OP_Parameters *from, int parm_idx, const char *relative_path=nullptr)
ROP_RenderMode getRenderMode()
Definition: ROP_Node.h:219
virtual const char * getInteractiveImageDevice() const
Definition: ROP_Node.h:505
virtual void DORANGE_SET(int val)
Definition: ROP_Node.h:513
virtual void RENDER_TAKE(UT_String &take)
Definition: ROP_Node.h:516
void forceBackgroundRender(bool f=true)
Definition: ROP_Node.h:396
virtual fpreal FSTART()
Definition: ROP_Node.h:248
ROP_Node * getTopLevelRop() const
Definition: ROP_Node.h:720
void evalString(UT_String &val, int pi, int vi, fpreal t) const
constexpr auto set(type rhs) -> int
Definition: core.h:610
GLuint GLuint end
Definition: glcorearb.h:475
void setFullAscendingFrameRange(ROP_Node &rop)
Definition: ROP_Node.h:694
virtual bool getOutputResolution(int &x, int &y)
Definition: ROP_Node.h:333
bool getForceBackgroundRender() const
Definition: ROP_Node.h:398
void addWarning(int code, const char *msg=0)
Definition: ROP_Node.h:468
#define FLT_SET(name, vi, t, val)
Definition: ROP_Node.h:99
float myRenderAspect
Definition: ROP_Node.h:522
ROP_Node * getTemporaryInputs(int i) const
Definition: ROP_Node.h:568
void copyErrorsInto(UT_ErrorManager &error_manager)
Definition: ROP_Node.h:411
void addError(int code, const char *msg=0)
Definition: ROP_Node.h:466
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
OP_OpTypeId
Definition: OP_OpTypeId.h:18
fpreal CHgetEvalTime()
Definition: CH_Manager.h:2161
GLuint const GLchar * name
Definition: glcorearb.h:786
fpreal myCachedInc
Definition: ROP_Node.h:542
fpreal getFrameInc() const
Definition: ROP_Node.h:692
GLint GLenum GLint x
Definition: glcorearb.h:409
const ROP_RenderItemHandle & getDepParent() const
Definition: ROP_Node.h:739
virtual OP_DataType getCookedDataType() const =0
bool operator==(const ROP_RenderDepParms &copy)
Definition: ROP_Node.h:766
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
virtual OP_OpTypeId getOpTypeID() const
Definition: OP_Node.h:547
int getNumTemporaryInputs() const
Definition: ROP_Node.h:565
void setFrameRange(fpreal start, fpreal end, fpreal finc)
Definition: ROP_Node.h:685
void setTemporaryInputs(const UT_ValArray< ROP_Node * > &in)
Definition: ROP_Node.h:402
GLdouble t
Definition: glad.h:2397
bool getDoInputs() const
Definition: ROP_Node.h:714
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:687
virtual const char * getChildType() const
int myRenderX
Definition: ROP_Node.h:523
**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:728
virtual fpreal FINC()
Definition: ROP_Node.h:263
virtual const char * getFileExtension(int binary) const =0
GA_API const UT_StringHolder parms
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
void setIgnoreFlags(bool ignore_bypass, bool ignore_locks)
Definition: ROP_Node.h:723
virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms)
ROP_RenderList & getOrder() const
Definition: ROP_Node.h:680
UT_String myJobFrames
Definition: ROP_Node.h:530
void copyErrorsFrom(UT_ErrorManager &error_manager)
Definition: ROP_Node.h:415
fpreal64 fpreal
Definition: SYS_Types.h:278
void inputConnectChanged(OP_InputIdx which) override
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:39
UT_String myRenderSuffix
Definition: ROP_Node.h:521
void setFrameMerge(bool merge)
Definition: ROP_Node.h:744
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:525
A global error manager scope.
ROP_RenderMode
Definition: ROP_Node.h:55
OP_DataType
Definition: OP_DataTypes.h:189
virtual OP_OpTypeId getChildTypeID() const =0
fpreal myCachedEnd
Definition: ROP_Node.h:541
**If you just want to fire and args
Definition: thread.h:618
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:719
bool getIgnoreLocks() const
Definition: ROP_Node.h:729
ROP_Verbose & getRopVerbose()
Definition: ROP_Node.h:532
OutGridT XformOp bool bool MergePolicy merge
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:745
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:577
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:390
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:690
Definition: format.h:1821
CH_ScriptLanguage
int myCachedDoRange
Definition: ROP_Node.h:539
virtual void onCreated()
Overriden in VOPs.
Definition: OP_Node.h:3190
int getRenderSerial() const
Definition: ROP_Node.h:734
virtual void deleteCookedData()=0
UT_String myJobTag
Definition: ROP_Node.h:529