HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_AttributeSplit Class Reference

#include <PDG_AttributeSplit.h>

Public Types

template<typename Value >
using SplitMap = UT_ArrayMap< Value, PDG_WorkItemArray >
 
using StringSplitMap = UT_ArrayStringMap< PDG_WorkItemArray >
 
using BatchSplitArray = UT_Array< PDG_WorkItemArray >
 

Static Public Member Functions

static void batchWorkItemsByFrame (BatchSplitArray &batches, PDG_WorkItemArray &missing_items, const PDG_WorkItemArray &work_items, const PDG_NodeArray *input_nodes, bool save_missing=true)
 
template<typename Attribute >
static bool splitWorkItems (SplitMap< typename Attribute::Data > &split, PDG_WorkItemArray &missing_items, typename Attribute::Array &unique_values, const PDG_WorkItemArray &work_items, const UT_StringHolder &attrib_name, bool save_missing=true)
 
static bool splitWorkItems (StringSplitMap &split, PDG_WorkItemArray &missing_items, UT_StringArray &unique_values, const PDG_WorkItemArray &work_items, const UT_StringHolder &attrib_names, const UT_StringHolder *default_value, bool save_missing=true, bool partial_match=false)
 

Detailed Description

Utility class for splitting a list of work items by an attribute value, into a map to subsets of the original work item list.

Definition at line 28 of file PDG_AttributeSplit.h.

Member Typedef Documentation

Integer value -> work item list map, used when splitting a list of work items into batches.

Definition at line 42 of file PDG_AttributeSplit.h.

template<typename Value >
using PDG_AttributeSplit::SplitMap = UT_ArrayMap<Value, PDG_WorkItemArray>

Value -> work item list map, used when splitting a list of work items into multiple list by an attribute value.

Definition at line 34 of file PDG_AttributeSplit.h.

String value -> work item list map, used when splitting a list of work items without specifying a specific attribute type.

Definition at line 38 of file PDG_AttributeSplit.h.

Member Function Documentation

static void PDG_AttributeSplit::batchWorkItemsByFrame ( BatchSplitArray batches,
PDG_WorkItemArray missing_items,
const PDG_WorkItemArray work_items,
const PDG_NodeArray input_nodes,
bool  save_missing = true 
)
static

Batches work items by frame. Iterates over a list of work items and attempts to extract N contiguous lists that span an increasing frame range.

template<typename Attribute >
static bool PDG_AttributeSplit::splitWorkItems ( SplitMap< typename Attribute::Data > &  split,
PDG_WorkItemArray missing_items,
typename Attribute::Array unique_values,
const PDG_WorkItemArray work_items,
const UT_StringHolder attrib_name,
bool  save_missing = true 
)
inlinestatic

Splits a list of input work items into a split map by the specified attribute value. Work items that are missing the attribute are returned in a second output list. The list of unique attribute values is also returned as a third output.

This variation of the function is templated on a specific type of attribute, and uses that type natively for the map key and when accessing attribute values. An alternative version exists below that is not templated on the type and simply uses the common, string represenation of the attribute value instead.

Definition at line 66 of file PDG_AttributeSplit.h.

static bool PDG_AttributeSplit::splitWorkItems ( StringSplitMap split,
PDG_WorkItemArray missing_items,
UT_StringArray unique_values,
const PDG_WorkItemArray work_items,
const UT_StringHolder attrib_names,
const UT_StringHolder default_value,
bool  save_missing = true,
bool  partial_match = false 
)
static

Same as above, but values are converted to strings and accessed without any type information. The attribute name string can contain multiple attrib names, separated by spaces


The documentation for this class was generated from the following file: