bool isOldShape = isOldContext &&
(theSubShape == anOldShape || (theSubShape && anOldShape && theSubShape->isEqual(anOldShape)));
if (isOldShape) return false; // shape is the same, so context is also unchanged
+ bool aToUnblock = false;
// update the referenced object if needed
if (!isOldContext) {
- myRef.setValue(theContext);
+ aToUnblock = !owner()->data()->blockSendAttributeUpdated(true);
+ myRef.setValue(theContext);
}
// do noth use naming if selected shape is result shape itself, but not sub-shape
TDF_Label aRefLab = myRef.myRef->Label();
aSelLab.ForgetAllAttributes(true);
myRef.myRef = TDF_Reference::Set(aSelLab.Father(), aSelLab.Father());
+ if (aToUnblock)
+ owner()->data()->blockSendAttributeUpdated(false);
return false;
}
if (theContext->groupName() == ModelAPI_ResultBody::group()) {
}
owner()->data()->sendAttributeUpdated(this);
+
+ if (aToUnblock)
+ owner()->data()->blockSendAttributeUpdated(false);
+
return true;
}
std::shared_ptr<GeomAPI_Shape> Model_AttributeSelection::value()
{
+ if (!ModelAPI_AttributeSelection::isInitialized() && !myTmpContext.get() && !myTmpSubShape.get())
+ return std::shared_ptr<GeomAPI_Shape>();
CenterType aType = NOT_CENTER;
std::shared_ptr<GeomAPI_Shape> aResult = internalValue(aType);
return centerByEdge(aResult, aType);
}
ResultPtr Model_AttributeSelection::context() {
+ /*
+ if (!ModelAPI_AttributeSelection::isInitialized() && !myTmpContext.get() && !myTmpSubShape.get())
+ return ResultPtr();
+ */
+
if (myTmpContext.get() || myTmpSubShape.get()) {
return myTmpContext;
}
}
}
// for group Scope is not limitet: this is always up to date objects
- bool isGroup = aFeature.get() && aFeature->getKind() == "Group";
+ // this causes problem in galeries.py
+ //bool isGroup = aFeature.get() && aFeature->getKind() == "Group";
for(; aFIter != allFeatures.end(); aFIter++) {
if (*aFIter == owner()) { // the left features are created later (except subs of composite)
aMePassed = true;
continue;
}
- if (isGroup) aMePassed = false;
+ //if (isGroup) aMePassed = false;
bool isInScope = !aMePassed;
if (!isInScope && aComposite.get()) {
// try to add sub-elements of composite if this is composite