00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __ROP_MDD__
00020 #define __ROP_MDD__
00021
00022 #include "ROP_API.h"
00023
00024 #include <FS/FS_Writer.h>
00025
00026 #include "ROP_Node.h"
00027
00028 enum ropMDDParmIndex
00029 {
00030 MDD_SOPPATH = 0,
00031 MDD_OUTPUT,
00032 MDD_XFORMTYPE,
00033 MDD_COORDSYS,
00034 MDD_SCALE,
00035 MDD_RELTIME,
00036 MDD_INITSIM,
00037 MDD_RESTFRAME,
00038
00039 MDD_NUM_PARMS
00040 };
00041
00042 #define STR_PARM(name, idx, t) \
00043 do { evalString(str, name, &mddIndirect[idx], 0, t); } while (false)
00044 #define INT_PARM(name, idx, vi, t) \
00045 do { return evalInt(name, &mddIndirect[idx], vi, t); } while (false)
00046 #define FLOAT_PARM(name, idx, vi, t) \
00047 do { return evalFloat(name, &mddIndirect[idx], vi, t); } while (false)
00048
00049 class SOP_Node;
00050
00051 class ROP_API ROP_MDD : public ROP_Node
00052 {
00053 public:
00054 static OP_Node *myConstructor(OP_Network *net, const char*name, OP_Operator *op);
00055
00056 OP_Context &getContext() { return myContext; }
00057
00058 static OP_Operator *buildOperator();
00059 static PRM_Template myTemplateList[];
00060
00061 protected:
00062 ROP_MDD(OP_Network *net, const char *name, OP_Operator *entry);
00063 virtual ~ROP_MDD();
00064
00065 virtual int startRender(int nframes, float s, float e);
00066 virtual ROP_RENDER_CODE renderFrame(float time, UT_Interrupt *boss);
00067 virtual ROP_RENDER_CODE endRender();
00068
00069
00070
00071 void OUTPUT(UT_String &str, float t)
00072 {
00073 if (getRenderMode() == RENDER_PRM)
00074 {
00075 if (!getOutputOverride(str, t))
00076 { STR_PARM("file", MDD_OUTPUT, t); }
00077 }
00078 else str = getRenderOutput();
00079 }
00080
00081
00082 void SOPPATH(UT_String &str, float t)
00083 { STR_PARM("soppath", MDD_SOPPATH, t); }
00084
00085
00086 int INITSIM()
00087 { INT_PARM("initsim", MDD_INITSIM, 0, 0); }
00088
00089 enum CoordSysType {
00090 COORDSYS_LEFT,
00091 COORDSYS_RIGHT
00092 };
00093 CoordSysType COORDSYS()
00094 { return (CoordSysType)
00095 evalInt("coordsys", &mddIndirect[MDD_COORDSYS], 0, 0); }
00096
00097 int XFORMTYPE()
00098 { INT_PARM("xformtype", MDD_XFORMTYPE, 0, 0); }
00099
00100 float SX()
00101 { FLOAT_PARM("s", MDD_SCALE, 0, 0); }
00102 float SY()
00103 { FLOAT_PARM("s", MDD_SCALE, 1, 0); }
00104 float SZ()
00105 { FLOAT_PARM("s", MDD_SCALE, 2, 0); }
00106
00107 bool RELTIME()
00108 { INT_PARM("reltime", MDD_RELTIME, 0, 0); }
00109
00110 float RESTFRAME()
00111 { FLOAT_PARM("restframe", MDD_RESTFRAME, 0, 0); }
00112
00113 private:
00114
00115
00116
00117
00118
00119 static int *mddIndirect;
00120
00121 OP_Context myContext;
00122 SOP_Node *myRenderSop;
00123 FS_Writer *myFile;
00124 int myNumPoints;
00125 };
00126
00127 #undef STR_PARM
00128 #undef INT_PARM
00129 #undef FLOAT_PARM
00130
00131 #endif