cee::ug::DataElementSetBuilder Class Reference

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< DataElementSetcreateSet ()
 Returns the complete data element set. More...
 

Detailed Description

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.

std::vector<size_t> eltementIndices1 = { 7, 5, 16, 8 };
std::vector<size_t> eltementIndices2 = { 17, 24, 3, 9 };
builder.addUniqueItems(1, 1, eltementIndices1);
builder.addUniqueItems(1, 1, eltementIndices2);
cee::PtrRef<DataElementSet> set = builder.createSet();

Constructor & Destructor Documentation

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

Member Function Documentation

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.