X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelHighAPI%2FModelHighAPI_FeatureStore.cpp;h=09e944d4ee7995413c522e680eea05f3dbc59060;hb=f03c02cd62fe508c65818d31fdf9dcf69f8cbf35;hp=f0d4deb48d9b2f427daa53e5b842b01ac79a8bf5;hpb=f29add28ea010ab76fe32889b61c06fbdcbb535d;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp index f0d4deb48..09e944d4e 100644 --- a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp +++ b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include @@ -160,6 +159,14 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) { 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(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()) { @@ -188,12 +195,23 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) { } } else if (aType == ModelAPI_AttributeInteger::typeId()) { AttributeIntegerPtr anAttr = std::dynamic_pointer_cast(theAttr); + // do not dump a type of ConstraintAngle, because it can be changed due dumping + if (anAttr->id() == "AngleType") { + return ""; + } if (anAttr->text().empty()) aResult<value(); else aResult<text(); } else if (aType == ModelAPI_AttributeDouble::typeId()) { AttributeDoublePtr anAttr = std::dynamic_pointer_cast(theAttr); + if (anAttr->id() == "ConstraintValue") { + // do not dump a value of constraint if it is ConstraintAngle, + // because this value depends on the angle type + FeaturePtr anOwner = ModelAPI_Feature::feature(anAttr->owner()); + if (anOwner && anOwner->getKind() == "SketchConstraintAngle") + return ""; + } int aPrecision = PRECISION; // Special case - precision for the arc angle. It is calculated with tolerance 1e-4, // so the value has only 4 correct digits @@ -206,6 +224,10 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) { aResult<text(); } else if (aType == ModelAPI_AttributeBoolean::typeId()) { AttributeBooleanPtr anAttr = std::dynamic_pointer_cast(theAttr); + // do not dump internal flags of ConstraintAngle + if (anAttr->id() == "AngleReversedLine1" || anAttr->id() == "AngleReversedLine2") { + return ""; + } aResult<value(); } else if (aType == ModelAPI_AttributeString::typeId()) { AttributeStringPtr anAttr = std::dynamic_pointer_cast(theAttr); @@ -225,7 +247,10 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) { } else if (aType == ModelAPI_AttributeSelection::typeId()) { AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttr); - aResult<namingName(); + if (anAttr->context().get()) + aResult<namingName(); + else + aResult<<"__notinitialized__"; } else if (aType == ModelAPI_AttributeSelectionList::typeId()) { AttributeSelectionListPtr anAttr = std::dynamic_pointer_cast(theAttr);