aOperation->abort();
return;
}
+ // Init flyout point for radius rotation
+ FeaturePtr aFeature = myCurrentSelection.begin().key();
if (isSketcher) {
myIsDragging = true;
get2dPoint(theWnd, theEvent, myCurrentPoint);
myDragDone = false;
launchEditing();
- // Init flyout point for radius rotation
- FeaturePtr aFeature = myCurrentSelection.begin().key();
- std::shared_ptr<SketchPlugin_Feature> aSPFeature =
- std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
- if (aSPFeature->getKind() == SketchPlugin_ConstraintRadius::ID()) {
- DataPtr aData = aSPFeature->data();
- AttributePtr aAttr = aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT());
- std::shared_ptr<GeomDataAPI_Point2D> aFPAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aAttr);
- aFPAttr->setValue(myCurrentPoint.myCurX, myCurrentPoint.myCurY);
+ if (aFeature.get() != NULL) {
+ std::shared_ptr<SketchPlugin_Feature> aSPFeature =
+ std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
+ if (aSPFeature->getKind() == SketchPlugin_ConstraintRadius::ID()) {
+ DataPtr aData = aSPFeature->data();
+ AttributePtr aAttr = aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT());
+ std::shared_ptr<GeomDataAPI_Point2D> aFPAttr =
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aAttr);
+ aFPAttr->setValue(myCurrentPoint.myCurX, myCurrentPoint.myCurY);
+ }
}
-
} else if (isSketchOpe && isEditing) {
// If selected another object commit current result
aOperation->commit();
FeaturePtr aFeature = anIt.key();
getCurrentSelection(aFeature, myCurrentSketch, aWorkshop, myCurrentSelection);
}
- //qDebug(QString(" storeSelection: %1").arg(myCurrentSelection.size()).toStdString().c_str());
+ qDebug(QString(" storeSelection: %1").arg(myCurrentSelection.size()).toStdString().c_str());
}
void PartSet_SketcherMgr::restoreSelection()