HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_FrameUtils.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  * COMMENTS:
7  */
8 
9 #ifndef __PDG_FRAME_UTILS_H__
10 #define __PDG_FRAME_UTILS_H__
11 
12 #include "PDG_API.h"
13 
14 #include "PDG_NodeTypes.h"
15 #include "PDG_WorkItem.h"
16 #include "PDG_WorkItemTypes.h"
17 
18 #include <UT/UT_Array.h>
19 
20 /**
21  * Utiliy class for working with work items over a frame range
22  */
24 {
25 public:
26  /// Array of arrays of workitems, used when splitting a list of
27  /// work items into batches by frame.
29 
30 public:
31  /// Batches work items by frame. Iterates over a list of work items and
32  /// attempts to extract N contiguous lists that span an increasing frame
33  /// range.
34  static void batchWorkItemsByFrame(
35  BatchSplitArray& batches,
36  PDG_WorkItemArray& missing_items,
37  const PDG_WorkItemArray& work_items,
38  const PDG_NodeArray* input_nodes,
39  bool save_missing = true);
40 
41  /// Detects the start, end, and step frame range values from a list of
42  /// work items. Ignores work items that are missing a frame range.
43  static bool detectFrameRange(
44  fpreal& start,
45  fpreal& end,
46  fpreal& step,
47  const PDG_WorkItemArray& work_items,
48  exint step_precision=100);
49 
50  /// Detects the start, end, and step frame range values from a list of
51  /// frame values.
52  static bool detectFrameRange(
53  fpreal& start,
54  fpreal& end,
55  fpreal& step,
56  const UT_FprealArray& frames,
57  exint step_precision=100);
58 
59 private:
60  /// Internal frame detection implementation, assumes that the frame values
61  /// have been sorted in ascending order
62  static bool detectFrameRangeSorted(
63  fpreal& start,
64  fpreal& end,
65  fpreal& step,
66  const UT_FprealArray& frames,
67  exint step_precision=100);
68 };
69 
70 #endif
GLuint start
Definition: glcorearb.h:475
#define PDG_API
Definition: PDG_API.h:23
int64 exint
Definition: SYS_Types.h:125
GLuint GLuint end
Definition: glcorearb.h:475
fpreal64 fpreal
Definition: SYS_Types.h:278