Helper class for building element sets in an efficient matter. More...
Public Member Functions | |
DataElementSetBuilder (int setId) | |
Creates the element set builder. More... | |
void | addItem (const DataElementSetItem &item) |
Adds the item to the element set builder. More... | |
void | addItems (int geometryId, int partId, const std::vector< size_t > &elementIndices) |
Adds the items to the element set builder. More... | |
void | addUniqueItem (const DataElementSetItem &item) |
Adds the item to the element set builder. More... | |
void | addUniqueItems (int geometryId, int partId, const std::vector< size_t > &elementIndices) |
Adds the items to the element set builder. More... | |
PtrRef< DataElementSet > | createSet () |
Returns the complete data element set. More... | |
Helper class for building element sets in an efficient matter.
If you need to call DataElementSet::addItem()/addItems() many times for each data element set, you can use this helper class to increase performance.
Use the add* functions to add items to be included in the element set. After all items are added, get the complete element set using createSet(). Always use addUnique* when possible to increase performance further.
cee::ug::DataElementSetBuilder::DataElementSetBuilder | ( | int | setId | ) |
Creates the element set builder.
setId need to be unique when the element set is added to the model
void cee::ug::DataElementSetBuilder::addItem | ( | const DataElementSetItem & | item | ) |
Adds the item to the element set builder.
void cee::ug::DataElementSetBuilder::addItems | ( | int | geometryId, |
int | partId, | ||
const std::vector< size_t > & | elementIndices | ||
) |
Adds the items to the element set builder.
void cee::ug::DataElementSetBuilder::addUniqueItem | ( | const DataElementSetItem & | item | ) |
Adds the item to the element set builder.
Requires unique items. Only use this if you are sure the item does not already exist in the element set.
void cee::ug::DataElementSetBuilder::addUniqueItems | ( | int | geometryId, |
int | partId, | ||
const std::vector< size_t > & | elementIndices | ||
) |
Adds the items to the element set builder.
Requires unique items. Only use this if you are sure the item does not already exist in the element set.
cee::PtrRef< cee::ug::DataElementSet > cee::ug::DataElementSetBuilder::createSet | ( | ) |
Returns the complete data element set.
Call this once after all items are added.