if (aRefAttr->isObject()) {
FeaturePtr aFeature = ModelAPI_Feature::feature(aRefAttr->object());
std::map<FeaturePtr, Slvs_hEntity>::iterator aFIt = myFeatureMap.find(aFeature);
- if (aFeature && (aFIt == myFeatureMap.end() || aCurAttrs.find(aFIt->second) == aCurAttrs.end()))
- return true;
+ if (aFeature) {
+ if (aFIt == myFeatureMap.end())
+ return true;
+ // Additional check the points of entity
+ if (aCurAttrs.find(aFIt->second) == aCurAttrs.end()) {
+ Slvs_Entity anEntity = myStorage->getEntity(aFIt->second);
+ bool isFound = false;
+ for (int i = 0; i < 4 && !isFound; i++)
+ if (anEntity.point[i] != SLVS_E_UNKNOWN &&
+ aCurAttrs.find(anEntity.point[i]) != aCurAttrs.end())
+ isFound = true;
+ if (!isFound)
+ return true;
+ }
+ }
} else if (aRefAttr->attr()) {
std::map<AttributePtr, Slvs_hEntity>::iterator anAIt = myAttributeMap.find(aRefAttr->attr());
if (anAIt == myAttributeMap.end() || aCurAttrs.find(anAIt->second) == aCurAttrs.end())
{
cleanErrorMsg();
std::map<AttributePtr, Slvs_hEntity>::iterator anAttrIter = myAttributeMap.begin();
- for (; anAttrIter != myAttributeMap.end(); anAttrIter++) {
+ while (anAttrIter != myAttributeMap.end()) {
std::shared_ptr<GeomDataAPI_Point> aPoint =
std::dynamic_pointer_cast<GeomDataAPI_Point>(anAttrIter->first);
+ Slvs_Entity anEntity = myStorage->getEntity(anAttrIter->second);
+ if (anEntity.h == SLVS_E_UNKNOWN) {
+ std::map<AttributePtr, Slvs_hEntity>::iterator aTmpIter = anAttrIter++;
+ myAttributeMap.erase(aTmpIter);
+ continue;
+ }
if (aPoint) {
- Slvs_Entity anEntity = myStorage->getEntity(anAttrIter->second);
double aXYZ[3];
for (int i = 0; i < 3; i++) {
Slvs_Param aPar = myStorage->getParameter(anEntity.param[i]);
std::shared_ptr<GeomDataAPI_Point2D> aPoint2D =
std::dynamic_pointer_cast<GeomDataAPI_Point2D>(anAttrIter->first);
if (aPoint2D) {
- Slvs_Entity anEntity = myStorage->getEntity(anAttrIter->second);
double aXY[2];
for (int i = 0; i < 2; i++) {
Slvs_Param aPar = myStorage->getParameter(anEntity.param[i]);
AttributeDoublePtr aScalar =
std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(anAttrIter->first);
if (aScalar) {
- Slvs_Entity anEntity = myStorage->getEntity(anAttrIter->second);
Slvs_Param aPar = myStorage->getParameter(anEntity.param[0]);
if (fabs(aScalar->value() - aPar.val) > tolerance)
aScalar->setValue(aPar.val);
}
}
}
+ anAttrIter++;
}
std::map<AttributePtr, Slvs_hParam>::iterator aValIter = myValueMap.begin();