std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(
theAttr->owner()->data());
std::string anID = aData->id(theAttr);
- if (myIsInitialized && object() == theAttr->owner() && myID->Get().IsEqual(anID.c_str()))
+ ObjectPtr anObj = object();
+ if (myIsInitialized && anObj == theAttr->owner() && myID->Get().IsEqual(anID.c_str()))
return; // nothing is changed
- REMOVE_BACK_REF(theAttr->owner());
+ REMOVE_BACK_REF(anObj);
myRef->Set(aData->label().Father());
myID->Set(aData->id(theAttr).c_str());
ADD_BACK_REF(theAttr->owner());
#include <iostream>
#endif
-#define CIRCLE_FEATURE_DELETE_WITHOUT_REFERENCES
-
static const double PI = 3.141592653589793238463;
SketchPlugin_ConstraintSplit::SketchPlugin_ConstraintSplit()
FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObjectAttr->value());
ResultPtr aBaseFeatureResult = getFeatureResult(aBaseFeature);
std::set<FeaturePtr> aFeaturesToDelete, aFeaturesToUpdate;
- #ifdef CIRCLE_FEATURE_DELETE_WITHOUT_REFERENCES
- FeaturePtr aCircleFeatureToDelete;
- #endif
std::map<FeaturePtr, IdToPointPair> aTangentFeatures;
std::map<FeaturePtr, IdToPointPair> aCoincidenceToFeature;
updateRefFeatureConstraints(getFeatureResult(aBaseFeature), aRefsToFeature);
AttributePtr aCenterAttr = aCircleFeature->attribute(SketchPlugin_Circle::CENTER_ID());
-#ifdef CIRCLE_FEATURE_DELETE_WITHOUT_REFERENCES
- aCircleFeatureToDelete = aCircleFeature;
-#else
aFeaturesToDelete.insert(aCircleFeature);
-#endif
// as circle is removed, temporary fill this attribute*/
aBaseObjectAttr->setObject(ResultPtr());
}
}
#endif
ModelAPI_Tools::removeFeaturesAndReferences(aFeaturesToDelete);
-#ifdef CIRCLE_FEATURE_DELETE_WITHOUT_REFERENCES
- std::set<FeaturePtr> aCircleFeatures;
- aCircleFeatures.insert(aCircleFeatureToDelete);
- ModelAPI_Tools::removeFeatures(aCircleFeatures, false);
-#endif
#ifdef DEBUG_SPLIT
std::cout << "update features after split:" << std::endl;