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_WorkItemTypes.h"
16 
17 #include <UT/UT_Array.h>
18 
19 /**
20  * Utiliy class for working with work items over a frame range
21  */
23 {
24 public:
25  /// Array of arrays of workitems, used when splitting a list of
26  /// work items into batches by frame.
28 
29 public:
30  /// Batches work items by frame. Iterates over a list of work items and
31  /// attempts to extract N contiguous lists that span an increasing frame
32  /// range.
33  static void batchWorkItemsByFrame(
34  BatchSplitArray& batches,
35  PDG_WorkItemArray& missing_items,
36  const PDG_WorkItemArray& work_items,
37  const PDG_NodeArray* input_nodes,
38  bool save_missing = true);
39 
40  /// Detects the start, end, and step frame range values from a list of
41  /// work items. Ignores work items that are missing a frame range.
42  static bool detectFrameRange(
43  fpreal& start,
44  fpreal& end,
45  fpreal& step,
46  const PDG_WorkItemArray& work_items,
47  exint step_precision=100);
48 
49  /// Detects the start, end, and step frame range values from a list of
50  /// frame values.
51  static bool detectFrameRange(
52  fpreal& start,
53  fpreal& end,
54  fpreal& step,
55  const UT_FprealArray& frames,
56  exint step_precision=100);
57 
58 private:
59  /// Internal frame detection implementation, assumes that the frame values
60  /// have been sorted in ascending order
61  static bool detectFrameRangeSorted(
62  fpreal& start,
63  fpreal& end,
64  fpreal& step,
65  const UT_FprealArray& frames,
66  exint step_precision=100);
67 };
68 
69 #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:283