00001 #ifndef __OP_Context__ 00002 #define __OP_Context__ 00003 00004 #include "OP_API.h" 00005 #include "OP_DataTypes.h" // For OP_DATA_TYPE 00006 #include "OP_Version.h" // For OP_VERSION 00007 00008 #include <stdio.h> 00009 00010 class OP_API OP_ContextFlags 00011 { 00012 public: 00013 unsigned long myCookOverride:1, // Cook only if it is quick 00014 myTimeDep:1; // Am I time dependent? 00015 }; 00016 00017 class OP_API OP_Context 00018 { 00019 public: 00020 OP_Context(); 00021 explicit OP_Context(float t); 00022 OP_Context(float t, int thread); 00023 OP_Context(const OP_Context &from); 00024 00025 void *getData() const { return myData; } 00026 OP_VERSION getVersion() const { return myVersion; } 00027 long getFrame() const; 00028 float getFloatFrame() const; 00029 float getTime() const { return myTime; } 00030 void setTime(float t) { myTime = t; } 00031 00032 void setThread(int thr) { myThread = thr; } 00033 int getThread() const { return myThread; } 00034 00035 void setData(void *data) { myData = data; } 00036 void setVersion(OP_VERSION version) { myVersion = version; } 00037 00038 void setData(void *data, OP_DATA_TYPE type) 00039 { 00040 myData = data; 00041 myType = type; 00042 } 00043 void setFrame(long frame); 00044 void setFrame(float frame); 00045 00046 void copyPointer(const OP_Context &from); 00047 00048 int operator==( const OP_Context &to ) const; 00049 OP_Context &operator= ( const OP_Context &to ); 00050 00051 void print(FILE *); 00052 00053 00054 // Match criteria. 00055 // These fields define the parameters 00056 // for getCookedData(), or 00057 // needToCook() or cook(). 00058 float myTime; // 0 based time 00059 int myXres; // Pixel resolution 00060 int myYres; // Pixel resolution 00061 00062 00063 // These fields are used to define the 00064 // kind of COOK or GET that is to take 00065 // place 00066 00067 OP_DATA_TYPE myType; // What kind of data is myData 00068 void *myData; // Put output here instead of with node 00069 00070 OP_VERSION myVersion; // When fetching data, this is the 00071 // version number of the fetched data. 00072 00073 int myThread; // UTgetSTID() when this context was 00074 // created. 00075 00076 OP_ContextFlags myFlags; 00077 00078 private: 00079 void initDefaults(float t, int thread); 00080 }; 00081 00082 #endif
1.5.9