aFeature = myFeatures.Find(aFeatureLabel);
aKeptFeatures.insert(aFeature);
if (anUpdatedMap.Contains(aFeatureLabel)) {
+ if (!theOpen) { // on abort/undo/redo reinitialize attributes is something is changed
+ std::shared_ptr<Model_Data> aD = std::dynamic_pointer_cast<Model_Data>(aFeature->data());
+ aD->myAttrs.clear();
+ aFeature->initAttributes();
+ }
ModelAPI_EventCreator::get()->sendUpdated(aFeature, anUpdateEvent);
if (aFeature->getKind() == "Parameter") { // if parameters are changed, update the results (issue 937)
const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aFeature->results();
} else if (aType == ModelAPI_AttributeRefList::typeId()) {
AttributeRefListPtr anAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(theAttr);
+ // for sketch sub-features the empty values may be skipped and order is not important
+ bool isSketchFeatures = anAttr->id() == "Features" &&
+ std::dynamic_pointer_cast<ModelAPI_Feature>(anAttr->owner())->getKind() == "Sketch";
std::list<ObjectPtr> aList = anAttr->list();
+ std::list<std::string> aResList; // list of resulting strings
for(std::list<ObjectPtr>::iterator aL = aList.begin(); aL != aList.end(); aL++) {
- if (aL != aList.begin())
- aResult<<" ";
if (aL->get()) {
- aResult<<(*aL)->data()->name();
- } else {
- aResult<<"__empty__";
+ aResList.push_back((*aL)->data()->name());
+ } else if (!isSketchFeatures) {
+ aResList.push_back("__empty__");
}
}
+ if (isSketchFeatures)
+ aResList.sort();
+ for(std::list<std::string>::iterator aR = aResList.begin(); aR != aResList.end(); aR++) {
+ aResult<<*aR<<" ";
+ }
} else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
AttributeRefAttrListPtr anAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeRefAttrList>(theAttr);
#include <GeomAPI_XY.h>
#include <GeomDataAPI_Point2D.h>
#include <ModelAPI_AttributeDouble.h>
-#include <ModelAPI_AttributeRefList.h>
#include <ModelAPI_AttributeRefAttrList.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_Events.h>
#include "SketchPlugin_ConstraintSplit.h"
-//#include <GeomAPI_Circ2d.h>
-//#include <GeomAPI_Dir2d.h>
-//#include <GeomAPI_Lin2d.h>
#include <GeomAPI_Pnt2d.h>
-//#include <GeomAPI_XY.h>
#include <GeomDataAPI_Point2D.h>
-//#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeReference.h>
#include <ModelAPI_AttributeString.h>
-//#include <ModelAPI_AttributeRefList.h>
#include <ModelAPI_AttributeRefAttr.h>
#include <ModelAPI_Tools.h>
#include <ModelAPI_Document.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_Object.h>
-#include <ModelAPI_AttributeRefList.h>
#include <ModelAPI_ResultConstruction.h>
/// It is important.