if (aObj.get()) {
FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
if (aFeature.get()) {
- std::shared_ptr<SketchPlugin_Feature> aSketch =
- std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
- if (aSketch.get())
+ CompositeFeaturePtr aComp = ModelAPI_Tools::compositeOwner(aFeature);
+ if (aComp.get() && (aComp->getKind() == SketchPlugin_Sketch::ID()))
aCount++;
}
}
{
setAllEnabled();
XGUI_Selection* aSelection = myWorkshop->selector()->selection();
- if (aSelection->getSelected(ModuleBase_ISelection::Viewer).size() > 0)
+ //if (aSelection->getSelected(ModuleBase_ISelection::Viewer).size() > 0)
+ if (aSelection->getSelected().size() > 0)
updateOnViewSelection();
FeaturePtr anActiveFeature = FeaturePtr();
QObjectPtrList XGUI_Selection::selectedObjects() const
{
- return myWorkshop->objectBrowser()->selectedObjects();
+ if (myWorkshop->objectBrowser())
+ return myWorkshop->objectBrowser()->selectedObjects();
+ return QObjectPtrList();
}
void XGUI_Selection::setSelectedObjects( const QObjectPtrList& theObjects ) const