00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef ROP_RenderItem_h
00020 #define ROP_RenderItem_h
00021
00022 #include "ROP_API.h"
00023
00024 #include <UT/UT_FloatArray.h>
00025 #include "ROP_Node.h"
00026
00027 class ROP_API ROP_RenderItem
00028 {
00029 public:
00030 ROP_RenderItem(ROP_Node *node) : myNode(node)
00031 {
00032 mySingleFrame = false;
00033 myStartFrame = myEndFrame = 0.0f;
00034 myFrameInc = 1.0f;
00035 myRegularSequence = true;
00036 myRenderId = ++ourRenderIdCount;
00037 }
00038
00039
00040 void setSingleFrame(float frame)
00041 { mySingleFrame = true; myEndFrame = myStartFrame = frame; }
00042
00043 void setFrameRange(float start,float end, float finc);
00044
00045
00046 bool render(ostream *verbose=0, int count=0, int total=0) const;
00047
00048
00049
00050 bool containedBy(const ROP_RenderItem &item);
00051
00052
00053
00054 void removeOverlap(const ROP_RenderItem &item);
00055
00056 bool mergeWith(const ROP_RenderItem &item);
00057
00058
00059
00060 void print(ostream &os, bool full_path, bool condense_range) const;
00061
00062
00063 int getNumFrames() const;
00064
00065
00066 ROP_Node *getNode() const { return myNode; }
00067 bool isSingleFrame() const { return mySingleFrame; }
00068 float getFrame() const { return myStartFrame; }
00069 float getStartFrame() const { return myStartFrame; }
00070 float getEndFrame() const { return myEndFrame; }
00071 float getFrameInc() const { return myFrameInc; }
00072
00073
00074
00075
00076
00077 bool isRegularSequence() const { return myRegularSequence; }
00078 const UT_FloatArray &getFrameList() const { return myFrames; }
00079
00080
00081
00082
00083 static void resetRenderIds() { ourRenderIdCount = 0; }
00084
00085 int getRenderId() const { return myRenderId; }
00086
00087
00088
00089 void addDependency(const ROP_RenderItem &item) const;
00090
00091
00092 void mergeDependencies(const ROP_RenderItem &item);
00093
00094
00095
00096 void replaceDependencies(const ROP_RenderItem &with_item);
00097
00098 private:
00099 ROP_Node *myNode;
00100 bool mySingleFrame;
00101 bool myRegularSequence;
00102 float myStartFrame;
00103 float myEndFrame;
00104 float myFrameInc;
00105 UT_FloatArray myFrames;
00106
00107 int myRenderId;
00108
00109
00110
00111 mutable UT_PtrArray<const ROP_RenderItem *> myDependencies;
00112
00113
00114
00115 mutable UT_PtrArray<const ROP_RenderItem *> myDependents;
00116
00117
00118 static int ourRenderIdCount;
00119 };
00120
00121 #endif