}
else if (aFeatureKind == SketchPlugin_Trim::ID()) {
/*std::shared_ptr<ModelAPI_AttributeReference> aRefSelectedAttr =
- std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
- theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT()));
+ std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
+ theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT()));
std::shared_ptr<ModelAPI_AttributeReference> aNRefSelectedAttr =
- std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
- theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT()));
+ std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
+ theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT()));
aNRefSelectedAttr->setValue(aRefSelectedAttr->value());*/
std::shared_ptr<ModelAPI_AttributeReference> aRefPreviewAttr =
- std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
- theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT()));
+ std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
+ theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT()));
std::shared_ptr<ModelAPI_AttributeReference> aNRefPreviewAttr =
- std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
- theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT()));
+ std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
+ theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT()));
aNRefPreviewAttr->setValue(aRefPreviewAttr->value());
/*std::shared_ptr<GeomDataAPI_Point2D> aPointSelectedAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
- theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT()));
std::shared_ptr<GeomDataAPI_Point2D> aNPointSelectedAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
- theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT()));
aNPointSelectedAttr->setValue(aPointSelectedAttr->x(), aPointSelectedAttr->y());
*/
std::shared_ptr<GeomDataAPI_Point2D> aPointPreviewAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
- theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT()));
std::shared_ptr<GeomDataAPI_Point2D> aNPointPreviewAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
- theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT()));
aNPointPreviewAttr->setValue(aPointPreviewAttr->x(), aPointPreviewAttr->y());
aChanged = true;
const std::shared_ptr<GeomAPI_Pnt>& thePoint)
{
std::shared_ptr<GeomAPI_Pnt2d> aPoint;
+ if (!thePoint.get())
+ return aPoint;
AttributeReferencePtr aBaseObjectAttr = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT()));
findShapePoints(SELECTED_OBJECT(), SELECTED_POINT(), aStartShapePoint, aLastShapePoint);
std::shared_ptr<GeomAPI_Pnt2d> aStartShapePoint2d = convertPoint(aStartShapePoint);
-
std::shared_ptr<GeomAPI_Pnt2d> aLastShapePoint2d = convertPoint(aLastShapePoint);
std::set<FeaturePtr> aFeaturesToDelete;
}
}
if (aPreviewObject.get()) {
- static Events_ID anId = ModelAPI_EventReentrantMessage::eventId();
std::shared_ptr<ModelAPI_EventReentrantMessage> aMessage = std::shared_ptr
- <ModelAPI_EventReentrantMessage>(new ModelAPI_EventReentrantMessage(anId, 0));
+ <ModelAPI_EventReentrantMessage>(new ModelAPI_EventReentrantMessage(
+ ModelAPI_EventReentrantMessage::eventId(), 0));
aMessage->setSelectedObject(aPreviewObject);
Events_Loop::loop()->send(aMessage);
- Events_Loop::loop()->flush(anId);
}
#ifdef DEBUG_TRIM
std::cout << "SketchPlugin_Trim::done" << std::endl;