00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __ROP_IFD_Base__
00022 #define __ROP_IFD_Base__
00023
00024 #include "ROP_API.h"
00025 #include <UT/UT_SysClone.h>
00026 #include "ROP_Node.h"
00027 #include "ROP_IPRList.h"
00028 #include "ROP_IFDEvent.h"
00029
00030 class UT_Interrupt;
00031 class IFD_Output;
00032 class IFD_Scene;
00033 class IFD_PassThru;
00034 class IFD_ObjectParms;
00035 class IFD_RenderDefinition;
00036 class OBJ_Camera;
00037 class OP_Bundle;
00038 class IFD_IPRTree;
00039 class IFD_StreamEvent;
00040
00041 class ROP_API ROP_IFDBase : public ROP_Node {
00042 public:
00043 ROP_IFDBase(OP_Network *net, const char *name, OP_Operator *op);
00044 virtual ~ROP_IFDBase();
00045
00046 static IFD_Scene *getIFDScene();
00047 static PRM_Template myObsoleteList[];
00048
00049 virtual ROP_IFDBase *castToROPIFDBase() { return this; }
00050
00051
00052
00053
00054 virtual int getRenderTag(const char *token, UT_String &result,
00055 float now);
00056
00057 void setObjectParms(IFD_ObjectParms &parms, float now);
00058
00059 virtual void getIFDResolution(int &xres, int &yres, float &aspect,
00060 float now);
00061
00062 virtual unsigned disableParms();
00063 virtual int startRender(int nframes, float s, float e);
00064 virtual ROP_RENDER_CODE renderFrame(float time, UT_Interrupt *);
00065 virtual ROP_RENDER_CODE endRender();
00066
00067 virtual IFD_RenderDefinition *getRenderDefinition();
00068 virtual const char *getRenderName() = 0;
00069
00070
00071
00072 virtual IFD_IPRTree *setupIPR(fpreal now);
00073
00074
00075 virtual const UT_String &getRemoteHost() const = 0;
00076 virtual void CAMERA(UT_String &name, float now) = 0;
00077 virtual void VISIBLE(UT_String &pattern, float now) = 0;
00078 virtual const char *VISIBLE_TOKEN() const = 0;
00079 virtual void VISIBLEFOG(UT_String &pattern, float now) = 0;
00080 virtual const char *VISIBLEFOG_TOKEN() const = 0;
00081 virtual void ALIGHTS(UT_String &pattern, float now) = 0;
00082 virtual const char *ALIGHTS_TOKEN() const = 0;
00083 virtual void PICTURE(UT_String &name, float now) = 0;
00084 virtual void getFrameDevice(UT_String &dev, float now,
00085 const char *renderer) = 0;
00086 virtual int DOF() = 0;
00087 virtual float DITHER(float now) = 0;
00088 virtual int DORES() = 0;
00089 virtual int RESX() = 0;
00090 virtual int RESY() = 0;
00091 virtual int DOSCRIPT() = 0;
00092 virtual int BINARY() = 0;
00093 virtual int BACKGROUND() = 0;
00094 virtual float ASPECT() = 0;
00095 virtual float GAMMA(float now) = 0;
00096 virtual int SAMPLEX(float now) = 0;
00097 virtual int SAMPLEY(float now) = 0;
00098 virtual float JITTER(float now) = 0;
00099 virtual void FIELD(UT_String &fields) = 0;
00100 virtual void COMMAND(UT_String &cmd, float now) = 0;
00101 virtual void SCRIPT(UT_String &file, float now) = 0;
00102 virtual void BLUR(UT_String &blur) = 0;
00103 virtual int INITSIM() = 0;
00104 virtual int DISPSOP() = 0;
00105
00106 virtual void PRERENDER(UT_String &script, float now) = 0;
00107 virtual void PREFRAME(UT_String &script, float now) = 0;
00108 virtual void POSTFRAME(UT_String &script, float now) = 0;
00109 virtual void POSTRENDER(UT_String &script, float now) = 0;
00110
00111 virtual int DOBUNDLEGROUPS() { return 0; }
00112
00113 OP_Bundle * getMaskBundle(float now, const char *tag,
00114 const char *filter);
00115
00116 virtual OP_Bundle *getVisibleBundle(float now);
00117 virtual OP_Bundle *getVisibleIPRBundle(float now);
00118 virtual OP_Bundle *getVisibleFogBundle(float now);
00119 virtual OP_Bundle *getActiveLightBundle(float now);
00120
00121
00122
00123
00124
00125
00126 virtual bool getIPRParm(const char *token, UT_String &value);
00127
00128 virtual bool getIPRTag(const char *token, int idx,
00129 UT_String &value, fpreal now);
00130 IFD_IPRTree *findIPR(fpreal now)
00131 { return myIPRList.findTree(now); }
00132
00133 virtual OBJ_Camera *getCamera(float now);
00134
00135 virtual void getOutputResolution(int &x, int &y);
00136
00137 static void buildMotionBlurMenu(void *o, PRM_Name *, int,
00138 const PRM_SpareData *, PRM_Parm *);
00139 static int clearIPRCache(void *data, int index, float time,
00140 const PRM_Template *tplate);
00141
00142
00143 UT_NotifierImpl<ROP_IFDEvent &>
00144 &getEventNotifier() { return myEventNotifier; }
00145
00146 protected:
00147 virtual void handleStreamEvent(IFD_StreamEvent &event);
00148
00149
00150
00151 virtual int startMultiFrame(IFD_Output *renderer,
00152 fpreal start, fpreal end, int nframes) = 0;
00153 virtual int callRenderer(IFD_Output *renderer,
00154 float now) = 0;
00155 virtual int endMultiFrame(IFD_Output *renderer) = 0;
00156
00157 virtual bool supportsExplicitMotionBlur() const { return false; }
00158
00159 virtual IFD_Output *createOutput(IFD_RenderDefinition &def);
00160
00161 bool setRIBVersionParms(IFD_Output *output,
00162 const char *version);
00163
00164 UT_NotifierImpl<ROP_IFDEvent &> myEventNotifier;
00165
00166 IFD_Output *myOutput;
00167 IFD_Scene *myScene;
00168 IFD_Scene *myIFDScene;
00169 UT_PtrArray<IFD_PassThru *> myPassThruList;
00170 int myStashCwd;
00171 float myEndTime;
00172 int mySaveExtraType;
00173 void *mySaveExtraData;
00174 ROP_IPRList myIPRList;
00175 UT_NotifierList myNotifierList;
00176
00177 private:
00178 bool createScene(fpreal tstart);
00179 int doSingleFrame(IFD_Output *ren, fpreal now,
00180 UT_Interrupt *boss);
00181 static IFD_Scene *theIFDScene;
00182 };
00183
00184 #endif
00185