00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Mark Alexander 00008 * Side Effects Software Inc 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: ROP_RenderList.h ( ROP Library, C++) 00015 * 00016 * COMMENTS: 00017 * Defines a list of render objects, and ensures that no ROP/frame pair 00018 * is rendered twice within the list. 00019 */ 00020 #ifndef ROP_RenderList_h 00021 #define ROP_RenderList_h 00022 00023 #include "ROP_API.h" 00024 00025 #include <UT/UT_IntArray.h> 00026 #include <UT/UT_PtrArray.h> 00027 00028 class ROP_RenderItem; 00029 class ROP_RenderDepParms; 00030 00031 class ROP_API ROP_RenderList 00032 { 00033 public: 00034 ROP_RenderList() {} 00035 ~ROP_RenderList(); 00036 00037 // this steals the pointer, and will delete it when this list is 00038 // destroyed. It is added to the list unless it's a duplicate of an item 00039 // already in the list (if so, it will return false) 00040 bool addItem(ROP_RenderItem *item, 00041 const ROP_RenderDepParms &parms); 00042 00043 // This adds a new copy of 'item' to the list, if 'item' is not already in 00044 // the list. 00045 void addItemDependency(const ROP_RenderItem &item); 00046 00047 void replaceDependencies(ROP_RenderItem *item, 00048 ROP_RenderItem *newitem); 00049 void replaceOldDependencies(ROP_RenderItem *item) const; 00050 ROP_RenderItem *removeItem(unsigned int i); 00051 00052 int entries() const { return myItems.entries(); } 00053 00054 ROP_RenderItem *operator()(unsigned int i) { return myItems(i); } 00055 00056 const ROP_RenderItem *operator()(unsigned int i) const 00057 { return myItems(i); } 00058 00059 // Merges 'mergelist' into this list, along with removed dependencies. 00060 // mergelist is emptied after this operation. 00061 void mergeAndClear (ROP_RenderList &merge_list, 00062 bool append); 00063 00064 // makes this list depend on the items in merge_list, and prepends 00065 // those items into this list. 00066 void dependMerge(ROP_RenderList &merge_list); 00067 00068 // Ensures that all dependents are rendered after the ROPs they are 00069 // dependent on. This should be the last step for the final dependency 00070 // list. 00071 void resortDependencies(); 00072 00073 /// Obtain a list of items that nobody depends on in the list. 00074 void getDependencyRoots( 00075 UT_PtrArray<ROP_RenderItem *> &roots) const; 00076 00077 /// Obtain a list of items that don't depend on any other item in the list. 00078 void getDependencyLeaves( 00079 UT_PtrArray<ROP_RenderItem *> &leaves)const; 00080 00081 // assign rendered frame information to each node's popup info. 00082 void assignRenderInfo(const char *job_tag); 00083 00084 // dump the render information to os. 00085 void print(ostream &os, bool full_path, bool condense_range) const; 00086 00087 private: 00088 UT_PtrArray<ROP_RenderItem *> myItems; 00089 UT_PtrArray<ROP_RenderItem *> myUnusedItems; 00090 UT_IntArray myRemovedDependencies; 00091 UT_PtrArray<ROP_RenderItem *> myReplacementDependencies; 00092 }; 00093 00094 #endif
1.5.9