HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ROP_RenderList.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: ROP_RenderList.h ( ROP Library, C++)
7  *
8  * COMMENTS:
9  * Defines a list of render objects, and ensures that no ROP/frame pair
10  * is rendered twice within the list.
11  */
12 #ifndef ROP_RenderList_h
13 #define ROP_RenderList_h
14 
15 #include "ROP_API.h"
16 #include "ROP_RenderItem.h"
17 
18 #include <UT/UT_IntArray.h>
19 #include <UT/UT_ValArray.h>
20 
21 class ROP_RenderDepParms;
22 
24 {
25 public:
27  ~ROP_RenderList();
28 
29  // this steals the pointer, and will delete it when this list is
30  // destroyed. It is added to the list unless it's a duplicate of an item
31  // already in the list (if so, it will return false)
32  bool addItem(const ROP_RenderItemHandle &item,
33  const ROP_RenderDepParms &parms);
34 
35  // This adds a new copy of 'item' to the list, if 'item' is not already in
36  // the list.
37  ROP_RenderItemHandle addItemDependency(const ROP_RenderItemHandle &item);
38 
39  void replaceDependencies(const ROP_RenderItemHandle &item,
40  const ROP_RenderItemHandle &newitem);
41  void replaceOldDependencies(const ROP_RenderItemHandle &item) const;
42  ROP_RenderItemHandle removeItem(unsigned int i);
43 
44  int entries() const { return myItems.entries(); }
45 
46  ROP_RenderItemHandle &operator()(unsigned int i) { return myItems(i); }
47 
48  const ROP_RenderItemHandle &operator()(unsigned int i) const
49  { return myItems(i); }
50 
51  // Merges 'mergelist' into this list, along with removed dependencies.
52  // mergelist is emptied after this operation.
53  void mergeAndClear (ROP_RenderList &merge_list,
54  bool append);
55 
56  // makes this list depend on the items in merge_list, and prepends
57  // those items into this list.
58  void dependMerge(ROP_RenderList &merge_list);
59 
60  // Ensures that all dependents are rendered after the ROPs they are
61  // dependent on. This should be the last step for the final dependency
62  // list.
63  void resortDependencies();
64 
65  /// Obtain a list of items that nobody depends on in the list.
66  void getDependencyRoots(
67  UT_Array<ROP_RenderItemHandle> &roots) const;
68 
69  /// Obtain a list of items that don't depend on any other item in the list.
70  void getDependencyLeaves(
71  UT_Array<ROP_RenderItemHandle> &leaves)const;
72 
73  // assign rendered frame information to each node's popup info.
74  void assignRenderInfo(const char *job_tag);
75 
76  // dump the render information to os.
77  void print(std::ostream &os, bool full_path,
78  bool condense_range) const;
79 
80 private:
82  UT_Array<ROP_RenderItemHandle> myUnusedItems;
83  UT_IntArray myRemovedDependencies;
84  UT_Array<ROP_RenderItemHandle> myReplacementDependencies;
85 };
86 
87 #endif
const ROP_RenderItemHandle & operator()(unsigned int i) const
ROP_RenderItemHandle & operator()(unsigned int i)
#define ROP_API
Definition: ROP_API.h:10
int entries() const
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
Definition: core.h:2976