//}
//aBaseShape = aShape;
-#ifdef DEBUG_TRIM_METHODS
+#ifdef DEBUG_SPLIT
if (!aSelectedShape.get())
std::cout << "Set empty selected object" << std::endl;
else
std::string SketchPlugin_Split::processEvent(const std::shared_ptr<Events_Message>& theMessage)
{
-#ifdef DEBUG_TRIM_METHODS
- std::cout << "SketchPlugin_Trim::processEvent:" << data()->name() << std::endl;
+#ifdef DEBUG_SPLIT
+ std::cout << "SketchPlugin_Split::processEvent:" << data()->name() << std::endl;
#endif
std::string aFilledAttributeName;
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
GeomShapePtr aSelectedShape = getSubShape(SELECTED_OBJECT(), SELECTED_POINT());
- #ifdef DEBUG_TRIM_METHODS
+ if (aSelectedShape.get()) {
+ aFilledAttributeName = SELECTED_OBJECT();
+ }
+ else {
+ // #2480 - sub shape is not initialized when split sketch
+ // If restarted operation use some selection on the shape that is split and
+ // result selectiona can not participate in new split(checked shape above is null),
+ // reset filled values of selection set in this method above
+ aRefSelectedAttr->setValue(ResultPtr());
+ aRefPreviewAttr->setValue(ResultPtr());
+ }
+ #ifdef DEBUG_SPLIT
if (!aSelectedShape.get())
std::cout << "Set empty selected object" << std::endl;
else
std::cout << "Set shape with ShapeType: " << aSelectedShape->shapeTypeStr() << std::endl;
#endif
- aFilledAttributeName = SELECTED_OBJECT();
}
}
}
return anAIS;
}
return AISObjectPtr();*/
-#ifdef DEBUG_TRIM_METHODS
- std::cout << "SketchPlugin_Trim::getAISObject: " << data()->name() << std::endl;
+#ifdef DEBUG_SPLIT
+ std::cout << "SketchPlugin_Split::getAISObject: " << data()->name() << std::endl;
#endif
AISObjectPtr anAIS = thePrevious;
}
if (aFeaturePointAttribute.get()) {
// create new constraint and remove the current
- aCoincFeature = SketchPlugin_Tools::createConstraint(sketch(),
+ aCoincFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(),
SketchPlugin_ConstraintCoincidence::ID(),
aFeaturePointAttribute, aCoincFeature->refattr(aSecondAttribute)->attr());
theFeaturesToDelete.insert(aCIt->first);
for (; aSFIt != aSFLast; aSFIt++) {
AttributePoint2DPtr aSFAttribute = *aSFIt;
if (aCoincPnt->isEqual(aSFAttribute->pnt())) {
- SketchPlugin_Tools::createConstraint(sketch(), SketchPlugin_ConstraintCoincidence::ID(),
+ SketchPlugin_Tools::createConstraintAttrAttr(sketch(),
+ SketchPlugin_ConstraintCoincidence::ID(),
aSFAttribute, aCoincFeature->refattr(aSecondAttribute)->attr());
}
}
aFeature->attribute(SketchPlugin_Line::END_ID())));
anNewFeature = aFeature;
}
- aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(),
+ aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(),
SketchPlugin_ConstraintCoincidence::ID(),
theSplitFeature->attribute(SketchPlugin_Line::END_ID()),
aFeature->attribute(SketchPlugin_Line::START_ID()));
fillAttribute(theBaseFeatureModified->attribute(SketchPlugin_Line::END_ID()),
aFirstPointAttrOfSplit);
theBaseFeatureModified->execute(); // to update result
- aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(),
+ aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(),
SketchPlugin_ConstraintCoincidence::ID(),
theBaseFeatureModified->attribute(SketchPlugin_Line::END_ID()),
theSplitFeature->attribute(SketchPlugin_Line::START_ID()));
aFeature->attribute(SketchPlugin_Arc::END_ID())));
anNewFeature = aFeature;
}
- aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(),
+ aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(),
SketchPlugin_ConstraintCoincidence::ID(),
theSplitFeature->attribute(SketchPlugin_Arc::END_ID()),
aFeature->attribute(SketchPlugin_Arc::START_ID()));
fillAttribute(theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID()),
aFirstPointAttrOfSplit);
theBaseFeatureModified->execute(); // to update result
- aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(),
+ aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(),
SketchPlugin_ConstraintCoincidence::ID(),
theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID()),
theSplitFeature->attribute(SketchPlugin_Arc::START_ID()));
(theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID())));
// additional constraints between split and base features
- aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(),
+ aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(),
SketchPlugin_ConstraintCoincidence::ID(),
theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID()),
theSplitFeature->attribute(SketchPlugin_Arc::END_ID()));
theCreatedFeatures.insert(aConstraintFeature);
- aConstraintFeature = SketchPlugin_Tools::createConstraint(sketch(),
+ aConstraintFeature = SketchPlugin_Tools::createConstraintAttrAttr(sketch(),
SketchPlugin_ConstraintCoincidence::ID(),
theBaseFeatureModified->attribute(SketchPlugin_Arc::START_ID()),
theSplitFeature->attribute(SketchPlugin_Arc::START_ID()));