HDK
|
#include <PDG_PartitionHolder.h>
Public Types | |
using | IndexMap = UT_ArrayMap< int, PDG_WorkItemIDSet > |
Public Member Functions | |
PDG_PartitionHolder (const PDG_WorkItemArray &work_item) | |
Constructs a new partition holder with a list of valid work items. More... | |
bool | addItemToPartition (PDG_WorkItemID id, int index, bool required, UT_WorkBuffer &errors) |
Adds a work item to the partition with the specified index. More... | |
bool | addItemToPartition (PDG_WorkItem *work_item, int index, bool required, UT_WorkBuffer &errors) |
Adds a work item to the partition with the specified index. More... | |
bool | addItemToPartition (PDG_WorkItem *work_item, const UT_StringHolder &name, bool required, UT_WorkBuffer &errors) |
Adds a work item to the partition with the specified name. More... | |
bool | addItemToAllPartitions (PDG_WorkItem *work_item, UT_WorkBuffer &errors) |
void | setPartitionFrame (int index, fpreal frame) |
Sets the frame for the partition with the given index. More... | |
void | setPartitionFrame (const UT_StringHolder &name, fpreal frame) |
Sets the frame for the partition with the given name. More... | |
const IndexMap & | partitions () const |
Returns the partition map. More... | |
const IndexMap & | required () const |
Returns the items that should be marked as required for each partition. More... | |
const PDG_WorkItemIDSet & | allSet () const |
int | maxIndex () const |
Returns the current max index of all partitions added to the holder. More... | |
int | numPartitions () const |
const UT_StringHolder & | splitAttribute () const |
Returns the split attribute name. More... | |
const UT_StringHolder & | splitValue () const |
Returns the current split attribute value. More... | |
bool | isSplitting () const |
const PDG_WorkItemArray & | splitMissing () const |
PDG_WorkItemArray & | splitMissing () |
PDG_WorkItem * | partitionInput (PDG_WorkItemID id) const |
PDG_OptionalFrame | frameForPartition (int index) const |
Return the frame specified for the partition with the given index. More... | |
bool | isAllSetOnly () const |
Returns true if the holder only consists of entries in the All Set. More... | |
void | setSplitInfo (const UT_StringHolder &name) |
void | setSplitValue (const UT_StringHolder &value, int index_offset) |
void | resolveNames () |
Converts named partitions into real partitions. More... | |
bool | checkLoop (UT_WorkBuffer &errors, const PDG_WorkItemIDSet &ids, PDG_WorkItem **current_item, bool check_all) const |
bool | checkLoop (UT_WorkBuffer &errors, const PDG_WorkItemArray &work_items, PDG_WorkItem **current_item) const |
Factory/holder object that creates or updates partitions
Definition at line 24 of file PDG_PartitionHolder.h.
Definition at line 27 of file PDG_PartitionHolder.h.
PDG_PartitionHolder::PDG_PartitionHolder | ( | const PDG_WorkItemArray & | work_item | ) |
Constructs a new partition holder with a list of valid work items.
bool PDG_PartitionHolder::addItemToAllPartitions | ( | PDG_WorkItem * | work_item, |
UT_WorkBuffer & | errors | ||
) |
Adds a work item to all partitions, without having to know the indices or number of partitions that exist
bool PDG_PartitionHolder::addItemToPartition | ( | PDG_WorkItemID | id, |
int | index, | ||
bool | required, | ||
UT_WorkBuffer & | errors | ||
) |
Adds a work item to the partition with the specified index.
bool PDG_PartitionHolder::addItemToPartition | ( | PDG_WorkItem * | work_item, |
int | index, | ||
bool | required, | ||
UT_WorkBuffer & | errors | ||
) |
Adds a work item to the partition with the specified index.
bool PDG_PartitionHolder::addItemToPartition | ( | PDG_WorkItem * | work_item, |
const UT_StringHolder & | name, | ||
bool | required, | ||
UT_WorkBuffer & | errors | ||
) |
Adds a work item to the partition with the specified name.
|
inline |
Returns the all set, e.g. the set of items that should be added to all partitions
Definition at line 81 of file PDG_PartitionHolder.h.
bool PDG_PartitionHolder::checkLoop | ( | UT_WorkBuffer & | errors, |
const PDG_WorkItemIDSet & | ids, | ||
PDG_WorkItem ** | current_item, | ||
bool | check_all | ||
) | const |
Determines the loop stack work item for a set of work item IDs, and returns false if the IDs don't form a valid partition for a loop.
bool PDG_PartitionHolder::checkLoop | ( | UT_WorkBuffer & | errors, |
const PDG_WorkItemArray & | work_items, | ||
PDG_WorkItem ** | current_item | ||
) | const |
Determines the loop stack work item for a list of work items, and return false if the items don't form a valid partition for a loop
PDG_OptionalFrame PDG_PartitionHolder::frameForPartition | ( | int | index | ) | const |
Return the frame specified for the partition with the given index.
bool PDG_PartitionHolder::isAllSetOnly | ( | ) | const |
Returns true if the holder only consists of entries in the All Set.
|
inline |
Returns true if this holder is being used for partitioning with a split attribute.
Definition at line 104 of file PDG_PartitionHolder.h.
|
inline |
Returns the current max index of all partitions added to the holder.
Definition at line 86 of file PDG_PartitionHolder.h.
|
inline |
Returns the number of partitions added to the holder. This is reset after setSplitValue is called.
Definition at line 91 of file PDG_PartitionHolder.h.
|
inline |
Returns the input work item for the specifed ID, or null if the ID is not a valid input
Definition at line 116 of file PDG_PartitionHolder.h.
|
inline |
Returns the partition map.
Definition at line 72 of file PDG_PartitionHolder.h.
|
inline |
Returns the items that should be marked as required for each partition.
Definition at line 76 of file PDG_PartitionHolder.h.
void PDG_PartitionHolder::resolveNames | ( | ) |
Converts named partitions into real partitions.
Sets the frame for the partition with the given index.
void PDG_PartitionHolder::setPartitionFrame | ( | const UT_StringHolder & | name, |
fpreal | frame | ||
) |
Sets the frame for the partition with the given name.
void PDG_PartitionHolder::setSplitInfo | ( | const UT_StringHolder & | name | ) |
Sets the global split attribute information for this holder. Called once during partitioning with a split attribute.
void PDG_PartitionHolder::setSplitValue | ( | const UT_StringHolder & | value, |
int | index_offset | ||
) |
Sets the local split attribute information for this holder. Called once for each split attribute value during partitioning.
|
inline |
Returns the split attribute name.
Definition at line 95 of file PDG_PartitionHolder.h.
|
inline |
Returns the array of work items that are missing the split attribute, or nullptr if isSplitting() returns false;
Definition at line 109 of file PDG_PartitionHolder.h.
|
inline |
Definition at line 111 of file PDG_PartitionHolder.h.
|
inline |
Returns the current split attribute value.
Definition at line 99 of file PDG_PartitionHolder.h.