#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;
getConstraints(aFeaturesToDelete, aFeaturesToUpdate, aTangentFeatures, 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;