//**********************************************************************************
int CollectionPlugin_WidgetField::getSelectionType(const std::string& theStr) const
{
- if (theStr == "vertex")
+ QString aType(theStr.c_str());
+ aType = aType.toLower();
+ if (aType == "vertex")
return 0;
- else if (theStr == "edge")
+ else if (aType == "edge")
return 1;
- else if (theStr == "face")
+ else if (aType == "face")
return 2;
- else if (theStr == "solid")
+ else if (aType == "solid")
return 3;
- else if (theStr == "object")
+ else if (aType == "object")
return 4;
- else if (theStr == "part")
+ else if (aType == "part")
return 5;
return -1;
}
Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel();
- ModuleBase_ModelWidget* aCurrentWidget = aPanel->preselectionWidget();
- if (!aCurrentWidget)
- aCurrentWidget = myWorkshop->module()->activeWidget();
- if (aCurrentWidget) {
- ModuleBase_ViewerPrsPtr aPrs(new ModuleBase_ViewerPrs());
- myWorkshop->selection()->fillPresentation(aPrs, theOwner);
- ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast<ModuleBase_WidgetValidated*>
- (aCurrentWidget);
- if (aWidgetValidated)
- aValid = !aWidgetValidated || aWidgetValidated->isValidSelection(aPrs);
- else{
- ModuleBase_WidgetValidator* aWidgetValidator = aCurrentWidget->widgetValidator();
- if (aWidgetValidator)
- aValid = aWidgetValidator->isValidSelection(aPrs);
+ if (aPanel) {
+ ModuleBase_ModelWidget* aCurrentWidget = aPanel->preselectionWidget();
+ if (!aCurrentWidget)
+ aCurrentWidget = myWorkshop->module()->activeWidget();
+ if (aCurrentWidget) {
+ ModuleBase_ViewerPrsPtr aPrs(new ModuleBase_ViewerPrs());
+ myWorkshop->selection()->fillPresentation(aPrs, theOwner);
+ ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast<ModuleBase_WidgetValidated*>
+ (aCurrentWidget);
+ if (aWidgetValidated)
+ aValid = !aWidgetValidated || aWidgetValidated->isValidSelection(aPrs);
+ else{
+ ModuleBase_WidgetValidator* aWidgetValidator = aCurrentWidget->widgetValidator();
+ if (aWidgetValidator)
+ aValid = aWidgetValidator->isValidSelection(aPrs);
+ }
}
}
}