- QString anEntry = anOwner->entry();
- QString aPrefix = HYDROGUI_DataObject::entryPrefix();
- if( anEntry.left( aPrefix.length() ) == aPrefix )
- {
- anEntry.remove( aPrefix );
- for( ObjectKind anObjectKind = KIND_UNKNOWN + 1; anObjectKind <= KIND_LAST; anObjectKind++ )
- if( HYDROGUI_DataModel::partitionName( anObjectKind ) == anEntry )
- return anObjectKind;
- }
- }
- return KIND_UNKNOWN;
-}
-
-Handle(HYDROData_Entity) HYDROGUI_Tool::FindObjectByName( HYDROGUI_Module* theModule,
- const QString& theName,
- const ObjectKind theObjectKind )
-{
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() );
- return HYDROData_Tool::FindObjectByName( aDocument, theName, theObjectKind );
-}
-
-HYDROData_SequenceOfObjects HYDROGUI_Tool::FindObjectsByNames( HYDROGUI_Module* theModule,
- const QStringList& theNames,
- const ObjectKind theObjectKind )
-{
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() );
- return HYDROData_Tool::FindObjectsByNames( aDocument, theNames, theObjectKind );
-}
-
-QString HYDROGUI_Tool::GenerateObjectName( HYDROGUI_Module* theModule,
- const QString& thePrefix,
- const QStringList& theUsedNames )
-{
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() );
- return HYDROData_Tool::GenerateObjectName( aDocument, thePrefix, theUsedNames );
-}
-
-size_t HYDROGUI_Tool::GetActiveViewId( HYDROGUI_Module* theModule,
- const QString& theViewId )
-{
- size_t aViewId = 0;
- SUIT_ViewManager* aViewMgr = theModule->getApp()->activeViewManager();
- if( !aViewMgr || ( !theViewId.isEmpty() && aViewMgr->getType() != theViewId ) )
- return aViewId;
-
- if( SUIT_ViewModel* aViewer = aViewMgr->getViewModel() )
- aViewId = (size_t)aViewer;
- return aViewId;
-}
-
-size_t HYDROGUI_Tool::GetActiveGraphicsViewId( HYDROGUI_Module* theModule )
-{
- return GetActiveViewId( theModule, GraphicsView_Viewer::Type() );
-}