From: mpv Date: Tue, 4 Jun 2019 07:28:59 +0000 (+0300) Subject: Debug of filters arguments processing X-Git-Tag: VEDF2019Lot4~101^2~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0b7860f6ea3d1b8389227f337ec507833cbadb06;p=modules%2Fshaper.git Debug of filters arguments processing --- diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 5f867fca1..16355161a 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -240,7 +240,7 @@ AttributePtr Model_Data::addFloatingAttribute( int anIndex; TDF_Label aLab; if (myLab.IsAttribute(TDF_TagSource::GetID())) { - TDF_Label aLab = myLab.NewChild(); // already exists a floating attribute, create the next + aLab = myLab.NewChild(); // already exists a floating attribute, create the next anIndex = aLab.Tag(); } else { // put the first floating attribute, quite far from other standard attributes anIndex = int(myAttrs.size()) + 1000; diff --git a/src/Model/Model_Filter.cpp b/src/Model/Model_Filter.cpp index 84b0bd5f7..b0592b35e 100644 --- a/src/Model/Model_Filter.cpp +++ b/src/Model/Model_Filter.cpp @@ -38,21 +38,28 @@ bool Model_FiltersFactory::isValid(FeaturePtr theFiltersFeature, GeomShapePtr th // prepare all filters args ModelAPI_FiltersArgs anArgs; std::map aReverseFlags; /// map of all filters to the reverse values - static const std::string& anEmptyType(""); - std::list > allAttrs = - theFiltersFeature->data()->attributes(anEmptyType); - std::list >::iterator anAttr = allAttrs.begin(); - for(; anAttr != allAttrs.end(); anAttr++) { - const std::string& anAttrID = (*anAttr)->id(); - if (anAttrID.find(kFilterSeparator) == std::string::npos) { // possible a filter reverse flag - std::shared_ptr aReverse = theFiltersFeature->boolean(anAttrID); - if (aReverse.get() && myFilters.find(anAttrID) != myFilters.end()) { - aReverseFlags[myFilters[anAttrID] ] = aReverse->value(); + + std::list aGroups; + theFiltersFeature->data()->allGroups(aGroups); + for(std::list::iterator aGIter = aGroups.begin(); aGIter != aGroups.end(); aGIter++) + { + if (myFilters.find(*aGIter) == myFilters.end()) + continue; + std::list > anAttrs; + theFiltersFeature->data()->attributesOfGroup(*aGIter, anAttrs); + std::list >::iterator anAttrIter = anAttrs.begin(); + for(; anAttrIter != anAttrs.end(); anAttrIter++) { + std::string anArgID = (*anAttrIter)->id().substr((*aGIter).length() + 2); + if (anArgID.empty()) { // reverse flag + std::shared_ptr aReverse = + std::dynamic_pointer_cast(*anAttrIter); + aReverseFlags[myFilters[*aGIter] ] = aReverse->value(); + } else { + anArgs.add(*anAttrIter); } - } else { // an argument of a filter - anArgs.add(*anAttr); } } + // iterate filters and check shape for validity for all of them std::map::iterator aFilter = aReverseFlags.begin(); for(; aFilter != aReverseFlags.end(); aFilter++) {