-void CollectionAPI_Field::addStep(const ModelHighAPI_Integer& theStepNum,
- const ModelHighAPI_Integer& theStamp,
- const std::list<std::list<ModelHighAPI_ComponentValue> >& theComponents)
-{
- // set the table size to be sure the values are up to date
- myvalues->setSize(myselection->size() + 1 /* with defaults */,
- mycomponentsNum->value(), mystepsNum->value());
-
- // set values one by one
- int aRowIndex = 0;
- std::list<std::list<ModelHighAPI_ComponentValue> >::const_iterator
- aRowsIter = theComponents.begin();
- for(; aRowsIter != theComponents.end(); aRowsIter++, aRowIndex++) {
- int aColIndex = 0;
- std::list<ModelHighAPI_ComponentValue>::const_iterator aColIter = aRowsIter->begin();
- for(; aColIter != aRowsIter->end(); aColIter++, aColIndex++) {
- aColIter->fill(myvalues, theStepNum.intValue(), aColIndex, aRowIndex);
- }
- }
- execute();
+#define addStepImplementation(type, fieldType, type2, fieldType2, type3, fieldType3) \
+void CollectionAPI_Field::addStep(const ModelHighAPI_Integer& theStepNum, \
+ const ModelHighAPI_Integer& theStamp, \
+ const std::list<std::list<type> >& theComponents) \
+{ \
+ mystamps->setValue(theStepNum.intValue(), theStamp.intValue()); \
+ int aRowIndex = 0; \
+ std::list<std::list<type> >::const_iterator \
+ aRowsIter = theComponents.begin(); \
+ for(; aRowsIter != theComponents.end(); aRowsIter++, aRowIndex++) { \
+ int aColIndex = 0; \
+ std::list<type>::const_iterator aColIter = aRowsIter->begin(); \
+ for(; aColIter != aRowsIter->end(); aColIter++, aColIndex++) { \
+ ModelAPI_AttributeTables::Value aVal; \
+ aVal.fieldType = *aColIter; \
+ aVal.fieldType2 = type2(*aColIter); \
+ aVal.fieldType3 = type3(*aColIter); \
+ myvalues->setValue(aVal, aRowIndex, aColIndex, theStepNum.intValue()); \
+ } \
+ } \
+ execute(); \