}
myOriginalShape = aShapePtr->impl<TopoDS_Shape>();
if (!myOriginalShape.IsNull()) {
- Set(aShapePtr->impl<TopoDS_Shape>());
+ Set(myOriginalShape);
AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);
}
}
QList<ModuleBase_ViewerPrs> aPrsList = aSelection->getSelected();
TopoDS_Shape aShape;
ResultPtr aResult;
+ FeaturePtr aFeature;
foreach(ModuleBase_ViewerPrs aPrs, aPrsList) {
aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aPrs.object());
if (aResult.get() != NULL) {
hasFeature = true;
else
hasAttribute = true;
+ } else {
+ aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aPrs.object());
+ hasFeature = (aFeature.get() != NULL);
}
}
if (aPrsList.size() == 1) {
TopoDS_Shape aShape = aPrsList.first().shape();
- if (aShape.ShapeType() == TopAbs_VERTEX) {
+ if ((!aShape.IsNull()) && aShape.ShapeType() == TopAbs_VERTEX) {
// Find 2d coordinates
FeaturePtr aSketchFea = myModule->sketchMgr()->activeSketch();
if (aSketchFea->getKind() == SketchPlugin_Sketch::ID()) {
if (!aShapePrs.IsNull()) {
std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aResult);
if (aShapePtr.get()) {
- const TopoDS_Shape& aShape = aShapePrs->Shape();
- std::shared_ptr<GeomAPI_Shape> anAISShapePtr(new GeomAPI_Shape());
- anAISShapePtr->setImpl(new TopoDS_Shape(aShape));
- isEqualShapes = aShapePtr->isEqual(anAISShapePtr);
+ const TopoDS_Shape& aOldShape = aShapePrs->Shape();
+ isEqualShapes = aOldShape.IsEqual(aShapePtr->impl<TopoDS_Shape>());
}
}
}