void FiltersAPI_Argument::dump(ModelHighAPI_Dumper& theDumper) const
{
- if (mySelectionAttr)
- theDumper << mySelectionAttr;
+ if (mySelectionAttr) {
+ // write empty selection attribute, because parametrization is not supported yet
+ theDumper << "model.selection()"; // mySelectionAttr;
+ }
else if (mySelection.variantType() == ModelHighAPI_Selection::VT_Empty) {
if (myValue.empty())
theDumper << myBoolean;
const std::list<AttributePtr>& theArguments)
: myName(theName)
{
- for (std::list<AttributePtr>::const_iterator anArgIt = theArguments.begin();
- anArgIt != theArguments.end(); ++anArgIt) {
- AttributeBooleanPtr aBoolAttr =
+ std::list<AttributePtr>::const_iterator anArgIt = theArguments.begin();
+ // first attribute is usually for reversing the filter
+ AttributeBooleanPtr aBoolAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(*anArgIt);
- if (aBoolAttr) {
- myReversed = aBoolAttr->value();
- continue;
- }
+ if (aBoolAttr) {
+ myReversed = aBoolAttr->value();
+ ++anArgIt;
+ }
+ for (; anArgIt != theArguments.end(); ++anArgIt) {
AttributeSelectionListPtr aSelList =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(*anArgIt);
if (aSelList) {
// check selection list is obtained by filters
FiltersFeaturePtr aFilters = theAttrSelList->filters();
if (aFilters) {
- *myDumpStorage << ", ";
+ if (theAttrSelList->size() > 0)
+ *myDumpStorage << ", ";
dumpFeature(aFilters, true);
}
return "__notcase__";
}
std::string aType = theAttr->attributeType();
+
+ // do not check selection of the filter,
+ // because there is neither parametric update nor dump support yet.
+ FiltersFeaturePtr aFilter = std::dynamic_pointer_cast<ModelAPI_FiltersFeature>(aFeatOwner);
+ if (aFilter && (aType == ModelAPI_AttributeSelection::typeId() ||
+ aType == ModelAPI_AttributeSelectionList::typeId()))
+ return "__filter_selection__";
+
std::ostringstream aResult;
if (!theAttr->isInitialized()) {
if (aType == ModelAPI_AttributeBoolean::typeId()) {