From 5d6ee52817dbc0c10e3976079e774563f4f84bd9 Mon Sep 17 00:00:00 2001 From: rraphael Date: Mon, 8 Feb 2021 19:30:53 +0100 Subject: [PATCH] Add shaper standalone executable without CORBA --- src/CMakeLists.txt | 4 + src/LightApp/LightApp_Application.cxx | 13 +- src/SUIT/SUIT_Session.cxx | 39 + src/SUIT/SUIT_Session.h | 7 + src/SalomeApp/CMakeLists.txt | 95 +- src/SalomeApp/SalomeApp_Application.cxx | 72 +- src/SalomeApp/SalomeApp_Application.h | 16 +- src/SalomeApp/SalomeApp_DataModel.cxx | 28 +- src/SalomeApp/SalomeApp_DataModel.h | 6 +- src/SalomeApp/SalomeApp_DataObject.cxx | 48 +- src/SalomeApp/SalomeApp_DataObject.h | 12 +- src/SalomeApp/SalomeApp_DoubleSpinBox.cxx | 2 + src/SalomeApp/SalomeApp_ExceptionHandler.cxx | 4 + src/SalomeApp/SalomeApp_ExitDlg.cxx | 10 +- src/SalomeApp/SalomeApp_ExitDlg.h | 2 + src/SalomeApp/SalomeApp_IntSpinBox.cxx | 2 + src/SalomeApp/SalomeApp_Module.cxx | 20 +- src/SalomeApp/SalomeApp_NoteBook.cxx | 17 +- src/SalomeApp/SalomeApp_NoteBook.h | 6 +- src/SalomeApp/SalomeApp_Study.cxx | 614 +++++--- src/SalomeApp/SalomeApp_Study.h | 12 +- .../SalomeApp_StudyPropertiesDlg.cxx | 35 +- src/SalomeApp/SalomeApp_StudyPropertiesDlg.h | 6 +- src/SalomeApp/SalomeApp_Tools.cxx | 2 + src/SalomeApp/SalomeApp_Tools.h | 4 + src/SalomeApp/SalomeApp_TypeFilter.cxx | 10 +- src/SalomeApp/SalomeApp_VisualState.cxx | 31 +- src/Session/SALOME_Session_Server.cxx | 3 + src/Shaper/CMakeLists.txt | 76 + src/Shaper/Shaper.cxx | 486 +++++++ src/ShaperApp/CMakeLists.txt | 244 ++++ .../SALOMEDSImplAdapt/CMakeLists.txt | 34 + .../SALOMEDSImplAdapt/SALOMEDSImpl.hxx | 68 + .../SALOMEDSImplAdapt/SALOMEDSImplAdapt.hxx | 37 + .../SALOMEDSImplAdaptCopyAttribute.hxx | 79 + .../SALOMEDSImplAdaptTypes.hxx | 63 + .../SALOMEDSImplAdapt_ChildIterator.cxx | 45 + .../SALOMEDSImplAdapt_ChildIterator.hxx | 46 + .../SALOMEDSImplAdapt_SComponent.cxx | 43 + .../SALOMEDSImplAdapt_SComponent.hxx | 45 + .../SALOMEDSImplAdapt_SComponentIterator.cxx | 44 + .../SALOMEDSImplAdapt_SComponentIterator.hxx | 46 + .../SALOMEDSImplAdapt_SObject.cxx | 61 + .../SALOMEDSImplAdapt_SObject.hxx | 50 + .../SALOMEDSImplAdapt_Study.cxx | 159 ++ .../SALOMEDSImplAdapt_Study.hxx | 77 + .../SALOMEDSImplAdapt_StudyBuilder.cxx | 105 ++ .../SALOMEDSImplAdapt_StudyBuilder.hxx | 65 + .../SALOMEDSImplAdapt_UseCaseBuilder.cxx | 61 + .../SALOMEDSImplAdapt_UseCaseBuilder.hxx | 50 + .../SALOMEDSImplAdapt_UseCaseIterator.cxx | 45 + .../SALOMEDSImplAdapt_UseCaseIterator.hxx | 48 + .../SALOMEDSImplAdapt_definitions.hxx | 83 ++ src/ShaperApp/SalomeApp_EngineImpl.cxx | 448 ++++++ src/ShaperApp/SalomeApp_EngineImpl.h | 126 ++ src/ShaperApp/resources/LightShaperApp.xml | 286 ++++ .../resources/LightShaperApp_images.ts | 23 + .../resources/LightShaperApp_msg_en.ts | 1284 +++++++++++++++++ .../resources/LightShaperApp_msg_fr.ts | 1284 +++++++++++++++++ .../resources/LightShaperApp_msg_ja.ts | 1281 ++++++++++++++++ src/ShaperApp/resources/ShaperApp.xml | 49 + src/ShaperApp/resources/ShaperApp_images.ts | 4 + src/ShaperApp/resources/ShaperApp_msg_en.ts | 574 ++++++++ src/ShaperApp/resources/ShaperApp_msg_fr.ts | 574 ++++++++ src/ShaperApp/resources/ShaperApp_msg_ja.ts | 566 ++++++++ src/ShaperApp/resources/shaper.png | Bin 0 -> 1713 bytes src/TOOLSGUI/ToolsGUI.h | 3 + 67 files changed, 9438 insertions(+), 344 deletions(-) create mode 100644 src/Shaper/CMakeLists.txt create mode 100644 src/Shaper/Shaper.cxx create mode 100644 src/ShaperApp/CMakeLists.txt create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/CMakeLists.txt create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImpl.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdaptCopyAttribute.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdaptTypes.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_ChildIterator.cxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_ChildIterator.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponent.cxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponent.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponentIterator.cxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponentIterator.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SObject.cxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SObject.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_Study.cxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_Study.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_StudyBuilder.cxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_StudyBuilder.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseBuilder.cxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseBuilder.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseIterator.cxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseIterator.hxx create mode 100644 src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_definitions.hxx create mode 100644 src/ShaperApp/SalomeApp_EngineImpl.cxx create mode 100644 src/ShaperApp/SalomeApp_EngineImpl.h create mode 100644 src/ShaperApp/resources/LightShaperApp.xml create mode 100644 src/ShaperApp/resources/LightShaperApp_images.ts create mode 100644 src/ShaperApp/resources/LightShaperApp_msg_en.ts create mode 100644 src/ShaperApp/resources/LightShaperApp_msg_fr.ts create mode 100644 src/ShaperApp/resources/LightShaperApp_msg_ja.ts create mode 100644 src/ShaperApp/resources/ShaperApp.xml create mode 100644 src/ShaperApp/resources/ShaperApp_images.ts create mode 100644 src/ShaperApp/resources/ShaperApp_msg_en.ts create mode 100644 src/ShaperApp/resources/ShaperApp_msg_fr.ts create mode 100644 src/ShaperApp/resources/ShaperApp_msg_ja.ts create mode 100644 src/ShaperApp/resources/shaper.png diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b21cb8e7e..22677f1a4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -154,3 +154,7 @@ IF(NOT SALOME_LIGHT_ONLY) ADD_SUBDIRECTORY(GuiHelpers) ADD_SUBDIRECTORY(TreeData) ENDIF(NOT SALOME_LIGHT_ONLY) + +# package without CORBA (enabled with directive DISABE_ORB defined in ShaperApp/CMakeLists.txt) +ADD_SUBDIRECTORY(ShaperApp) +ADD_SUBDIRECTORY(Shaper) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index b0d8f7f8f..49152a173 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -2236,14 +2236,15 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const _prefs_ = new LightApp_Preferences( resourceMgr() ); that->createPreferences( _prefs_ ); qAddPostRoutine( LightAppCleanUpAppResources ); - } - that->myPrefs = _prefs_; - connect( myPrefs, SIGNAL( preferenceChanged( QString&, QString&, QString& ) ), - this, SLOT( onPreferenceChanged( QString&, QString&, QString& ) ), Qt::UniqueConnection ); - connect( myPrefs, SIGNAL( resetToDefaults() ), - this, SIGNAL( preferenceResetToDefaults() ), Qt::UniqueConnection ); + that->myPrefs = _prefs_; + + connect( myPrefs, SIGNAL( preferenceChanged( QString&, QString&, QString& ) ), + this, SLOT( onPreferenceChanged( QString&, QString&, QString& ) ), Qt::UniqueConnection ); + connect( myPrefs, SIGNAL( resetToDefaults() ), + this, SIGNAL( preferenceResetToDefaults() ), Qt::UniqueConnection ); + } if ( !crt ) return myPrefs; diff --git a/src/SUIT/SUIT_Session.cxx b/src/SUIT/SUIT_Session.cxx index ce7bf7832..19a5baa63 100644 --- a/src/SUIT/SUIT_Session.cxx +++ b/src/SUIT/SUIT_Session.cxx @@ -218,6 +218,11 @@ SUIT_ResourceMgr* SUIT_Session::resourceMgr() const return myResMgr; } +SUIT_ResourceMgr* & SUIT_Session::resourceMgr() +{ + return myResMgr; +} + /*! Removes the application from the list of launched applications. If it is a last application the session will be closed. @@ -363,3 +368,37 @@ void SUIT_Session::onApplicationActivated( SUIT_Application* app ) { myActiveApp = app; } + +/*! + * \return name of the main Application launched by the executable + * -> SalomeApp, ShaperApp + */ +std::string SUIT_Session::executableAppName() const +{ + return myExecutableAppName; +} + +/*! + * \return static name of the shaper executable application + */ +std::string SUIT_Session::shaperAppName() const +{ + return "ShaperApp"; +} + +/*! + * \return static name of the shaper executable application + */ +std::string SUIT_Session::salomeAppName() const +{ + return "SalomeApp"; +} + +/*! + * \brief sets thename of the main Application launched by the executable + * -> SalomeApp, ShaperApp + */ +void SUIT_Session::setExecutableAppName(const std::string & appName) +{ + myExecutableAppName = appName; +} diff --git a/src/SUIT/SUIT_Session.h b/src/SUIT/SUIT_Session.h index d04a8ef4e..721b1ea1c 100644 --- a/src/SUIT/SUIT_Session.h +++ b/src/SUIT/SUIT_Session.h @@ -74,6 +74,7 @@ public: SUIT_Application* activeApplication() const; SUIT_ResourceMgr* resourceMgr() const; + SUIT_ResourceMgr*& resourceMgr(); void closeSession( int mode = ASK, int flags = 0 ); int exitFlags() const; @@ -82,6 +83,11 @@ public: void insertApplication( SUIT_Application* ); + std::string executableAppName() const; + std::string shaperAppName() const; + std::string salomeAppName() const; + void setExecutableAppName(const std::string & appName); + signals: void applicationClosed( SUIT_Application* ); @@ -112,6 +118,7 @@ private: int myExitStatus; int myExitFlags; + std::string myExecutableAppName; }; #endif diff --git a/src/SalomeApp/CMakeLists.txt b/src/SalomeApp/CMakeLists.txt index 10ae94a81..6c6ba2db0 100644 --- a/src/SalomeApp/CMakeLists.txt +++ b/src/SalomeApp/CMakeLists.txt @@ -124,37 +124,41 @@ ENDIF() # --- headers --- # header files / to be processed by moc -SET(_moc_HEADERS - SalomeApp_Application.h - SalomeApp_CheckFileDlg.h - SalomeApp_DataModel.h - SalomeApp_DoubleSpinBox.h - SalomeApp_ExitDlg.h - SalomeApp_IntSpinBox.h - SalomeApp_ListView.h - SalomeApp_LoadStudiesDlg.h - SalomeApp_Module.h - SalomeApp_Study.h - SalomeApp_StudyPropertiesDlg.h +SET(SalomeCommon_moc_HEADERS + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_Application.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_CheckFileDlg.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_DataModel.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_DoubleSpinBox.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_ExitDlg.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_IntSpinBox.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_ListView.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_LoadStudiesDlg.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_Module.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_Study.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_StudyPropertiesDlg.h ) +SET(_moc_HEADERS ${SalomeCommon_moc_HEADERS}) + IF(SALOME_USE_PYCONSOLE) LIST(APPEND _moc_HEADERS SalomeApp_NoteBook.h) ENDIF() # header files / no moc processing -SET(_other_HEADERS - SalomeApp.h - SalomeApp_DataObject.h - SalomeApp_Engine_i.h - SalomeApp_ExceptionHandler.h - SalomeApp_Filter.h - SalomeApp_ImportOperation.h - SalomeApp_Tools.h - SalomeApp_TypeFilter.h - SalomeApp_VisualState.h +SET(SalomeCommon_other_HEADERS + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_DataObject.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_ExceptionHandler.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_Filter.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_ImportOperation.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_Tools.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_TypeFilter.h + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_VisualState.h ) +SET(_other_HEADERS ${SalomeCommon_other_HEADERS} + SalomeApp_Engine_i.h) + IF(SALOME_USE_PYCONSOLE) LIST(APPEND _other_HEADERS SalomeApp_PyInterp.h) ENDIF() @@ -183,28 +187,35 @@ SET(_other_RESOURCES QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS}) # sources / static -SET(_other_SOURCES - SalomeApp_Application.cxx - SalomeApp_CheckFileDlg.cxx - SalomeApp_DataModel.cxx - SalomeApp_DataObject.cxx - SalomeApp_DoubleSpinBox.cxx - SalomeApp_Engine_i.cxx - SalomeApp_ExceptionHandler.cxx - SalomeApp_ExitDlg.cxx - SalomeApp_Filter.cxx - SalomeApp_ImportOperation.cxx - SalomeApp_IntSpinBox.cxx - SalomeApp_ListView.cxx - SalomeApp_LoadStudiesDlg.cxx - SalomeApp_Module.cxx - SalomeApp_Study.cxx - SalomeApp_StudyPropertiesDlg.cxx - SalomeApp_Tools.cxx - SalomeApp_TypeFilter.cxx - SalomeApp_VisualState.cxx +SET(SalomeCommon_other_SOURCES + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_Application.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_CheckFileDlg.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_DataModel.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_DataObject.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_ExceptionHandler.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_ExitDlg.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_Filter.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_ImportOperation.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_IntSpinBox.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_ListView.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_Module.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_Study.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_Tools.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_TypeFilter.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_VisualState.cxx ) +SET(_other_SOURCES ${SalomeCommon_other_SOURCES} + SalomeApp_Engine_i.cxx) + +# export for Shaper application +SET(SalomeCommon_moc_HEADERS ${SalomeCommon_moc_HEADERS} PARENT_SCOPE) +SET(SalomeCommon_other_SOURCES ${SalomeCommon_other_SOURCES} PARENT_SCOPE) +SET(SalomeCommon_other_HEADERS ${SalomeCommon_other_HEADERS} PARENT_SCOPE) + IF(SALOME_USE_PYCONSOLE) LIST(APPEND _other_SOURCES SalomeApp_PyInterp.cxx SalomeApp_NoteBook.cxx) ENDIF() diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index bfb209efa..3f0e8f30c 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -80,9 +80,11 @@ //#include +#ifndef DISABLE_ORB #include #include #include +#endif #include #include @@ -96,7 +98,9 @@ #include #include +#ifndef DISABLE_ORB #include +#endif #include #include @@ -336,10 +340,12 @@ void SalomeApp_Application::createActions() tr( "MEN_DESK_CATALOG_GENERATOR" ), tr( "PRP_DESK_CATALOG_GENERATOR" ), Qt::ALT+Qt::SHIFT+Qt::Key_G, desk, false, this, SLOT( onCatalogGen() ) ); +#ifndef DISABLE_ORB //! Registry Display createAction( RegDisplayId, tr( "TOT_DESK_REGISTRY_DISPLAY" ), QIcon(), tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ), /*Qt::SHIFT+Qt::Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) ); +#endif createAction( ConnectId, tr( "TOT_DESK_CONNECT_STUDY" ), QIcon(), tr( "MEN_DESK_CONNECT" ), tr( "PRP_DESK_CONNECT" ), @@ -372,7 +378,9 @@ void SalomeApp_Application::createActions() int toolsMenu = createMenu( tr( "MEN_DESK_TOOLS" ), -1, MenuToolsId, 50 ); createMenu( CatalogGenId, toolsMenu, 10, -1 ); +#ifndef DISABLE_ORB createMenu( RegDisplayId, toolsMenu, 10, -1 ); +#endif createMenu( separator(), toolsMenu, -1, 15, -1 ); createExtraActions(); @@ -401,12 +409,17 @@ void SalomeApp_Application::onExit() //MessageLocker ml( myToIgnoreMessages ); bool killServers = false; +#ifdef DISABLE_ORB + killServers = true; +#endif bool result = true; if ( exitConfirmation() ) { SalomeApp_ExitDlg dlg( desktop() ); result = dlg.exec() == QDialog::Accepted; +#ifndef DISABLE_ORB killServers = dlg.isServersShutdown(); +#endif } if ( result ) { @@ -639,7 +652,11 @@ void SalomeApp_Application::onCopy() if( so ) { try { +#ifndef DISABLE_ORB stdDS->Copy(so); +#else + //TODO stdDS->Copy(*so); +#endif onSelectionChanged(); } catch(...) { @@ -677,7 +694,11 @@ void SalomeApp_Application::onPaste() if( so ) { try { +#ifndef DISABLE_ORB stdDS->Paste(so); +#else + //TODO stdDS->Paste(*so); +#endif updateObjectBrowser( true ); updateActions(); //SRN: BugID IPAL9377, case 3 } @@ -762,8 +783,13 @@ void SalomeApp_Application::onSelectionChanged() _PTR(SObject) so = getStudy()->FindObjectID(it.Value()->getEntry()); if ( so ) { +#ifndef DISABLE_ORB canCopy = canCopy || getStudy()->CanCopy(so); canPaste = canPaste || getStudy()->CanPaste(so); +#else + //TODO canCopy = canCopy || getStudy()->CanCopy(so); + //TODO canPaste = canPaste || getStudy()->CanPaste(so); +#endif } } @@ -782,7 +808,7 @@ void SalomeApp_Application::onDeleteInvalidReferences() return; _PTR(Study) aStudyDS = getStudy(); - _PTR(StudyBuilder) aStudyBuilder = aStudyDS->NewBuilder(); + auto aStudyBuilder = aStudyDS->NewBuilder(); _PTR(SObject) anObj; for( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) @@ -966,7 +992,9 @@ void SalomeApp_Application::onDumpStudy( ) bool res; { SUIT_OverrideCursor wc; +#ifndef SHAPER_STANDALONE ensureShaperIsActivated(); +#endif res = appStudy->dump( aFileName, toPublish, isMultiFile, toSaveGUI ); } if ( !res ) @@ -1000,7 +1028,7 @@ void SalomeApp_Application::onLoadScript( ) if ( !aFile.isEmpty() ) { - QString command = QString("exec(compile(open('%1', 'rb').read(), '%1', 'exec'))").arg(aFile); + QString command = QString("exec(open(\"%1\", \"rb\").read())").arg(aFile); #ifndef DISABLE_PYCONSOLE PyConsole_Console* pyConsole = pythonConsole(); @@ -1341,6 +1369,7 @@ void SalomeApp_Application::moduleActionSelected( const int id ) } } +#ifndef DISABLE_ORB /*!Gets CORBA::ORB_var*/ CORBA::ORB_var SalomeApp_Application::orb() { @@ -1354,19 +1383,25 @@ CORBA::ORB_var SalomeApp_Application::orb() return _orb; } +#endif /*!Create and return SALOMEDS_Study.*/ _PTR(Study) SalomeApp_Application::getStudy() { static _PTR(Study) _study; if(!_study) { +#ifndef DISABLE_ORB CORBA::Object_var aSObject = namingService()->Resolve("/Study"); SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(aSObject); _study = ClientFactory::Study(aStudy); +#else + _study = _PTR(Study)( new _CLASS(Study)); +#endif } return _study; } +#ifndef DISABLE_ORB /*!Create and return SALOME_NamingService.*/ SALOME_NamingService* SalomeApp_Application::namingService() { @@ -1380,6 +1415,7 @@ SALOME_LifeCycleCORBA* SalomeApp_Application::lcc() static SALOME_LifeCycleCORBA _lcc( namingService() ); return &_lcc; } +#endif /*!Private SLOT. On preferences.*/ void SalomeApp_Application::onProperties() @@ -1388,7 +1424,7 @@ void SalomeApp_Application::onProperties() if( !study ) return; - _PTR(StudyBuilder) SB = study->studyDS()->NewBuilder(); + auto SB = study->studyDS()->NewBuilder(); SB->NewCommand(); SalomeApp_StudyPropertiesDlg aDlg( desktop() ); @@ -1442,8 +1478,8 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePop if( it.Value()->hasEntry() ) { _PTR(SObject) aSObject = getStudy()->FindObjectID( it.Value()->getEntry() ), aRefObj = aSObject; - while( aRefObj && aRefObj->ReferencedObject( anObj ) ) - aRefObj = anObj; + while( aRefObj && aRefObj->ReferencedObject( anObj ) ) + aRefObj = anObj; if( aRefObj && aRefObj!=aSObject && QString( aRefObj->GetName().c_str() ).isEmpty() ) isInvalidRefs = true; @@ -1473,7 +1509,7 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePop _PTR( GenericAttribute ) anAttr; std::string auid = "AttributeUserID"; auid += Kernel_Utils::GetGUID(Kernel_Utils::ObjectdID); - if ( aSO->FindAttribute( anAttr, auid ) ) { + if ( aSO->FindAttribute( anAttr, auid ) ) { _PTR(AttributeUserID) aAttrID = anAttr; QString aId = aAttrID->Value().c_str(); if ( myExtActions.contains( aId ) ) { @@ -1507,9 +1543,15 @@ void SalomeApp_Application::updateObjectBrowser( const bool updateModels ) SalomeApp_Study* study = dynamic_cast(activeStudy()); if ( study ) { +#ifndef DISABLE_ORB for ( _PTR(SComponentIterator) it ( getStudy()->NewComponentIterator() ); it->More(); it->Next() ) { _PTR(SComponent) aComponent ( it->Value() ); +#else + for ( _PTR(SComponentIterator) it ( getStudy()->GetNewComponentIterator()); it->More(); it->Next() ) + { + _PTR(SComponent) aComponent ( it->GetValue() ); +#endif #ifndef WITH_SALOMEDS_OBSERVER // with GUI observers this check is not needed anymore @@ -1539,6 +1581,7 @@ void SalomeApp_Application::onCatalogGen() aDlg.exec(); } +#ifndef DISABLE_ORB /*!Display Registry Display dialog */ void SalomeApp_Application::onRegDisplay() { @@ -1548,6 +1591,7 @@ void SalomeApp_Application::onRegDisplay() regWnd->raise(); regWnd->activateWindow(); } +#endif /*!find original object by double click on item */ void SalomeApp_Application::onDblClick( SUIT_DataObject* theObj ) @@ -1966,6 +2010,7 @@ bool SalomeApp_Application::updateStudy() int savePoint; _PTR(AttributeParameter) ap; +#ifndef DISABLE_ORB _PTR(IParameters) ip = ClientFactory::getIParameters(ap); if(ip->isDumpPython()) ip->setDumpPython(); //Unset DumpPython flag. if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method @@ -1973,6 +2018,15 @@ bool SalomeApp_Application::updateStudy() savePoint = SalomeApp_VisualState( this ).storeState(); //SRN: create a temporary save point } bool ok = getStudy()->DumpStudy( aTmpDir.toStdString(), aScriptName.toStdString(), toPublish, isMultiFile ); +#else + _PTR(IParameters) ip; //TODO = ClientFactory::getIParameters(ap); + //TODO if(ip->isDumpPython()) ip->setDumpPython(); //Unset DumpPython flag. + if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method + //TODO ip->setDumpPython(); + savePoint = SalomeApp_VisualState( this ).storeState(); //SRN: create a temporary save point + } + bool ok = 0; //TODO getStudy()->DumpStudy( aTmpDir.toStdString(), aScriptName.toStdString(), toPublish, isMultiFile ); +#endif if ( toSaveGUI ) study->removeSavePoint(savePoint); //SRN: remove the created temporary save point. @@ -2115,6 +2169,7 @@ PyConsole_Interp* SalomeApp_Application::createPyInterp() #endif // DISABLE_PYCONSOLE +#ifndef SHAPER_STANDALONE void SalomeApp_Application::ensureShaperIsActivated() { SalomeApp_Study* study = dynamic_cast(activeStudy()); @@ -2127,8 +2182,9 @@ void SalomeApp_Application::ensureShaperIsActivated() study->dataModels( models ); for( int i = 0; i < models.count() && !shaperIsActive; i++ ) shaperIsActive = models[i]->module()->moduleName() == "Shaper"; - + if (shaper && !shaperIsActive) onDesktopMessage("register_module_in_study/Shaper"); } } +#endif diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 5f4da65f0..80d0b0ed9 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -34,6 +34,7 @@ #include "SalomeApp.h" #include +#ifndef DISABLE_ORB #include //#include @@ -41,6 +42,9 @@ #include #include "SALOMEDSClient.hxx" +#else +#include "SALOMEDSImplAdapt.hxx" +#endif #include @@ -50,7 +54,9 @@ class SalomeApp_Study; class SalomeApp_NoteBook; #endif class SUIT_Desktop; +#ifndef DISABLE_ORB class SALOME_LifeCycleCORBA; +#endif #ifdef WIN32 @@ -95,10 +101,14 @@ public: virtual bool checkExistingDoc(); +#ifndef DISABLE_ORB static CORBA::ORB_var orb(); +#endif static _PTR(Study) getStudy(); +#ifndef DISABLE_ORB static SALOME_NamingService* namingService(); static SALOME_LifeCycleCORBA* lcc(); +#endif SUIT_ViewManager* newViewManager(const QString&); void updateSavePointDataObjects( SalomeApp_Study* ); @@ -187,13 +197,17 @@ private slots: void onRestoreGUIState(); void onCatalogGen(); +#ifndef DISABLE_ORB void onRegDisplay(); +#endif void onOpenWith(); void onExtAction(); private: void createExtraActions(); +#ifndef SHAPER_STANDALONE void ensureShaperIsActivated(); +#endif private: #ifndef DISABLE_PYCONSOLE diff --git a/src/SalomeApp/SalomeApp_DataModel.cxx b/src/SalomeApp/SalomeApp_DataModel.cxx index e9b0f05e5..3c5644cb1 100644 --- a/src/SalomeApp/SalomeApp_DataModel.cxx +++ b/src/SalomeApp/SalomeApp_DataModel.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -35,8 +35,10 @@ #include #include +#ifndef DISABLE_ORB #include #include CORBA_SERVER_HEADER(SALOME_Exception) +#endif typedef _PTR(SObject) kerPtr; typedef SUIT_DataObject* suitPtr; @@ -90,12 +92,12 @@ bool SalomeApp_DataModelSync::isCorrect( const kerPtr& so ) const QString name = so->GetName().c_str(); _PTR( GenericAttribute ) anAttr; bool isDraw = true; - if ( so->FindAttribute(anAttr, "AttributeDrawable") ) + if ( so->FindAttribute(anAttr, "AttributeDrawable") ) { _PTR(AttributeDrawable) aAttrDraw = anAttr; - isDraw = aAttrDraw->IsDrawable(); + isDraw = aAttrDraw->IsDrawable(); } - bool res = so && ( so->GetName().size() || so->ReferencedObject( refObj ) ) && isDraw; + bool res = so && ( so->GetName().size() || so->ReferencedObject( refObj ) ) && isDraw; return res; } @@ -194,16 +196,24 @@ QList SalomeApp_DataModelSync::children( const kerPtr& obj ) const if ( expandable ) { // tmp?? - _PTR(UseCaseBuilder) aUseCaseBuilder = myStudy->GetUseCaseBuilder(); + auto aUseCaseBuilder = myStudy->GetUseCaseBuilder(); if (aUseCaseBuilder->HasChildren(obj)) { _PTR(UseCaseIterator) it ( aUseCaseBuilder->GetUseCaseIterator( obj ) ); for ( ; it->More(); it->Next() ) +#ifndef DISABLE_ORB ch.append( it->Value() ); +#else + ch.append( _PTR(SObject)(it->GetValue()) ); +#endif } else { _PTR(ChildIterator) it ( myStudy->NewChildIterator( obj ) ); for ( ; it->More(); it->Next() ) +#ifndef DISABLE_ORB ch.append( it->Value() ); +#else + ch.append( _PTR(SObject)(it->GetValue()) ); +#endif } } @@ -286,7 +296,7 @@ bool SalomeApp_DataModel::open( const QString& name, CAM_Study* study, QStringLi if ( anId.isEmpty() ) return true; // Probably nothing to load - _PTR(SComponent) aSComp ( SalomeApp_Application::getStudy()->FindComponentID( std::string( anId.toUtf8() ) ) ); + _PTR(SComponent) aSComp ( SalomeApp_Application::getStudy()->FindComponentID( anId.toUtf8().data() ) ); if ( aSComp ) updateTree( aSComp, aDoc ); @@ -320,7 +330,7 @@ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study ) studyRoot = dynamic_cast( aSStudy->root() ); QString anId = getRootEntry( aSStudy ); if ( !anId.isEmpty() ){ // if nothing is published in the study for this module -> do nothing - sobj = SalomeApp_Application::getStudy()->FindComponentID( std::string( anId.toUtf8() ) ); + sobj = SalomeApp_Application::getStudy()->FindComponentID( anId.toUtf8().data() ); } } } @@ -330,7 +340,7 @@ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study ) aSStudy = dynamic_cast( studyRoot->study() ); // value should not change here theoretically, but just to make sure if ( aSStudy ) { // modelRoot->object() cannot be reused here: it is about to be deleted by buildTree() soon - sobj = SalomeApp_Application::getStudy()->FindComponentID( std::string( modelRoot->entry().toUtf8() ) ); + sobj = SalomeApp_Application::getStudy()->FindComponentID(modelRoot->entry().toUtf8().data() ); } } } @@ -423,7 +433,7 @@ QString SalomeApp_DataModel::getRootEntry( SalomeApp_Study* study ) const anEntry = anObj->entry(); } else if ( study && study->studyDS() ) { // this works even if is null - _PTR(SComponent) aSComp( study->studyDS()->FindComponent( module()->name().toStdString() ) ); + _PTR(SComponent) aSComp( study->studyDS()->FindComponent( module()->name().toUtf8().data() ) ); if ( aSComp ) anEntry = aSComp->GetID().c_str(); } diff --git a/src/SalomeApp/SalomeApp_DataModel.h b/src/SalomeApp/SalomeApp_DataModel.h index 945b39223..a13cf00b5 100644 --- a/src/SalomeApp/SalomeApp_DataModel.h +++ b/src/SalomeApp/SalomeApp_DataModel.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -34,7 +34,11 @@ #include "SalomeApp.h" #include "LightApp_DataModel.h" +#ifndef DISABLE_ORB #include "SALOMEDSClient.hxx" +#else +#include "SALOMEDSImplAdapt.hxx" +#endif class SalomeApp_Module; class SalomeApp_Study; diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index b606e3a21..64079d121 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -32,7 +32,9 @@ #include #include +#ifndef DISABLE_ORB #include +#endif #include #include @@ -225,7 +227,11 @@ QColor SalomeApp_DataObject::color( const ColorRole role, const int id ) const _PTR(GenericAttribute) anAttr; if ( myObject->FindAttribute( anAttr, "AttributeTextColor" ) ) { _PTR(AttributeTextColor) aColAttr = anAttr; +#ifndef DISABLE_ORB c = QColor( (int)aColAttr->TextColor().R, (int)aColAttr->TextColor().G, (int)aColAttr->TextColor().B ); +#else + c = QColor( (int)aColAttr->TextColor()[0], (int)aColAttr->TextColor()[1], (int)aColAttr->TextColor()[2] ); +#endif } } break; @@ -241,9 +247,15 @@ QColor SalomeApp_DataObject::color( const ColorRole role, const int id ) const _PTR(GenericAttribute) anAttr; if( myObject->FindAttribute ( anAttr, "AttributeTextHighlightColor") ) { _PTR(AttributeTextHighlightColor) aHighColAttr = anAttr; - c = QColor( (int)(aHighColAttr->TextHighlightColor().R), - (int)(aHighColAttr->TextHighlightColor().G), +#ifndef DISABLE_ORB + c = QColor( (int)(aHighColAttr->TextHighlightColor().R), + (int)(aHighColAttr->TextHighlightColor().G), (int)(aHighColAttr->TextHighlightColor().B)); +#else + c = QColor( (int)(aHighColAttr->TextHighlightColor()[0]), + (int)(aHighColAttr->TextHighlightColor()[1]), + (int)(aHighColAttr->TextHighlightColor()[2])); +#endif } } break; @@ -258,6 +270,7 @@ QColor SalomeApp_DataObject::color( const ColorRole role, const int id ) const return c; } +#ifndef DISABLE_ORB /*! \brief Get data object tooltip for the specified column. \param id column id (not used) @@ -301,6 +314,7 @@ QString SalomeApp_DataObject::toolTip( const int /*id*/ ) const return QString( "Object \'%1\', module \'%2\', ID=%3" ).arg( name() ).arg( componentDataType() ).arg( entry() ); } +#endif // DISABLE_ORB /*! \brief Get font to be used for data object rendering in the item views @@ -401,7 +415,7 @@ bool SalomeApp_DataObject::hasChildren() const bool ok = false; // tmp?? - _PTR(UseCaseBuilder) aUseCaseBuilder = SalomeApp_Application::getStudy()->GetUseCaseBuilder(); + auto aUseCaseBuilder = SalomeApp_Application::getStudy()->GetUseCaseBuilder(); if (aUseCaseBuilder->IsUseCaseNode(myObject)) { ok = aUseCaseBuilder->HasChildren(myObject); // TODO: check name as below? @@ -409,7 +423,11 @@ bool SalomeApp_DataObject::hasChildren() const else { _PTR(ChildIterator) it ( SalomeApp_Application::getStudy()->NewChildIterator( myObject ) ); for ( ; it->More() && !ok; it->Next() ) { +#ifndef DISABLE_ORB _PTR(SObject) obj = it->Value(); +#else + _PTR(SObject) obj(it->GetValue()); +#endif if ( obj ) { _PTR(SObject) refObj; //if ( obj->ReferencedObject( refObj ) ) continue; // omit references @@ -526,7 +544,7 @@ QString SalomeApp_DataObject::entry( const _PTR(SObject)& obj ) const /*! \brief Get data object value. \param obj data object - \return data object value or empty string if there is no + \return data object value or empty string if there is no value associated to the object */ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const @@ -543,7 +561,7 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const std::string str = strAttr->Value(); QString aStrings = fromUtf8( str ); - //Special case to show NoteBook variables in the "Value" column of the OB + //Special case to show NoteBook variables in the "Value" column of the OB bool ok = false; QStringList aSectionList = aStrings.split( "|" ); if ( !aSectionList.isEmpty() ) @@ -654,10 +672,10 @@ SalomeApp_ModuleObject::SalomeApp_ModuleObject( SUIT_DataObject* parent ) */ SalomeApp_ModuleObject::SalomeApp_ModuleObject( const _PTR(SObject)& sobj, SUIT_DataObject* parent ) -: CAM_DataObject( parent ), - LightApp_DataObject( parent ), - SalomeApp_DataObject( sobj, parent ), - CAM_ModuleObject( parent ) + : CAM_DataObject( parent ), + LightApp_DataObject( parent ), + SalomeApp_DataObject( sobj, parent ), + CAM_ModuleObject( parent ) { } @@ -668,12 +686,12 @@ SalomeApp_ModuleObject::SalomeApp_ModuleObject( const _PTR(SObject)& sobj, \param parent parent data object */ SalomeApp_ModuleObject::SalomeApp_ModuleObject( CAM_DataModel* dm, - const _PTR(SObject)& sobj, + const _PTR(SObject)& sobj, SUIT_DataObject* parent ) -: CAM_DataObject( parent ), - LightApp_DataObject( parent ), - SalomeApp_DataObject( sobj, parent ), - CAM_ModuleObject( dm, parent ) + : CAM_DataObject( parent ), + LightApp_DataObject( parent ), + SalomeApp_DataObject( sobj, parent ), + CAM_ModuleObject( dm, parent ) { } diff --git a/src/SalomeApp/SalomeApp_DataObject.h b/src/SalomeApp/SalomeApp_DataObject.h index 9925ec384..513d68add 100644 --- a/src/SalomeApp/SalomeApp_DataObject.h +++ b/src/SalomeApp/SalomeApp_DataObject.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -28,7 +28,11 @@ #include "SalomeApp.h" #include +#ifndef DISABLE_ORB #include +#else +#include "SALOMEDSImplAdapt.hxx" +#endif class SalomeApp_Study; @@ -54,7 +58,9 @@ public: virtual QString text( const int = NameId ) const; virtual QPixmap icon( const int = NameId ) const; virtual QColor color( const ColorRole, const int = NameId ) const; +#ifndef DISABLE_ORB virtual QString toolTip( const int = NameId ) const; +#endif virtual QFont font( const int = NameId ) const; virtual _PTR(SObject) object() const; @@ -86,7 +92,7 @@ private: }; class SALOMEAPP_EXPORT SalomeApp_ModuleObject : public SalomeApp_DataObject, - public CAM_ModuleObject + public CAM_ModuleObject { public: SalomeApp_ModuleObject( SUIT_DataObject* = 0 ); @@ -100,7 +106,7 @@ public: }; class SALOMEAPP_EXPORT SalomeApp_RootObject : public SalomeApp_DataObject, - public LightApp_RootObject + public LightApp_RootObject { public: SalomeApp_RootObject( LightApp_Study* ); diff --git a/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx b/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx index cf0151028..3e23d9d4e 100644 --- a/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx +++ b/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx @@ -31,8 +31,10 @@ #include +#ifndef DISABLE_ORB #include "SALOMEDSClient_ClientFactory.hxx" #include CORBA_SERVER_HEADER(SALOMEDS) +#endif #include #include diff --git a/src/SalomeApp/SalomeApp_ExceptionHandler.cxx b/src/SalomeApp/SalomeApp_ExceptionHandler.cxx index e9fa0f9af..b88350823 100644 --- a/src/SalomeApp/SalomeApp_ExceptionHandler.cxx +++ b/src/SalomeApp/SalomeApp_ExceptionHandler.cxx @@ -21,7 +21,9 @@ // #include "SalomeApp_ExceptionHandler.h" +#ifndef DISABLE_ORB #include "Utils_CorbaException.hxx" +#endif #include @@ -83,10 +85,12 @@ bool SalomeApp_ExceptionHandler::handle( QObject* o, QEvent* e ) { showMessage( title, QString( e.GetMessageString() ) ); } +#ifndef DISABLE_ORB catch( SALOME::SALOME_Exception& ex) { showMessage( title, QString( ex.details.text)); } +#endif #ifndef WIN32 catch(...) { diff --git a/src/SalomeApp/SalomeApp_ExitDlg.cxx b/src/SalomeApp/SalomeApp_ExitDlg.cxx index 470784db1..3fa1777ae 100644 --- a/src/SalomeApp/SalomeApp_ExitDlg.cxx +++ b/src/SalomeApp/SalomeApp_ExitDlg.cxx @@ -56,13 +56,17 @@ SalomeApp_ExitDlg::SalomeApp_ExitDlg( QWidget* parent ) m_lDescr->setText( tr( "QUE_DESK_EXIT" ) ); m_lDescr->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); +#ifndef DISABLE_ORB myServersShutdown = new QCheckBox( tr( "SHUTDOWN_SERVERS" ), this ); myServersShutdown->setChecked( true ); - +#endif + QVBoxLayout* m_vl1 = new QVBoxLayout(); m_vl1->setMargin( 10 ); m_vl1->setSpacing( 16 ); m_vl1->addWidget( m_lDescr ); +#ifndef DISABLE_ORB m_vl1->addWidget( myServersShutdown ); +#endif QHBoxLayout* m_hl1 = new QHBoxLayout(); m_hl1->setMargin( 0 ); m_hl1->setSpacing( 6 ); @@ -99,8 +103,10 @@ SalomeApp_ExitDlg::~SalomeApp_ExitDlg() /*! * \brief get the check box status */ +#ifndef DISABLE_ORB bool SalomeApp_ExitDlg::isServersShutdown() { return myServersShutdown->isChecked(); } - + #endif + diff --git a/src/SalomeApp/SalomeApp_ExitDlg.h b/src/SalomeApp/SalomeApp_ExitDlg.h index 64489595e..a90caba1c 100644 --- a/src/SalomeApp/SalomeApp_ExitDlg.h +++ b/src/SalomeApp/SalomeApp_ExitDlg.h @@ -38,10 +38,12 @@ public: SalomeApp_ExitDlg( QWidget* ) ; ~SalomeApp_ExitDlg(); +#ifndef DISABLE_ORB bool isServersShutdown(); private: QCheckBox* myServersShutdown; +#endif }; #endif // SALOMEAPP_EXITDLG_H diff --git a/src/SalomeApp/SalomeApp_IntSpinBox.cxx b/src/SalomeApp/SalomeApp_IntSpinBox.cxx index 7e242b516..8201aef11 100644 --- a/src/SalomeApp/SalomeApp_IntSpinBox.cxx +++ b/src/SalomeApp/SalomeApp_IntSpinBox.cxx @@ -31,8 +31,10 @@ #include +#ifndef DISABLE_ORB #include "SALOMEDSClient_ClientFactory.hxx" #include CORBA_SERVER_HEADER(SALOMEDS) +#endif #include #include diff --git a/src/SalomeApp/SalomeApp_Module.cxx b/src/SalomeApp/SalomeApp_Module.cxx index e6fe76ca7..8d7939d19 100644 --- a/src/SalomeApp/SalomeApp_Module.cxx +++ b/src/SalomeApp/SalomeApp_Module.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -39,7 +39,7 @@ #include #include - + #include #include @@ -101,23 +101,33 @@ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_Li if( obj->hasEntry() ) { _PTR(SObject) SO = study->studyDS()->FindObjectID( obj->getEntry() ); +#ifndef DISABLE_ORB if( SO && QString( SO->GetID().c_str() ) == SO->GetFatherComponent()->GetID().c_str() ) { //component is selected _PTR(SComponent) SC( SO->GetFatherComponent() ); +#else + if( SO && QString( SO->GetID().c_str() ) == SO->GetFatherComponent().GetID().c_str() ) + { //component is selected + _PTR(SComponent) SC( _CLASS(SComponent)(SO->GetFatherComponent()) ); +#endif _PTR(ChildIterator) anIter ( study->studyDS()->NewChildIterator( SC ) ); anIter->InitEx( true ); while( anIter->More() ) { +#ifndef DISABLE_ORB _PTR(SObject) valSO ( anIter->Value() ); +#else + _PTR(SObject) valSO ( anIter->GetValue() ); +#endif _PTR(SObject) refSO; if( !valSO->ReferencedObject( refSO ) ) { QString id = valSO->GetID().c_str(), - comp = SC->ComponentDataType().c_str(), - val = valSO->GetName().c_str(); + comp = SC->ComponentDataType().c_str(), + val = valSO->GetName().c_str(); Handle( SALOME_InteractiveObject ) new_obj = - new SALOME_InteractiveObject( id.toUtf8(), comp.toLatin1(), val.toLatin1() ); + new SALOME_InteractiveObject( id.toUtf8(), comp.toLatin1(), val.toLatin1() ); dest.Append( new_obj ); } anIter->Next(); diff --git a/src/SalomeApp/SalomeApp_NoteBook.cxx b/src/SalomeApp/SalomeApp_NoteBook.cxx index a3d7c0bea..9e524f8fb 100644 --- a/src/SalomeApp/SalomeApp_NoteBook.cxx +++ b/src/SalomeApp/SalomeApp_NoteBook.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -280,6 +280,7 @@ bool NoteBook_TableRow::IsValidStringValue(const QString /*theValue*/) if( aNumRows == 0 ) return true; +#ifndef DISABLE_PYCONSOLE bool aLastRowIsEmpty = myParentTable->myRows[ aNumRows - 1 ]->GetName().isEmpty() && myParentTable->myRows[ aNumRows - 1 ]->GetValue().isEmpty(); @@ -303,6 +304,9 @@ bool NoteBook_TableRow::IsValidStringValue(const QString /*theValue*/) bool aResult = pyInterp->run(command.c_str()); pyConsole->setIsSuppressOutput(oldSuppressValue); return !aResult; +#else + return true; +#endif } /////////////////////////////////////////////////////////////////////////// @@ -455,6 +459,7 @@ bool NoteBook_Table::IsValid() const if( !myRows[i]->CheckName() || !IsUniqueName( myRows[i] ) || !myRows[i]->CheckValue() ) return false; +#ifndef DISABLE_PYCONSOLE SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ); PyConsole_Console* pyConsole = app->pythonConsole(); PyConsole_Interp* pyInterp = app->getPyInterp(); @@ -477,6 +482,9 @@ bool NoteBook_Table::IsValid() const pyConsole->setIsSuppressOutput(oldSuppressValue); return !aResult; +#else + return true; +#endif } //============================================================================ @@ -876,6 +884,7 @@ void SalomeApp_NoteBook::onApply() } } +#ifndef DISABLE_ORB if( NoteBook_TableRow::IsIntegerValue(aValue,&anIVal) ) aStudy->SetInteger(std::string(aName.toUtf8().constData()),anIVal); @@ -887,6 +896,10 @@ void SalomeApp_NoteBook::onApply() else aStudy->SetString(std::string(aName.toUtf8().constData()),aValue.toStdString()); +#else + return; + //TODO +#endif } } myTable->ResetMaps(); @@ -923,5 +936,7 @@ void SalomeApp_NoteBook::onUpdateStudy() SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ); if(!app) return; +#ifndef DISABLE_PYCONSOLE app->onUpdateStudy(); +#endif } diff --git a/src/SalomeApp/SalomeApp_NoteBook.h b/src/SalomeApp/SalomeApp_NoteBook.h index 6658ae025..3629bef75 100644 --- a/src/SalomeApp/SalomeApp_NoteBook.h +++ b/src/SalomeApp/SalomeApp_NoteBook.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -26,8 +26,10 @@ #include "SalomeApp.h" -#include "SALOMEDSClient_ClientFactory.hxx" +#ifndef DISABLE_ORB +#include "SALOMEDSClient_ClientFactory.hxx" #include CORBA_SERVER_HEADER(SALOMEDS) +#endif #include #include diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index c68065232..eb8a8e113 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -21,7 +21,7 @@ // #ifndef DISABLE_PYCONSOLE - #include "SalomeApp_PyInterp.h" // WARNING! This include must be the first! +#include "SalomeApp_PyInterp.h" // WARNING! This include must be the first! #endif #include "SalomeApp_Study.h" @@ -30,7 +30,12 @@ #include "SalomeApp_DataObject.h" #include "SalomeApp_DataModel.h" #include "SalomeApp_Application.h" +#ifndef DISABLE_ORB #include "SalomeApp_Engine_i.h" +#else +#include "SalomeApp_EngineImpl.h" +#include +#endif #include "SalomeApp_VisualState.h" // temporary commented @@ -55,6 +60,7 @@ #include "SALOMEDS_Tool.hxx" +#ifndef DISABLE_ORB #include "SALOMEDSClient_ClientFactory.hxx" #include @@ -120,230 +126,230 @@ public: switch(event) { case 1: - { //Add sobject - _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID(theID); - _PTR(SComponent) aSComp = aSObj->GetFatherComponent(); + { //Add sobject + _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID(theID); + _PTR(SComponent) aSComp = aSObj->GetFatherComponent(); - if (!aSComp || aSComp->IsNull()) { - MESSAGE("Entry " << theID << " has not father component. Problem ??"); + if (!aSComp || aSComp->IsNull()) { + MESSAGE("Entry " << theID << " has not father component. Problem ??"); + return; + } + + // Mantis issue 0020136: Drag&Drop in OB + _PTR(UseCaseBuilder) aUseCaseBuilder = SalomeApp_Application::getStudy()->GetUseCaseBuilder(); + if (aUseCaseBuilder->IsUseCaseNode(aSComp)) { // BEGIN: work with tree nodes structure + if (!aUseCaseBuilder->IsUseCaseNode(aSObj)) { + // tree node is not yet set, it is a normal situation return; } - // Mantis issue 0020136: Drag&Drop in OB - _PTR(UseCaseBuilder) aUseCaseBuilder = SalomeApp_Application::getStudy()->GetUseCaseBuilder(); - if (aUseCaseBuilder->IsUseCaseNode(aSComp)) { // BEGIN: work with tree nodes structure - if (!aUseCaseBuilder->IsUseCaseNode(aSObj)) { - // tree node is not yet set, it is a normal situation - return; - } + _PTR(SObject) aFatherSO = aUseCaseBuilder->GetFather(aSObj); + if (!aFatherSO || aFatherSO->IsNull()) { + MESSAGE("Father SObject is not found. Problem ??"); + return; + } - _PTR(SObject) aFatherSO = aUseCaseBuilder->GetFather(aSObj); - if (!aFatherSO || aFatherSO->IsNull()) { - MESSAGE("Father SObject is not found. Problem ??"); - return; - } + std::string parent_id = aFatherSO->GetID(); + EntryMapIter it = entry2SuitObject.find(parent_id.c_str()); + + if (it == entry2SuitObject.end()) { + MESSAGE("Father data object is not found. Problem ??"); + return; + } - std::string parent_id = aFatherSO->GetID(); - EntryMapIter it = entry2SuitObject.find(parent_id.c_str()); + SalomeApp_DataObject* aFatherDO = it->second; - if (it == entry2SuitObject.end()) { - MESSAGE("Father data object is not found. Problem ??"); - return; - } + it = entry2SuitObject.find(theID); + if (it != entry2SuitObject.end()) { // this SOobject is already added somewhere + suit_obj = it->second; + SUIT_DataObject* oldFather = suit_obj->parent(); + if (oldFather) { + oldFather->removeChild(suit_obj, false); + SalomeApp_Application* app = dynamic_cast( myStudy->application() ); + // MESSAGE("myStudy: " << myStudy->id() << " app " << app); + // MESSAGE("objectBrowser: "<< app->objectBrowser()); + if (!app->objectBrowser()) { + MESSAGE("Object Browser not found. Problem ??"); + return; + } + SUIT_AbstractModel* model = dynamic_cast(app->objectBrowser()->model()); + model->forgetObject( suit_obj ); - SalomeApp_DataObject* aFatherDO = it->second; - - it = entry2SuitObject.find(theID); - if (it != entry2SuitObject.end()) { // this SOobject is already added somewhere - suit_obj = it->second; - SUIT_DataObject* oldFather = suit_obj->parent(); - if (oldFather) { - oldFather->removeChild(suit_obj, false); - SalomeApp_Application* app = dynamic_cast( myStudy->application() ); -// MESSAGE("myStudy: " << myStudy->id() << " app " << app); -// MESSAGE("objectBrowser: "<< app->objectBrowser()); - if (!app->objectBrowser()) { - MESSAGE("Object Browser not found. Problem ??"); - return; - } - SUIT_AbstractModel* model = dynamic_cast(app->objectBrowser()->model()); - model->forgetObject( suit_obj ); - - if (SalomeApp_DataObject* oldFatherSA = dynamic_cast(oldFather)) { - oldFatherSA->updateItem(); - } + if (SalomeApp_DataObject* oldFatherSA = dynamic_cast(oldFather)) { + oldFatherSA->updateItem(); } } - else { - suit_obj = new SalomeApp_DataObject(aSObj); - entry2SuitObject[theID] = suit_obj; - } + } + else { + suit_obj = new SalomeApp_DataObject(aSObj); + entry2SuitObject[theID] = suit_obj; + } - suit_obj->updateItem(); - // define position in the data tree (in aFatherDO) to insert the aSObj - int pos = aUseCaseBuilder->GetIndexInFather(aFatherSO, aSObj); - - aFatherDO->insertChildAtPos(suit_obj, pos); - //aFatherDO->insertChild(suit_obj, pos); - aFatherDO->updateItem(); - - /* Define visibility state */ - bool isComponent = dynamic_cast( suit_obj ) != 0; - if ( suit_obj && !isComponent && myStudy->visibilityState( theID.c_str() ) == Qtx::UnpresentableState ) { - QString moduleTitle = ((CAM_Application*)myStudy->application())->moduleTitle(suit_obj->componentDataType()); - if (!moduleTitle.isEmpty()) { - LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(moduleTitle,false); - if (aDisplayer) { - if(aDisplayer->canBeDisplayed(theID.c_str())) { - myStudy->setVisibilityState( theID.c_str(), Qtx::HiddenState ); //hide the just added object - //MESSAGE("Object with entry : "<< theID <<" CAN be displayed !!!"); - } - //else - //MESSAGE("Object with entry : "<< theID <<" CAN'T be displayed !!!"); + suit_obj->updateItem(); + // define position in the data tree (in aFatherDO) to insert the aSObj + int pos = aUseCaseBuilder->GetIndexInFather(aFatherSO, aSObj); + + aFatherDO->insertChildAtPos(suit_obj, pos); + //aFatherDO->insertChild(suit_obj, pos); + aFatherDO->updateItem(); + + /* Define visibility state */ + bool isComponent = dynamic_cast( suit_obj ) != 0; + if ( suit_obj && !isComponent && myStudy->visibilityState( theID.c_str() ) == Qtx::UnpresentableState ) { + QString moduleTitle = ((CAM_Application*)myStudy->application())->moduleTitle(suit_obj->componentDataType()); + if (!moduleTitle.isEmpty()) { + LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(moduleTitle,false); + if (aDisplayer) { + if(aDisplayer->canBeDisplayed(theID.c_str())) { + myStudy->setVisibilityState( theID.c_str(), Qtx::HiddenState ); //hide the just added object + //MESSAGE("Object with entry : "<< theID <<" CAN be displayed !!!"); } + //else + //MESSAGE("Object with entry : "<< theID <<" CAN'T be displayed !!!"); } } - } // END: work with tree nodes structure - else { // BEGIN: work with study structure - EntryMapIter it = entry2SuitObject.find( theID ); - if ( it != entry2SuitObject.end() ) { - MESSAGE("Entry " << theID << " is already added. Problem ??"); - return; - } + } + } // END: work with tree nodes structure + else { // BEGIN: work with study structure + EntryMapIter it = entry2SuitObject.find( theID ); + if ( it != entry2SuitObject.end() ) { + MESSAGE("Entry " << theID << " is already added. Problem ??"); + return; + } + + int last2Pnt_pos = (int)theID.rfind( ":" ); //!< TODO: conversion from size_t to int + std::string parent_id = theID.substr( 0, last2Pnt_pos ); + int tag = atoi( theID.substr( last2Pnt_pos+1 ).c_str() ); - int last2Pnt_pos = (int)theID.rfind( ":" ); //!< TODO: conversion from size_t to int - std::string parent_id = theID.substr( 0, last2Pnt_pos ); - int tag = atoi( theID.substr( last2Pnt_pos+1 ).c_str() ); + if ( parent_id.length() == 3 ) // "0:1" - root item? + { + // It's probably a SComponent + if ( theID == aSComp->GetID() ) + suit_obj = new SalomeApp_ModuleObject( aSComp ); + else + suit_obj = new SalomeApp_DataObject( aSObj ); + } + else + { + suit_obj = new SalomeApp_DataObject( aSObj ); + } + it = entry2SuitObject.find( parent_id ); + if ( it != entry2SuitObject.end() ) { + SalomeApp_DataObject* father = it->second; + father->insertChildAtTag( suit_obj, tag ); + } + else { if ( parent_id.length() == 3 ) // "0:1" - root item? { - // It's probably a SComponent - if ( theID == aSComp->GetID() ) - suit_obj = new SalomeApp_ModuleObject( aSComp ); - else - suit_obj = new SalomeApp_DataObject( aSObj ); + // This should be for a module + SUIT_DataObject* father=myStudy->root(); + father->appendChild(suit_obj); } else { - suit_obj = new SalomeApp_DataObject( aSObj ); - } - - it = entry2SuitObject.find( parent_id ); - if ( it != entry2SuitObject.end() ) { - SalomeApp_DataObject* father = it->second; - father->insertChildAtTag( suit_obj, tag ); - } - else { - if ( parent_id.length() == 3 ) // "0:1" - root item? - { - // This should be for a module - SUIT_DataObject* father=myStudy->root(); - father->appendChild(suit_obj); - } - else - { - MESSAGE("SHOULD NEVER GET HERE!!!"); - - //Try to find the SalomeApp_DataObject object parent - std::string root_id = parent_id.substr( 0, 4 ); - std::string obj_id = parent_id.substr( 4 ); - - std::string anID; - std::string::size_type debut = 0; - std::string::size_type fin; - SalomeApp_DataObject* anObj = dynamic_cast( myStudy->root() ); - while ( anObj ) { - fin = obj_id.find_first_of( ':', debut ); - if ( fin == std::string::npos ) { - //last id - anObj = dynamic_cast(anObj->childObject(atoi(obj_id.substr(debut).c_str())-1)); - if ( anObj ) - entry2SuitObject[parent_id] = anObj; - break; - } - anID = root_id + obj_id.substr( 0, fin ); - EntryMapIter it2 = entry2SuitObject.find( anID ); - if ( it2 == entry2SuitObject.end() ) { - //the ID is not known in entry2SuitObject - anObj = dynamic_cast(anObj->childObject(atoi(obj_id.substr(debut, fin-debut).c_str())-1)); - if ( anObj ) - entry2SuitObject[anID] = anObj; - } - else - anObj = it2->second; - debut = fin+1; + MESSAGE("SHOULD NEVER GET HERE!!!"); + + //Try to find the SalomeApp_DataObject object parent + std::string root_id = parent_id.substr( 0, 4 ); + std::string obj_id = parent_id.substr( 4 ); + + std::string anID; + std::string::size_type debut = 0; + std::string::size_type fin; + SalomeApp_DataObject* anObj = dynamic_cast( myStudy->root() ); + while ( anObj ) { + fin = obj_id.find_first_of( ':', debut ); + if ( fin == std::string::npos ) { + //last id + anObj = dynamic_cast(anObj->childObject(atoi(obj_id.substr(debut).c_str())-1)); + if ( anObj ) + entry2SuitObject[parent_id] = anObj; + break; } - if ( anObj ) - anObj->insertChildAtTag( suit_obj, tag ); + anID = root_id + obj_id.substr( 0, fin ); + EntryMapIter it2 = entry2SuitObject.find( anID ); + if ( it2 == entry2SuitObject.end() ) { + //the ID is not known in entry2SuitObject + anObj = dynamic_cast(anObj->childObject(atoi(obj_id.substr(debut, fin-debut).c_str())-1)); + if ( anObj ) + entry2SuitObject[anID] = anObj; + } + else + anObj = it2->second; + debut = fin+1; } + if ( anObj ) + anObj->insertChildAtTag( suit_obj, tag ); } - entry2SuitObject[theID] = suit_obj; - } // END: work with study structure - break; - } - case 2: - { // Remove sobject - EntryMapIter it = entry2SuitObject.find( theID ); - if ( it != entry2SuitObject.end() ) - { - suit_obj = it->second; - suit_obj->updateItem(); - SUIT_DataObject* father=suit_obj->parent(); - if(father) - father->removeChild(suit_obj); - entry2SuitObject.erase(it); - } - else - { - MESSAGE("Want to remove an unknown object" << theID); } - break; + entry2SuitObject[theID] = suit_obj; + } // END: work with study structure + break; + } + case 2: + { // Remove sobject + EntryMapIter it = entry2SuitObject.find( theID ); + if ( it != entry2SuitObject.end() ) + { + suit_obj = it->second; + suit_obj->updateItem(); + SUIT_DataObject* father=suit_obj->parent(); + if(father) + father->removeChild(suit_obj); + entry2SuitObject.erase(it); + } + else + { + MESSAGE("Want to remove an unknown object" << theID); } + break; + } case 0: - { //modify sobject - //MESSAGE("Want to modify an object " << theID); - EntryMapIter it = entry2SuitObject.find( theID ); - if ( it != entry2SuitObject.end() ) - { - suit_obj = it->second; - suit_obj->updateItem(); - } - else - { - MESSAGE("Want to modify an unknown object" << theID); - } - break; + { //modify sobject + //MESSAGE("Want to modify an object " << theID); + EntryMapIter it = entry2SuitObject.find( theID ); + if ( it != entry2SuitObject.end() ) + { + suit_obj = it->second; + suit_obj->updateItem(); } - case 5: //IOR of the object modified + else { - EntryMapIter it = entry2SuitObject.find( theID ); - if ( it != entry2SuitObject.end() ) - suit_obj = it->second; - - /* Define visibility state */ - bool isComponent = dynamic_cast( suit_obj ) != 0; - if ( suit_obj && !isComponent ) { - QString moduleTitle = ((CAM_Application*)myStudy->application())->moduleTitle(suit_obj->componentDataType()); - if (!moduleTitle.isEmpty()) { - LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(moduleTitle,false); - if (aDisplayer) { - if(aDisplayer->canBeDisplayed(theID.c_str())) { - myStudy->setVisibilityState( theID.c_str(), Qtx::HiddenState ); - //MESSAGE("Object with entry : "<< theID <<" CAN be displayed !!!"); - } - //else - //MESSAGE("Object with entry : "<< theID <<" CAN'T be displayed !!!"); + MESSAGE("Want to modify an unknown object" << theID); + } + break; + } + case 5: //IOR of the object modified + { + EntryMapIter it = entry2SuitObject.find( theID ); + if ( it != entry2SuitObject.end() ) + suit_obj = it->second; + + /* Define visibility state */ + bool isComponent = dynamic_cast( suit_obj ) != 0; + if ( suit_obj && !isComponent ) { + QString moduleTitle = ((CAM_Application*)myStudy->application())->moduleTitle(suit_obj->componentDataType()); + if (!moduleTitle.isEmpty()) { + LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(moduleTitle,false); + if (aDisplayer) { + if(aDisplayer->canBeDisplayed(theID.c_str())) { + myStudy->setVisibilityState( theID.c_str(), Qtx::HiddenState ); + //MESSAGE("Object with entry : "<< theID <<" CAN be displayed !!!"); } + //else + //MESSAGE("Object with entry : "<< theID <<" CAN'T be displayed !!!"); } } - break; } + break; + } #ifndef DISABLE_PYCONSOLE case 6: //NoteBook variables were modified - { - myStudy->onNoteBookVarUpdate( QString( theID.c_str() ) ); - break; - } + { + myStudy->onNoteBookVarUpdate( QString( theID.c_str() ) ); + break; + } #endif default:MESSAGE("Unknown event: " << event);break; } //switch @@ -386,13 +392,17 @@ private: SalomeApp_Study* myStudy; EntryMap entry2SuitObject; }; +#endif // DISABLE_ORB /*! Constructor. */ SalomeApp_Study::SalomeApp_Study( SUIT_Application* app ) -: LightApp_Study( app ), myObserver( 0 ) + : LightApp_Study( app ) + #ifndef DISABLE_ORB + , myObserver( 0 ) + #endif { myStudyDS = SalomeApp_Application::getStudy(); } @@ -402,11 +412,13 @@ SalomeApp_Study::SalomeApp_Study( SUIT_Application* app ) */ SalomeApp_Study::~SalomeApp_Study() { +#ifndef DISABLE_ORB if ( myObserver ) { PortableServer::ObjectId_var oid = myObserver->_default_POA()->servant_to_id( myObserver ); myObserver->_default_POA()->deactivate_object( oid.in() ); myObserver = 0; } +#endif } #ifndef DISABLE_PYCONSOLE @@ -463,11 +475,15 @@ bool SalomeApp_Study::createDocument( const QString& theStr ) bool aRet = CAM_Study::createDocument( theStr ); +#ifndef DISABLE_ORB #ifdef WITH_SALOMEDS_OBSERVER myObserver = new Observer_i(this); //attach an observer to the study with notification of modifications myStudyDS->attach(myObserver->_this(),true); #endif +#else + //TODO +#endif emit created( this ); @@ -485,7 +501,7 @@ bool SalomeApp_Study::openDocument( const QString& theFileName ) // read HDF file bool res = false; bool showError = !application()->property("open_study_from_command_line").isValid() || - !application()->property("open_study_from_command_line").toBool(); + !application()->property("open_study_from_command_line").toBool(); try { res = myStudyDS->Open( theFileName.toUtf8().data() ); } @@ -521,12 +537,16 @@ bool SalomeApp_Study::openDocument( const QString& theFileName ) // but tree that corresponds to not-loaded data models will be updated any way. ((SalomeApp_Application*)application())->updateObjectBrowser( false ); +#ifndef DISABLE_ORB #ifdef WITH_SALOMEDS_OBSERVER dynamic_cast( root() )->setToSynchronize(false); myObserver = new Observer_i(this); //attach an observer to the study with notification of modifications myStudyDS->attach(myObserver->_this(),true); #endif +#else + //TODO +#endif res = CAM_Study::openDocument( theFileName ); @@ -576,12 +596,16 @@ bool SalomeApp_Study::loadDocument( const QString& theStudyName ) // but tree that corresponds to not-loaded data models will be updated any way. ((SalomeApp_Application*)application())->updateObjectBrowser( false ); +#ifndef DISABLE_ORB #ifdef WITH_SALOMEDS_OBSERVER dynamic_cast( root() )->setToSynchronize(false); myObserver = new Observer_i(this); //attach an observer to the study with notification of modifications myStudyDS->attach(myObserver->_this(),true); #endif +#else + //TODO +#endif bool restore = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", true ); if ( restore ) { @@ -611,7 +635,7 @@ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName ) while ( it.hasNext() ) { // Cast to LightApp class in order to give a chance // to light modules to save their data - if ( LightApp_DataModel* aModel = + if ( LightApp_DataModel* aModel = dynamic_cast( it.next() ) ) { listOfFiles.clear(); aModel->saveAs( theFileName, this, listOfFiles ); @@ -628,8 +652,19 @@ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName ) bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false ); bool isAscii = resMgr->booleanValue( "Study", "ascii_file", false ); +#ifndef DISABLE_ORB bool res = studyDS()->SaveAs( theFileName.toUtf8().data(), isMultiFile, isAscii ) - && CAM_Study::saveDocumentAs( theFileName ); + && CAM_Study::saveDocumentAs( theFileName ); +#else + // create engine for data model if not existing + it.toFront(); + while ( it.hasNext() ) { + SalomeApp_EngineImpl::EngineIORForComponent(it.next()->module()->name().toUtf8().data(), true); + } + SALOMEDSImpl_DriverFactory* theDriversFactory = dynamic_cast(SalomeApp_EngineImplFactory::instance()); + bool res = studyDS()->SaveAs( theFileName.toUtf8().data(), theDriversFactory, isMultiFile, isAscii ) + && CAM_Study::saveDocumentAs( theFileName ); +#endif res = res && saveStudyData(theFileName, 0); // 0 means persistence file @@ -655,7 +690,7 @@ bool SalomeApp_Study::saveDocument() while ( it.hasNext() ) { // Cast to LightApp class in order to give a chance // to light modules to save their data - if ( LightApp_DataModel* aModel = + if ( LightApp_DataModel* aModel = dynamic_cast( it.next() ) ) { listOfFiles.clear(); aModel->save(listOfFiles); @@ -672,7 +707,13 @@ bool SalomeApp_Study::saveDocument() bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false ); bool isAscii = resMgr->booleanValue( "Study", "ascii_file", false ); +#ifndef DISABLE_ORB bool res = studyDS()->Save( isMultiFile, isAscii ) && CAM_Study::saveDocument(); +#else + SALOMEDSImpl_DriverFactory* theDriversFactory = dynamic_cast(SalomeApp_EngineImplFactory::instance()); + bool res = studyDS()->Save(theDriversFactory, isMultiFile, isAscii ) + && CAM_Study::saveDocument(); +#endif res = res && saveStudyData(studyName(), 0); // 0 means persistence file if ( res ) @@ -688,9 +729,13 @@ void SalomeApp_Study::closeDocument(bool permanently) { LightApp_Study::closeDocument(permanently); +#ifndef DISABLE_ORB // close SALOMEDS document if ( myObserver ) myStudyDS->detach( myObserver->_this() ); +#else + //TODO +#endif if ( permanently ) { SUIT_Desktop* desk = SUIT_Session::session()->activeApplication()->desktop(); bool isBlocked = desk->signalsBlocked(); @@ -710,22 +755,23 @@ void SalomeApp_Study::closeDocument(bool permanently) to participate in dump study operation. \param theFileName - full path to the output Python file - \param toPublish - if true, all objects are published in a study - by the output script, including those not orignally present + \param toPublish - if true, all objects are published in a study + by the output script, including those not orignally present in the current study. - \param isMultiFile - if true, each module's dump is written into + \param isMultiFile - if true, each module's dump is written into a separate Python file, otherwise a single output file is written \param toSaveGUI - if true, the GUI state is written \return - true if the operation succeeds, and false otherwise. */ bool SalomeApp_Study::dump( const QString& theFileName, - bool toPublish, + bool toPublish, bool isMultiFile, bool toSaveGUI ) { int savePoint = 0; _PTR(AttributeParameter) ap; +#ifndef DISABLE_ORB _PTR(IParameters) ip = ClientFactory::getIParameters(ap); if( ip->isDumpPython() ) @@ -733,24 +779,33 @@ bool SalomeApp_Study::dump( const QString& theFileName, if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method ip->setDumpPython(); +#else + //auto aParam = ClientFactory::getIParameters(*ap); + //_PTR(IParameters) ip = _OBJ2PTR(IParameters, new SALOMEDSImpl_IParameters(ap)); + //TODO if( ip->isDumpPython() ) + //TODO ip->setDumpPython(); //Unset DumpPython flag. + + if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method + //TODO ip->setDumpPython(); +#endif //SRN: create a temporary save point - savePoint = SalomeApp_VisualState( - dynamic_cast( application() ) ).storeState(); + savePoint = SalomeApp_VisualState( + dynamic_cast( application() ) ).storeState(); } // Issue 21377 - Each data model is asked to dump its data not present in SALOMEDS study. // This is an optional but important step, it gives a chance to light modules // to dump their data as a part of common dump study operation - ModelList list; + ModelList list; dataModels( list ); QListIterator it( list ); QStringList listOfFiles; while ( it.hasNext() ) { - if ( LightApp_DataModel* aModel = + if ( LightApp_DataModel* aModel = dynamic_cast( it.next() ) ) { listOfFiles.clear(); - if ( aModel->dumpPython( theFileName, this, isMultiFile, listOfFiles ) && + if ( aModel->dumpPython( theFileName, this, isMultiFile, listOfFiles ) && !listOfFiles.isEmpty() ) // This call simply passes the data model's dump output to SalomeApp_Engine servant. // This code is shared with persistence mechanism. @@ -760,13 +815,27 @@ bool SalomeApp_Study::dump( const QString& theFileName, } } - // Now dump SALOMEDS part that also involves SalomeApp_Engine in case if + // Now dump SALOMEDS part that also involves SalomeApp_Engine in case if // any light module is present in the current configuration QFileInfo aFileInfo( theFileName ); +#ifndef DISABLE_ORB bool res = myStudyDS->DumpStudy( aFileInfo.absolutePath().toUtf8().data(), - aFileInfo.baseName().toUtf8().data(), - toPublish, - isMultiFile); + aFileInfo.baseName().toUtf8().data(), + toPublish, + isMultiFile); +#else + // create engine for data model if not existing + it.toFront(); + while ( it.hasNext() ) { + SalomeApp_EngineImpl::EngineIORForComponent(it.next()->module()->name().toUtf8().data(), true); + } + SALOMEDSImpl_DriverFactory* theDriversFactory = dynamic_cast(SalomeApp_EngineImplFactory::instance()); + + bool res = myStudyDS->DumpStudy( aFileInfo.absolutePath().toUtf8().data(), + aFileInfo.baseName().toUtf8().data(), + toPublish, + isMultiFile, theDriversFactory); +#endif if ( toSaveGUI ) removeSavePoint( savePoint ); //SRN: remove the created temporary save point. @@ -862,8 +931,8 @@ bool SalomeApp_Study::saveStudyData( const QString& /*theFileName*/, int type ) ModelList list; dataModels( list ); QListIterator it( list ); while ( it.hasNext() ){ - LightApp_DataModel* aLModel = - dynamic_cast( it.next() ); + LightApp_DataModel* aLModel = + dynamic_cast( it.next() ); // It is safe to call SetListOfFiles() for any kind of module // because SetListOfFiles() does nothing for full modules :) if ( aLModel ) @@ -914,7 +983,7 @@ CAM_ModuleObject* SalomeApp_Study::createModuleObject( LightApp_DataModel* theDa if ( !res ){ _PTR(SComponent) aComp = myStudyDS->FindComponent( - theDataModel->module()->name().toStdString() ); + theDataModel->module()->name().toUtf8().data()); if ( !aComp ) return res; @@ -946,13 +1015,13 @@ void SalomeApp_Study::addComponent(const CAM_DataModel* dm) if (!aModule) { // Check SComponent existance - std::string aCompDataType = dm->module()->name().toStdString(); + QString aCompDataType = dm->module()->name(); - _PTR(SComponent) aComp = myStudyDS->FindComponent(aCompDataType); + _PTR(SComponent) aComp = myStudyDS->FindComponent(aCompDataType.toUtf8().data()); if (!aComp) { // Create SComponent - _PTR(StudyBuilder) aBuilder = myStudyDS->NewBuilder(); - aComp = aBuilder->NewComponent(aCompDataType); + auto aBuilder = myStudyDS->NewBuilder(); + aComp = aBuilder->NewComponent(aCompDataType.toUtf8().data()); aBuilder->SetName(aComp, dm->module()->moduleName().toStdString()); QString anIconName = dm->module()->iconName(); if (!anIconName.isEmpty()) { @@ -961,16 +1030,21 @@ void SalomeApp_Study::addComponent(const CAM_DataModel* dm) anAttr->SetPixMap(anIconName.toStdString()); } +#ifndef DISABLE_ORB // Set default engine IOR // Issue 21377 - using separate engine for each type of light module - std::string anEngineIOR = SalomeApp_Engine_i::EngineIORForComponent( aCompDataType.c_str(), + std::string anEngineIOR = SalomeApp_Engine_i::EngineIORForComponent( aCompDataType.toUtf8().data(), true ); +#else + std::string anEngineIOR = SalomeApp_EngineImpl::EngineIORForComponent( aCompDataType.toUtf8().data(), + true ); +#endif aBuilder->DefineComponentInstance(aComp, anEngineIOR); //SalomeApp_DataModel::BuildTree( aComp, root(), this, /*skipExisitng=*/true ); SalomeApp_DataModel::synchronize( aComp, this ); } else { - _PTR(StudyBuilder) aBuilder = myStudyDS->NewBuilder(); + auto aBuilder = myStudyDS->NewBuilder(); aBuilder->SetName(aComp, dm->module()->moduleName().toStdString()); QString anIconName = dm->module()->iconName(); if (!anIconName.isEmpty()) { @@ -998,9 +1072,13 @@ bool SalomeApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm // 1. aModule == 0 means that this is a light module (no CORBA enigine) if (!aModule) { // Issue 21377 - using separate engine for each type of light module - std::string aCompDataType = dm->module()->name().toStdString(); - anEngine = SalomeApp_Engine_i::EngineIORForComponent( aCompDataType.c_str(), true ).c_str(); - aSComp = myStudyDS->FindComponent( aCompDataType ); + QString aCompDataType = dm->module()->name(); +#ifndef DISABLE_ORB + anEngine = SalomeApp_Engine_i::EngineIORForComponent( aCompDataType.toUtf8().data(), true ).c_str(); +#else + anEngine = SalomeApp_EngineImpl::EngineIORForComponent( aCompDataType.toUtf8().data(), true ).c_str(); +#endif + aSComp = myStudyDS->FindComponent( aCompDataType.toUtf8().data() ); } else { SalomeApp_DataModel* aDM = dynamic_cast( dm ); @@ -1011,16 +1089,25 @@ bool SalomeApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm anEngine = aDM->getModule()->engineIOR(); if ( anEngine.isEmpty() ) return false; - aSComp = myStudyDS->FindComponentID( std::string( anId.toLatin1() ) ); + aSComp = myStudyDS->FindComponentID( anId.toUtf8().data() ); } } if ( aSComp ) { - _PTR(StudyBuilder) aBuilder( myStudyDS->NewBuilder() ); + auto aBuilder( myStudyDS->NewBuilder() ); +#ifndef DISABLE_ORB if ( aBuilder ) { try { aBuilder->LoadWith( aSComp, std::string( anEngine.toLatin1() ) ); } catch( const SALOME::SALOME_Exception& ) { +#else + if ( aBuilder ) { + try { + SALOMEDSImpl_Driver* aDriver = SalomeApp_EngineImplFactory::instance()->GetDriverByIOR(anEngine.toUtf8().data()); + aBuilder->LoadWith(*aSComp, aDriver); + } + catch( const SALOME_Exception& ) { +#endif // Oops, something went wrong while loading -> return an error return false; } @@ -1062,7 +1149,11 @@ bool SalomeApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm std::vector SalomeApp_Study::GetListOfFiles( const char* theModuleName, int type ) const { // Issue 21377 - using separate engine for each type of light module +#ifndef DISABLE_ORB SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance( theModuleName, false ); +#else + SalomeApp_EngineImpl* aDefaultEngine = SalomeApp_EngineImpl::GetInstance( theModuleName, false ); +#endif if (aDefaultEngine) return aDefaultEngine->GetListOfFiles( type ); @@ -1081,7 +1172,11 @@ void SalomeApp_Study::SetListOfFiles ( const char* theModuleName, int type, const std::vector theListOfFiles ) { // Issue 21377 - using separate engine for each type of light module +#ifndef DISABLE_ORB SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance( theModuleName, false ); +#else + SalomeApp_EngineImpl* aDefaultEngine = SalomeApp_EngineImpl::GetInstance( theModuleName, false ); +#endif if (aDefaultEngine) aDefaultEngine->SetListOfFiles(type, theListOfFiles); } @@ -1112,9 +1207,14 @@ void SalomeApp_Study::RemoveTemporaryFiles ( const char* theModuleName, bool isM std::vector aSeq; aSeq.reserve(n); for (int i = 0; i < n; i++) +#ifndef DISABLE_ORB aSeq.push_back(CORBA::string_dup(aListOfFiles[i + 1].c_str())); SalomeApp_Engine_i* engine = SalomeApp_Engine_i::GetInstance( theModuleName, false ); +#else + aSeq.push_back(std::string(aListOfFiles[i + 1].c_str())); + SalomeApp_EngineImpl* engine = SalomeApp_EngineImpl::GetInstance( theModuleName, false ); +#endif bool toRemove = force || ( engine && !engine->keepFiles() ); if ( toRemove ) { @@ -1140,9 +1240,11 @@ void SalomeApp_Study::updateFromNotebook( const QString& theFileName, bool isSav LightApp_DataObject* SalomeApp_Study::findObjectByEntry( const QString& theEntry ) { LightApp_DataObject* o = 0; +#ifndef DISABLE_ORB if ( myObserver ) { o = dynamic_cast( myObserver->findObject( theEntry.toUtf8().constData() ) ); } +#endif if ( !o ) { o = LightApp_Study::findObjectByEntry( theEntry ); } @@ -1155,12 +1257,16 @@ LightApp_DataObject* SalomeApp_Study::findObjectByEntry( const QString& theEntry */ void SalomeApp_Study::deleteReferencesTo( _PTR( SObject ) obj ) { - _PTR(StudyBuilder) sb = studyDS()->NewBuilder(); + auto sb = studyDS()->NewBuilder(); std::vector<_PTR(SObject)> aRefs = studyDS()->FindDependances( obj ); for( size_t i=0, n=aRefs.size(); iGetFatherComponent()->ComponentDataType()==obj->GetFatherComponent()->ComponentDataType() ) +#else + if( o->GetFatherComponent().ComponentDataType()==obj->GetFatherComponent().ComponentDataType() ) +#endif { sb->RemoveReference( o ); sb->RemoveObjectWithChildren( o ); @@ -1174,7 +1280,7 @@ void SalomeApp_Study::deleteReferencesTo( _PTR( SObject ) obj ) */ QString SalomeApp_Study::referencedToEntry( const QString& entry ) const { - _PTR(SObject) obj = studyDS()->FindObjectID( entry.toStdString() ); + _PTR(SObject) obj = studyDS()->FindObjectID( entry.toUtf8().data() ); _PTR(SObject) refobj; if( obj && obj->ReferencedObject( refobj ) ) @@ -1187,10 +1293,16 @@ QString SalomeApp_Study::referencedToEntry( const QString& entry ) const */ QString SalomeApp_Study::componentDataType( const QString& entry ) const { - _PTR(SObject) obj( studyDS()->FindObjectID( entry.toStdString() ) ); + _PTR(SObject) obj( studyDS()->FindObjectID( entry.toUtf8().data() ) ); +#ifndef DISABLE_ORB if ( !obj ) return LightApp_Study::componentDataType( entry ); return obj->GetFatherComponent()->ComponentDataType().c_str(); +#else + if ( !obj ) + return LightApp_Study::componentDataType( entry ); + return obj->GetFatherComponent().ComponentDataType().c_str(); +#endif } /*! @@ -1198,8 +1310,12 @@ QString SalomeApp_Study::componentDataType( const QString& entry ) const */ bool SalomeApp_Study::isComponent( const QString& entry ) const { - _PTR(SObject) obj( studyDS()->FindObjectID( entry.toStdString() ) ); + _PTR(SObject) obj( studyDS()->FindObjectID( entry.toUtf8().data() ) ); +#ifndef DISABLE_ORB return obj && QString( obj->GetID().c_str() ) == obj->GetFatherComponent()->GetID().c_str(); +#else + return obj && QString( obj->GetID().c_str() ) == obj->GetFatherComponent().GetID().c_str(); +#endif } /*! @@ -1207,13 +1323,17 @@ bool SalomeApp_Study::isComponent( const QString& entry ) const */ void SalomeApp_Study::children( const QString& entry, QStringList& child_entries ) const { - _PTR(SObject) SO = studyDS()->FindObjectID( entry.toStdString() ); + _PTR(SObject) SO = studyDS()->FindObjectID( entry.toUtf8().data() ); _PTR(ChildIterator) anIter ( studyDS()->NewChildIterator( SO ) ); anIter->InitEx( true ); while( anIter->More() ) { - _PTR(SObject) val( anIter->Value() ); + auto val( anIter->Value() ); +#ifndef DISABLE_ORB child_entries.append( val->GetID().c_str() ); +#else + child_entries.append( val.GetID().c_str() ); +#endif anIter->Next(); } } @@ -1224,9 +1344,15 @@ void SalomeApp_Study::children( const QString& entry, QStringList& child_entries */ void SalomeApp_Study::components( QStringList& comps ) const { +#ifndef DISABLE_ORB for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More(); it->Next() ) { _PTR(SComponent) aComponent ( it->Value() ); +#else + for( _PTR(SComponentIterator) it ( studyDS()->GetNewComponentIterator()); it->More(); it->Next() ) + { + _PTR(SComponent) aComponent ( it->GetValue() ); +#endif // skip the magic "Interface Applicative" component if ( aComponent && aComponent->ComponentDataType() != getVisualComponentName().toLatin1().constData() ) comps.append( aComponent->ComponentDataType().c_str() ); @@ -1241,9 +1367,15 @@ void SalomeApp_Study::components( QStringList& comps ) const QString SalomeApp_Study::centry( const QString& comp ) const { QString e; +#ifndef DISABLE_ORB for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More() && e.isEmpty(); it->Next() ) { _PTR(SComponent) aComponent ( it->Value() ); +#else + for( _PTR(SComponentIterator) it ( studyDS()->GetNewComponentIterator()); it->More() && e.isEmpty(); it->Next() ) + { + _PTR(SComponent) aComponent ( it->GetValue() ); +#endif if ( aComponent && comp == aComponent->ComponentDataType().c_str() ) e = aComponent->GetID().c_str(); } @@ -1260,11 +1392,15 @@ std::vector SalomeApp_Study::getSavePoints() _PTR(SObject) so = studyDS()->FindComponent( getVisualComponentName().toLatin1().constData() ); if(!so) return v; - _PTR(StudyBuilder) builder = studyDS()->NewBuilder(); - _PTR(ChildIterator) anIter ( studyDS()->NewChildIterator( so ) ); + auto builder = studyDS()->NewBuilder(); + auto anIter ( studyDS()->NewChildIterator( so ) ); for(; anIter->More(); anIter->Next()) { +#ifndef DISABLE_ORB _PTR(SObject) val( anIter->Value() ); +#else + _PTR(SObject) val( anIter->GetValue() ); +#endif _PTR(GenericAttribute) genAttr; if(builder->FindAttribute(val, genAttr, "AttributeParameter")) v.push_back(val->Tag()); } @@ -1278,9 +1414,9 @@ std::vector SalomeApp_Study::getSavePoints() void SalomeApp_Study::removeSavePoint(int savePoint) { if(savePoint <= 0) return; - _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint); - _PTR(SObject) so = AP->GetSObject(); - _PTR(StudyBuilder) builder = studyDS()->NewBuilder(); + auto AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint); + auto so = AP->GetSObject(); + auto builder = studyDS()->NewBuilder(); builder->RemoveObjectWithChildren(so); } @@ -1289,8 +1425,13 @@ void SalomeApp_Study::removeSavePoint(int savePoint) */ QString SalomeApp_Study::getNameOfSavePoint(int savePoint) { +#ifndef DISABLE_ORB _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint); _PTR(IParameters) ip = ClientFactory::getIParameters(AP); +#else + _CLASS(AttributeParameter)* AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint); + _PTR(IParameters) ip; //TODO = ClientFactory::getIParameters(AP); +#endif return ip->getProperty("AP_SAVEPOINT_NAME").c_str(); } @@ -1299,8 +1440,13 @@ QString SalomeApp_Study::getNameOfSavePoint(int savePoint) */ void SalomeApp_Study::setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint) { +#ifndef DISABLE_ORB _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint); _PTR(IParameters) ip = ClientFactory::getIParameters(AP); +#else + _CLASS(AttributeParameter)* AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint); + _PTR(IParameters) ip; //TODO = ClientFactory::getIParameters(AP); +#endif ip->setProperty("AP_SAVEPOINT_NAME", nameOfSavePoint.toStdString()); } diff --git a/src/SalomeApp/SalomeApp_Study.h b/src/SalomeApp/SalomeApp_Study.h index 4e6c0763f..490911eaa 100644 --- a/src/SalomeApp/SalomeApp_Study.h +++ b/src/SalomeApp/SalomeApp_Study.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -31,7 +31,11 @@ #pragma warning( disable:4251 ) #endif +#ifndef DISABLE_ORB #include "SALOMEDSClient.hxx" +#else +#include "SALOMEDSImplAdapt.hxx" +#endif class SALOMEAPP_EXPORT SalomeApp_Study : public LightApp_Study { @@ -104,7 +108,7 @@ protected: virtual void dataModelInserted( const CAM_DataModel* ); virtual bool openDataModel( const QString&, CAM_DataModel* ); - virtual CAM_ModuleObject* createModuleObject( LightApp_DataModel* theDataModel, + virtual CAM_ModuleObject* createModuleObject( LightApp_DataModel* theDataModel, SUIT_DataObject* theParent ) const; protected slots: virtual void updateModelRoot( const CAM_DataModel* ); @@ -114,10 +118,12 @@ protected slots: private: _PTR(Study) myStudyDS; +#ifndef DISABLE_ORB Observer_i* myObserver; +#endif #ifndef DISABLE_PYCONSOLE - signals: +signals: void notebookVarUpdated( QString theVarName ); #endif }; diff --git a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx index b355724e5..40b2b37ab 100644 --- a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx +++ b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -32,9 +32,11 @@ #include #include +#ifndef DISABLE_ORB // CORBA Headers #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#endif // QT Includes #include @@ -169,14 +171,21 @@ SalomeApp_StudyPropertiesDlg::~SalomeApp_StudyPropertiesDlg() void SalomeApp_StudyPropertiesDlg::initData() { bool hasData = (SalomeApp_Application::getStudy() != NULL); - _PTR(AttributeStudyProperties) propAttr; + /* _PTR(AttributeStudyProperties) propAttr; if (hasData) propAttr = SalomeApp_Application::getStudy()->GetProperties(); - hasData = hasData && propAttr; + hasData = hasData && propAttr;*/ if (hasData) { + auto propAttr = SalomeApp_Application::getStudy()->GetProperties(); + if(propAttr){ //Creator and creation date +#ifndef DISABLE_ORB myAuthor->setText(propAttr->GetUserName().c_str()); +#else + //TODO +#endif + int minutes, hours, day, month, year; if (propAttr->GetCreationDate(minutes, hours, day, month, year)) { QString strDate; @@ -224,7 +233,11 @@ void SalomeApp_StudyPropertiesDlg::initData() //Modifications std::vector aUsers; std::vector aMins, aHours, aDays, aMonths, aYears; +#ifndef DISABLE_ORB propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false); +#else + //TODO +#endif int aCnt = aUsers.size(); for ( int i = 0; i < (int)aCnt; i++ ) { QString date; @@ -255,6 +268,7 @@ void SalomeApp_StudyPropertiesDlg::initData() myVersions->addTopLevelItem(item); } } + } adjustSize(); } @@ -263,7 +277,7 @@ void SalomeApp_StudyPropertiesDlg::initData() */ void SalomeApp_StudyPropertiesDlg::clickOnOk() { - _PTR(AttributeStudyProperties) propAttr = SalomeApp_Application::getStudy()->GetProperties(); + auto propAttr = SalomeApp_Application::getStudy()->GetProperties(); //Firstly, store locked flag if(propAttr) { bool bLocked = myLocked->isChecked(); @@ -275,6 +289,7 @@ void SalomeApp_StudyPropertiesDlg::clickOnOk() bool needWarning = false; //Author +#ifndef DISABLE_ORB if (QString(propAttr->GetUserName().c_str()) != myAuthor->text().trimmed()) { if(!propAttr->IsLocked()) { propAttr->SetUserName(myAuthor->text().trimmed().toStdString()); @@ -284,6 +299,18 @@ void SalomeApp_StudyPropertiesDlg::clickOnOk() } } +#else + //TODO + /*if (QString(propAttr->GetUserName().c_str()) != myAuthor->text().trimmed()) { + if(!propAttr->IsLocked()) { + propAttr->SetUserName(myAuthor->text().trimmed().toStdString()); + myIsChanged = true; + } else { + needWarning = true; + } + } + */ +#endif //Unit if (QString(propAttr->GetUnits().c_str()) != myUnits->currentText()) { if(!propAttr->IsLocked()) { diff --git a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.h b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.h index 81b27f2d1..33de77c7b 100644 --- a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.h +++ b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -31,10 +31,14 @@ #include +#ifndef DISABLE_ORB #include #include CORBA_SERVER_HEADER(SALOMEDS) #include +#else +#include "SALOMEDSImpl_Study.hxx" +#endif class QLineEdit; class QLabel; diff --git a/src/SalomeApp/SalomeApp_Tools.cxx b/src/SalomeApp/SalomeApp_Tools.cxx index 6328202eb..8e62c4ba2 100644 --- a/src/SalomeApp/SalomeApp_Tools.cxx +++ b/src/SalomeApp/SalomeApp_Tools.cxx @@ -52,6 +52,7 @@ QColor SalomeApp_Tools::color( const Quantity_Color& c ) return QColor( (int)( c.Red() * 255 ), (int)( c.Green() * 255 ), (int)( c.Blue() * 255 ) ); } +#ifndef DISABLE_ORB /*! Gets message on exception \a S_ex. */ @@ -127,3 +128,4 @@ void SalomeApp_Tools::QtCatchCorbaException( const SALOME::SALOME_Exception& S_e title, message ); } +#endif //DISABLE_ORB diff --git a/src/SalomeApp/SalomeApp_Tools.h b/src/SalomeApp/SalomeApp_Tools.h index 3c485a250..72057f80d 100644 --- a/src/SalomeApp/SalomeApp_Tools.h +++ b/src/SalomeApp/SalomeApp_Tools.h @@ -32,8 +32,10 @@ class QString; class Quantity_Color; +#ifndef DISABLE_ORB #include #include CORBA_CLIENT_HEADER(SALOME_Exception) +#endif /*! Class which provide color converter and exception message box. @@ -44,8 +46,10 @@ public: static Quantity_Color color( const QColor& ); static QColor color( const Quantity_Color& ); +#ifndef DISABLE_ORB static QString ExceptionToString( const SALOME::SALOME_Exception& ); static void QtCatchCorbaException( const SALOME::SALOME_Exception& ); +#endif }; #endif diff --git a/src/SalomeApp/SalomeApp_TypeFilter.cxx b/src/SalomeApp/SalomeApp_TypeFilter.cxx index ad802404a..648f33384 100644 --- a/src/SalomeApp/SalomeApp_TypeFilter.cxx +++ b/src/SalomeApp/SalomeApp_TypeFilter.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -53,10 +53,14 @@ bool SalomeApp_TypeFilter::isOk( const SUIT_DataOwner* sOwner ) const { QString entry = owner->entry(); - _PTR(SObject) aSObj( SalomeApp_Application::getStudy()->FindObjectID( entry.toStdString() ) ); + _PTR(SObject) aSObj( SalomeApp_Application::getStudy()->FindObjectID( entry.toUtf8().data() ) ); if (aSObj) { - _PTR(SComponent) aComponent(aSObj->GetFatherComponent()); +#ifndef DISABLE_ORB + _PTR(SComponent) aComponent(aSObj->GetFatherComponent()); +#else + _PTR(SComponent) aComponent(_CLASS(SComponent)(aSObj->GetFatherComponent())); +#endif if ( aComponent && (aComponent->ComponentDataType() == myKind.toStdString()) ) return true; } diff --git a/src/SalomeApp/SalomeApp_VisualState.cxx b/src/SalomeApp/SalomeApp_VisualState.cxx index 1bd77cf94..95c523302 100644 --- a/src/SalomeApp/SalomeApp_VisualState.cxx +++ b/src/SalomeApp/SalomeApp_VisualState.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -38,8 +38,12 @@ #include #include +#ifndef DISABLE_ORB #include //? #include //? +#else +#include +#endif #include //? #include //? @@ -119,9 +123,15 @@ int SalomeApp_VisualState::storeState() if ( savePoints.size() > 0) savePoint = savePoints[savePoints.size()-1] + 1; - _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName().toLatin1().constData(), +#ifndef DISABLE_ORB + _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName().toLatin1().constData(), savePoint ); - _PTR(IParameters) ip = ClientFactory::getIParameters( ap ); + _PTR(IParameters) ip = ClientFactory::getIParameters( ap ); +#else + auto ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName().toLatin1().constData(), + savePoint); + _PTR(IParameters) ip; //TODO = ClientFactory::getIParameters( ap ); +#endif ViewManagerList lst; myApp->viewManagers( lst ); @@ -208,9 +218,15 @@ void SalomeApp_VisualState::restoreState(int savePoint) if ( !study ) return; +#ifndef DISABLE_ORB _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName().toLatin1().constData(), savePoint ); - _PTR(IParameters) ip = ClientFactory::getIParameters(ap); + _PTR(IParameters) ip = ClientFactory::getIParameters(ap); +#else + auto ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName().toLatin1().constData(), + savePoint ); + _PTR(IParameters) ip ; //TODO = ClientFactory::getIParameters(ap); +#endif qApp->installEventFilter( this ); @@ -228,7 +244,14 @@ void SalomeApp_VisualState::restoreState(int savePoint) for ( int i = 0; i < nbViewers; i++ ) { std::string viewerEntry = ip->getValue( "AP_VIEWERS_LIST", i ); + #ifndef DISABLE_ORB std::vector veiewerParams = ip->parseValue(viewerEntry,'_'); +#else + //TODO + std::vector veiewerParams; + return; + // = ip->getValues(viewerEntry,'_'); +#endif std::string type = veiewerParams[0]; std::string viewerID = veiewerParams[1]; SUIT_ViewManager* vm = myApp->newViewManager( type.c_str() ); diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 0bf8344fd..0d46e86b7 100644 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -388,6 +388,7 @@ int main( int argc, char **argv ) QApplication::addLibraryPath( qtdir ); // Add application library path (to search style plugin etc...) + QString path = SUIT_Tools::addSlash( Qtx::getenv( "GUI_ROOT_DIR" ) ) + "bin/salome"; QApplication::addLibraryPath( QDir::toNativeSeparators( path ) ); @@ -617,6 +618,8 @@ int main( int argc, char **argv ) // Load SalomeApp dynamic library MESSAGE( "creation SUIT_Application" ); SUIT_Application* aGUIApp = aGUISession->startApplication( "SalomeApp", 0, 0 ); + // Fill the executable name in session + aGUISession->setExecutableAppName(aGUISession->salomeAppName()); if ( aGUIApp ) { #ifdef USE_SALOME_STYLE diff --git a/src/Shaper/CMakeLists.txt b/src/Shaper/CMakeLists.txt new file mode 100644 index 000000000..7ef7cb428 --- /dev/null +++ b/src/Shaper/CMakeLists.txt @@ -0,0 +1,76 @@ +# Copyright (C) 2012-2020 CEA/DEN, EDF R&D, CSGROUP +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +cmake_policy(SET CMP0060 NEW) + +INCLUDE(UseQtExt) + +# --- options --- + +# additional include directories +INCLUDE_DIRECTORIES( + ${QT_INCLUDES} + ${Boost_INCLUDE_DIRS} + ${PYTHON_INCLUDE_DIRS} + ${OpenCASCADE_INCLUDE_DIR} + ${PTHREAD_INCLUDE_DIR} + ${PROJECT_BINARY_DIR} + ${PROJECT_BINARY_DIR}/idl + ${PROJECT_SOURCE_DIR}/src/Qtx + ${PROJECT_SOURCE_DIR}/src/SUIT + ${PROJECT_SOURCE_DIR}/src/Event + ${PROJECT_SOURCE_DIR}/src/Style + ${PROJECT_SOURCE_DIR}/src/SUIT + ${PROJECT_SOURCE_DIR}/src/STD + ${PROJECT_SOURCE_DIR}/src/CAM + ${PROJECT_SOURCE_DIR}/src/OBJECT + ${PROJECT_SOURCE_DIR}/src/LightApp + ${PROJECT_SOURCE_DIR}/src/ShaperApp + ${PROJECT_SOURCE_DIR}/../../../SHAPER/src/SHAPERGUI + ${PROJECT_SOURCE_DIR}/../../../SHAPER/src/XGUI + ${PROJECT_SOURCE_DIR}/../../../SHAPER/src/ModuleBase + ${PROJECT_SOURCE_DIR}/../../../SHAPER/src/Config + ${PROJECT_SOURCE_DIR}/../../../SHAPER/src/Events + ${PROJECT_SOURCE_DIR}/src/OCCViewer + ${PROJECT_SOURCE_DIR}/src/ShaperApp/SALOMEDSImplAdapt + ${PROJECT_SOURCE_DIR}/src/SalomeApp + ) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${QT_DEFINITIONS} + ${BOOST_DEFINITIONS} + ${PYTHON_DEFINITIONS} + ${OpenCASCADE_DEFINITIONS} + -DHAVE_SALOME + -DDISABLE_ORB + #-DDISABLE_PYCONSOLE +) + +# libraries to link to +SET(_link_LIBRARIES + ${QT_LIBRARIES} + ShaperApp +) + + +ADD_EXECUTABLE(shaper Shaper.cxx) +TARGET_LINK_LIBRARIES(shaper ${_link_LIBRARIES}) +INSTALL(TARGETS shaper EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) + diff --git a/src/Shaper/Shaper.cxx b/src/Shaper/Shaper.cxx new file mode 100644 index 000000000..e8f1b6073 --- /dev/null +++ b/src/Shaper/Shaper.cxx @@ -0,0 +1,486 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef DISABLE_PYCONSOLE +#include // this include must be the first one as it includes Python.h +#endif +#include +#include + +#include "GUI_version.h" +#include "Qtx.h" +#include "QtxMsgHandler.h" +#include "QtxSplash.h" +//#include "SALOME_Event.h" +#ifdef USE_SALOME_STYLE +#include "Style_Salome.h" +#endif // USE_SALOME_STYLE +#include "SUIT_Application.h" +#include "SUIT_Desktop.h" +#include "SUIT_ExceptionHandler.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" +#include "SUIT_Tools.h" + +#ifdef WIN32 +#define sleep _sleep +#include +#include +#include +#endif +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +//! CORBA server for SALOME GUI session +/*! + * SALOME_Session_Server launches a SALOME session servant. + * The servant registers to the Naming Service. + * See SALOME_Session.idl for interface specification. + * Main services offered by the servant are: + * - launch GUI + * - stop Session ( must be idle ) + * - get session state + * + * Also, session server: + * - reads arguments, + * - defines list of embedded services to launch with their arguments, + * - defines list of standalone services to connect/wait, + * - waits for naming service to finish its initalization, + * - creates and runs a separate thread to launch/initialize all services. + */ + +#include "SalomeApp_Application.h" + + +namespace myAppNameSpace{ + const QString myAppName("ShaperApp"); + const QString myLightAppName("LightShaperApp"); + } + +namespace +{ + //! Custom handler to manage Qt messages + class MsgHandler: public QtxMsgHandlerCallback + { + public: + MsgHandler() {} + void qtMessage( QtMsgType type, const QMessageLogContext& /*context*/, const QString& message ) + { + (void)message; // unused in debug mode + switch ( type ) + { + case QtDebugMsg: +#ifdef QT_DEBUG_MESSAGE + MESSAGE( "Debug: " << qPrintable( message ) ); +#endif + break; + case QtWarningMsg: + MESSAGE( "Warning: " << qPrintable( message ) ); + break; + case QtCriticalMsg: + MESSAGE( "Critical: " << qPrintable( message ) ); + break; + case QtFatalMsg: + MESSAGE( "Fatal: " << qPrintable( message ) ); + break; + case QtInfoMsg: + default: + MESSAGE( "Information: " << qPrintable( message ) ); + break; + } + } + }; + + //! Get version of SALOME GUI module + QString salomeVersion() + { + return GUI_VERSION_STR; + } + + //! Custom resources manager, that allows customization of application name/version + // via configuration/translation files. + class ResourceMgr : public SUIT_ResourceMgr + { + public: + ResourceMgr( const QString& appName = myAppNameSpace::myAppName ) : SUIT_ResourceMgr( appName, "%1Config" ) + { + customize(); // activate customization + setCurrentFormat( "xml" ); + setOption( "translators", QString( "%P_msg_%L.qm|%P_icons.qm|%P_images.qm" ) ); + } + + QString customName() const { return myCustomAppName; } + QString version() const { return myCustomAppVersion; } + + private: + static void customize() + { + // Try to retrieve actual application name and version from translation files. + // We create temporary resource manager and load LightApp and ShaperApp translations. + // This procedure is supposed to be done only once, at first call. + if ( myCustomAppName.isNull() ) { + SUIT_ResourceMgr mgr( myAppNameSpace::myAppName, "%1Config" ); + mgr.setCurrentFormat( "xml" ); + mgr.setWorkingMode( IgnoreUserValues ); // prevent reading data from user's file + mgr.loadLanguage( myAppNameSpace::myLightAppName, "en" ); + mgr.loadLanguage( myAppNameSpace::myAppName, "en" ); + + // actual application name can be customized via APP_NAME resource key + myCustomAppName = QObject::tr( "APP_NAME" ).trimmed(); + if ( myCustomAppName == "APP_NAME" || myCustomAppName.toLower() == "shaper" ) + myCustomAppName = myAppNameSpace::myAppName; // fallback name + + // actual application name can be customized via APP_VERSION resource key + myCustomAppVersion = QObject::tr( "APP_VERSION" ).trimmed(); + if ( myCustomAppVersion == "APP_VERSION" ) + myCustomAppVersion = myCustomAppName == myAppNameSpace::myAppName ? salomeVersion() : ""; // fallback version + } + } + + protected: + QString userFileName( const QString& /*appName*/, const bool forLoad ) const + { + if ( version().isEmpty() ) return ""; + return SUIT_ResourceMgr::userFileName( myCustomAppName, forLoad ); + } + + virtual long userFileId( const QString& _fname ) const + { + ////////////////////////////////////////////////////////////////////////////////////////////// + // In SALOME and SALOME-based applications the user preferences file is named as + // - .xml. on Windows + // - rc. on Linux + // where + // * AppName is application name, defaults to SalomeApp. Can be customized in SALOME-based + // applications, see ResourceMgr above for more details. + // * AppVersion is application version, defaults to current version of SALOME GUI module + // if AppName is not customize, otherwise empty. Can be customized in SALOME-based + // applications, see ResourceMgr above for more details. + // + // Since version 6.5.0 of SALOME, user file is stored in the ~/.config/salome + // directory. For backward compatibility, when user preferences from nearest + // version of application is searched, user home directory is also looked through, + // with lower priority. + // + // Since version 6.6.0 of SALOME, user file name on Linux is no more prefixed by dot + // symbol since it is stored in the hidden ~/.config/salome directory. However, dot-prefixed + // files are also taken into account (with lower priority) for backward compatibility. + // + // Notes: + // - Currently the following format of version number is supported: + // [.[.[]]] + // Parts in square brackets are considered optional. Here: + // * major - major version id + // * minor - minor version id + // * release - maintenance version id + // * type - dev or patch marker; it can be either one alphabetical symbol (from 'a' to 'z') + // or 'rc' to point release candidate (case-insensitive) + // * dev - dev version or patch number + // All numerical values must be of range [1-99]. + // Examples: 1.0, 6.5.0, 1.2.0a1, 3.3.3rc3 (release candidate 3), 11.0.0p1 (patch 1) + // + // - Versioning approach can be customized by implementing and using own resource manager class, + // see QtxResurceMgr, SUIT_ResourceMgr classes, and ResourceMgr class above in this file. + ////////////////////////////////////////////////////////////////////////////////////////////// + + long id = -1; + if ( !myCustomAppName.isEmpty() ) { +#ifdef WIN32 + // On Windows, user file name is something like SalomeApp.xml.6.5.0 where + // - SalomeApp is an application name (can be customized) + // - xml is a file format (xml or ini) + // - 6.5.0 is an application version, can include alfa/beta/rc marks, e.g. 6.5.0a3, 6.5.0rc1 + QRegExp exp( QString( "%1\\.%2\\.([a-zA-Z0-9.]+)" ).arg( myCustomAppName ).arg( currentFormat() ) ); +#else + // On Linux, user file name is something like SalomeApprc.6.5.0 where + // - SalomeApp is an application name (can be customized) + // - 6.5.0 is an application version, can include alfa/beta/rc marks, e.g. 6.5.0a3, 6.5.0rc1 + + // VSR 24/09/2012: issue 0021781: since version 6.6.0 user filename is not prepended with "." + // when it is stored in the ~/.config/ directory; + // for backward compatibility we also check files prepended with "." with lower priority + QRegExp exp( QString( "\\.?%1rc\\.([a-zA-Z0-9.]+)" ).arg( myCustomAppName ) ); +#endif + QString fname = QFileInfo( _fname ).fileName(); + if ( exp.exactMatch( fname ) ) { + long fid = Qtx::versionToId( exp.cap( 1 ) ); + if ( fid > 0 ) id = fid; + } + } + return id; + } + + private: + static QString myCustomAppName; + static QString myCustomAppVersion; + }; + QString ResourceMgr::myCustomAppName; + QString ResourceMgr::myCustomAppVersion; + + //! Custom session, to use custom resource manager class. + class Session : public SUIT_Session + { + public: + virtual SUIT_ResourceMgr* createResourceMgr( const QString& appName ) const + { + return new ResourceMgr( appName ); + } + }; + + //! Custom QApplication class, redefines notify() method, to transfer all events + // via centralized exception handling mechanism. + class Application : public QApplication + { + public: + Application( int& argc, char** argv ) + : QApplication( argc, argv ), + myHandler ( 0 ) + { + myDebug = !Qtx::getenv( "SALOME_DEBUG_EXCEPTIONS" ).isEmpty(); + } + + virtual bool notify( QObject* receiver, QEvent* e ) + { + if ( myDebug || !myHandler ) { + return QApplication::notify( receiver, e ); + } + else { + try { + return myHandler->handle( receiver, e ); + } + catch ( std::exception& e ) { + std::cerr << "notify(): Caught exception : " << e.what() << std::endl; + } + catch (...) { + std::cerr << "notify(): Caught unknown exception : there's probably a bug in SALOME platform" << std::endl; + } + return false; // return false when exception is caught + } + } + + SUIT_ExceptionHandler* handler() const { return myHandler; } + void setHandler( SUIT_ExceptionHandler* h ) { myHandler = h; } + + private: + SUIT_ExceptionHandler* myHandler; + bool myDebug; + }; + + //! Checks command line for presense of given option(s). + // Option that results to \c true is specified via \a trueOption parameter. + // Option that results to \c false is specified via \a falseOption parameter (empty for default). + // Default value for the result (returned if both \a trueOption \a falseOption are not given) is specified via \c defValue parameter. + bool boolCmdOption( const QString trueOption, const QString falseOption = QString(), bool defValue = false ) + { + bool value = defValue; + + QStringList args = QApplication::arguments(); + foreach ( QString arg, args ) + { + if ( arg == trueOption ) + value = true; + else if ( arg == falseOption ) + value = false; + } + return value; + } + +} // end of anonymous namespace + +// ---------------------------- MAIN ----------------------- +int main( int argc, char **argv ) +{ + if( myAppNameSpace::myAppName == "ShaperApp") + qputenv(QString(myAppNameSpace::myAppName + "Config").toUtf8().data(), + qgetenv("SalomeAppConfig")); + + // Set-up application settings configuration (as for QSettings) + // Note: these are default settings which can be customized (see below) + QApplication::setOrganizationName( "salome" ); + QApplication::setApplicationName( "shaper" ); + QApplication::setApplicationVersion( salomeVersion() ); + + // Install Qt debug messages handler + MsgHandler msgHandler; + qInstallMessageHandler( QtxMsgHandler ); + + // Add /plugins dir to the pluins search path for image plugins + QString qtdir = Qtx::qtDir( "plugins" ); + if ( !qtdir.isEmpty() ) + QApplication::addLibraryPath( qtdir ); + + // Add application library path (to search style plugin etc...) + + QString path = SUIT_Tools::addSlash( Qtx::getenv( "GUI_ROOT_DIR" ) ) + "bin/salome"; + QApplication::addLibraryPath( QDir::toNativeSeparators( path ) ); + + // QSurfaceFormat should be set before creation of QApplication, + // so to avoid conflicts beetween SALOME and ParaView QSurfaceFormats we should merge theirs formats + // (see void Qtx::initDefaultSurfaceFormat()) and set the resultant format here. + Qtx::initDefaultSurfaceFormat(); + + // Create Qt application instance: this should be done as early as possible! + // Note: QApplication forces setting locale LC_ALL to system one: setlocale(LC_ALL, ""). + Application app( argc, argv ); + + // Initialize Python (only once) + // Note: Python forces setting locale LC_CTYPE to system one: setlocale(LC_CTYPE, ""). +#ifndef DISABLE_PYCONSOLE + char* py_argv[] = {(char*)""}; + KERNEL_PYTHON::init_python( 1, py_argv ); +#endif + // Create auxiliary resource manager to access application settings + ResourceMgr resMgr; + resMgr.setWorkingMode( ResourceMgr::IgnoreUserValues ); + resMgr.loadLanguage( myAppNameSpace::myLightAppName, "en" ); + resMgr.loadLanguage( myAppNameSpace::myAppName, "en" ); + resMgr.loadLanguage( "Session" ); + + // Set-up application settings configuration possible customized via resources + if ( resMgr.customName() != myAppNameSpace::myAppName ) { + QApplication::setApplicationName( resMgr.customName() ); + QApplication::setApplicationVersion( resMgr.version() ); + } + + // Force default "C" locale if requested via user's preferences + // Note: this does not change whole application locale (changed via setlocale() function), + // but only affects GUI behavior + resMgr.setWorkingMode( ResourceMgr::AllowUserValues ); // we must take into account user preferences + if ( resMgr.booleanValue( "language", "locale", true ) ) + QLocale::setDefault( QLocale::c() ); + resMgr.setWorkingMode( ResourceMgr::IgnoreUserValues ); + + bool isGUI = boolCmdOption( "--show-desktop", "--hide-desktop", true ); // true by default + bool isSplash = boolCmdOption( "--show-splash", "--hide-splash", true ); // true by default + isSplash = false; + // Show splash screen (only if both the "GUI" and "SPLASH" options are true) + QtxSplash* splash = 0; + if ( isGUI && isSplash ) { + splash = QtxSplash::splash( QPixmap() ); + splash->readSettings( &resMgr ); + if ( splash->pixmap().isNull() ) + splash->setPixmap( resMgr.loadPixmap(myAppNameSpace::myLightAppName, QObject::tr( "ABOUT_SPLASH" ) ) ); + if ( splash->pixmap().isNull() ) { + delete splash; + splash = 0; + } + else { + splash->setOption( "%A", QObject::tr( "APP_NAME" ) ); + splash->setOption( "%V", QObject::tr( "ABOUT_VERSION" ).arg( resMgr.version() ) ); + splash->setOption( "%L", QObject::tr( "ABOUT_LICENSE" ) ); + splash->setOption( "%C", QObject::tr( "ABOUT_COPYRIGHT" ) ); + splash->show(); + QApplication::instance()->processEvents(); + } + } + + // Initialization + int result = -1; + + SUIT_Session* aGUISession = 0; + +#if defined(WIN32) && defined(UNICODE) + char** new_argv = NULL; +#endif + + bool shutdownAll = false; + bool debugExceptions = boolCmdOption( "--no-exception-handler" ) || + resMgr.booleanValue( "launch", "noexcepthandler", false ); + + while ( true ) { + // SUIT_Session creation + aGUISession = new Session(); + + MESSAGE( "creation SUIT_Application" ); + + aGUISession->resourceMgr() = new ResourceMgr( myAppNameSpace::myAppName ); + aGUISession->resourceMgr()->loadLanguage(); + + SalomeApp_Application* aGUIApp = new SalomeApp_Application(); + aGUIApp->setObjectName(myAppNameSpace::myAppName); + aGUISession->insertApplication(aGUIApp); + aGUIApp->start(); + + // Fill the executable name in session + aGUISession->setExecutableAppName(aGUISession->shaperAppName()); + if ( aGUIApp ) + + { +#ifdef USE_SALOME_STYLE + Style_Salome::initialize( aGUIApp->resourceMgr() ); + if ( aGUIApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) ) + Style_Salome::apply(); +#endif // USE_SALOME_STYLE + + if ( !debugExceptions ) + app.setHandler( aGUISession->handler() ); // after loading SalomeApp application + // aGUISession contains SalomeApp_ExceptionHandler + + // Run GUI loop + MESSAGE( "run(): starting the main event loop" ); + + if ( splash ) + splash->finish( aGUIApp->desktop() ); + + result = app.exec(); + + splash = 0; + + if ( result == SUIT_Session::NORMAL ) { + // desktop is explicitly closed by user from GUI + // exit flags says if it's necessary to shutdown all servers + // all session server only + shutdownAll = aGUISession->exitFlags(); + } + + } + break; + delete aGUISession; + aGUISession = 0; + + } + + delete aGUISession; + +#if defined(WIN32) && defined(UNICODE) + delete[] new_argv; +#endif +#ifndef DISABLE_PYCONSOLE + // Finalize Python + if ( Py_IsInitialized() ) + { + PyGILState_Ensure(); + Py_Finalize(); + } +#endif + MESSAGE( "shaper: end" ); + + return result; +} diff --git a/src/ShaperApp/CMakeLists.txt b/src/ShaperApp/CMakeLists.txt new file mode 100644 index 000000000..9da464465 --- /dev/null +++ b/src/ShaperApp/CMakeLists.txt @@ -0,0 +1,244 @@ +# Copyright (C) 2012-2020 CEA/DEN, EDF R&D, CSGROUP +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +INCLUDE(UseQtExt) + +# --- options --- + +# additional include directories +INCLUDE_DIRECTORIES( + ${OpenCASCADE_INCLUDE_DIR} + ${QT_INCLUDES} + ${QWT_INCLUDE_DIR} + ${Boost_INCLUDE_DIRS} + ${PTHREAD_INCLUDE_DIR} + ${PROJECT_BINARY_DIR}/idl + ${PROJECT_SOURCE_DIR}/src/CAM + ${PROJECT_SOURCE_DIR}/src/CASCatch + ${PROJECT_SOURCE_DIR}/src/Event + ${PROJECT_SOURCE_DIR}/src/LightApp + ${PROJECT_SOURCE_DIR}/src/OBJECT + ${PROJECT_SOURCE_DIR}/src/ObjBrowser + ${PROJECT_SOURCE_DIR}/src/Prs + ${PROJECT_SOURCE_DIR}/src/Qtx + ${PROJECT_SOURCE_DIR}/src/STD + ${PROJECT_SOURCE_DIR}/src/SUIT + ${PROJECT_SOURCE_DIR}/src/SVTK + ${PROJECT_SOURCE_DIR}/src/TOOLSGUI + ${PROJECT_SOURCE_DIR}/src/VTKViewer + ${PROJECT_SOURCE_DIR}/src/SalomeApp + ${PROJECT_SOURCE_DIR}/src/ShaperApp + SALOMEDSImplAdapt +) + +IF(SALOME_USE_PYCONSOLE) + INCLUDE_DIRECTORIES( + ${PYTHON_INCLUDE_DIRS} + ${PROJECT_SOURCE_DIR}/tools/PyConsole/src + ${PROJECT_SOURCE_DIR}/tools/PyInterp/src + ) +ENDIF() + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${QT_DEFINITIONS} + ${QWT_DEFINITIONS} + ${OpenCASCADE_DEFINITIONS} + ${BOOST_DEFINITIONS} + -DDISABLE_ORB + -DSHAPER_STANDALONE + #-DDISABLE_PYCONSOLE + ) + +IF(SALOME_USE_PYCONSOLE) + ADD_DEFINITIONS(${PYTHON_DEFINITIONS}) +ENDIF() + +# ---- add static ToolsGUI in SALOMEDSImpl mode ------------------ +# header files / to be processed by moc +SET(ToolsGUI_moc_HEADERS + ${PROJECT_SOURCE_DIR}/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h + ) + +# header files / to install +SET(ToolsGUI_HEADERS ${ToolsGUI_moc_HEADERS} ${ToolsGUI_other_HEADERS}) +# --- resources --- +# resource files / to be processed by lrelease +SET(ToolsGUI_ts_RESOURCES + ${PROJECT_SOURCE_DIR}/src/TOOLSGUI/resources/ToolsGUI_msg_en.ts + ${PROJECT_SOURCE_DIR}/src/TOOLSGUI/resources/ToolsGUI_msg_fr.ts + ${PROJECT_SOURCE_DIR}/src/TOOLSGUI/resources/ToolsGUI_msg_ja.ts +) +# sources / static +SET(ToolsGUI_other_SOURCES + ${PROJECT_SOURCE_DIR}/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx +) +# sources / to compile +SET(ToolsGUI_SOURCES ${ToolsGUI_other_SOURCES} ${ToolsGUI_moc_SOURCES}) + +# ---- add static TOOLSDS in SALOMEDSImpl mode ------------------ +# sources / static +SET(TOOLSDS_SOURCES + ${PROJECT_SOURCE_DIR}/../KERNEL/src/TOOLSDS/SALOMEDS_Tool.cxx + ${PROJECT_SOURCE_DIR}/../KERNEL/src/Utils/Utils_SALOME_Exception.cxx + ${PROJECT_SOURCE_DIR}/../KERNEL/src/Utils/duplicate.cxx + ) + +# ------------------------------------------------------------------ + +# libraries to link to +SET(_link_LIBRARIES + ${QT_LIBRARIES} + ${KERNEL_SalomeDSImpl} + LightApp + ) + +IF(SALOME_USE_VTKVIEWER) + LIST(APPEND _link_LIBRARIES VTKViewer SVTK) +ENDIF() + +IF(SALOME_USE_PYCONSOLE) + LIST(APPEND _link_LIBRARIES PyInterp PyConsole) +ENDIF() + +IF(SALOME_USE_GLVIEWER) + LIST(APPEND _link_LIBRARIES GLViewer) +ENDIF() + +IF(SALOME_USE_PLOT2DVIEWER) + LIST(APPEND _link_LIBRARIES Plot2d) + IF(SALOME_USE_SALOMEOBJECT) + LIST(APPEND _link_LIBRARIES SPlot2d) + ENDIF(SALOME_USE_SALOMEOBJECT) +ENDIF(SALOME_USE_PLOT2DVIEWER) + +IF(SALOME_USE_OCCVIEWER) + LIST(APPEND _link_LIBRARIES OCCViewer) + IF(SALOME_USE_SALOMEOBJECT) + LIST(APPEND _link_LIBRARIES SOCC) + ENDIF(SALOME_USE_SALOMEOBJECT) +ENDIF() + +IF(SALOME_USE_PVVIEWER) + LIST(APPEND _link_LIBRARIES PVViewer) +ENDIF() + +IF(SALOME_USE_SALOMEOBJECT) + LIST(APPEND _link_LIBRARIES SalomeObject) +ENDIF() + +IF(NOT SALOME_LIGHT_ONLY) + LIST(APPEND _link_LIBRARIES SalomeIDLGUI) + LIST(APPEND _link_LIBRARIES ${KERNEL_SalomeContainer}) +ENDIF() + +# --- headers --- + +# header files / to be processed by moc + +SET(_moc_HEADERS ${SalomeCommon_moc_HEADERS}) + +IF(SALOME_USE_PYCONSOLE) + LIST(APPEND _moc_HEADERS ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_NoteBook.h) +ENDIF() + +# header files / no moc processing + +SET(_other_HEADERS ${SalomeCommon_other_HEADERS} + SalomeApp_EngineImpl.h) + +IF(SALOME_USE_PYCONSOLE) + LIST(APPEND _other_HEADERS ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_PyInterp.h) +ENDIF() + +# header files / to install +SET(ShaperApp_HEADERS ${_moc_HEADERS} ${_other_HEADERS}) + +# --- resources --- + +# resource files / to be processed by lrelease +SET(_ts_RESOURCES + resources/ShaperApp_images.ts + resources/ShaperApp_msg_en.ts + resources/ShaperApp_msg_fr.ts + resources/ShaperApp_msg_ja.ts + resources/LightShaperApp_images.ts + resources/LightShaperApp_msg_en.ts + resources/LightShaperApp_msg_fr.ts + resources/LightShaperApp_msg_ja.ts +) + +# resource files / static +SET(_other_RESOURCES + resources/ShaperApp.xml + resources/LightShaperApp.xml + resources/shaper.png +) +SET(SALOME_RESOURCES_FILES + shaper.png +) +# --- sources --- + +# sources / moc wrappings +QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS} ${ToolsGUI_moc_HEADERS}) + +# sources / static + +SET(_other_SOURCES ${SalomeCommon_other_SOURCES} + SalomeApp_EngineImpl.cxx) + +IF(SALOME_USE_PYCONSOLE) + LIST(APPEND _other_SOURCES ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_PyInterp.cxx + ${PROJECT_SOURCE_DIR}/src/SalomeApp/SalomeApp_NoteBook.cxx) +ENDIF() + +# adapter sources for GUI without CORBA +ADD_SUBDIRECTORY(SALOMEDSImplAdapt) + +# sources / to compile +SET(ShaperApp_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${ToolsGUI_SOURCES} ${TOOLSDS_SOURCES} ${SALOMEDSImplAdapt_SOURCES}) + +# --- scripts --- + +# scripts / bin +SET(_bin_SCRIPTS + ${PROJECT_SOURCE_DIR}/src/SalomeApp/addvars2notebook.py +) + +# scripts / python +SET(_py_SCRIPTS + ${PROJECT_SOURCE_DIR}/src/SalomeApp/salome_pluginsmanager.py +) + +# --- rules --- + +ADD_LIBRARY(ShaperApp ${ShaperApp_SOURCES}) +TARGET_LINK_LIBRARIES(ShaperApp ${_link_LIBRARIES}) +INSTALL(TARGETS ShaperApp EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +INSTALL(FILES ${ShaperApp_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}") + +INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA}) + +SALOME_INSTALL_SCRIPTS("${_py_SCRIPTS}" ${SALOME_INSTALL_PYTHON}) +SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON}) + + + diff --git a/src/ShaperApp/SALOMEDSImplAdapt/CMakeLists.txt b/src/ShaperApp/SALOMEDSImplAdapt/CMakeLists.txt new file mode 100644 index 000000000..a654912b8 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/CMakeLists.txt @@ -0,0 +1,34 @@ +# Copyright (C) 2012-2020 CEA/DEN, EDF R&D, CSGROUP +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + + +SET(SALOMEDSImplAdapt_SOURCES + ${PROJECT_SOURCE_DIR}/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_ChildIterator.cxx + ${PROJECT_SOURCE_DIR}/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponent.cxx + ${PROJECT_SOURCE_DIR}/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponentIterator.cxx + ${PROJECT_SOURCE_DIR}/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SObject.cxx + ${PROJECT_SOURCE_DIR}/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_StudyBuilder.cxx + ${PROJECT_SOURCE_DIR}/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_Study.cxx + ${PROJECT_SOURCE_DIR}/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseBuilder.cxx + ${PROJECT_SOURCE_DIR}/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseIterator.cxx + ) + +# export for Shaper application +SET(SALOMEDSImplAdapt_SOURCES ${SALOMEDSImplAdapt_SOURCES} PARENT_SCOPE) + diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImpl.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImpl.hxx new file mode 100644 index 000000000..b25596c7f --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImpl.hxx @@ -0,0 +1,68 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef SALOMEDSIMPL_HXX__ +#define SALOMEDSIMPL_HXX__ + +#include "SALOMEDSImpl_AttributeComment.hxx" +#include "SALOMEDSImpl_AttributeDrawable.hxx" +#include "SALOMEDSImpl_AttributeExpandable.hxx" +#include "SALOMEDSImpl_AttributeExternalFileDef.hxx" +#include "SALOMEDSImpl_AttributeFileType.hxx" +#include "SALOMEDSImpl_AttributeFlags.hxx" +#include "SALOMEDSImpl_AttributeGraphic.hxx" +#include "SALOMEDSImpl_AttributeIOR.hxx" +#include "SALOMEDSImpl_AttributeInteger.hxx" +#include "SALOMEDSImpl_AttributeLocalID.hxx" +#include "SALOMEDSImpl_AttributeName.hxx" +#include "SALOMEDSImpl_AttributeOpened.hxx" +#include "SALOMEDSImpl_AttributePersistentRef.hxx" +#include "SALOMEDSImpl_AttributePixMap.hxx" +#include "SALOMEDSImpl_AttributePythonObject.hxx" +#include "SALOMEDSImpl_AttributeReal.hxx" +#include "SALOMEDSImpl_AttributeSelectable.hxx" +#include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx" +#include "SALOMEDSImpl_AttributeSequenceOfReal.hxx" +#include "SALOMEDSImpl_AttributeStudyProperties.hxx" +#include "SALOMEDSImpl_AttributeTableOfInteger.hxx" +#include "SALOMEDSImpl_AttributeTableOfReal.hxx" +#include "SALOMEDSImpl_AttributeTableOfString.hxx" +#include "SALOMEDSImpl_AttributeTarget.hxx" +#include "SALOMEDSImpl_AttributeTextColor.hxx" +#include "SALOMEDSImpl_AttributeTextHighlightColor.hxx" +#include "SALOMEDSImpl_AttributeTreeNode.hxx" +#include "SALOMEDSImpl_AttributeUserID.hxx" +#include "SALOMEDSImpl_AttributeParameter.hxx" +#include "SALOMEDSImpl_AttributeString.hxx" +#include "SALOMEDSImpl_ChildIterator.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" +#include "SALOMEDSImpl_GenericVariable.hxx" +#include "SALOMEDSImpl_SComponent.hxx" +#include "SALOMEDSImpl_SComponentIterator.hxx" +#include "SALOMEDSImpl_SObject.hxx" +#include "SALOMEDSImpl_Study.hxx" +#include "SALOMEDSImpl_StudyBuilder.hxx" +#include "SALOMEDSImpl_UseCaseBuilder.hxx" +#include "SALOMEDSImpl_UseCaseIterator.hxx" +#include "SALOMEDSImpl_IParameters.hxx" + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt.hxx new file mode 100644 index 000000000..09488f247 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt.hxx @@ -0,0 +1,37 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef SALOMEDSIMPL_ADAPT_HXX +#define SALOMEDSIMPL_ADAPT_HXX + +#include "SALOMEDSImplAdaptTypes.hxx" + +#include "SALOMEDSImplAdapt_SObject.hxx" +#include "SALOMEDSImplAdapt_SComponent.hxx" +#include "SALOMEDSImplAdapt_StudyBuilder.hxx" +#include "SALOMEDSImplAdapt_UseCaseBuilder.hxx" +#include "SALOMEDSImplAdapt_Study.hxx" +#include "SALOMEDSImplAdapt_UseCaseIterator.hxx" +#include "SALOMEDSImplAdapt_SComponentIterator.hxx" +#include "SALOMEDSImplAdapt_ChildIterator.hxx" + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdaptCopyAttribute.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdaptCopyAttribute.hxx new file mode 100644 index 000000000..c622e325a --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdaptCopyAttribute.hxx @@ -0,0 +1,79 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef SALOMEDSIMPL_ADAPT_CopyAttribute_HXX +#define SALOMEDSIMPL_ADAPT_CopyAttribute_HXX + +#include "SALOMEDSImplAdapt_definitions.hxx" +#include +#include "SALOMEDSImplAdaptTypes.hxx" + +namespace{ + +#define __CreateAttributeClass(className) if (strcmp(aTypeOfAttribute.c_str(), #className) == 0) { \ + anAttr = _PTR(className)( new _CLASS(className)); \ +} + +#define __CreateGenerictAttributeClass \ + __CreateAttributeClass(AttributeReal) \ + __CreateAttributeClass(AttributeInteger) \ + __CreateAttributeClass(AttributeSequenceOfReal) \ + __CreateAttributeClass(AttributeSequenceOfInteger) \ + __CreateAttributeClass(AttributeName) \ + __CreateAttributeClass(AttributeComment) \ + __CreateAttributeClass(AttributeIOR) \ + __CreateAttributeClass(AttributePixMap) \ + __CreateAttributeClass(AttributeLocalID) \ + __CreateAttributeClass(AttributeTableOfInteger) \ + __CreateAttributeClass(AttributeTableOfReal) \ + __CreateAttributeClass(AttributeTableOfString) \ + __CreateAttributeClass(AttributePythonObject) \ + __CreateAttributeClass(AttributePersistentRef) \ + __CreateAttributeClass(AttributeDrawable) \ + __CreateAttributeClass(AttributeSelectable) \ + __CreateAttributeClass(AttributeExpandable) \ + __CreateAttributeClass(AttributeOpened) \ + __CreateAttributeClass(AttributeTextColor) \ + __CreateAttributeClass(AttributeTextHighlightColor) \ + __CreateAttributeClass(AttributeTarget) \ + __CreateAttributeClass(AttributeStudyProperties) \ + __CreateAttributeClass(AttributeExternalFileDef) \ + __CreateAttributeClass(AttributeFileType) \ + __CreateAttributeClass(AttributeFlags) \ + __CreateAttributeClass(AttributeGraphic) \ + __CreateAttributeClass(AttributeTreeNode) \ + __CreateAttributeClass(AttributeUserID) \ + __CreateAttributeClass(AttributeParameter) \ + __CreateAttributeClass(AttributeString) + + inline _PTR(GenericAttribute) copyAttribute(_CLASS(GenericAttribute) * aFilledAttr) + { + _PTR(GenericAttribute) anAttr; + std::string aTypeOfAttribute = aFilledAttr->GetClassType(); + __CreateGenerictAttributeClass + // fill using implicit-defined copy assignent operator + *anAttr = *aFilledAttr; + return anAttr; + } +} + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdaptTypes.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdaptTypes.hxx new file mode 100644 index 000000000..7eb9d9838 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdaptTypes.hxx @@ -0,0 +1,63 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef SALOMEDSIMPL_ADAPT_TYPES_HXX +#define SALOMEDSIMPL_ADAPT_TYPES_HXX + +#include "SALOMEDSImplAdapt_definitions.hxx" +#include "SALOMEDSImpl.hxx" + +typedef SALOMEDSImpl_AttributeComment SALOMEDSImplAdapt_AttributeComment; +typedef SALOMEDSImpl_AttributeDrawable SALOMEDSImplAdapt_AttributeDrawable; +typedef SALOMEDSImpl_AttributeExpandable SALOMEDSImplAdapt_AttributeExpandable; +typedef SALOMEDSImpl_AttributeExternalFileDef SALOMEDSImplAdapt_AttributeExternalFileDef; +typedef SALOMEDSImpl_AttributeFileType SALOMEDSImplAdapt_AttributeFileType; +typedef SALOMEDSImpl_AttributeFlags SALOMEDSImplAdapt_AttributeFlags; +typedef SALOMEDSImpl_AttributeGraphic SALOMEDSImplAdapt_AttributeGraphic; +typedef SALOMEDSImpl_AttributeIOR SALOMEDSImplAdapt_AttributeIOR; +typedef SALOMEDSImpl_AttributeInteger SALOMEDSImplAdapt_AttributeInteger; +typedef SALOMEDSImpl_AttributeLocalID SALOMEDSImplAdapt_AttributeLocalID; +typedef SALOMEDSImpl_AttributeName SALOMEDSImplAdapt_AttributeName; +typedef SALOMEDSImpl_AttributeOpened SALOMEDSImplAdapt_AttributeOpened; +typedef SALOMEDSImpl_AttributePersistentRef SALOMEDSImplAdapt_AttributePersistentRef; +typedef SALOMEDSImpl_AttributePixMap SALOMEDSImplAdapt_AttributePixMap; +typedef SALOMEDSImpl_AttributePythonObject SALOMEDSImplAdapt_AttributePythonObject; +typedef SALOMEDSImpl_AttributeReal SALOMEDSImplAdapt_AttributeReal; +typedef SALOMEDSImpl_AttributeSelectable SALOMEDSImplAdapt_AttributeSelectable; +typedef SALOMEDSImpl_AttributeSequenceOfInteger SALOMEDSImplAdapt_AttributeSequenceOfInteger; +typedef SALOMEDSImpl_AttributeSequenceOfReal SALOMEDSImplAdapt_AttributeSequenceOfReal; +typedef SALOMEDSImpl_AttributeStudyProperties SALOMEDSImplAdapt_AttributeStudyProperties; +typedef SALOMEDSImpl_AttributeTableOfInteger SALOMEDSImplAdapt_AttributeTableOfInteger; +typedef SALOMEDSImpl_AttributeTableOfReal SALOMEDSImplAdapt_AttributeTableOfReal; +typedef SALOMEDSImpl_AttributeTableOfString SALOMEDSImplAdapt_AttributeTableOfString; +typedef SALOMEDSImpl_AttributeTarget SALOMEDSImplAdapt_AttributeTarget; +typedef SALOMEDSImpl_AttributeTextColor SALOMEDSImplAdapt_AttributeTextColor; +typedef SALOMEDSImpl_AttributeTextHighlightColor SALOMEDSImplAdapt_AttributeTextHighlightColor; +typedef SALOMEDSImpl_AttributeTreeNode SALOMEDSImplAdapt_AttributeTreeNode; +typedef SALOMEDSImpl_AttributeUserID SALOMEDSImplAdapt_AttributeUserID; +typedef SALOMEDSImpl_AttributeParameter SALOMEDSImplAdapt_AttributeParameter; +typedef SALOMEDSImpl_AttributeString SALOMEDSImplAdapt_AttributeString; +typedef SALOMEDSImpl_GenericAttribute SALOMEDSImplAdapt_GenericAttribute; +typedef SALOMEDSImpl_GenericVariable SALOMEDSImplAdapt_GenericVariable; +typedef SALOMEDSImpl_IParameters SALOMEDSImplAdapt_IParameters; + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_ChildIterator.cxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_ChildIterator.cxx new file mode 100644 index 000000000..00fd51155 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_ChildIterator.cxx @@ -0,0 +1,45 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + + +#include "SALOMEDSImplAdapt_ChildIterator.hxx" +#include "SALOMEDSImplAdapt_SObject.hxx" + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_ChildIterator::SALOMEDSImplAdapt_ChildIterator(const SALOMEDSImpl_SObject& theObject): + SALOMEDSImpl_ChildIterator(theObject){} + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_ChildIterator* SALOMEDSImplAdapt_ChildIterator::GetPersistentCopy() const +{ + SALOMEDSImplAdapt_ChildIterator* itr = new SALOMEDSImplAdapt_ChildIterator(); + itr->_it = _it; + itr->_so = _so; + return itr; +} + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_SObject SALOMEDSImplAdapt_ChildIterator::GetValue() { + return SALOMEDSImplAdapt_SObject(SALOMEDSImpl_ChildIterator::Value()); +} + + diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_ChildIterator.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_ChildIterator.hxx new file mode 100644 index 000000000..50c85e582 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_ChildIterator.hxx @@ -0,0 +1,46 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +//======================================================================================= +// file: SALOMEDSImplAdapt_ChildIterator.hxx +// purpose: adaper for class SALOMEDSImpl_ChildIterator in Salome GUI without CORBA +//======================================================================================= + +#ifndef SALOMEDSIMPL_ADAPT_ChildIterator_HXX +#define SALOMEDSIMPL_ADAPT_ChildIterator_HXX + +#include "SALOMEDSImpl_ChildIterator.hxx" + +class SALOMEDSImplAdapt_SObject; + +class SALOMEDSIMPL_EXPORT SALOMEDSImplAdapt_ChildIterator: public SALOMEDSImpl_ChildIterator +{ +public: + SALOMEDSImplAdapt_ChildIterator() = default; + explicit SALOMEDSImplAdapt_ChildIterator(const SALOMEDSImpl_SObject& theObject); + virtual ~SALOMEDSImplAdapt_ChildIterator() = default; + + SALOMEDSImplAdapt_ChildIterator* GetPersistentCopy() const; + SALOMEDSImplAdapt_SObject GetValue(); +}; + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponent.cxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponent.cxx new file mode 100644 index 000000000..7d51b9965 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponent.cxx @@ -0,0 +1,43 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "SALOMEDSImplAdapt_SComponent.hxx" + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_SComponent::SALOMEDSImplAdapt_SComponent(const SALOMEDSImpl_SComponent& theSCO) + :SALOMEDSImpl_SComponent(theSCO), SALOMEDSImplAdapt_SObject() +{} + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_SComponent::SALOMEDSImplAdapt_SComponent(){} + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_SComponent* SALOMEDSImplAdapt_SComponent::GetPersistentCopy() const +{ + SALOMEDSImplAdapt_SComponent* sco = new SALOMEDSImplAdapt_SComponent(); + sco->_lab = _lab; + sco->_name = _name; + sco->_type = _type; + sco->_value = _value; + return sco; +} + diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponent.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponent.hxx new file mode 100644 index 000000000..5f31d3645 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponent.hxx @@ -0,0 +1,45 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +//======================================================================================= +// file: SALOMEDSImplAdapt_SComponent.hxx +// purpose: adaper for class SALOMEDSImpl_SComponent in Salome GUI without CORBA +//======================================================================================= + +#ifndef SALOMEDSIMPL_ADAPT_SComponent_HXX +#define SALOMEDSIMPL_ADAPT_SComponent_HXX + +#include "SALOMEDSImpl_SComponent.hxx" +#include "SALOMEDSImplAdapt_SObject.hxx" + +class SALOMEDSImplAdapt_SComponent: public virtual SALOMEDSImpl_SComponent, + public virtual SALOMEDSImplAdapt_SObject +{ +public: + SALOMEDSImplAdapt_SComponent(const SALOMEDSImpl_SComponent& theSCO); + SALOMEDSImplAdapt_SComponent(); + virtual ~SALOMEDSImplAdapt_SComponent() = default; + + SALOMEDSImplAdapt_SComponent* GetPersistentCopy() const; +}; + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponentIterator.cxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponentIterator.cxx new file mode 100644 index 000000000..266237b5c --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponentIterator.cxx @@ -0,0 +1,44 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "SALOMEDSImplAdapt_SComponentIterator.hxx" +#include "SALOMEDSImplAdapt_SComponent.hxx" + + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_SComponentIterator::SALOMEDSImplAdapt_SComponentIterator(DF_Document* doc): + SALOMEDSImpl_SComponentIterator(doc){} + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_SComponentIterator* SALOMEDSImplAdapt_SComponentIterator::GetPersistentCopy() const +{ + SALOMEDSImplAdapt_SComponentIterator* itr = new SALOMEDSImplAdapt_SComponentIterator(); + itr->_lab = _lab; + itr->_it = _it; + return itr; +} + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_SComponent SALOMEDSImplAdapt_SComponentIterator::GetValue() { + return SALOMEDSImplAdapt_SComponent(SALOMEDSImpl_SComponentIterator::Value()); +} + diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponentIterator.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponentIterator.hxx new file mode 100644 index 000000000..f94a81493 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SComponentIterator.hxx @@ -0,0 +1,46 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +//======================================================================================= +// file: SALOMEDSImplAdapt_SComponentIterator.hxx +// purpose: adaper for class SALOMEDSImpl_SComponentIterator in Salome GUI without CORBA +//======================================================================================= + +#ifndef SALOMEDSIMPL_ADAPT_SComponentIterator_HXX +#define SALOMEDSIMPL_ADAPT_SComponentIterator_HXX + +#include "SALOMEDSImpl_SComponentIterator.hxx" + +class SALOMEDSImplAdapt_SComponent; + +class SALOMEDSIMPL_EXPORT SALOMEDSImplAdapt_SComponentIterator: public SALOMEDSImpl_SComponentIterator +{ +public: + SALOMEDSImplAdapt_SComponentIterator() = default; + explicit SALOMEDSImplAdapt_SComponentIterator(DF_Document* doc); + virtual ~SALOMEDSImplAdapt_SComponentIterator() = default; + + SALOMEDSImplAdapt_SComponentIterator* GetPersistentCopy() const; + SALOMEDSImplAdapt_SComponent GetValue(); +}; + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SObject.cxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SObject.cxx new file mode 100644 index 000000000..3db3a4b67 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SObject.cxx @@ -0,0 +1,61 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "SALOMEDSImplAdapt_SObject.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" +#include "SALOMEDSImplAdaptCopyAttribute.hxx" + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_SObject::SALOMEDSImplAdapt_SObject(const SALOMEDSImpl_SObject& theSObject): + SALOMEDSImpl_SObject(theSObject){} + +bool SALOMEDSImplAdapt_SObject::SALOMEDSImplAdapt_SObject::ReferencedObject(_PTR(SObject) & theObject) const +{ + SALOMEDSImpl_SObject anObj; + bool aResult = SALOMEDSImpl_SObject::ReferencedObject(anObj); + if(aResult){ + theObject = _PTR(SObject)(new _CLASS(SObject)(anObj)); + } + return aResult; +} + +bool SALOMEDSImplAdapt_SObject::FindAttribute( _PTR(GenericAttribute) & anAttr, const std::string aTypeOfAttribute) +{ + DF_Attribute* aFilledAttr = nullptr; + bool isFound = SALOMEDSImpl_SObject::FindAttribute(aFilledAttr, aTypeOfAttribute); + if(isFound){ + anAttr = copyAttribute(_CAST(GenericAttribute, aFilledAttr)); + return true; + } + return false; +} + +SALOMEDSImplAdapt_SObject* SALOMEDSImplAdapt_SObject::GetPersistentCopy() const +{ + SALOMEDSImplAdapt_SObject* so = new SALOMEDSImplAdapt_SObject; + so->_lab = _lab; + so->_name = _name; + so->_type = _type; + so->_value = _value; + return so; +} +// ---------------------------------------------------------------------------------------- diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SObject.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SObject.hxx new file mode 100644 index 000000000..cdcf5c61c --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_SObject.hxx @@ -0,0 +1,50 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +//======================================================================================= +// file: SALOMEDSImplAdapt_SObject.hxx +// purpose: adaper for class SALOMEDSImpl_SObject in Salome GUI without CORBA +//======================================================================================= + +#ifndef SALOMEDSIMPL_ADAPT_SObject_HXX +#define SALOMEDSIMPL_ADAPT_SObject_HXX + +#include "SALOMEDSImplAdapt_definitions.hxx" +#include "SALOMEDSImpl_SObject.hxx" +#include + +class SALOMEDSImpl_GenericAttribute; +typedef SALOMEDSImpl_GenericAttribute SALOMEDSImplAdapt_GenericAttribute; + +class SALOMEDSIMPL_EXPORT SALOMEDSImplAdapt_SObject: public virtual SALOMEDSImpl_SObject +{ +public: + SALOMEDSImplAdapt_SObject() = default; + SALOMEDSImplAdapt_SObject(const SALOMEDSImpl_SObject& theSObject); + virtual ~SALOMEDSImplAdapt_SObject() = default; + + bool ReferencedObject(_PTR(SObject) & theObject) const; + bool FindAttribute( _PTR(GenericAttribute) & anAttr, const std::string aTypeOfAttribute); + SALOMEDSImplAdapt_SObject* GetPersistentCopy() const; +}; + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_Study.cxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_Study.cxx new file mode 100644 index 000000000..e9bf2d37a --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_Study.cxx @@ -0,0 +1,159 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "SALOMEDSImplAdapt_Study.hxx" +#include "SALOMEDSImplAdapt_ChildIterator.hxx" +#include "SALOMEDSImplAdapt_SComponentIterator.hxx" +#include "SALOMEDSImplAdapt_StudyBuilder.hxx" +#include "SALOMEDSImplAdapt_SObject.hxx" +#include "SALOMEDSImplAdapt_UseCaseBuilder.hxx" +#include "SALOMEDSImplAdapt_SComponent.hxx" +#include "SALOMEDSImpl_GenericVariable.hxx" + +typedef SALOMEDSImpl_GenericVariable SALOMEDSImplAdapt_GenericVariable; + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_Study::SALOMEDSImplAdapt_Study() + :_myNewBuilder(nullptr), _myUseCaseBuilder(nullptr) +{} + +// ---------------------------------------------------------------------------------------- +_PTR(SObject) SALOMEDSImplAdapt_Study::FindObjectID(const QString& anObjectID) +{ + auto aFound = SALOMEDSImpl_Study::FindObjectID(anObjectID.toUtf8().data()); + if(!aFound.IsNull()) + return _PTR(SObject) (new _CLASS(SObject)(aFound)); + return nullptr; +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_Study::CanOpen(const std::string & url) +{ + SALOMEDSImpl_Study aTmp; + return aTmp.Open(url); +} + +// ---------------------------------------------------------------------------------------- +_CLASS(StudyBuilder)* SALOMEDSImplAdapt_Study::NewBuilder() +{ + _myNewBuilder = std::unique_ptr<_CLASS(StudyBuilder)> + (new _CLASS(StudyBuilder)(SALOMEDSImpl_Study::NewBuilder())); + return _myNewBuilder.get(); +} + +// ---------------------------------------------------------------------------------------- +_PTR(SComponent) SALOMEDSImplAdapt_Study::FindComponent (const QString& aComponentName) +{ + return _PTR(SComponent)(_CLASS(SComponent)( + SALOMEDSImpl_Study::FindComponent(aComponentName.toUtf8().data()))); +} + +// ---------------------------------------------------------------------------------------- +_PTR(SComponent) SALOMEDSImplAdapt_Study::FindComponentID(const QString& aComponentID){ + return _PTR(SComponent)(_CLASS(SComponent)( + SALOMEDSImpl_Study::FindComponentID(aComponentID.toUtf8().data()))); +} + +// ---------------------------------------------------------------------------------------- +std::vector<_PTR(SObject)> SALOMEDSImplAdapt_Study::FindDependances(const _PTR(SObject) & obj) +{ + std::vector<_PTR(SObject)> aResult; + if(obj){ + auto aRefs = SALOMEDSImpl_Study::FindDependances( + *std::dynamic_pointer_cast(obj) ); + for(auto aVal : aRefs) + aResult.push_back(_PTR(SObject)(new _CLASS(SObject) (aVal))); + } + return aResult; +} + +// ---------------------------------------------------------------------------------------- +_PTR(ChildIterator) SALOMEDSImplAdapt_Study::NewChildIterator(const _PTR(SObject)& aSO) +{ + if(aSO) + return _PTR(ChildIterator) (_CLASS(ChildIterator)( + *std::dynamic_pointer_cast(aSO) + ).GetPersistentCopy()); + return nullptr; +} + +// ---------------------------------------------------------------------------------------- +_CLASS(UseCaseBuilder)* SALOMEDSImplAdapt_Study::GetUseCaseBuilder() +{ + _myUseCaseBuilder = std::unique_ptr<_CLASS(UseCaseBuilder)>( + new _CLASS(UseCaseBuilder)(SALOMEDSImpl_Study::GetUseCaseBuilder())); + return _myUseCaseBuilder.get(); +} + +// ---------------------------------------------------------------------------------------- +_PTR(SComponentIterator) SALOMEDSImplAdapt_Study::GetNewComponentIterator() +{ + return _PTR(SComponentIterator)( new SALOMEDSImplAdapt_SComponentIterator(GetDocument())); +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_Study::IsReal(const std::string & aName) +{ + return IsTypeOf(aName, _CLASS(GenericVariable)::REAL_VAR); +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_Study::IsInteger(const std::string & aName) +{ + return IsTypeOf(aName, _CLASS(GenericVariable)::INTEGER_VAR); +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_Study::IsString(const std::string & aName) +{ + return IsTypeOf(aName, _CLASS(GenericVariable)::STRING_VAR); +} + +// ---------------------------------------------------------------------------------------- +int SALOMEDSImplAdapt_Study::GetInteger( const std::string & aName ) +{ + return GetVariableValue(aName); +} + +// ---------------------------------------------------------------------------------------- +double SALOMEDSImplAdapt_Study::GetReal( const std::string & aName) +{ + return GetVariableValue(aName); +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_Study::IsBoolean(const std::string & aName) +{ + return IsTypeOf(aName, _CLASS(GenericVariable)::BOOLEAN_VAR); +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_Study::GetBoolean(const std::string & aName) +{ + return GetVariableValue(aName); +} + +// ---------------------------------------------------------------------------------------- +std::string SALOMEDSImplAdapt_Study::GetString(const std::string & aName) +{ + return GetStringVariableValue(aName); +} diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_Study.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_Study.hxx new file mode 100644 index 000000000..28658e9a5 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_Study.hxx @@ -0,0 +1,77 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +//======================================================================================= +// file: SALOMEDSImplAdapt_Study.hxx +// purpose: adaper for class SALOMEDSImpl_Study in Salome GUI without CORBA +//======================================================================================= + +#ifndef SALOMEDSIMPL_ADAPT_Study_HXX +#define SALOMEDSIMPL_ADAPT_Study_HXX + +#include "SALOMEDSImplAdapt_definitions.hxx" +#include "SALOMEDSImpl_Study.hxx" +#include "SALOMEDSImplAdapt_StudyBuilder.hxx" +#include "SALOMEDSImplAdapt_UseCaseBuilder.hxx" + +#include +#include + +class SALOMEDSImplAdapt_ChildIterator; +class SALOMEDSImplAdapt_SComponentIterator; +class SALOMEDSImplAdapt_SObject; +class SALOMEDSImplAdapt_SComponent; + +class SALOMEDSIMPL_EXPORT SALOMEDSImplAdapt_Study: public SALOMEDSImpl_Study +{ +public: + SALOMEDSImplAdapt_Study(); + virtual ~SALOMEDSImplAdapt_Study() = default; + + _CLASS(StudyBuilder)* NewBuilder(); + _CLASS(UseCaseBuilder)* GetUseCaseBuilder(); + + _PTR(SObject) FindObjectID(const QString& anObjectID); + _PTR(SComponent) FindComponent(const QString& aComponentName); + _PTR(SComponent) FindComponentID(const QString& aComponentID); + _PTR(ChildIterator) NewChildIterator(const _PTR(SObject)& aSO); + _PTR(SComponentIterator) GetNewComponentIterator(); + + std::vector<_PTR(SObject)> FindDependances(const _PTR(SObject) & obj); + + bool CanOpen(const std::string & url); + bool IsReal(const std::string & aName); + bool IsInteger(const std::string & aName); + bool IsString(const std::string & aName); + bool IsBoolean(const std::string & aName); + inline bool Modified(){return IsModified();} + int GetInteger( const std::string & aName); + bool GetBoolean(const std::string & aName); + std::string GetString(const std::string & aName); + double GetReal( const std::string & aName); + +private: + std::unique_ptr<_CLASS(StudyBuilder)> _myNewBuilder; + std::unique_ptr<_CLASS(UseCaseBuilder)> _myUseCaseBuilder; +}; + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_StudyBuilder.cxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_StudyBuilder.cxx new file mode 100644 index 000000000..7ab58108d --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_StudyBuilder.cxx @@ -0,0 +1,105 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + + +#include "SALOMEDSImplAdapt_StudyBuilder.hxx" +#include "SALOMEDSImplAdapt_SObject.hxx" +#include "SALOMEDSImplAdapt_SComponent.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" +#include "SALOMEDSImplAdaptCopyAttribute.hxx" + + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_StudyBuilder::SALOMEDSImplAdapt_StudyBuilder(SALOMEDSImpl_StudyBuilder* theBuilder): + SALOMEDSImpl_StudyBuilder(theBuilder->GetOwner()){} + +// ---------------------------------------------------------------------------------------- +void SALOMEDSImplAdapt_StudyBuilder::RemoveReference(_PTR(SObject) & aSObject){ + if(aSObject) + SALOMEDSImpl_StudyBuilder::RemoveReference(*std::dynamic_pointer_cast(aSObject)); +} + +// ---------------------------------------------------------------------------------------- +_PTR(SComponent) SALOMEDSImplAdapt_StudyBuilder::NewComponent (const QString& ComponentDataType){ + return _PTR(SComponent)(_CLASS(SComponent)( + SALOMEDSImpl_StudyBuilder::NewComponent(ComponentDataType.toUtf8().data()))); +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_StudyBuilder::SetName(const _PTR(SComponent)& theSO, const std::string& theValue){ + if(theSO){ + return SALOMEDSImpl_StudyBuilder::SetName(*std::dynamic_pointer_cast(theSO), theValue); + } + return false; +} + +// ---------------------------------------------------------------------------------------- +_PTR(GenericAttribute) SALOMEDSImplAdapt_StudyBuilder::FindOrCreateAttribute(const _PTR(SComponent)& anObject, + const std::string& aTypeOfAttribute){ + if(anObject) + { + auto aResult = SALOMEDSImpl_StudyBuilder::FindOrCreateAttribute( + *std::dynamic_pointer_cast(anObject), aTypeOfAttribute); + if(aResult){ + return copyAttribute(_CAST(GenericAttribute, aResult)); + } + } + return nullptr; +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_StudyBuilder::DefineComponentInstance(const _PTR(SComponent)& aComponent, const std::string& IOR){ + if(aComponent){ + return SALOMEDSImpl_StudyBuilder::DefineComponentInstance( + *std::dynamic_pointer_cast(aComponent), IOR); + } + return false; +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_StudyBuilder::RemoveObjectWithChildren(const _PTR(SObject) &object){ + if(object) + return SALOMEDSImpl_StudyBuilder::RemoveObjectWithChildren( + *std::dynamic_pointer_cast(object)); + return false; +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_StudyBuilder::RemoveObjectWithChildren(const SALOMEDSImpl_SObject& anObject){ + return SALOMEDSImpl_StudyBuilder::RemoveObjectWithChildren(anObject); +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_StudyBuilder::FindAttribute(const _PTR(SObject)& anObject, + _PTR(GenericAttribute)& anAttribute, + const std::string& aTypeOfAttribute) +{ + DF_Attribute* anAttr = nullptr; + if(anObject){ + bool aResult = SALOMEDSImpl_StudyBuilder::FindAttribute(*std::dynamic_pointer_cast(anObject), + anAttr, aTypeOfAttribute); + anAttribute = _PTR(GenericAttribute)(_CAST(GenericAttribute, anAttr)); + return aResult; + } + return false; +} + diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_StudyBuilder.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_StudyBuilder.hxx new file mode 100644 index 000000000..1a8c00990 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_StudyBuilder.hxx @@ -0,0 +1,65 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +//======================================================================================= +// file: SALOMEDSImplAdapt_StudyBuilder.hxx +// purpose: adaper for class SALOMEDSImpl_StudyBuilder in Salome GUI without CORBA +//======================================================================================= + +#ifndef SALOMEDSIMPL_ADAPT_StudyBuilder_HXX +#define SALOMEDSIMPL_ADAPT_StudyBuilder_HXX + +#include "SALOMEDSImplAdapt_definitions.hxx" +#include "SALOMEDSImpl_StudyBuilder.hxx" + +#include + +class SALOMEDSImpl_SObject; +class SALOMEDSImplAdapt_SObject; +class SALOMEDSImplAdapt_SComponent; +class SALOMEDSImpl_GenericAttribute; +typedef SALOMEDSImpl_GenericAttribute SALOMEDSImplAdapt_GenericAttribute; + +class SALOMEDSIMPL_EXPORT SALOMEDSImplAdapt_StudyBuilder: public SALOMEDSImpl_StudyBuilder +{ +public: + SALOMEDSImplAdapt_StudyBuilder() = default; + explicit SALOMEDSImplAdapt_StudyBuilder(SALOMEDSImpl_StudyBuilder* theBuilder); + virtual ~SALOMEDSImplAdapt_StudyBuilder() = default; + + void RemoveReference(_PTR(SObject) & aSObject); + + _PTR(SComponent) NewComponent (const QString& ComponentDataType); + _PTR(GenericAttribute) FindOrCreateAttribute(const _PTR(SComponent)& anObject, + const std::string& aTypeOfAttribute); + + bool SetName(const _PTR(SComponent)& theSO, const std::string& theValue); + bool DefineComponentInstance(const _PTR(SComponent)& aComponent, const std::string& IOR); + bool RemoveObjectWithChildren(const _PTR(SObject) &object); + bool RemoveObjectWithChildren(const SALOMEDSImpl_SObject& anObject) override; + + bool FindAttribute(const _PTR(SObject)& anObject, + _PTR(GenericAttribute)& anAttribute, + const std::string& aTypeOfAttribute); +}; + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseBuilder.cxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseBuilder.cxx new file mode 100644 index 000000000..f1cb71085 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseBuilder.cxx @@ -0,0 +1,61 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + + + +#include "SALOMEDSImplAdapt_UseCaseBuilder.hxx" +#include "SALOMEDSImplAdapt_UseCaseIterator.hxx" +#include "SALOMEDSImplAdapt_SObject.hxx" + + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_UseCaseBuilder::SALOMEDSImplAdapt_UseCaseBuilder(SALOMEDSImpl_UseCaseBuilder* aCopy): + SALOMEDSImpl_UseCaseBuilder(aCopy){} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_UseCaseBuilder::HasChildren(const _PTR(SObject) & theObject){ + if(theObject) + return SALOMEDSImpl_UseCaseBuilder::HasChildren( + *std::dynamic_pointer_cast(theObject)); + return false; +} + +// ---------------------------------------------------------------------------------------- +bool SALOMEDSImplAdapt_UseCaseBuilder::IsUseCaseNode(const _PTR(SObject) & theObject){ + if(theObject) + return SALOMEDSImpl_UseCaseBuilder::IsUseCaseNode( + *std::dynamic_pointer_cast(theObject)); + return false; +} + +// ---------------------------------------------------------------------------------------- +_PTR(UseCaseIterator) SALOMEDSImplAdapt_UseCaseBuilder::GetUseCaseIterator(const _PTR(SObject) & theObject){ + if(theObject){ + return _PTR(UseCaseIterator)(_CLASS(UseCaseIterator)( + std::unique_ptr( + SALOMEDSImpl_UseCaseBuilder::GetUseCaseIterator( + *std::dynamic_pointer_cast(theObject) + ).GetPersistentCopy()) + ).GetPersistentCopy()); + } + return nullptr; +} diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseBuilder.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseBuilder.hxx new file mode 100644 index 000000000..deb3b0474 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseBuilder.hxx @@ -0,0 +1,50 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +//======================================================================================= +// file: SALOMEDSImplAdapt_UseCaseBuilder.hxx +// purpose: adaper for class SALOMEDSImpl_UseCaseBuilder in Salome GUI without CORBA +//======================================================================================= + +#ifndef SALOMEDSIMPL_ADAPT_UseCaseBuilder_HXX +#define SALOMEDSIMPL_ADAPT_UseCaseBuilder_HXX + +#include "SALOMEDSImpl_UseCaseBuilder.hxx" +#include "SALOMEDSImplAdapt_definitions.hxx" + +class SALOMEDSImplAdapt_UseCaseIterator; +class SALOMEDSImplAdapt_SObject; + + +class SALOMEDSImplAdapt_UseCaseBuilder: public SALOMEDSImpl_UseCaseBuilder +{ +public: + SALOMEDSImplAdapt_UseCaseBuilder() = default; + SALOMEDSImplAdapt_UseCaseBuilder(SALOMEDSImpl_UseCaseBuilder* aCopy); + virtual ~SALOMEDSImplAdapt_UseCaseBuilder() = default; + + bool HasChildren(const _PTR(SObject) & theObject); + bool IsUseCaseNode(const _PTR(SObject) & theObject); + _PTR(UseCaseIterator) GetUseCaseIterator(const _PTR(SObject) & theObject); +}; + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseIterator.cxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseIterator.cxx new file mode 100644 index 000000000..dc49f7102 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseIterator.cxx @@ -0,0 +1,45 @@ + +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + + +#include "SALOMEDSImplAdapt_UseCaseIterator.hxx" +#include "SALOMEDSImplAdapt_SObject.hxx" + +// ---------------------------------------------------------------------------------------- +SALOMEDSImplAdapt_UseCaseIterator::SALOMEDSImplAdapt_UseCaseIterator(const std::unique_ptr refIterator): + SALOMEDSImpl_UseCaseIterator(refIterator.get()){} + +SALOMEDSImplAdapt_UseCaseIterator* SALOMEDSImplAdapt_UseCaseIterator::GetPersistentCopy() const +{ + SALOMEDSImplAdapt_UseCaseIterator* itr = new SALOMEDSImplAdapt_UseCaseIterator(); + itr->_it = _it; + itr->_node = _node; + itr->_guid = _guid; + itr->_levels = _levels; + return itr; +} + +SALOMEDSImplAdapt_SObject SALOMEDSImplAdapt_UseCaseIterator::GetValue() { + return SALOMEDSImplAdapt_SObject(SALOMEDSImpl_UseCaseIterator::Value()); +} +// ---------------------------------------------------------------------------------------- diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseIterator.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseIterator.hxx new file mode 100644 index 000000000..5538fe414 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_UseCaseIterator.hxx @@ -0,0 +1,48 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +//======================================================================================= +// file: SALOMEDSImplAdapt_UseCaseIterator.hxx +// purpose: adaper for class SALOMEDSImpl_UseCaseIterator in Salome GUI without CORBA +//======================================================================================= + +#ifndef SALOMEDSIMPL_ADAPT_UseCaseIterator_HXX +#define SALOMEDSIMPL_ADAPT_UseCaseIterator_HXX + +#include "SALOMEDSImpl_UseCaseIterator.hxx" + +#include + +class SALOMEDSImplAdapt_SObject; + +class SALOMEDSIMPL_EXPORT SALOMEDSImplAdapt_UseCaseIterator: public SALOMEDSImpl_UseCaseIterator +{ +public: + SALOMEDSImplAdapt_UseCaseIterator() = default; + explicit SALOMEDSImplAdapt_UseCaseIterator(const std::unique_ptr refIterator); + virtual ~SALOMEDSImplAdapt_UseCaseIterator() = default; + + SALOMEDSImplAdapt_UseCaseIterator* GetPersistentCopy() const; + SALOMEDSImplAdapt_SObject GetValue(); +}; + +#endif diff --git a/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_definitions.hxx b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_definitions.hxx new file mode 100644 index 000000000..0bd116f34 --- /dev/null +++ b/src/ShaperApp/SALOMEDSImplAdapt/SALOMEDSImplAdapt_definitions.hxx @@ -0,0 +1,83 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef SALOMEDSIMPL_ADAPT_DEF_HXX +#define SALOMEDSIMPL_ADAPT_DEF_HXX + +#ifdef WIN32 +# if defined SALOMEDSIMPL_EXPORTS || defined SalomeDSImpl_EXPORTS +# define SALOMEDSIMPL_EXPORT __declspec( dllexport ) +# else +# define SALOMEDSIMPL_EXPORT __declspec( dllimport ) +# endif +#else +# define SALOMEDSIMPL_EXPORT +#endif + +#include + +template class clt_std_shared_ptr: public std::shared_ptr +{ +public: + clt_std_shared_ptr() {} + clt_std_shared_ptr(std::nullptr_t p): std::shared_ptr(p){} + + template + explicit clt_std_shared_ptr(Y * p) + { + std::shared_ptr::reset(p); + } + + template + explicit clt_std_shared_ptr(const Y & p) + { + std::shared_ptr::reset(p.IsNull()? 0:p.GetPersistentCopy()); + } + + template + clt_std_shared_ptr(clt_std_shared_ptr const & r): + std::shared_ptr(std::dynamic_pointer_cast(r)) + {} + + template + clt_std_shared_ptr & operator=(clt_std_shared_ptr const & r) + { + clt_std_shared_ptr(r).swap(*this); + return *this; + } + + template clt_std_shared_ptr& operator()(Y * p) // Y must be complete + { + if(T* pt = dynamic_cast(p)) + std::shared_ptr::reset(pt); + else + throw std::exception(std::bad_cast()); + return *this; + } + +}; + +#define _CLASS(Class) SALOMEDSImplAdapt_##Class +#define _CAST(Class, ptr_Obj) dynamic_cast<_CLASS(Class)*>(ptr_Obj) +#define _PTR(Class) clt_std_shared_ptr<_CLASS(Class)> + +#endif diff --git a/src/ShaperApp/SalomeApp_EngineImpl.cxx b/src/ShaperApp/SalomeApp_EngineImpl.cxx new file mode 100644 index 000000000..e20ef0e56 --- /dev/null +++ b/src/ShaperApp/SalomeApp_EngineImpl.cxx @@ -0,0 +1,448 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "SalomeApp_EngineImpl.h" +#include "SalomeApp_Application.h" +#include "SalomeApp_Study.h" +#include "SUIT_Session.h" +#include "CAM_Module.h" +#include "LightApp_DataModel.h" + +#include +#include +#include +#include "SALOMEDSImpl_SComponent.hxx" + +#include +#include +#include +#include + +#include + +/*! + Constructor +*/ +SalomeApp_EngineImpl::SalomeApp_EngineImpl( const char* theComponentName ) + : _myKeepFiles( false ), _myComponentName( theComponentName ) +{ + MESSAGE("SalomeApp_EngineImpl::SalomeApp_EngineImpl(): myComponentName = " << + qPrintable( _myComponentName.c_str() ) << ", this = " << this); +} + +/*! + Destructor +*/ +SalomeApp_EngineImpl::~SalomeApp_EngineImpl() +{ + SalomeApp_EngineImplFactory::instance()->removeEngine(_myComponentName); + + MESSAGE("SalomeApp_EngineImpl::~SalomeApp_EngineImpl(): _myComponentName = " << + qPrintable( _myComponentName.c_str() ) << ", this = " << this); +} + +std::map SalomeApp_EngineImpl::_myComponentIORS = +{{"SHAPER", "1efa48dd-ce57-4e7b-a22d-e562b0563ddf"}}; + +SalomeApp_EngineImplFactory::~SalomeApp_EngineImplFactory() +{ + for(auto aEnginePair: _myEnginesMap) + { + if(aEnginePair.second){ + delete aEnginePair.second; + aEnginePair.second = nullptr; + } + } +} + +SALOMEDSImpl_Driver* SalomeApp_EngineImplFactory::GetDriverByType(const std::string& theComponentType) +{ + auto theFatory = instance(); + auto anIt = theFatory->_myEnginesMap.find(theComponentType); + if(anIt != theFatory->_myEnginesMap.end()) + { + if(anIt->second) + return dynamic_cast(anIt->second); + } + return nullptr; +} + +void SalomeApp_EngineImplFactory::removeEngine(const std::string& theComponentName) +{ + _myEnginesMap.erase(theComponentName); +} + +SALOMEDSImpl_Driver* SalomeApp_EngineImplFactory::GetDriverByIOR(const std::string& theIOR) +{ + for(auto aCompIOR : SalomeApp_EngineImpl::getComponentIORS()){ + if(aCompIOR.second == theIOR){ + return GetDriverByType(aCompIOR.first); + } + } + return nullptr; +} + +SalomeApp_EngineImplFactory* SalomeApp_EngineImplFactory::instance() +{ + static std::unique_ptr myFactory(new SalomeApp_EngineImplFactory()); + return myFactory.get(); +} + +SalomeApp_EngineImpl* SalomeApp_EngineImplFactory::makeEngine(const char* theComponentName, bool toCreate) +{ + SalomeApp_EngineImpl* anEngine = nullptr; + auto theFactory = SalomeApp_EngineImplFactory::instance(); + auto myItEngine = theFactory->_myEnginesMap.find(theComponentName); + if(myItEngine != theFactory->_myEnginesMap.end()) + anEngine = myItEngine->second; + // Activating a new engine + if ( toCreate && !anEngine ){ + anEngine = new SalomeApp_EngineImpl(theComponentName); + theFactory->_myEnginesMap[theComponentName] = anEngine; + } + return anEngine; +} + + +std::string SalomeApp_EngineImpl::GetIOR() +{ + return _myComponentIORS[_myComponentName]; +} + +SALOMEDSImpl_TMPFile *SalomeApp_EngineImpl::Save(const SALOMEDSImpl_SComponent& theComponent, const std::string& theURL, + long& theStreamLength, bool isMultiFile ) +{ + SALOMEDSImpl_Tool::TMPFile *aStreamFile = nullptr; + + if (theComponent.IsNull()) + return nullptr; + + // Component type + std::string componentName (const_cast(&theComponent)->ComponentDataType()); + + // Error somewhere outside - Save() called with wrong SComponent instance + if ( _myComponentName != componentName ) + return nullptr; + + // Get a temporary directory to store a file + //std::string aTmpDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); + + bool manuallySaved = false; + + if ( GetListOfFiles(0).empty() ) // 0 means persistence file + { + + // Save was probably called from outside GUI, so SetListOfFiles was not called! + // Try to get list of files from directly from data model + + MESSAGE("SalomeApp_EngineImpl::Save(): _myComponentName = " << + qPrintable( _myComponentName.c_str() ) << + "it seems Save() was called from outside GUI" ); + + // - Get app + SalomeApp_Application* app = + dynamic_cast(SUIT_Session::session()->activeApplication()); + if ( !app ) + return nullptr; + + // - Get study + SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); + + if ( !study ) + return nullptr; + QString url = QString::fromStdString(study->studyDS()->URL()); + + // - Get module + CAM_Module* module = app->module( SalomeApp_Application::moduleTitle( componentName.c_str() ) ); + if ( !module ) // load module??? + return nullptr; + // - Get data model + LightApp_DataModel* dataModel = dynamic_cast( module->dataModel() ); + if ( !dataModel ) + return nullptr; + // - Save data files + QStringList dataFiles; + // we use 'url' instead of 'theURL' as latter normally contains path to the tmp dir, + // but not actual study's URL + dataModel->saveAs( url, study, dataFiles ); + std::vector names; + foreach ( QString name, dataFiles ) { + if ( !name.isEmpty() ) + names.push_back(name.toUtf8().data()); + } + SetListOfFiles( 0, names ); // 0 means persistence file + manuallySaved = true; + } + + // Get a temporary directory to store a file + //std::string aTmpDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); + + // listOfFiles must contain temporary directory name in its first item + // and names of files (relatively the temporary directory) in the others + ListOfFiles listOfFiles = GetListOfFiles( 0 ); // 0 means persistence file + const int n = (int)listOfFiles.size() - 1; //!< TODO: conversion from size_t to int + + if (n > 0) { // there are some files, containing persistent data of the component + std::string aTmpDir = listOfFiles[0]; + + // Create a list to store names of created files + ListOfFiles aSeq; + aSeq.reserve(n); + for (int i = 0; i < n; i++) + aSeq.push_back(listOfFiles[i + 1]); + + // Convert a file to the byte stream + aStreamFile = SALOMEDS_Tool::PutFilesToStreamImpl(aTmpDir.c_str(), aSeq, isMultiFile); + + // Remove the files and tmp directory, created by the component storage procedure + SalomeApp_Application* app = + dynamic_cast( SUIT_Session::session()->activeApplication() ); + SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); + study->RemoveTemporaryFiles( _myComponentName.c_str(), isMultiFile ); + } + + if ( manuallySaved ) + SetListOfFiles(0, ListOfFiles()); // 0 means persistence file + + return dynamic_cast(aStreamFile); +} + +bool SalomeApp_EngineImpl::Load(const SALOMEDSImpl_SComponent & theComponent, const unsigned char* theStream, + const long theStreamLength, const std::string& theURL, bool isMultiFile ) +{ + std::cout << "SalomeApp_EngineImpl::Load() isMultiFile = " << isMultiFile << std::endl; + if (theComponent.IsNull()) + return false; + + // Error somewhere outside - Load() called with + // wrong SComponent instance + std::string componentName (const_cast(&theComponent)->ComponentDataType()); + if ( _myComponentName != componentName ) + return false; + + // Create a temporary directory for the component's data files + std::string aTmpDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); + + // Convert the byte stream theStream to a files and place them in the tmp directory. + // The files and temporary directory must be deleted by the component loading procedure. + SALOMEDSImpl_Tool::TMPFile theFile(theStreamLength, const_cast(theStream), 1); + ListOfFiles aSeq = + SALOMEDS_Tool::PutStreamToFilesImpl(theFile, aTmpDir.c_str(), isMultiFile); + + // Store list of file names to be used by the component loading procedure + const int n = (int)aSeq.size() + 1; //!< TODO: conversion from size_t to int + ListOfFiles listOfFiles (n); + listOfFiles[0] = aTmpDir; + for (int i = 1; i < n; i++) + listOfFiles[i] = std::string(aSeq[i - 1]); + + SetListOfFiles(0, listOfFiles); // 0 means persistence file + keepFiles( true ); + + return true; +} + +SalomeApp_EngineImpl::ListOfFiles SalomeApp_EngineImpl::GetListOfFiles(int type) +{ + return _myListOfFiles.count(type) ? _myListOfFiles[type] : ListOfFiles(); +} + +void SalomeApp_EngineImpl::SetListOfFiles (int type, const ListOfFiles& theListOfFiles) +{ + _myListOfFiles[type] = theListOfFiles; +} + +/*! + * DumpPython implementation for light modules + */ +SALOMEDSImpl_TMPFile* SalomeApp_EngineImpl::DumpPython(bool isPublished, bool isMultiFile, + bool& isValidScript, long& theStreamLength) +{ + MESSAGE("SalomeApp_EngineImpl::DumpPython(): _myComponentName = "<< + qPrintable( _myComponentName.c_str() ) << ", this = " << this); + + // Temporary solution: returning a non-empty sequence + // even if there's nothing to dump, to avoid crashes in SALOMEDS + // TODO: Improve SALOMEDSImpl_Study::DumpStudy() by skipping the components + // with isValidScript == false, and initialize isValidScript by false below. + SALOMEDSImpl_TMPFile* aStreamFile = nullptr; + SALOMEDSImpl_TMPFile* aStreamFileDefault = new SALOMEDSImpl_Tool::TMPFile(1, (unsigned char *)("\0"), 1); + isValidScript = true; + + ListOfFiles listOfFiles = GetListOfFiles( 1 ); // 1 means dump file + + // listOfFiles must contain temporary directory name in its first item + // and names of files (relatively the temporary directory) in the others + if ( listOfFiles.size() < 2 ) + return aStreamFileDefault; + + // there are some files, containing persistent data of the component + QString aTmpPath( listOfFiles.front().c_str() ); + QDir aTmpDir( aTmpPath ); + if ( !aTmpDir.exists() ) + return aStreamFileDefault; + + // Calculate file sizes + QStringList aFilePaths; + QList aFileSizes; + qint64 aBuffSize = 0; + ListOfFiles::const_iterator aFIt = listOfFiles.begin(); + ListOfFiles::const_iterator aFEnd = listOfFiles.end(); + aFIt++; + for (; aFIt != aFEnd; aFIt++){ + QString aFileName( (*aFIt).c_str() ); + if ( !aTmpDir.exists( aFileName ) ){ + continue; + } + + QFile aFile( aTmpDir.filePath( aFileName ) ); + if ( !aFile.open( QIODevice::ReadOnly ) ){ + continue; + } + + aFilePaths.push_back( aTmpDir.filePath( aFileName ) ); + aFileSizes.push_back( aFile.size() ); + aBuffSize += aFileSizes.back(); + + aFile.close(); + } + + if ( !aFilePaths.size() || !aBuffSize ) + return aStreamFileDefault; + + char* aBuffer = new char[aBuffSize + 1]; + if ( !aBuffer ) + return aStreamFileDefault; + + // Convert the file(s) to the byte stream, multiple files are simply + // concatenated + // TODO: imporve multi-script support if necessary... + qint64 aCurrPos = 0; + QStringList::const_iterator aFileIt = aFilePaths.begin(); + QStringList::const_iterator aFileEnd = aFilePaths.end(); + QList::const_iterator aSIt = aFileSizes.begin(); + for ( ; aFileIt != aFileEnd; aFileIt++, aSIt++ ){ + QFile aFile( aTmpDir.filePath( *aFileIt ) ); + if ( !aFile.open( QIODevice::ReadOnly ) ){ + continue; + } + + // Incorrect size of file + // Do not remove the bad file to have some diagnostic means + if ( aFile.read( aBuffer + aCurrPos, *aSIt ) != *aSIt ){ + aFile.close(); + return aStreamFileDefault; + } + + aCurrPos += (*aSIt); + aFile.remove(); + } + + // Here we should end up with empty aTmpDir + // TODO: Handle QDir::rmdir() error status somehow... + aTmpDir.rmdir( aTmpPath ); + + aBuffer[aBuffSize] = '\0'; + aStreamFile = new SALOMEDSImpl_Tool::TMPFile(aBuffSize + 1, (unsigned char*)(aBuffer), 1); + + return aStreamFile; +} + +/*! + \return Component data type string for this instance of the engine +*/ +std::string SalomeApp_EngineImpl::ComponentDataType() +{ + return _myComponentName; +} + +/*! + \return Component version +*/ +std::string SalomeApp_EngineImpl::Version() +{ + SalomeApp_Application::ModuleShortInfoList versions = SalomeApp_Application::getVersionInfo(); + QString version; + SalomeApp_Application::ModuleShortInfo version_info; + foreach ( version_info, versions ) { + if ( SalomeApp_Application::moduleName( version_info.name ) == QString(_myComponentName.c_str()) ) { + version = version_info.version; + break; + } + } + + return std::string(version.toLatin1().constData()); +} + + +/*! + Internal method, creates an engine for a light SALOME module + with the given "component data type" string, + activates it and registers in SALOME naming service with + /SalomeAppEngine/comp_data_type path. If the engine is already in the + naming service, simply returns and object reference to it. + \param theComponentName - synthetic "component data type" used to identify a given light module + \return Object reference to the engine +*/ +SalomeApp_EngineImpl *SalomeApp_EngineImpl::EngineForComponent( const char* theComponentName, + bool toCreate ) +{ + if ( !theComponentName || !strlen( theComponentName ) ) + return nullptr; + + if ( SalomeApp_Application::moduleTitle( theComponentName ).isEmpty() ) + return nullptr; + + return SalomeApp_EngineImplFactory::makeEngine(theComponentName, toCreate); +} + +/*! + \param theComponentName - synthetic "component data type" used to identify a given light module + \return IOR string for the engine for a light SALOME module + with the given "component data type" string + \sa GetInstance( const char* theComponentName ) +*/ +std::string SalomeApp_EngineImpl::EngineIORForComponent( const char* theComponentName, + bool toCreate ) +{ + std::string anIOR( "" ); + SalomeApp_EngineImpl * anEngine = EngineForComponent( theComponentName, toCreate ); + if (anEngine) + { + anIOR = anEngine->GetIOR(); + } + return anIOR; +} + +/*! + \param theComponentName - synthetic "component data type" used to identify a given light module + \return A pointer to corresponding C++ engine instance, null means some internal problems. + \sa EngineIORForComponent( const char* theComponentName ) +*/ +SalomeApp_EngineImpl* SalomeApp_EngineImpl::GetInstance( const char* theComponentName, + bool toCreate ) +{ + SalomeApp_EngineImpl* anEngine = EngineForComponent( theComponentName, toCreate ); + MESSAGE("SalomeApp_EngineImpl::GetInstance(): theComponentName = " << + theComponentName); + return anEngine; +} diff --git a/src/ShaperApp/SalomeApp_EngineImpl.h b/src/ShaperApp/SalomeApp_EngineImpl.h new file mode 100644 index 000000000..6ce99ff30 --- /dev/null +++ b/src/ShaperApp/SalomeApp_EngineImpl.h @@ -0,0 +1,126 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, CSGROUP +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef _SALOMEAPP_ENGINE_IMPL_HXX_ +#define _SALOMEAPP_ENGINE_IMPL_HXX_ + +#include "SalomeApp.h" +#include "SALOMEDS_Tool.hxx" +#include "SALOMEDSImpl_Driver.hxx" +#include +#include +#include +#include + +class SALOMEDSImpl_SComponent; +class SALOMEDSImpl_SObject; +class SalomeApp_EngineImplFactory; + +class SALOMEAPP_EXPORT SalomeApp_EngineImpl: public SALOMEDSImpl_Driver +{ +public: + + ~SalomeApp_EngineImpl(); + + virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent, const std::string& theURL, + long& theStreamLength, bool isMultiFile ) override; + + virtual bool Load(const SALOMEDSImpl_SComponent & theComponent, const unsigned char* theStream, + const long theStreamLength, const std::string& theURL, bool isMultiFile ) override; + + virtual SALOMEDSImpl_TMPFile* DumpPython(bool isPublished, bool isMultiFile, + bool& isValidScript, long& theStreamLength) override; + + typedef std::vector ListOfFiles; + typedef std::map MapOfFiles; + + ListOfFiles GetListOfFiles (int); + void SetListOfFiles (int, const ListOfFiles& theListOfFiles); + + static std::string EngineIORForComponent( const char* theComponentName, + bool toCreate ); + static SalomeApp_EngineImpl* GetInstance ( const char* theComponentName, bool toCreate ); + + static SalomeApp_EngineImpl* EngineForComponent( const char* theComponentName, + bool toCreate ); + virtual std::string GetIOR() override; + bool keepFiles() const { return _myKeepFiles; } + void keepFiles( bool keep ) { _myKeepFiles = keep; } + static const std::map & getComponentIORS() + {return _myComponentIORS;} + +private: + + friend class SalomeApp_EngineImplFactory; // builder + explicit SalomeApp_EngineImpl( const char* theComponentName ); + SalomeApp_EngineImpl() = default; + + // methods from SALOMEDS::Driver without implementation. Must be redefined because + // there is no default implementation of SALOMEDSImpl_Driver interface + virtual SALOMEDSImpl_TMPFile* SaveASCII( const SALOMEDSImpl_SComponent &, const std::string& , + long&, bool ) override + { return nullptr; } + virtual bool LoadASCII( const SALOMEDSImpl_SComponent &, const unsigned char* , const long, const std::string& , bool ) override + {return 0;} + virtual void Close( const SALOMEDSImpl_SComponent & ) override + {} + virtual std::string ComponentDataType(); + virtual std::string IORToLocalPersistentID( const SALOMEDSImpl_SObject &, const std::string &, bool, bool) override + {return "";} + virtual std::string LocalPersistentIDToIOR( const SALOMEDSImpl_SObject &, const std::string&, bool, bool ) override + {return "";} + virtual bool CanCopy( const SALOMEDSImpl_SObject& ) override + {return 0;} + virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& , int& , long& ) override + {} + virtual bool CanPaste(const std::string& , int ) override + {return 0;} + virtual std::string PasteInto( const unsigned char* , long, int, const SALOMEDSImpl_SObject& ) override + {return "";} + virtual std::string Version() override; + + MapOfFiles _myListOfFiles; + bool _myKeepFiles; + std::string _myComponentName; + static std::map _myComponentIORS; +}; + +SALOMEAPP_EXPORT class SalomeApp_EngineImplFactory: + public SALOMEDSImpl_DriverFactory +{ +public: + + virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType) override; + virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR) override; + static SalomeApp_EngineImpl* makeEngine(const char* theComponentName, bool toCreate); + static SalomeApp_EngineImplFactory* instance(); + void removeEngine(const std::string& theComponentName); + ~SalomeApp_EngineImplFactory(); +private: + std::map _myEnginesMap; + SalomeApp_EngineImplFactory() = default; +}; + + + +#endif + diff --git a/src/ShaperApp/resources/LightShaperApp.xml b/src/ShaperApp/resources/LightShaperApp.xml new file mode 100644 index 000000000..478997e7a --- /dev/null +++ b/src/ShaperApp/resources/LightShaperApp.xml @@ -0,0 +1,286 @@ + +
+ + + + + + + +
+
+ + + + + +
+
+ + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+ + + + + +
+
+ + +
+
+ + + + + + +
+
+ + + +
+
+ + + + + + + + + + + + +
+
+ + + + + + + +
+
+ + +
+
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + + + + + + + + +
+
+ + + + + +
+
+ +
+
+ + +
+
+ +
+
+ + + +
+ +
+ +
+
+ + +
+
+ + + + + + + +
+
+ + + + +
+
+ + + + + +
+
+ + +
+
+ + +
+
+ + +
+
diff --git a/src/ShaperApp/resources/LightShaperApp_images.ts b/src/ShaperApp/resources/LightShaperApp_images.ts new file mode 100644 index 000000000..f251578fe --- /dev/null +++ b/src/ShaperApp/resources/LightShaperApp_images.ts @@ -0,0 +1,23 @@ + + + + + @default + + APP_DEFAULT_ICO + shaper.png + + + ICO_ABOUT + icon_about.png + + + ABOUT + about.png + + + APP_BASE_LOGO + app_logo.png + + + diff --git a/src/ShaperApp/resources/LightShaperApp_msg_en.ts b/src/ShaperApp/resources/LightShaperApp_msg_en.ts new file mode 100644 index 000000000..6fce42ed7 --- /dev/null +++ b/src/ShaperApp/resources/LightShaperApp_msg_en.ts @@ -0,0 +1,1284 @@ + + + + + @default + + EXTERNAL_BROWSER_CANNOT_SHOW_PAGE + External browser "%1" can not show help page "%2". Do you want to change the browser's settings in preferences? + + + ABOUT_COPYRIGHT + Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE, CSGROUP + +Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, +CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + + + ABOUT_CAPTION + About %1 + + + ABOUT_BASE + Base information + + + ABOUT_MODULE_INFOS + Modules information + + + ABOUT_UNKNOWN_VERSION + Unknown + + + ABOUT_CLOSE + &Close + + + APP_NAME + SHAPER + + + ABOUT_LICENSE + GNU LGPL + + + ABOUT_VERSION + Version %1 + + + SALOME_SITE + SALOME Website + + + SALOME_FORUM + SALOME Forum + + + SALOME_VIDEO_TUTORIALS + Video Tutorials + + + PRP_SALOME_VIDEO_TUTORIALS + Visit YouTube channel with some videos + + + SALOME_TUTORIALS + Tutorials + + + PRP_SALOME_TUTORIALS + Try tutorials from SALOME site + + + ENTRY_COLUMN + Entry + + + APPCLOSE_CAPTION + Close active study + + + STUDYCLOSE_DESCRIPTION + The current study has unsaved changes. Would you like to save before closing it? + + + APPCLOSE_SAVE + &Yes + + + APPCLOSE_CLOSE + &No + + + APPCLOSE_CANCEL + &Cancel + + + WRN_PYTHON_FILE_NAME_BAD + Please enter correct file name. +Python file must include only letters, digits and underscores and start from letter or underscore. + + + PYTHON_FILES_FILTER + Python Files (*.py) + + + LOG_FILES_FILTER + Log files (*.log *.txt) + + + + LightApp_Application + + LANG_CHANGED + Application language has been changed. +The changes will be applied on the next application session. + + + LOCALE_CHANGED + Application locale has been changed. +The changes will be applied on the next application session. + + + MEN_DESK_THEME + Theme + + + TOT_THEME + Theme + + + PRP_THEME + Change style properties + + + TOT_FULLSCREEN + Full screen + + + MEN_DESK_FULLSCREEN + Full screen + + + PRP_FULLSCREEN + Switch to full screen mode + + + INF_TOOLBAR_MODULES + Modules + + + PREF_SHOW_LEGEND + Show legend + + + MEN_DESK_RENAME + &Rename + + + PREF_MULTI_FILE + Multi file save + + + MEN_DESK_PREFERENCES + Pre&ferences... + + + PREF_TRIHEDRON_SHOW + Show trihedron + + + PREF_TRIHEDRON + Trihedron + + + PREF_TRIHEDRON_SIZE + Size + + + OBJECT_BROWSER + Object Browser + + + INFO_PANEL + Help panel + + + PRP_DESK_PREFERENCES + Allow to change the preferences + + + PREF_GROUP_DIRECTORIES + Quick directory list + + + PREF_GROUP_VTKVIEWER + VTK 3D Viewer + + + PREF_LOAD_LIGHT + Automatic loading of light modules when opening study + + + PREF_STORE_POS + Store positions of windows + + + PREF_STORE_TOOL_POS + Store positions of toolbars + + + PREF_AUTO_SAVE + Auto-save interval (min) + + + PREF_AUTO_SAVE_DISABLED + Disabled + + + PREF_PROJECTION_MODE + Projection mode: + + + PREF_ORTHOGRAPHIC + Orthogonal + + + PREF_PERSPECTIVE + Perspective + + + PREF_POLYGON_SELECTION + Polygon + + + PREF_CIRCLE_SELECTION + Circle + + + PREF_SELECTION_STYLE + Advanced selection + + + PREF_NAVIGATION + Navigation style + + + PREF_STANDARD_STYLE + Salome standard controls + + + PREF_KEYFREE_STYLE + Keyboard free style + + + PREF_ZOOMING + Zooming style + + + PREF_ZOOMING_AT_CENTER + Relative to the view's center + + + PREF_ZOOMING_AT_CURSOR + Relative to the cursor + + + PREF_INCREMENTAL_SPEED + Speed increment: + + + PREF_INCREMENTAL_SPEED_MODE + Modification mode: + + + PREF_ARITHMETIC + Arithmetic progression + + + PREF_GEOMETRICAL + Geometrical progression + + + PREF_FRAME_SPACEMOUSE + Spacemouse + + + PREF_SHOW_STATIC_TRIHEDRON + Show static trihedron + + + PREF_SPACEMOUSE_FUNC_1 + Decrease speed increment + + + PREF_SPACEMOUSE_FUNC_2 + Increase speed increment + + + PREF_SPACEMOUSE_FUNC_3 + Dominant / combined switch + + + PREF_SPACEMOUSE_BTN_1 + Button 1 + + + PREF_SPACEMOUSE_BTN_2 + Button 2 + + + PREF_SPACEMOUSE_BTN_3 + Button 3 + + + PREF_SPACEMOUSE_BTN_4 + Button 4 + + + PREF_SPACEMOUSE_BTN_5 + Button 5 + + + PREF_SPACEMOUSE_BTN_6 + Button 6 + + + PREF_SPACEMOUSE_BTN_7 + Button 7 + + + PREF_SPACEMOUSE_BTN_8 + Button 8 + + + PREF_SPACEMOUSE_BTN_* + Button * + + + PREF_SPACEMOUSE_BTN_10 + Button 10 + + + PREF_SPACEMOUSE_BTN_11 + Button 11 + + + PREF_FRAME_RECORDING + AVI Recording + + + PREF_ALL_DISLPAYED_FRAMES + Recording all displayed frames + + + PREF_FPS + FPS + + + PREF_GROUP_TTL + Settings + + + PREF_PROGRESSIVE + Progressive + + + PREF_QUALITY + Quality + + + PREF_RECORDING_MODE + Mode + + + PREF_SKIPPED_FRAMES + Recording at a given FPS + + + PREF_FRAME_GROUP_NAMES + Names of groups + + + PREF_GROUP_NAMES_TEXT_COLOR + Text color + + + PREF_GROUP_NAMES_TRANSPARENCY + Transparency + + + PREF_BOTTOM + Bottom + + + PREF_CURVE_TYPE + Curve type: + + + PREF_POINTS + Points + + + PRP_MODULE + Switch to the module "%1" + + + PREF_ASCII_FILE + ASCII save + + + PREFERENCES_NOT_LOADED + Preferences for module "<b>%N</b>" will be available when the module is loaded + + + PREF_LINEAR + Linear + + + DATA_MODELS + Data models + + + PRP_RENAME + Rename active window + + + TOT_RENAME + Rename + + + MEN_RENAME_OBJ + Rename + + + LOG_WINDOW + Message Window + + + PREF_SPLINE + Spline + + + PREF_OBJ_BROWSER_SEARCH_TOOL + Search Tool + + + PREF_AUTO_HIDE_SEARCH_TOOL + Enable auto-hiding + + + PREF_OBJ_BROWSER_SETTINGS + Object browser settings + + + PRP_APP_MODULE + Switch to SALOME platform neutral point + + + PREF_GROUP_PY_CONSOLE + Python console + + + PREF_SHOW_BANNER + Show banner + + + PREF_AUTO_COMPLETION + Command auto-completion + + + PREF_GROUP_STYLE + Salome style + + + PREF_USE_SALOME_STYLE + Use Salome style + + + PREF_MARKER_SIZE + Marker size: + + + PREF_TAB_VIEWERS + Viewers + + + PREF_APP + Application + + + PREF_TOP + Top + + + MEN_REFRESH + Refresh + + + PREF_AUTO_SIZE_FIRST + Auto size for "Name" column + + + PREF_RESIZE_ON_EXPAND_ITEM + Resize columns on expand item + + + PREF_BROWSE_TO_THE_PUBLISHED_OBJECT + Browse to the published object + + + PREF_BROWSE_NEVER + Never + + + PREF_BROWSE_AFTER_APPLY_AND_CLOSE_ONLY + After Apply & Close only + + + PREF_BROWSE_ALWAYS + Always + + + PREF_TAB_OBJBROWSER + Object browser + + + PREF_TAB_GENERAL + General + + + NEW_WINDOW_0 + &GL 2D view + + + NEW_WINDOW_1 + &Plot 2D view + + + NEW_WINDOW_2 + &OCC 3D view + + + NEW_WINDOW_3 + VT&K 3D view + + + NEW_WINDOW_4 + Qx&Scene 2D view + + + NEW_WINDOW_5 + G&raphics view + + + NEW_WINDOW_6 + ParaVie&w view + + + NEW_WINDOW_7 + P&ython view + + + CREATING_NEW_WINDOW + Create new %1 + + + OBJ_BROWSER_NAME + Object + + + PREF_LEGEND_POSITION + Legend position: + + + PREF_RELATIVE_SIZE + Relative + + + PREF_VIEWER_BACKGROUND + Background + + + PREF_VIEWER_BACKGROUND_COLOR + Background color + + + PREF_VIEWER_SELECTION + Selection color + + + PREF_XYVIEWER_BACKGROUND + XY View + + + PREF_XZVIEWER_BACKGROUND + XZ View + + + PREF_YZVIEWER_BACKGROUND + YZ View + + + PREF_3DVIEWER_BACKGROUND + 3D View + + + PREF_FONT + Font + + + PREF_LEGEND_FONT + Legend font + + + PREF_FONT_COLOR + Legend font color + + + PREF_SELECTED_FONT_COLOR + Highlighted legend font color + + + PREF_LEFT + Left + + + PREF_TAB_DIRECTORIES + Directories + + + ACTIVATING_MODULE + Trying to activate module "%1" + + + PREF_VERT_AXIS_SCALE + Vertical axis scale: + + + PREF_HOR_AXIS_SCALE + Horizontal axis scale: + + + PREF_GROUP_LANGUAGE + Language + + + PREF_CURRENT_LANGUAGE + Current language + + + PREF_CURRENT_LOCALE + Use "C" locale + + + PREF_GROUP_LOOK_AND_FEEL + Look and feel + + + PREF_SHOW_SPLASH + Show splash screen at start-up + + + PREF_OPAQUE_RESIZE + Opaque resize + + + PREF_GROUP_STUDY + Study properties + + + PREF_CATEGORY_SALOME + SALOME + + + PREF_DROP_DOWN_BUTTONS + Drop-down buttons in toolbars for action groups + + + PREF_NOTIFY_TIMEOUT + Notifications auto-hide timeout + + + PREF_NOTIFY_TIMEOUT_NONE + None + + + PREF_GROUP_COMMON + Common + + + PREF_GROUP_3DVIEWER + 3D Viewer + + + PREF_GROUP_OCCVIEWER + OCC 3D Viewer + + + PREF_GROUP_STEREO + Stereo render + + + PREF_STEREO_TYPE + Stereo type + + + PREF_ANAGLYPH_FILTER + Anaglyph filter + + + PREF_ANAGLYPH_RED_CYAN + Red-Cyan + + + PREF_ANAGLYPH_YELLOW_BLUE + Yellow-Blue + + + PREF_ANAGLYPH_GREEN_MAGENTA + Green-Magenta + + + PREF_FOCUS_TYPE + Convergence distance type + + + PREF_FOCUS_VALUE + Stereographic focus value + + + PREF_IOD_TYPE + IOD type + + + PREF_IOD_VALUE + Interocular distance (IOD) value + + + PREF_ABSOLUTE + Absolute + + + PREF_RELATIVE + Relative + + + PREF_REVERSE_STEREO + Reverse stereo + + + PREF_ENABLE_VSYNC + Enable V-Sync + + + PREF_ENABLE_QUAD_BUFFER_SUPPORT + Enable quad-buffer support + + + PREF_LOGARITHMIC + Logarithmic + + + MEN_DESK_MODULE_HELP + Module Help + + + PREF_SUPERV_TITLE_COLOR + Title color + + + PREF_PARAM + Parameters + + + PREF_RIGHT + Right + + + PREF_LINES + Lines + + + INF_CANCELLED + Module activation cancelled + + + PREF_GROUP_EXT_BROWSER + External browser + + + PREF_SUPERV_CTRL_COLOR + Ctrl color + + + PREF_GROUP_DEF_COLUMNS + Default columns + + + PREF_GROUP_PLOT2DVIEWER + Plot 2D Viewer + + + PREF_GROUP_VIEWER + Viewer + + + PREF_GROUP_LEGEND + Legend + + + PREF_LEGEND_SYMBOL_TYPE + Symbol type: + + + PREF_MARKER_ABOVE_LINE + Marker above line + + + PREF_MARKER_ON_LINE + Marker on line + + + PREF_DEVIATION_COLOR + Deviation marker color + + + PREF_DEVIATION_MARKER_LW + Deviation marker line width + + + PREF_DEVIATION_MARKER_TS + Deviation marker tick size + + + MEN_DESK_MRU + Most Recently Used + + + TOT_DESK_PREFERENCES + Preferences + + + DEFINE_EXTERNAL_BROWSER + External browser is not found. Do you want to define it in preferences? + + + PREF_AUTO_SIZE + Auto size for other columns + + + TOT_DESK_MRU + Most recently used + + + ACTIVATE_MODULE_OP_NEW + &New + + + ACTIVATE_MODULE_OP_OPEN + &Open... + + + PYTHON_CONSOLE + Python Console + + + PREF_GROUP_SELECTION + Selection + + + PREF_ENABLE_SELECTION + Enable selection + + + PREF_ENABLE_PRESELECTION + Enable preselection + + + PREF_PRESELECTION + Preselection + + + PREF_PRESELECTION_STANDARD + Standard + + + PREF_PRESELECTION_DYNAMIC + Dynamic + + + PREF_PRESELECTION_DISABLED + Disabled + + + PREF_GROUP_CLIPPING + Clipping parameters + + + PREF_CLIPPING_COLOR + Color + + + PREF_CLIPPING_DEFAULT_TEXTURE + Use default texture + + + PREF_CLIPPING_TEXTURE + Texture + + + OCC_TEXTURE_FILES + Image files (*.jpeg *.jpg *.jpe *.png *.bmp *.gif *.ppm *.tif *.tiff* .tga *.exr) + + + PREF_CLIPPING_MODULATE + Modulate + + + PREF_CLIPPING_SCALE + Scale factor + + + PREF_GROUP_RAY_TRACING + Ray tracing + + + PREF_RAY_TRACING_DEPTH + Depth + + + PREF_RAY_TRACING_REFLECTION + Specular reflections + + + PREF_RAY_TRACING_ANTIALIASING + Adaptive anti-aliasing + + + PREF_RAY_TRACING_SHADOW + Shadows rendering + + + PREF_RAY_TRACING_TRANS_SHADOW + Transparent shadow + + + PREF_GROUP_LIGHT + Light source + + + PREF_LIGHT_COLOR + Color + + + TOT_CLOSE + Close + + + MEN_DESK_CLOSE + &Close + + + PRP_CLOSE + Close active window + + + TOT_CLOSE_ALL + Close all + + + MEN_DESK_CLOSE_ALL + Close All + + + PRP_CLOSE_ALL + Close all windows + + + TOT_GROUP_ALL + Group all + + + MEN_DESK_GROUP_ALL + &Group All + + + PRP_GROUP_ALL + Group all windows + + + ERR_DOC_NOT_EXISTS + Can not open %1. +File does not exist + + + PREF_GROUP_MRU + Show MRU items + + + PREF_MRU_VISIBLE_COUNT + Number of MRU items + + + PREF_MRU_INSERT_MODE + Insert mode + + + PREF_MRU_MOVE_FIRST + Move to the beginning + + + PREF_MRU_MOVE_LAST + Move to the end + + + PREF_MRU_ADD_FIRST + Add to the beginning + + + PREF_MRU_ADD_LAST + Add to the end + + + PREF_MRU_LINK_TYPE + Link type + + + PREF_MRU_LINK_AUTO + Auto + + + PREF_MRU_LINK_SHORT + Short + + + PREF_MRU_LINK_FULL + Full + + + PREFERENCES_NOT_SUPPORTED + Preferences for module "%1" not supported + + + PREF_TAB_SHORTCUTS + Shortcuts + + + PREF_GROUP_SHORTCUTS + Shortcuts settings + + + PREF_GROUP_FULL_SCREEN + Full-screen + + + PREF_FULL_SCREEN_AUTO + Hide object browser and viewers toolbars + + + PREF_TAB_PYEDITOR + Python Viewer + + + PREF_GROUP_PY_FONT + Font settings + + + PREF_PY_FONT + Font + + + PREF_GROUP_PY_DISPLAY + Display settings + + + PREF_PY_CURRLINE_HIGHLIGHT + Enable current line highlight + + + PREF_PY_TEXT_WRAP + Enable text wrapping + + + PREF_PY_CURSON_ON_SCROLL + Center cursor on scroll + + + PREF_PY_LINE_NUMBS_AREA + Display line numbers area + + + PREF_GROUP_PY_EDITOR + Editor settings + + + PREF_PY_COMPLETION_MODE + Completion mode + + + PREF_PY_NONE + None + + + PREF_PY_AUTO + Auto + + + PREF_PY_MANUAL + Manual + + + PREF_PY_ALWAYS + Always + + + PREF_GROUP_PY_TAB + Tab settings + + + PREF_PY_TAB_WHITESPACES + Display tab delimiters + + + PREF_PY_TAB_SIZE + Tab size: + + + PREF_GROUP_VERT_EDGE + Vertical edge settings + + + PREF_PY_VERT_EDGE + Display vertical edge + + + PREF_PY_NUM_COLUMNS + Number of columns: + + + INFO_WELCOME_TO_SALOME + Welcome to SALOME + + + INFO_GETTING_STARTED + Getting started + + + INFO_AVAILABLE_MODULES + Available modules + + + + LightApp_Module + + MEN_HIDE + Hide + + + TOP_DISPLAY_ONLY + Show only + + + STB_DISPLAY_ONLY + Show only + + + MEN_DISPLAY_ONLY + Show Only + + + TOP_HIDE + HIde + + + MEN_ERASE_ALL + Hide All + + + STB_HIDE + Hide + + + STB_SHOW + Show + + + TOP_SHOW + Show + + + MEN_SHOW + Show + + + STB_ERASE_ALL + Hide all + + + TOP_ERASE_ALL + Hide all + + + + LightApp_ModuleDlg + + DESCRIPTION + You're activating module + <b>%1</b>.<br>Please, select required action by pressing the corresponding button below. + + + CANCEL + &Cancel + + + CAPTION + Activate module + + + + LightApp_NameDlg + + TLT_RENAME + Rename + + + NAME_LBL + Name: + + + + LightApp_PreferencesDlg + + IMPORT_PREFERENCES + Import preferences + + + XML_FILES_FILTER + XML Files (*.xml) + + + CAPTION + Preferences + + + WARNING + Warning + + + IMPORT_BTN_TEXT + Import + + + DEFAULT_QUESTION + Do you want to retrieve default preferences? + + + DEFAULT_BTN_TEXT + Defaults + + + PREF_NEED_RESTART + Some changes will take effect only after application restart + + + + LightApp_ModuleAction + + ACTIVATE_MODULE_TOP + Activate/deactivate %1 module + + + + LightApp_PyEditor + + TOT_DUMP_PYCOMMANDS + Dump commands + + + TOT_SAVE_PYLOG + Save log + + + diff --git a/src/ShaperApp/resources/LightShaperApp_msg_fr.ts b/src/ShaperApp/resources/LightShaperApp_msg_fr.ts new file mode 100644 index 000000000..751fec8c7 --- /dev/null +++ b/src/ShaperApp/resources/LightShaperApp_msg_fr.ts @@ -0,0 +1,1284 @@ + + + + + @default + + EXTERNAL_BROWSER_CANNOT_SHOW_PAGE + Le navigateur externe "%1" ne peut pas trouver la page d'aide "%2". Voulez-vous modifier les settings du navigateur externe dans les préférences ? + + + ABOUT_COPYRIGHT + Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + +Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, +CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + + + ABOUT_CAPTION + A propos de %1 + + + ABOUT_BASE + Informations générales + + + ABOUT_MODULE_INFOS + Modules + + + ABOUT_UNKNOWN_VERSION + Inconnue + + + ABOUT_CLOSE + &Fermer + + + APP_NAME + SHAPER + + + ABOUT_LICENSE + GNU LGPL + + + ABOUT_VERSION + Version %1 + + + SALOME_SITE + SALOME Website + + + SALOME_FORUM + SALOME Forum + + + SALOME_VIDEO_TUTORIALS + Video Tutorials + + + PRP_SALOME_VIDEO_TUTORIALS + Visit YouTube channel with some videos + + + SALOME_TUTORIALS + Tutorials + + + PRP_SALOME_TUTORIALS + Try tutorials from SALOME site + + + ENTRY_COLUMN + Entrée + + + APPCLOSE_CAPTION + Fermer l'étude actuelle + + + STUDYCLOSE_DESCRIPTION + Une étude a des modifications non enregistrées. Voulez-vous les sauvegarder avant de fermer? + + + APPCLOSE_SAVE + &Oui + + + APPCLOSE_CLOSE + &Non + + + APPCLOSE_CANCEL + &Annuler + + + WRN_PYTHON_FILE_NAME_BAD + Indiquez un nom de fichier correct. +Un fichier Python ne doit être composé que de lettres, chiffres et tirets bas et doit commencer avec une lettre ou un tiret bas. + + + PYTHON_FILES_FILTER + Fichiers Python (*.py) + + + LOG_FILES_FILTER + Fichiers de trace (*.log *.txt) + + + + LightApp_Application + + LANG_CHANGED + La langue de l'application a été modifiée. +Les modifications seront appliquées à la prochaine session. + + + LOCALE_CHANGED + La locale de l'application a été modifiée. +Les modifications seront appliquées à la prochaine session. + + + MEN_DESK_THEME + T&hème + + + TOT_THEME + Thème + + + PRP_THEME + Changer les propriétés du style + + + TOT_FULLSCREEN + Plein écran + + + MEN_DESK_FULLSCREEN + Plein écran + + + PRP_FULLSCREEN + Basculer en mode plein écran + + + INF_TOOLBAR_MODULES + Modules + + + PREF_SHOW_LEGEND + Montrer la légende + + + MEN_DESK_RENAME + &Renommer + + + PREF_MULTI_FILE + Sauvegarde multi-fichiers + + + MEN_DESK_PREFERENCES + &Préférences... + + + PREF_TRIHEDRON_SHOW + Afficher le trièdre + + + PREF_TRIHEDRON + Trièdre + + + PREF_TRIHEDRON_SIZE + Taille + + + OBJECT_BROWSER + Arbre d'étude + + + INFO_PANEL + Help panel + + + PRP_DESK_PREFERENCES + Permettre de changer les préférences + + + PREF_GROUP_DIRECTORIES + Liste des répertoires + + + PREF_GROUP_VTKVIEWER + Scène VTK 3D + + + PREF_LOAD_LIGHT + Chargement automatique des modules Light à l'ouverture d'étude + + + PREF_STORE_POS + Enregistrer la position des fenêtres + + + PREF_STORE_TOOL_POS + Enregistrer la positions des barres d'outils + + + PREF_AUTO_SAVE + Intervalle d'enregistrement automatique (min) + + + PREF_AUTO_SAVE_DISABLED + Désactivé + + + PREF_PROJECTION_MODE + Mode de projection: + + + PREF_ORTHOGRAPHIC + Orthogonal + + + PREF_PERSPECTIVE + Perspective + + + PREF_POLYGON_SELECTION + Polygon + + + PREF_CIRCLE_SELECTION + Circle + + + PREF_SELECTION_STYLE + Advanced selection + + + PREF_NAVIGATION + Navigation: + + + PREF_STANDARD_STYLE + Style de contrôles type Salomé + + + PREF_KEYFREE_STYLE + Style sans clavier + + + PREF_ZOOMING + Mode de zoom: + + + PREF_ZOOMING_AT_CENTER + Relatif au centre de la scène + + + PREF_ZOOMING_AT_CURSOR + Relatif au curseur + + + PREF_INCREMENTAL_SPEED + Incrément de vitesse: + + + PREF_INCREMENTAL_SPEED_MODE + Mode de modification: + + + PREF_ARITHMETIC + Progression arithmétique + + + PREF_GEOMETRICAL + Progression géométrique + + + PREF_FRAME_SPACEMOUSE + Spacemouse + + + PREF_SHOW_STATIC_TRIHEDRON + Montrer le trièdre statique + + + PREF_SPACEMOUSE_FUNC_1 + Réduire l'incrément de vitesse + + + PREF_SPACEMOUSE_FUNC_2 + Augmenter l'incrément de vitesse + + + PREF_SPACEMOUSE_FUNC_3 + Changement Dominant/Combiné + + + PREF_SPACEMOUSE_BTN_1 + Bouton 1 + + + PREF_SPACEMOUSE_BTN_2 + Bouton 2 + + + PREF_SPACEMOUSE_BTN_3 + Bouton 3 + + + PREF_SPACEMOUSE_BTN_4 + Bouton 4 + + + PREF_SPACEMOUSE_BTN_5 + Bouton 5 + + + PREF_SPACEMOUSE_BTN_6 + Bouton 6 + + + PREF_SPACEMOUSE_BTN_7 + Bouton 7 + + + PREF_SPACEMOUSE_BTN_8 + Bouton 8 + + + PREF_SPACEMOUSE_BTN_* + Bouton * + + + PREF_SPACEMOUSE_BTN_10 + Bouton 10 + + + PREF_SPACEMOUSE_BTN_11 + Bouton 11 + + + PREF_FRAME_RECORDING + Enregistrement AVI + + + PREF_ALL_DISLPAYED_FRAMES + Enregistrer toutes les images affichées + + + PREF_FPS + FPS + + + PREF_GROUP_TTL + Paramètres + + + PREF_PROGRESSIVE + Progressif + + + PREF_QUALITY + Qualité + + + PREF_RECORDING_MODE + Mode + + + PREF_SKIPPED_FRAMES + Enregistrer à FPS donné + + + PREF_FRAME_GROUP_NAMES + Nom des groupes + + + PREF_GROUP_NAMES_TEXT_COLOR + Couleur du texte + + + PREF_GROUP_NAMES_TRANSPARENCY + Transparence + + + PREF_BOTTOM + Dessous + + + PREF_CURVE_TYPE + Type de courbe: + + + PREF_POINTS + Points + + + PRP_MODULE + Basculer vers le module "%1" + + + PREF_ASCII_FILE + Enregistrement ASCII + + + PREFERENCES_NOT_LOADED + Les préférences du module "<b>%N</b>" seront accessibles quand le module sera chargé + + + PREF_LINEAR + Linéaire + + + DATA_MODELS + Modèles de données + + + PRP_RENAME + Renommer la fenêtre active + + + TOT_RENAME + Renommer + + + MEN_RENAME_OBJ + Renommer + + + LOG_WINDOW + Fenêtre de messages + + + PREF_SPLINE + Spline + + + PREF_OBJ_BROWSER_SEARCH_TOOL + Outil de recherche + + + PREF_AUTO_HIDE_SEARCH_TOOL + Cacher automatiquement + + + PREF_OBJ_BROWSER_SETTINGS + Paramètres de l'arbre d'étude + + + PRP_APP_MODULE + Basculer au point neutre de la plate-forme SALOME + + + PREF_GROUP_PY_CONSOLE + Propriétés de la console Python + + + PREF_SHOW_BANNER + Afficher la bannière + + + PREF_AUTO_COMPLETION + Auto-completion + + + PREF_GROUP_STYLE + Style Salomé + + + PREF_USE_SALOME_STYLE + Utiliser le style Salomé + + + PREF_MARKER_SIZE + Taille de repère: + + + PREF_TAB_VIEWERS + Scènes + + + PREF_APP + Application + + + PREF_TOP + Dessus + + + MEN_REFRESH + Rafraîchir + + + PREF_AUTO_SIZE_FIRST + Taille automatique pour la colonne "Nom" + + + PREF_RESIZE_ON_EXPAND_ITEM + Redimensionner les colonnes quand l'objet est déplié + + + PREF_BROWSE_TO_THE_PUBLISHED_OBJECT + Se déplacer sur l'objet publié + + + PREF_BROWSE_NEVER + Jamais + + + PREF_BROWSE_AFTER_APPLY_AND_CLOSE_ONLY + Seulement après "Appliquer et Fermer" + + + PREF_BROWSE_ALWAYS + Toujours + + + PREF_TAB_OBJBROWSER + Arbre d'étude + + + PREF_TAB_GENERAL + Général + + + NEW_WINDOW_0 + Scène &GL + + + NEW_WINDOW_1 + Scène &Plot2d + + + NEW_WINDOW_2 + Scène &OCC + + + NEW_WINDOW_3 + Scène VT&K + + + NEW_WINDOW_4 + Scène Qx&Scene + + + NEW_WINDOW_5 + Scène G&raphiques + + + NEW_WINDOW_6 + Scène ParaVie&w + + + NEW_WINDOW_7 + Vue P&ython + + + CREATING_NEW_WINDOW + Créer une nouvelle %1 + + + OBJ_BROWSER_NAME + Objet + + + PREF_LEGEND_POSITION + Position de la Légende: + + + PREF_RELATIVE_SIZE + Relative + + + PREF_VIEWER_BACKGROUND + Arrière-plan + + + PREF_VIEWER_BACKGROUND_COLOR + Couleur de l'arrière-plan + + + PREF_VIEWER_SELECTION + Couleur de sélection + + + PREF_XYVIEWER_BACKGROUND + Vue XY + + + PREF_XZVIEWER_BACKGROUND + Vue XZ + + + PREF_YZVIEWER_BACKGROUND + Vue YZ + + + PREF_3DVIEWER_BACKGROUND + Vue 3D + + + PREF_FONT + Police + + + PREF_LEGEND_FONT + Police de la légende + + + PREF_FONT_COLOR + Couleur de police de la légende + + + PREF_SELECTED_FONT_COLOR + Couleur de surlignement de la légende + + + PREF_LEFT + Gauche + + + PREF_TAB_DIRECTORIES + Emplacements + + + ACTIVATING_MODULE + Activation du module "%1" en cours + + + PREF_VERT_AXIS_SCALE + Echelle de l'axe vertical : + + + PREF_HOR_AXIS_SCALE + Echelle de l'axe horizontal : + + + PREF_GROUP_LANGUAGE + Langue + + + PREF_CURRENT_LANGUAGE + Langue actuelle + + + PREF_CURRENT_LOCALE + Utiliser la locale "C" + + + PREF_GROUP_LOOK_AND_FEEL + Aspect + + + PREF_SHOW_SPLASH + Afficher l'écran de démarrage + + + PREF_OPAQUE_RESIZE + Redimensionnement opaque + + + PREF_GROUP_STUDY + Propiétés de l'étude + + + PREF_CATEGORY_SALOME + SALOME + + + PREF_DROP_DOWN_BUTTONS + Boutons alignés dans la barre + + + PREF_NOTIFY_TIMEOUT + Notifications auto-hide timeout + + + PREF_NOTIFY_TIMEOUT_NONE + None + + + PREF_GROUP_COMMON + Commun + + + PREF_GROUP_3DVIEWER + Scène 3D + + + PREF_GROUP_OCCVIEWER + Scène OCC 3D + + + PREF_GROUP_STEREO + Rendu stéréo + + + PREF_STEREO_TYPE + Type de rendu stéréo + + + PREF_ANAGLYPH_FILTER + Filtre anaglyphique + + + PREF_ANAGLYPH_RED_CYAN + Rouge-Cyan + + + PREF_ANAGLYPH_YELLOW_BLUE + Jaune-Bleu + + + PREF_ANAGLYPH_GREEN_MAGENTA + Vert-Magenta + + + PREF_FOCUS_TYPE + Type de la distance de convergence + + + PREF_FOCUS_VALUE + Valeur de la focalisation stéréographique + + + PREF_IOD_TYPE + Type de distance intraoculaire + + + PREF_IOD_VALUE + Valeur de la distance intraoculaire + + + PREF_ABSOLUTE + Absolu + + + PREF_RELATIVE + Relatif + + + PREF_REVERSE_STEREO + Stéréo inversée + + + PREF_ENABLE_VSYNC + Activer la synchronisation verticale + + + PREF_ENABLE_QUAD_BUFFER_SUPPORT + Activer le support du quad-buffer + + + PREF_LOGARITHMIC + Logarithmique + + + MEN_DESK_MODULE_HELP + Module &Aide + + + PREF_SUPERV_TITLE_COLOR + Couleur de titre + + + PREF_PARAM + Paramètres + + + PREF_RIGHT + Droite + + + PREF_LINES + Lignes + + + INF_CANCELLED + L'activation du module est annulée + + + PREF_GROUP_EXT_BROWSER + Navigateur externe + + + PREF_SUPERV_CTRL_COLOR + Couleur de contrôle + + + PREF_GROUP_DEF_COLUMNS + Colonnnes par défaut + + + PREF_GROUP_PLOT2DVIEWER + Scène Plot2d + + + PREF_GROUP_VIEWER + Scène + + + PREF_GROUP_LEGEND + Légende + + + PREF_LEGEND_SYMBOL_TYPE + Type de symbole: + + + PREF_MARKER_ABOVE_LINE + Marqueur dessus de la ligne + + + PREF_MARKER_ON_LINE + Marqueur sur la ligne + + + PREF_DEVIATION_COLOR + Couleur des marqueurs de déviation + + + PREF_DEVIATION_MARKER_LW + Epaisseur des lignes des marqueurs de déviation + + + PREF_DEVIATION_MARKER_TS + Taille des coches des marqueurs de déviation + + + MEN_DESK_MRU + &Récemment utilisés + + + TOT_DESK_PREFERENCES + Préférences + + + DEFINE_EXTERNAL_BROWSER + Le navigateur externe n'est pas trouvé. Voulez-vous le définir dans les préférences? + + + PREF_AUTO_SIZE + Taille automatique pour les autres colonnes + + + TOT_DESK_MRU + Récemment utilisés + + + ACTIVATE_MODULE_OP_NEW + &Nouveau + + + ACTIVATE_MODULE_OP_OPEN + &Ouvrir... + + + PYTHON_CONSOLE + Console Python + + + PREF_GROUP_SELECTION + Sélection + + + PREF_ENABLE_SELECTION + Activer sélection + + + PREF_ENABLE_PRESELECTION + Activer pré-sélection + + + PREF_PRESELECTION + Pré-sélection + + + PREF_PRESELECTION_STANDARD + Standard + + + PREF_PRESELECTION_DYNAMIC + Dynamique + + + PREF_PRESELECTION_DISABLED + Désactivée + + + PREF_GROUP_CLIPPING + Plan de coupe + + + PREF_CLIPPING_COLOR + Couleur + + + PREF_CLIPPING_DEFAULT_TEXTURE + Utiliser la texture par défaut + + + PREF_CLIPPING_TEXTURE + Texture + + + OCC_TEXTURE_FILES + Fichiers images (*.jpeg *.jpg *.jpe *.png *.bmp *.gif *.ppm *.tif *.tiff* .tga *.exr) + + + PREF_CLIPPING_MODULATE + Fond transparent + + + PREF_CLIPPING_SCALE + Facteur d'échelle + + + PREF_GROUP_RAY_TRACING + Ray tracing + + + PREF_RAY_TRACING_DEPTH + Profondeur + + + PREF_RAY_TRACING_REFLECTION + Réflexions spéculaires + + + PREF_RAY_TRACING_ANTIALIASING + Anti-aliasing adaptatif + + + PREF_RAY_TRACING_SHADOW + Rendu des ombres + + + PREF_RAY_TRACING_TRANS_SHADOW + Ombres transparentes + + + PREF_GROUP_LIGHT + Source de lumière + + + PREF_LIGHT_COLOR + Couleurr + + + TOT_CLOSE + Fermer + + + MEN_DESK_CLOSE + &Fermer + + + PRP_CLOSE + Fermer la fenêtre active + + + TOT_CLOSE_ALL + Tout fermer + + + MEN_DESK_CLOSE_ALL + &Tout fermer + + + PRP_CLOSE_ALL + Fermer toutes les fenêtres + + + TOT_GROUP_ALL + Tout grouper + + + MEN_DESK_GROUP_ALL + Tout &grouper + + + PRP_GROUP_ALL + Grouper toutes les fenêtres + + + ERR_DOC_NOT_EXISTS + Impossible d'ouvrir %1. +Le fichier n'existe pas + + + PREF_GROUP_MRU + Montrer les études récemment utilisées + + + PREF_MRU_VISIBLE_COUNT + Nombre d'études + + + PREF_MRU_INSERT_MODE + Mode d'insertion + + + PREF_MRU_MOVE_FIRST + Placer au début + + + PREF_MRU_MOVE_LAST + Placer à la fin + + + PREF_MRU_ADD_FIRST + Ajouter au début + + + PREF_MRU_ADD_LAST + Ajouter à la fin + + + PREF_MRU_LINK_TYPE + Type de lien + + + PREF_MRU_LINK_AUTO + Auto + + + PREF_MRU_LINK_SHORT + Court + + + PREF_MRU_LINK_FULL + Complet + + + PREFERENCES_NOT_SUPPORTED + Les préférences du module "%1" ne sont pas supportées + + + PREF_TAB_SHORTCUTS + Raccourcis clavier + + + PREF_GROUP_SHORTCUTS + Réglage des raccourcis clavier + + + PREF_GROUP_FULL_SCREEN + Plein écran + + + PREF_FULL_SCREEN_AUTO + Cacher l'arbre d'étude and les barres d'outils des vues + + + PREF_TAB_PYEDITOR + Editeur python + + + PREF_GROUP_PY_FONT + Paramètres de la fonte + + + PREF_PY_FONT + Fonte + + + PREF_GROUP_PY_DISPLAY + Paramètres d'affichage + + + PREF_PY_CURRLINE_HIGHLIGHT + Met en surbrillance de la ligne actuelle + + + PREF_PY_TEXT_WRAP + Retour à la ligne dynamique + + + PREF_PY_CURSON_ON_SCROLL + Centre le curseur lors du scroll + + + PREF_PY_LINE_NUMBS_AREA + Affiche les numéros de ligne + + + PREF_GROUP_PY_EDITOR + Paramètres de l'éditeur + + + PREF_PY_COMPLETION_MODE + Mode de complétion + + + PREF_PY_NONE + Aucun + + + PREF_PY_AUTO + Auto + + + PREF_PY_MANUAL + Manuel + + + PREF_PY_ALWAYS + Toujours + + + PREF_GROUP_PY_TAB + Indentation + + + PREF_PY_TAB_WHITESPACES + Affiche les guides d'indentation + + + PREF_PY_TAB_SIZE + Largeur d'intentation: + + + PREF_GROUP_VERT_EDGE + Marqueur de retour à la ligne + + + PREF_PY_VERT_EDGE + Afficher la ligne verticale + + + PREF_PY_NUM_COLUMNS + Nombre de colonnes: + + + INFO_WELCOME_TO_SALOME + Welcome to SALOME + + + INFO_GETTING_STARTED + Getting started + + + INFO_AVAILABLE_MODULES + Available modules + + + + LightApp_Module + + MEN_HIDE + Cacher + + + TOP_DISPLAY_ONLY + Afficher uniquement + + + STB_DISPLAY_ONLY + Afficher uniquement + + + MEN_DISPLAY_ONLY + Afficher uniquement + + + TOP_HIDE + Cacher + + + MEN_ERASE_ALL + Tout cacher + + + STB_HIDE + Cacher + + + STB_SHOW + Afficher + + + TOP_SHOW + Afficher + + + MEN_SHOW + Afficher + + + STB_ERASE_ALL + Tout cacher + + + TOP_ERASE_ALL + Tout cacher + + + + LightApp_ModuleDlg + + DESCRIPTION + Vous activez le module + <b>%1</b>.<br>Choisissez l'action nécessaire avec le bouton correspondant ci-dessous + + + CANCEL + &Annuler + + + CAPTION + Activer le module + + + + LightApp_NameDlg + + TLT_RENAME + Renommer + + + NAME_LBL + Nom: + + + + LightApp_PreferencesDlg + + IMPORT_PREFERENCES + Importer les préférences + + + XML_FILES_FILTER + Fichiers XML (*.xml) + + + CAPTION + Préférences + + + WARNING + Avertissement + + + IMPORT_BTN_TEXT + Importer + + + DEFAULT_QUESTION + Voulez-vous restaurer les préférences par défaut ? + + + DEFAULT_BTN_TEXT + Défauts + + + PREF_NEED_RESTART + Des changements prendront effets seulement après un redémarrage de l'application + + + + LightApp_ModuleAction + + ACTIVATE_MODULE_TOP + Activer/désactiver le module %1 + + + + LightApp_PyEditor + + TOT_DUMP_PYCOMMANDS + &Générer le script des commandes + + + TOT_SAVE_PYLOG + Sauver la trace + + + diff --git a/src/ShaperApp/resources/LightShaperApp_msg_ja.ts b/src/ShaperApp/resources/LightShaperApp_msg_ja.ts new file mode 100644 index 000000000..009aff53e --- /dev/null +++ b/src/ShaperApp/resources/LightShaperApp_msg_ja.ts @@ -0,0 +1,1281 @@ + + + + + @default + + EXTERNAL_BROWSER_CANNOT_SHOW_PAGE + 拡張ブラウザ "%1" はヘルプページ "%2"は見ることができない。設定を変更しますか? + + + ABOUT_COPYRIGHT + Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + +Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, +CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + + + ABOUT_CAPTION + %1について + + + ABOUT_BASE + 一般的な情報 + + + ABOUT_MODULE_INFOS + モジュール情報 + + + ABOUT_UNKNOWN_VERSION + 不明 + + + ABOUT_CLOSE + 閉じる(&C) + + + APP_NAME + SHAPER + + + ABOUT_LICENSE + GNU LGPL + + + ABOUT_VERSION + Version %1 + + + SALOME_SITE + SALOME Website + + + SALOME_FORUM + SALOME Forum + + + SALOME_VIDEO_TUTORIALS + Video Tutorials + + + PRP_SALOME_VIDEO_TUTORIALS + Visit YouTube channel with some videos + + + SALOME_TUTORIALS + Tutorials + + + PRP_SALOME_TUTORIALS + Try tutorials from SALOME site + + + ENTRY_COLUMN + エントリ + + + APPCLOSE_CAPTION + 現在のスタディを閉じる + + + STUDYCLOSE_DESCRIPTION + The current study has unsaved changes. Would you like to save before closing it? + + + APPCLOSE_SAVE + はい(&Y) + + + APPCLOSE_CLOSE + いいえ(&N) + + + APPCLOSE_CANCEL + キャンセル(&C) + + + WRN_PYTHON_FILE_NAME_BAD + 正確なファイル名を入力してください。 +Pythonファイルは、文字、数字、アンダースコアが含まれており、文字またはアンダースコアから開始する必要があります。 + + + PYTHON_FILES_FILTER + ファイル (*.py) PYTHON + + + LOG_FILES_FILTER + ログファイル (*.log *.txt) + + + + LightApp_Application + + LANG_CHANGED + アプリケーションの言語が変更されました。<BR>変更は、次のセッションに適用されます。 + + + LOCALE_CHANGED + アプリケーションの言語が変更されました。 +次回のセッションから有効になります。 + + + MEN_DESK_THEME + テーマ(&h) + + + TOT_THEME + テーマ + + + PRP_THEME + スタイルのプロパティを変更 + + + TOT_FULLSCREEN + 全画面表示 + + + MEN_DESK_FULLSCREEN + 全画面表示 + + + PRP_FULLSCREEN + 全画面表示モードに切り替え + + + INF_TOOLBAR_MODULES + モジュール情報 + + + PREF_SHOW_LEGEND + 凡例を表示 + + + MEN_DESK_RENAME + 名前変更(&R) + + + PREF_MULTI_FILE + 複数ファイルの保存 + + + MEN_DESK_PREFERENCES + 環境設定...(&f) + + + PREF_TRIHEDRON_SHOW + 三面体を表示 + + + PREF_TRIHEDRON + 三面体 + + + PREF_TRIHEDRON_SIZE + サイズ + + + OBJECT_BROWSER + オブジェクトブラウザー + + + INFO_PANEL + Help panel + + + PRP_DESK_PREFERENCES + 設定を変更することができます。 + + + PREF_GROUP_DIRECTORIES + ディレクトリの一覧 + + + PREF_GROUP_VTKVIEWER + VTK 3D Viewer + + + PREF_LOAD_LIGHT + スタディを開くときにLightモジュールを自動読み込みする + + + PREF_STORE_POS + ウィンドウの位置を保存 + + + PREF_STORE_TOOL_POS + ツールバーの位置を保存します。 + + + PREF_AUTO_SAVE + 自動保存間隔 (分) + + + PREF_AUTO_SAVE_DISABLED + 無効 + + + PREF_PROJECTION_MODE + 投影モード: + + + PREF_ORTHOGRAPHIC + 直交 + + + PREF_PERSPECTIVE + 遠近法 + + + PREF_POLYGON_SELECTION + Polygon + + + PREF_CIRCLE_SELECTION + Circle + + + PREF_SELECTION_STYLE + Advanced selection + + + PREF_NAVIGATION + ナビゲーション スタイル + + + PREF_STANDARD_STYLE + Salome標準コントロール + + + PREF_KEYFREE_STYLE + キーボードなしのスタイル + + + PREF_ZOOMING + ズーム モード: + + + PREF_ZOOMING_AT_CENTER + ビューの中心を基準 + + + PREF_ZOOMING_AT_CURSOR + カーソルを中心に + + + PREF_INCREMENTAL_SPEED + 速度の増加: + + + PREF_INCREMENTAL_SPEED_MODE + 編集モード: + + + PREF_ARITHMETIC + Arithmetic progression + + + PREF_GEOMETRICAL + 幾何学的進行 + + + PREF_FRAME_SPACEMOUSE + Spacemouse + + + PREF_SHOW_STATIC_TRIHEDRON + 静的三面体をを表示 + + + PREF_SPACEMOUSE_FUNC_1 + 速度低減 + + + PREF_SPACEMOUSE_FUNC_2 + 速度増加 + + + PREF_SPACEMOUSE_FUNC_3 + Dominant / combined スイッチ + + + PREF_SPACEMOUSE_BTN_1 + ボタン 1 + + + PREF_SPACEMOUSE_BTN_2 + ボタン 2 + + + PREF_SPACEMOUSE_BTN_3 + ボタン 3 + + + PREF_SPACEMOUSE_BTN_4 + ボタン 4 + + + PREF_SPACEMOUSE_BTN_5 + ボタン 5 + + + PREF_SPACEMOUSE_BTN_6 + ボタン 6 + + + PREF_SPACEMOUSE_BTN_7 + ボタン 7 + + + PREF_SPACEMOUSE_BTN_8 + ボタン 8 + + + PREF_SPACEMOUSE_BTN_* + ボタン * + + + PREF_SPACEMOUSE_BTN_10 + ボタン 10 + + + PREF_SPACEMOUSE_BTN_11 + ボタン 11 + + + PREF_FRAME_RECORDING + AVIで記録 + + + PREF_ALL_DISLPAYED_FRAMES + 表示されるすべてのフレームを保存 + + + PREF_FPS + FPS + + + PREF_GROUP_TTL + パラメーター + + + PREF_PROGRESSIVE + プログレッシブ + + + PREF_QUALITY + 品質 + + + PREF_RECORDING_MODE + モード + + + PREF_SKIPPED_FRAMES + 与えられたFPSに記録しています + + + PREF_FRAME_GROUP_NAMES + グループの名前 + + + PREF_GROUP_NAMES_TEXT_COLOR + テキストの色 + + + PREF_GROUP_NAMES_TRANSPARENCY + 透明度 + + + PREF_BOTTOM + Bottom + + + PREF_CURVE_TYPE + 曲線の種類: + + + PREF_POINTS + ポイント + + + PRP_MODULE + モジュール”%1”に切り替え + + + PREF_ASCII_FILE + ASCIIでの保存 + + + PREFERENCES_NOT_LOADED + “<b>%N</b>”モジュールの環境設定は、そのモジュールをロードしているときだけです。 + + + PREF_LINEAR + 線形 + + + DATA_MODELS + データ モデル + + + PRP_RENAME + アクティブなウィンドウの名前を変更 + + + TOT_RENAME + 名前変更 + + + MEN_RENAME_OBJ + 名前変更 + + + LOG_WINDOW + メッセージウィンドウ + + + PREF_SPLINE + スプライン + + + PREF_OBJ_BROWSER_SEARCH_TOOL + 検索ツール + + + PREF_AUTO_HIDE_SEARCH_TOOL + 自動非表示の有効化 + + + PREF_OBJ_BROWSER_SETTINGS + オブジェクトブラウザーの設定 + + + PRP_APP_MODULE + Salomeプラットフォームの中立ポイントにスイッチ + + + PREF_GROUP_PY_CONSOLE + Python コンソールのプロパティ + + + PREF_SHOW_BANNER + バナーの表示 + + + PREF_AUTO_COMPLETION + コマンドオートコンプリート + + + PREF_GROUP_STYLE + Salomeスタイル + + + PREF_USE_SALOME_STYLE + Salomeスタイルを使用 + + + PREF_MARKER_SIZE + マーカーのサイズ: + + + PREF_TAB_VIEWERS + シーン + + + PREF_APP + アプリケーション + + + PREF_TOP + トップ + + + MEN_REFRESH + 更新 + + + PREF_AUTO_SIZE_FIRST + [名前] 列の自動サイズ + + + PREF_RESIZE_ON_EXPAND_ITEM + オブジェクトを開いたときの列のサイズを変更 + + + PREF_BROWSE_TO_THE_PUBLISHED_OBJECT + 公開オブジェクトをブラウズ + + + PREF_BROWSE_NEVER + なし + + + PREF_BROWSE_AFTER_APPLY_AND_CLOSE_ONLY + 適用して閉じるをした後のみ + + + PREF_BROWSE_ALWAYS + 適用毎に + + + PREF_TAB_OBJBROWSER + オブジェクトブラウザー + + + PREF_TAB_GENERAL + 一般的な + + + NEW_WINDOW_0 + GL 2D view(&G) + + + NEW_WINDOW_1 + Plot 2D View(&P) + + + NEW_WINDOW_2 + OCC 3D View(&O) + + + NEW_WINDOW_3 + VTK 3D View(&K) + + + NEW_WINDOW_4 + シーン QxScene(&S) + + + NEW_WINDOW_5 + グラフィックの表示 (&r) + + + NEW_WINDOW_6 + ParaView 表示 (&w) + + + NEW_WINDOW_7 + P&ython view + + + CREATING_NEW_WINDOW + 新しい %1 を作成します。 + + + OBJ_BROWSER_NAME + オブジェクト + + + PREF_LEGEND_POSITION + 凡例の位置: + + + PREF_RELATIVE_SIZE + 相対 + + + PREF_VIEWER_BACKGROUND + 背景 + + + PREF_VIEWER_BACKGROUND_COLOR + 背景色 + + + PREF_VIEWER_SELECTION + 選択色 + + + PREF_XYVIEWER_BACKGROUND + XY 表示 + + + PREF_XZVIEWER_BACKGROUND + XZ ビュー + + + PREF_YZVIEWER_BACKGROUND + ビュー YZ + + + PREF_3DVIEWER_BACKGROUND + 3D ビュー + + + PREF_FONT + フォント + + + PREF_LEGEND_FONT + 凡例のフォント + + + PREF_FONT_COLOR + 凡例のフォントの色 + + + PREF_SELECTED_FONT_COLOR + ハイライトした凡例の文字色 + + + PREF_LEFT + 左 + + + PREF_TAB_DIRECTORIES + ディレクトリー + + + ACTIVATING_MODULE + モジュール”%1”をアクティブにする + + + PREF_VERT_AXIS_SCALE + 垂直軸のスケール: + + + PREF_HOR_AXIS_SCALE + 水平方向の軸のスケール: + + + PREF_GROUP_LANGUAGE + 言語 + + + PREF_CURRENT_LANGUAGE + 現在の言語 + + + PREF_CURRENT_LOCALE + 言語 "C" を使います + + + PREF_GROUP_LOOK_AND_FEEL + 外観 + + + PREF_SHOW_SPLASH + スプラッシュ スクリーンを表示します。 + + + PREF_OPAQUE_RESIZE + 不透明のサイズ変更 + + + PREF_GROUP_STUDY + スタディのプロパティ + + + PREF_CATEGORY_SALOME + SALOME + + + PREF_DROP_DOWN_BUTTONS + バーでのボタンの配置 + + + PREF_NOTIFY_TIMEOUT + Notifications auto-hide timeout + + + PREF_NOTIFY_TIMEOUT_NONE + None + + + PREF_GROUP_COMMON + 共通 + + + PREF_GROUP_3DVIEWER + 3D シーン + + + PREF_GROUP_OCCVIEWER + OCC 3D Viewer + + + PREF_GROUP_STEREO + ステレオレンダリング + + + PREF_STEREO_TYPE + ステレオタイプ + + + PREF_ANAGLYPH_FILTER + Anaglyph filter + + + PREF_ANAGLYPH_RED_CYAN + 赤-シアン投影 + + + PREF_ANAGLYPH_YELLOW_BLUE + 黄-青投影 + + + PREF_ANAGLYPH_GREEN_MAGENTA + 緑-マゼンタ投影 + + + PREF_FOCUS_TYPE + 一致距離型 + + + PREF_FOCUS_VALUE + 立体画法焦点値 + + + PREF_IOD_TYPE + 眼間距離(IOD)型 + + + PREF_IOD_VALUE + 眼間距離(IOD)値 + + + PREF_ABSOLUTE + 絶対 + + + PREF_RELATIVE + 早退 + + + PREF_REVERSE_STEREO + Reverse stereo + + + PREF_ENABLE_VSYNC + V-Syncを有効 + + + PREF_ENABLE_QUAD_BUFFER_SUPPORT + quad-buffer サポートを有効 + + + PREF_LOGARITHMIC + 対数 + + + MEN_DESK_MODULE_HELP + モジュールのヘルプ + + + PREF_SUPERV_TITLE_COLOR + タイトルの色 + + + PREF_PARAM + パラメーター + + + PREF_RIGHT + 右 + + + PREF_LINES + ライン + + + INF_CANCELLED + モジュールの有効化をキャンセル + + + PREF_GROUP_EXT_BROWSER + 外部ブラウザー + + + PREF_SUPERV_CTRL_COLOR + コントロールの色 + + + PREF_GROUP_DEF_COLUMNS + 既定の列 + + + PREF_GROUP_PLOT2DVIEWER + Plot 2D Viewer + + + PREF_GROUP_VIEWER + ビューワ + + + PREF_GROUP_LEGEND + 凡例 + + + PREF_LEGEND_SYMBOL_TYPE + シンボルの型: + + + PREF_MARKER_ABOVE_LINE + 線の上のマーカー + + + PREF_MARKER_ON_LINE + 線上のマーカー + + + PREF_DEVIATION_COLOR + 偏差のマーカーの色 + + + PREF_DEVIATION_MARKER_LW + 偏差のマーカーの線の太さ + + + PREF_DEVIATION_MARKER_TS + サイズ偏差マーカーのチェック マーク + + + MEN_DESK_MRU + 最近使用したファイル + + + TOT_DESK_PREFERENCES + 設定 + + + DEFINE_EXTERNAL_BROWSER + 外部のブラウザーが見つかりません。環境設定で設定しますか。 + + + PREF_AUTO_SIZE + 他の列の自動サイズ + + + TOT_DESK_MRU + 最近使用したファイル + + + ACTIVATE_MODULE_OP_NEW + 新規作成(&N) + + + ACTIVATE_MODULE_OP_OPEN + 開く...(&O) + + + PYTHON_CONSOLE + Python コンソール + + + PREF_GROUP_SELECTION + 選択 + + + PREF_ENABLE_SELECTION + 選択範囲を有効にします。 + + + PREF_ENABLE_PRESELECTION + 予選を有効にします。 + + + PREF_PRESELECTION + 予選 + + + PREF_PRESELECTION_STANDARD + 標準 + + + PREF_PRESELECTION_DYNAMIC + 動的 + + + PREF_PRESELECTION_DISABLED + 無効になっています。 + + + PREF_GROUP_CLIPPING + クリッピングパラメータ + + + PREF_CLIPPING_COLOR + 色 + + + PREF_CLIPPING_DEFAULT_TEXTURE + デフォルトテキスチャの使用 + + + PREF_CLIPPING_TEXTURE + テキスチャ + + + OCC_TEXTURE_FILES + イメージファイル (*.jpeg *jpg *.jpe *.png *.bmp *.gif *.ppm *.tif *.tiff* .tga *.exr) + + + PREF_CLIPPING_MODULATE + 調整 + + + PREF_CLIPPING_SCALE + スケールファクタ + + + PREF_GROUP_RAY_TRACING + レイトレース + + + PREF_RAY_TRACING_DEPTH + 深度 + + + PREF_RAY_TRACING_REFLECTION + 狭反射 + + + PREF_RAY_TRACING_ANTIALIASING + 最適アンチエイリアシング + + + PREF_RAY_TRACING_SHADOW + シャドウレンダリング + + + PREF_RAY_TRACING_TRANS_SHADOW + 透過影 + + + PREF_GROUP_LIGHT + 光源 + + + PREF_LIGHT_COLOR + 色 + + + TOT_CLOSE + 閉じる + + + MEN_DESK_CLOSE + 閉じる(&C) + + + PRP_CLOSE + アクティブ ウィンドウを閉じる + + + TOT_CLOSE_ALL + すべて閉じる + + + MEN_DESK_CLOSE_ALL + すべて閉じる + + + PRP_CLOSE_ALL + すべてのウィンドウを閉じる + + + TOT_GROUP_ALL + すべてをグループ化 + + + MEN_DESK_GROUP_ALL + すべてをグループ化(&G) + + + PRP_GROUP_ALL + すべてのウィンドウをグループ化 + + + ERR_DOC_NOT_EXISTS + %1 を開くことができません。ファイルが存在しません + + + PREF_GROUP_MRU + MRUアイテムの表示 + + + PREF_MRU_VISIBLE_COUNT + MRUアイテムの数 + + + PREF_MRU_INSERT_MODE + 挿入モード + + + PREF_MRU_MOVE_FIRST + 先頭に移動 + + + PREF_MRU_MOVE_LAST + 末尾に移動 + + + PREF_MRU_ADD_FIRST + 先頭に追加 + + + PREF_MRU_ADD_LAST + 最後に追加 + + + PREF_MRU_LINK_TYPE + リンクの種類 + + + PREF_MRU_LINK_AUTO + 自動 + + + PREF_MRU_LINK_SHORT + 短い + + + PREF_MRU_LINK_FULL + 完全な + + + PREFERENCES_NOT_SUPPORTED + モジュール "%1" の設定はサポートされていません + + + PREF_TAB_SHORTCUTS + ショートカット + + + PREF_GROUP_SHORTCUTS + ショートカットの設定 + + + PREF_GROUP_FULL_SCREEN + 全画面表示 + + + PREF_FULL_SCREEN_AUTO + オブジェクトブラウザと表示ツールバーを隠す + + + PREF_TAB_PYEDITOR + Python Viewer + + + PREF_GROUP_PY_FONT + フォント設定 + + + PREF_PY_FONT + フォント + + + PREF_GROUP_PY_DISPLAY + セッティング表示 + + + PREF_PY_CURRLINE_HIGHLIGHT + 現在のハイライト線を有効 + + + PREF_PY_TEXT_WRAP + テキストラッピングを有効 + + + PREF_PY_CURSON_ON_SCROLL + スクロール上のセンタカーソル + + + PREF_PY_LINE_NUMBS_AREA + ライン数エリアの表示 + + + PREF_GROUP_PY_EDITOR + エディタ設定 + + + PREF_PY_COMPLETION_MODE + 完了モード + + + PREF_PY_NONE + なし + + + PREF_PY_AUTO + 自動 + + + PREF_PY_MANUAL + 手動 + + + PREF_PY_ALWAYS + 常に + + + PREF_GROUP_PY_TAB + 設定タブ + + + PREF_PY_TAB_WHITESPACES + タブホワイトスペースタブの表示 + + + PREF_PY_TAB_SIZE + タブサイズ: + + + PREF_GROUP_VERT_EDGE + 垂直エッジ設定 + + + PREF_PY_VERT_EDGE + 垂直エッジの表示 + + + PREF_PY_NUM_COLUMNS + 列数 + + + INFO_WELCOME_TO_SALOME + Welcome to SALOME + + + INFO_GETTING_STARTED + Getting started + + + INFO_AVAILABLE_MODULES + Available modules + + + + LightApp_Module + + MEN_HIDE + 非表示 + + + TOP_DISPLAY_ONLY + 選択のみ表示 + + + STB_DISPLAY_ONLY + 選択のみ表示 + + + MEN_DISPLAY_ONLY + 選択のみ表示 + + + TOP_HIDE + 非表示 + + + MEN_ERASE_ALL + すべてを非表示 + + + STB_HIDE + 非表示 + + + STB_SHOW + 表示 + + + TOP_SHOW + 表示 + + + MEN_SHOW + 表示 + + + STB_ERASE_ALL + すべてを非表示 + + + TOP_ERASE_ALL + すべてを非表示 + + + + LightApp_ModuleDlg + + DESCRIPTION + モジュール <b>%1</b> を起動します。<br>下のボタンを押して動作を選択して下さい。 + + + CANCEL + キャンセル(&C) + + + CAPTION + モジュールのアクティブ化 + + + + LightApp_NameDlg + + TLT_RENAME + 名前変更 + + + NAME_LBL + 名前: + + + + LightApp_PreferencesDlg + + IMPORT_PREFERENCES + インポート設定 + + + XML_FILES_FILTER + XMLファイル (*.xml) + + + CAPTION + 環境設定 + + + WARNING + 警告 + + + IMPORT_BTN_TEXT + インポート + + + DEFAULT_QUESTION + 既定の設定を復元しますか? + + + DEFAULT_BTN_TEXT + デフォルト + + + PREF_NEED_RESTART + 幾つかの変更はアプリケーションを再起動後に有効になります + + + + LightApp_ModuleAction + + ACTIVATE_MODULE_TOP + モジュール %1 の有効/無効にします。 + + + + LightApp_PyEditor + + TOT_DUMP_PYCOMMANDS + スクリプト コマンドを生成します。 + + + TOT_SAVE_PYLOG + ログの保存 + + + diff --git a/src/ShaperApp/resources/ShaperApp.xml b/src/ShaperApp/resources/ShaperApp.xml new file mode 100644 index 000000000..aab5264ca --- /dev/null +++ b/src/ShaperApp/resources/ShaperApp.xml @@ -0,0 +1,49 @@ + + + +
+ + + + + + + + + + + +
+
+ + +
+
+ + + + + +
+
+ + + + + + + + +
+
+ + + + + + +
+ +
diff --git a/src/ShaperApp/resources/ShaperApp_images.ts b/src/ShaperApp/resources/ShaperApp_images.ts new file mode 100644 index 000000000..305ed4131 --- /dev/null +++ b/src/ShaperApp/resources/ShaperApp_images.ts @@ -0,0 +1,4 @@ + + + + diff --git a/src/ShaperApp/resources/ShaperApp_msg_en.ts b/src/ShaperApp/resources/ShaperApp_msg_en.ts new file mode 100644 index 000000000..d75e202a2 --- /dev/null +++ b/src/ShaperApp/resources/ShaperApp_msg_en.ts @@ -0,0 +1,574 @@ + + + + + @default + + WRN_FILE_NOT_EXIST + The file %1 does not exist. + + + WRN_STUDY_LOCKED + Study is locked. + + + WRN_NO_STUDY_ON SERV + No active study in this session. + + + CLOSE_LOCKED_STUDY + Close locked study? + + + PUBLISH_IN_STUDY + Publish in study + + + MULTI_FILE_DUMP + Multi file dump + + + BUT_NEW + &New + + + SAVE_POINT_ROOT_NAME + GUI states + + + SAVE_POINT_ROOT_TOOLTIP + Persistent GUI states + + + SAVE_GUI_STATE + Save GUI state + + + BUT_LOAD + &Load + + + BUT_OPEN + &Open + + + SAVE_POINT_OBJECT_TOOLTIP + Saved GUI state: %1 + + + SAVE_POINT_DEF_NAME + GUI state: + + + VALUE_COLUMN + Value + + + IOR_COLUMN + IOR + + + REFENTRY_COLUMN + Ref.Entry + + + ERR_INCOMPATIBLE_TYPE + Variable with name "%1" has incompatible numeric type + + + ERR_INVALID_VALUE + Value hasn't been validated + + + ERR_NO_VARIABLE + Variable with name "%1" doesn't exist + + + ERR_ACTIVE_STUDY_CREATE + Cannot create study: there is already an active study in this session. +Launch a new session or close the study. + + + ERR_ACTIVE_STUDY_OPEN + Cannot open study: there is already an active study in this session. +Launch a new session or close the study. + + + OPEN_DOCUMENT_PROBLEM + Unknown problem during opening of the document + + + CREATE_DOCUMENT_PROBLEM + Unknown problem during creation of the document + + + TOT_DESK_CONNECT_STUDY + Connect study + + + TOT_DESK_DISCONNECT_STUDY + Disconnect study + + + PRP_DESK_CONNECT + Connect active study + + + PRP_DESK_DISCONNECT + Disconnect the current study + + + MEN_DESK_CONNECT + Conn&ect + + + MEN_DESK_DISCONNECT + D&isconnect + + + + SalomeApp_Application + + ALL_FILES_FILTER + All files (*.*) + + + APPCLOSE_UNLOAD + &Disconnect w/o saving + + + APPCLOSE_UNLOAD_SAVE + S&ave && Disconnect + + + MEN_WINDOWS_NEW + New Window + + + MEN_DELETE_INVALID_REFERENCE + Delete Invalid Reference + + + TOT_FILE_DESK_PREFERENCES + Preferences + + + MEN_DELETE_VS + Delete + + + MEN_OPENWITH + Activate %1 Module + + + MEN_DESK_REGISTRY_DISPLAY + Registry &Display + + + TOT_DESK_FILE_LOAD_SCRIPT + Load python script + + + PREF_PYDUMP_PUBLISH + Publish in study in python dump + + + PREF_PYDUMP_MULTI_FILE + Multi file python dump + + + PREF_PYDUMP_SAVE_GUI + Save GUI state in python dump + + + PREF_STORE_VISUAL_STATE + Store/restore last GUI state + + + PRP_DESK_FILE_SAVE_GUI_STATE + Saves current state of viewers, displayed objects, etc. + + + MEN_DESK_FILE_SAVE_GUI_STATE + Save GUI State + + + TOT_DESK_FILE_SAVE_GUI_STATE + Save GUI state + + + MEN_RESTORE_VS + Restore + + + WRN_DUMP_STUDY_FAILED + Dump study failed + + + MEN_DESK_PROPERTIES + Pro&perties... + + + QUE_DOC_ALREADYEXIST + The document %1 already exists. +Do you want to reload it ? + + + MEN_RENAME_VS + Rename + + + TOT_DESK_CATALOG_GENERATOR + Catalog generator + + + TOT_DESK_ADD_VARS_TO_NOTEBOOK + Add vars to notebook + + + PUBLISH_IN_STUDY + Publish in study + + + PREF_OBJ_BROWSER_SETTINGS + Settings + + + PRP_DESK_REGISTRY_DISPLAY + Displays content of the Registry CORBA server + + + APPCLOSE_DESCRIPTION + Do you want to save study before closing? + + + PRP_DESK_PROPERTIES + Edits study properties + + + PREF_TAB_OBJBROWSER + Object browser + + + STUDY_LOCKED + LOCKED + + + OBJ_BROWSER_NAME + Object + + + TOT_DESK_REGISTRY_DISPLAY + Registry display + + + OBJ_BROWSER_COLUMN_0 + Entry + + + OBJ_BROWSER_COLUMN_1 + Value + + + OBJ_BROWSER_COLUMN_2 + IOR + + + OBJ_BROWSER_COLUMN_3 + Reference entry + + + PREF_CATEGORY_SALOME + SALOME + + + PYTHON_CONSOLE + Python Console + + + MEN_DESK_FILE_LOAD_SCRIPT + Load Scrip&t... + + + MEN_DESK_TOOLS + &Tools + + + MEN_DESK_PLUGINS_TOOLS + Tools + + + MEN_DESK_PLUGINS + Plugins + + + TOT_DESK_FILE_DUMP_STUDY + Dump study + + + MEN_VIEW_WNDS + Windows + + + MEN_DESK_FILE_DUMP_STUDY + &Dump Study... + + + PRP_DESK_CATALOG_GENERATOR + Generates XML catalog of a component's interface + + + PRP_DESK_ADD_VARS_TO_NOTEBOOK + Add variables of the study to the notebook + + + PRP_DESK_FILE_DUMP_STUDY + Dumps study to the python script + + + TOT_DESK_FILE_NOTEBOOK + Open Notebook + + + MEN_DESK_FILE_NOTEBOOK + Noteboo&k... + + + PRP_DESK_FILE_NOTEBOOK + Open Notebook + + + TOT_DESK_PROPERTIES + Study properties + + + PREF_GROUP_DEF_COLUMNS + Default columns + + + PRP_DESK_FILE_LOAD_SCRIPT + Loads python script from file + + + MEN_DESK_CATALOG_GENERATOR + Catalog &Generator + + + MEN_DESK_ADD_VARS_TO_NOTEBOOK + Add vars to NoteBook + + + MEN_DESK_MRU + Most Recently Used + + + TOT_DESK_MRU + Most recently used + + + ACTIVATE_MODULE_OP_LOAD + &Connect + + + ACTIVATE_MODULE_OP_SCRIPT + Load &Script... + + + DISCONNECT_CAPTION + Disconnect active study + + + DISCONNECT_DESCRIPTION + Do you want to save study before disconnect? + + + DISCONNECT_SAVE + &Save && Disconnect + + + DISCONNECT_WO_SAVE + &Disconnect w/o saving + + + + SalomeApp_StudyPropertiesDlg + + PRP_MODE_FROM_SCRATCH + from scratch + + + PRP_AUTHOR + Author + + + PRP_LOCKED + Locked + + + PRP_MODIFICATIONS + Modifications + + + PRP_COMPONENT + Component + + + PRP_VERSION + Version + + + PRP_VERSIONS + Stored data + + + PRP_DATE_MODIF + Date + + + PRP_UNITS + Length units + + + PRP_COMMENT + Comment + + + PRP_NO + No + + + PRP_YES + Yes + + + PRP_MODIFIED + Modified + + + PRP_NOT_MODIFIED + Not modified + + + PRP_DATE + Creation date + + + PRP_MODE + Mode + + + PRP_MODE_FROM_COPYFROM + copy from + + + TLT_STUDY_PROPERTIES + Study Properties + + + + SalomeApp_ExitDlg + + SHUTDOWN_SERVERS + Shutdown servers + + + + NoteBook_Table + + REMOVE_VARIABLE_IS_USED + Variable with name "%1" is used in the study. +Do you really want to remove it? + + + RENAME_VARIABLE_IS_USED + Variable with name "%1" is used in the study. +Do you really want to rename it? + + + VARNAME_COLUMN + Variable + + + VARVALUE_COLUMN + Value + + + VARVALUE_INCORRECT + Variable Value Incorrect: %1 + + + VARNAME_INCORRECT + Variable Name Incorrect :%1 + + + VARNAME_EXISTS + Variable with name "%1" exists + + + + SalomeApp_NoteBook + + NOTEBOOK_TITLE + NoteBook + + + BUT_UPDATE_STUDY + &Update Study + + + BUT_REMOVE + &Remove + + + BUT_APPLY_AND_CLOSE + A&pply and Close + + + BUT_HELP + &Help + + + CLOSE_CAPTION + Close NoteBook + + + CLOSE_DESCRIPTION + Do you want to save changes you made to NoteBook? + + + INCORRECT_DATA + At least one variable has been defined incorrectly. +Please edit its parameters or remove it from table. + + + ERR_UPDATE_STUDY_FAILED + Failed to update study! + + + + SalomeApp_DoubleSpinBox + + VALID_RANGE_VAR_MSG + Specify either a variable name or +a floating-point value in range ( %1; %2 ) +with %3-digit precision + + + VALID_RANGE_NOVAR_MSG + Specify a floating-point value in range ( %1; %2 ) +with %3-digit precision + + + + SalomeApp_IntSpinBox + + VALID_RANGE_VAR_MSG + Specify either a variable name or +an integer value in range ( %1; %2 ) + + + VALID_RANGE_NOVAR_MSG + Specify an integer value in range ( %1; %2 ) + + + diff --git a/src/ShaperApp/resources/ShaperApp_msg_fr.ts b/src/ShaperApp/resources/ShaperApp_msg_fr.ts new file mode 100644 index 000000000..ac9e08e95 --- /dev/null +++ b/src/ShaperApp/resources/ShaperApp_msg_fr.ts @@ -0,0 +1,574 @@ + + + + + @default + + WRN_FILE_NOT_EXIST + Le fichier %1 n'existe pas. + + + WRN_STUDY_LOCKED + L'étude est verrouillée + + + WRN_NO_STUDY_ON SERV + Pas d'étude active dans cette session. + + + CLOSE_LOCKED_STUDY + Fermer l'étude verrouillée ? + + + PUBLISH_IN_STUDY + Publier dans l'étude + + + MULTI_FILE_DUMP + Dump multi-fichiers + + + BUT_NEW + &Nouvelle + + + SAVE_POINT_ROOT_NAME + Etats d'IHM + + + SAVE_POINT_ROOT_TOOLTIP + Etats d'IHM persistents + + + SAVE_GUI_STATE + Sauvegarder l'état d'IHM + + + BUT_LOAD + &Charger + + + BUT_OPEN + &Ouvrir + + + SAVE_POINT_OBJECT_TOOLTIP + Etat d'IHM: %1 sauvegardé + + + SAVE_POINT_DEF_NAME + Etat d'IHM: + + + VALUE_COLUMN + Valeur + + + IOR_COLUMN + IOR + + + REFENTRY_COLUMN + Entrée de réf. + + + ERR_INCOMPATIBLE_TYPE + Le type numérique de la variable "%1" n'est pas compatible + + + ERR_INVALID_VALUE + La valeur n'a pas été validée + + + ERR_NO_VARIABLE + La variable "%1" n'existe pas. + + + ERR_ACTIVE_STUDY_CREATE + Impossible de créer une étude car il y en a déjà une d'active. +Lancez une nouvelle session ou fermez l'étude en cours. + + + ERR_ACTIVE_STUDY_OPEN + Impossible d'ouvrir l'étude car il y en a déjà une d'active. +Lancez une nouvelle session ou fermez l'étude en cours. + + + OPEN_DOCUMENT_PROBLEM + Problème inconnu à l'ouverture du document + + + CREATE_DOCUMENT_PROBLEM + Problème inconnu à la création du document + + + TOT_DESK_CONNECT_STUDY + Connecter l'étude + + + TOT_DESK_DISCONNECT_STUDY + Déconnecter l'étude + + + PRP_DESK_CONNECT + Connecter l'étude en cours + + + PRP_DESK_DISCONNECT + Déconnecter l'étude en cours + + + MEN_DESK_CONNECT + Conn&ecter + + + MEN_DESK_DISCONNECT + D&éconnecter + + + + SalomeApp_Application + + ALL_FILES_FILTER + Tous les fichiers (*.*) + + + APPCLOSE_UNLOAD + &Déconnecter sans sauvegarder + + + APPCLOSE_UNLOAD_SAVE + Sauvegarder && D&éconnecter + + + MEN_WINDOWS_NEW + Nouvelle fenêtre + + + MEN_DELETE_INVALID_REFERENCE + Supprimer la référence invalide + + + TOT_FILE_DESK_PREFERENCES + Préférences + + + MEN_DELETE_VS + Supprimer + + + MEN_OPENWITH + Activer module %1 + + + MEN_DESK_REGISTRY_DISPLAY + Affichage du registre CORBA + + + TOT_DESK_FILE_LOAD_SCRIPT + Exécuter un script python + + + PREF_PYDUMP_PUBLISH + Publier dans l'étude dans un scrypt Python + + + PREF_PYDUMP_MULTI_FILE + Dump Python multi-fichiers + + + PREF_PYDUMP_SAVE_GUI + Enregistrer l'état de l'IHM dans un script Python + + + PREF_STORE_VISUAL_STATE + Sauvegarder/restaurer le dernier état d'IHM + + + PRP_DESK_FILE_SAVE_GUI_STATE + Sauvegarder l'état actuel des vues 3D, des objets affichés, etc. + + + MEN_DESK_FILE_SAVE_GUI_STATE + Sauvegarder l'état d'IHM + + + TOT_DESK_FILE_SAVE_GUI_STATE + Sauvegarder l'état d'IHM + + + MEN_RESTORE_VS + Restaurer + + + WRN_DUMP_STUDY_FAILED + Impossible de générer le script de l'étude + + + MEN_DESK_PROPERTIES + Pro&priétés... + + + QUE_DOC_ALREADYEXIST + Le document %1 existe déjà. +Voulez-vous le recharger ? + + + MEN_RENAME_VS + Renommer + + + TOT_DESK_CATALOG_GENERATOR + Générateur de catalogue + + + TOT_DESK_ADD_VARS_TO_NOTEBOOK + Ajouter les variables au registre + + + PUBLISH_IN_STUDY + Publier dans l'étude + + + PREF_OBJ_BROWSER_SETTINGS + Paramètres + + + PRP_DESK_REGISTRY_DISPLAY + Visualiser le contenu du registre du serveur CORBA + + + APPCLOSE_DESCRIPTION + Voulez-vous sauvegarder l'étude avant de quitter ? + + + PRP_DESK_PROPERTIES + Editer les propriétés de l'étude + + + PREF_TAB_OBJBROWSER + Arbre d'étude + + + STUDY_LOCKED + VERROUILLEE + + + OBJ_BROWSER_NAME + Objet + + + TOT_DESK_REGISTRY_DISPLAY + Visualiser le registre CORBA + + + OBJ_BROWSER_COLUMN_0 + Entrée + + + OBJ_BROWSER_COLUMN_1 + Valeur + + + OBJ_BROWSER_COLUMN_2 + IOR + + + OBJ_BROWSER_COLUMN_3 + Entrée de référence + + + PREF_CATEGORY_SALOME + SALOME + + + PYTHON_CONSOLE + Console Python + + + MEN_DESK_FILE_LOAD_SCRIPT + Exécuter un scrip&t... + + + MEN_DESK_TOOLS + &Outils + + + MEN_DESK_PLUGINS_TOOLS + Outils + + + MEN_DESK_PLUGINS + Extensions + + + TOT_DESK_FILE_DUMP_STUDY + Générer le script de l'étude + + + MEN_VIEW_WNDS + Fenêtres + + + MEN_DESK_FILE_DUMP_STUDY + &Générer le script de l'étude... + + + PRP_DESK_CATALOG_GENERATOR + Génére un catalogue XML de l'interface du composant + + + PRP_DESK_ADD_VARS_TO_NOTEBOOK + Ajouter les variables de l'étude au registre + + + PRP_DESK_FILE_DUMP_STUDY + Génère le script python de l'étude + + + TOT_DESK_FILE_NOTEBOOK + Ouvrir le registre + + + MEN_DESK_FILE_NOTEBOOK + Re&gistre... + + + PRP_DESK_FILE_NOTEBOOK + Ouvrir le registre + + + TOT_DESK_PROPERTIES + Propriétés de l'étude + + + PREF_GROUP_DEF_COLUMNS + Colonnes par défaut + + + PRP_DESK_FILE_LOAD_SCRIPT + Exécute un script Python à partir d'un fichier + + + MEN_DESK_CATALOG_GENERATOR + &Genérateur de catalogue + + + MEN_DESK_ADD_VARS_TO_NOTEBOOK + Ajouter les variables au registre + + + MEN_DESK_MRU + Dernières études ouvertes + + + TOT_DESK_MRU + Dernières études ouvertes + + + ACTIVATE_MODULE_OP_LOAD + &Connecter + + + ACTIVATE_MODULE_OP_SCRIPT + Charger un &script... + + + DISCONNECT_CAPTION + Déconnecter l'étude en cours + + + DISCONNECT_DESCRIPTION + Voulez-vous sauver l'étude avant la déconnexion ? + + + DISCONNECT_SAVE + &Sauver && Déconnecter + + + DISCONNECT_WO_SAVE + &Déconnecter sans sauver + + + + SalomeApp_StudyPropertiesDlg + + PRP_MODE_FROM_SCRATCH + du début + + + PRP_AUTHOR + Auteur + + + PRP_LOCKED + Verrouillée + + + PRP_MODIFICATIONS + Modifications + + + PRP_COMPONENT + Composant + + + PRP_VERSION + Version + + + PRP_VERSIONS + Données stockées + + + PRP_DATE_MODIF + Date + + + PRP_UNITS + Unités de longueur + + + PRP_COMMENT + Commentaires + + + PRP_NO + Non + + + PRP_YES + Oui + + + PRP_MODIFIED + Modifiée + + + PRP_NOT_MODIFIED + Non modifiée + + + PRP_DATE + Date de création + + + PRP_MODE + Mode + + + PRP_MODE_FROM_COPYFROM + copier de + + + TLT_STUDY_PROPERTIES + Propriétés de l'étude + + + + SalomeApp_ExitDlg + + SHUTDOWN_SERVERS + Arrêter les serveurs + + + + NoteBook_Table + + REMOVE_VARIABLE_IS_USED + La variable "%1" est utilisée dans l'étude. +Voulez-vous vraiment la supprimer? + + + RENAME_VARIABLE_IS_USED + La variable "%1" est utilisée dans l'étude. +Voulez-vous vraiment la renommer? + + + VARNAME_COLUMN + Nom de la variable + + + VARVALUE_COLUMN + Valeur de la variable + + + VARVALUE_INCORRECT + La valeur de la variable n'est pas correcte: %1 + + + VARNAME_INCORRECT + Le nom de la variable n'est pas correct: %1 + + + VARNAME_EXISTS + La variable "%1" existe + + + + SalomeApp_NoteBook + + NOTEBOOK_TITLE + Registre Salome + + + BUT_UPDATE_STUDY + &Mettre l'étude à jour + + + BUT_REMOVE + &Supprimer + + + BUT_APPLY_AND_CLOSE + A&ppliquer et Fermer + + + BUT_HELP + &Aide + + + CLOSE_CAPTION + Fermer le registre + + + CLOSE_DESCRIPTION + Voulez-vous sauvegarder les changements faits au registre ? + + + INCORRECT_DATA + Au moins une variable a été définie incorrectement. +Editez ses paramètres ou retirez la de la liste. + + + ERR_UPDATE_STUDY_FAILED + Impossible de mettre l'étude à jour ! + + + + SalomeApp_DoubleSpinBox + + VALID_RANGE_VAR_MSG + Indiquez un nom de variable ou +une valeur réelle dans l'intervalle ( %1; %2 ) +avec une précision de %3 décimales + + + VALID_RANGE_NOVAR_MSG + Indiquez une valeur réelle dans l'intervalle ( %1; %2 ) +avec une précision de %3 décimales + + + + SalomeApp_IntSpinBox + + VALID_RANGE_VAR_MSG + Indiquez un nom de variable ou +une valeur entière dans l'intervalle ( %1; %2 ) + + + VALID_RANGE_NOVAR_MSG + Indiquez une valeur entière dans l'intervalle ( %1; %2 ) + + + diff --git a/src/ShaperApp/resources/ShaperApp_msg_ja.ts b/src/ShaperApp/resources/ShaperApp_msg_ja.ts new file mode 100644 index 000000000..7dab9b3a4 --- /dev/null +++ b/src/ShaperApp/resources/ShaperApp_msg_ja.ts @@ -0,0 +1,566 @@ + + + + + @default + + WRN_FILE_NOT_EXIST + ファイル %1 は存在しません。 + + + WRN_STUDY_LOCKED + スタディがロックされています + + + WRN_NO_STUDY_ON SERV + セッションにスタディがありません。 + + + CLOSE_LOCKED_STUDY + ロックされたスタディを閉じますか。 + + + PUBLISH_IN_STUDY + スタディ公開 + + + MULTI_FILE_DUMP + 複数ファイルの書き出し + + + BUT_NEW + 新規作成(&N) + + + SAVE_POINT_ROOT_NAME + HMI の状態 + + + SAVE_POINT_ROOT_TOOLTIP + 状態の HMI 永続的です + + + SAVE_GUI_STATE + GUIの状態を保存 + + + BUT_LOAD + 読み込み(&L) + + + BUT_OPEN + 開く(&O) + + + SAVE_POINT_OBJECT_TOOLTIP + 保存されたGUI状態: %1 + + + SAVE_POINT_DEF_NAME + HCI の状態: + + + VALUE_COLUMN + 値 + + + IOR_COLUMN + IOR + + + REFENTRY_COLUMN + REFエントリ + + + ERR_INCOMPATIBLE_TYPE + 変数"%1"の数値型は互換性がありません + + + ERR_INVALID_VALUE + 値が検証されていません + + + ERR_NO_VARIABLE + 変数"%1"は存在しません。 + + + ERR_ACTIVE_STUDY_CREATE + スタディを作成できません: セッションに既にスタディがあります。 +新規セッションを開始するかスタディを閉じてください。 + + + ERR_ACTIVE_STUDY_OPEN + スタディを開けません: セッションに既にスタディがあります。 +新規セッションを開始するかスタディを閉じてください。 + + + OPEN_DOCUMENT_PROBLEM + ドキュメントオープン中に不明な問題が発生しました + + + CREATE_DOCUMENT_PROBLEM + ドキュメント作成中に不明な問題が発生しました + + + TOT_DESK_CONNECT_STUDY + スタディの接続 + + + TOT_DESK_DISCONNECT_STUDY + スタディの切断 + + + PRP_DESK_CONNECT + アクティブスタディの接続 + + + PRP_DESK_DISCONNECT + カレントスタディの切断 + + + MEN_DESK_CONNECT + 接続(&e) + + + MEN_DESK_DISCONNECT + 切断(&i) + + + + SalomeApp_Application + + ALL_FILES_FILTER + すべてのファイル (*. *) + + + APPCLOSE_UNLOAD + アンロード(&U) + + + APPCLOSE_UNLOAD_SAVE + 保存と切断(&a) + + + MEN_WINDOWS_NEW + 新しいウィンドウ + + + MEN_DELETE_INVALID_REFERENCE + 無効な参照を削除します。 + + + TOT_FILE_DESK_PREFERENCES + 設定 + + + MEN_DELETE_VS + 削除 + + + MEN_OPENWITH + モジュール %1 を有効 + + + MEN_DESK_REGISTRY_DISPLAY + レジストリの表示(&D) + + + TOT_DESK_FILE_LOAD_SCRIPT + Python スクリプトを実行 + + + PREF_PYDUMP_PUBLISH + Python scrypt の研究を公開します。 + + + PREF_PYDUMP_MULTI_FILE + 複数ファイルをPythonでダンプする + + + PREF_PYDUMP_SAVE_GUI + PythonダンプでGUIの状態を保存 + + + PREF_STORE_VISUAL_STATE + バックアップ/リストア HCI の最後の状態 + + + PRP_DESK_FILE_SAVE_GUI_STATE + ビューや表示オブジェクトなど、現在の状態を保存 + + + MEN_DESK_FILE_SAVE_GUI_STATE + GUIの状態を保存 + + + TOT_DESK_FILE_SAVE_GUI_STATE + GUIの状態を保存 + + + MEN_RESTORE_VS + 復元 + + + WRN_DUMP_STUDY_FAILED + 研究のスクリプトを生成できません。 + + + MEN_DESK_PROPERTIES + プロパティ...(&p) + + + QUE_DOC_ALREADYEXIST + ドキュメント %1 はの存在。それを再読み込みしますか。 + + + MEN_RENAME_VS + 名前の変更 + + + TOT_DESK_CATALOG_GENERATOR + カタログの生成 + + + TOT_DESK_ADD_VARS_TO_NOTEBOOK + 変数をレジストリに追加します。 + + + PUBLISH_IN_STUDY + スタディ公開 + + + PREF_OBJ_BROWSER_SETTINGS + パラメーター + + + PRP_DESK_REGISTRY_DISPLAY + CORBAサーバーの登録内容を表示 + + + APPCLOSE_DESCRIPTION + 閉じる、または閉じる前にスタディをアンロードしますか? + + + PRP_DESK_PROPERTIES + スタディのプロパティを編集 + + + PREF_TAB_OBJBROWSER + オブジェクトブラウザー + + + STUDY_LOCKED + ロック + + + OBJ_BROWSER_NAME + オブジェクト + + + TOT_DESK_REGISTRY_DISPLAY + レジストリの表示 + + + OBJ_BROWSER_COLUMN_0 + エントリ + + + OBJ_BROWSER_COLUMN_1 + 値 + + + OBJ_BROWSER_COLUMN_2 + IOR + + + OBJ_BROWSER_COLUMN_3 + 参照エントリ + + + PREF_CATEGORY_SALOME + SALOME + + + PYTHON_CONSOLE + Python コンソール + + + MEN_DESK_FILE_LOAD_SCRIPT + スクリプトを読込み...(&t) + + + MEN_DESK_TOOLS + ツール(&T) + + + MEN_DESK_PLUGINS_TOOLS + ツール + + + MEN_DESK_PLUGINS + プラグイン + + + TOT_DESK_FILE_DUMP_STUDY + physonスクリプトを保存 + + + MEN_VIEW_WNDS + Windows + + + MEN_DESK_FILE_DUMP_STUDY + スクリプトを保存(&D) + + + PRP_DESK_CATALOG_GENERATOR + コンポーネントインターフェイスのXMLカタログを生成 + + + PRP_DESK_ADD_VARS_TO_NOTEBOOK + スタディの変数をnotebookに追加 + + + PRP_DESK_FILE_DUMP_STUDY + Pythonスクリプトにスタディをダンプする + + + TOT_DESK_FILE_NOTEBOOK + レジストリを開く + + + MEN_DESK_FILE_NOTEBOOK + Notebook...(&k) + + + PRP_DESK_FILE_NOTEBOOK + レジストリを開く + + + TOT_DESK_PROPERTIES + スタディのプロパティ + + + PREF_GROUP_DEF_COLUMNS + 既定の列 + + + PRP_DESK_FILE_LOAD_SCRIPT + ファイルからPythonスクリプトを読込み + + + MEN_DESK_CATALOG_GENERATOR + カタログ ジェネレーター(&G) + + + MEN_DESK_ADD_VARS_TO_NOTEBOOK + 変数をレジストリに追加します。 + + + MEN_DESK_MRU + 最近のスタディ + + + TOT_DESK_MRU + 最近のスタディ + + + ACTIVATE_MODULE_OP_LOAD + 読込み(&L) + + + ACTIVATE_MODULE_OP_SCRIPT + スクリプト読込み(&S) + + + DISCONNECT_CAPTION + アクティブスタディの切断 + + + DISCONNECT_DESCRIPTION + 切断の前にスタディを保存しますか? + + + DISCONNECT_SAVE + 保存と切断(&S) + + + DISCONNECT_WO_SAVE + w/o 保存の切断(&D) + + + + SalomeApp_StudyPropertiesDlg + + PRP_MODE_FROM_SCRATCH + ゼロから + + + PRP_AUTHOR + 作成者 + + + PRP_LOCKED + ロック + + + PRP_MODIFICATIONS + 変更 + + + PRP_COMPONENT + コンポーネント + + + PRP_VERSION + バージョン + + + PRP_VERSIONS + 格納されているデータ + + + PRP_DATE_MODIF + 日付 + + + PRP_UNITS + 長さの単位 + + + PRP_COMMENT + コメント + + + PRP_NO + いいえ + + + PRP_YES + はい + + + PRP_MODIFIED + 変更 + + + PRP_NOT_MODIFIED + 変更無 + + + PRP_DATE + 作成日 + + + PRP_MODE + モード + + + PRP_MODE_FROM_COPYFROM + …からコピー + + + TLT_STUDY_PROPERTIES + スタディのプロパティ + + + + SalomeApp_ExitDlg + + SHUTDOWN_SERVERS + サーバーを停止します。 + + + + NoteBook_Table + + REMOVE_VARIABLE_IS_USED + 変数"%1"は、Studyに使用されています。\n本当にそれを削除しますか? + + + RENAME_VARIABLE_IS_USED + 変数"%1"は、Studyに使用されています。\n本当にその名前を変更しますか? + + + VARNAME_COLUMN + 変数名 + + + VARVALUE_COLUMN + 値 + + + VARVALUE_INCORRECT + 変数の値が正しくありません: %1 + + + VARNAME_INCORRECT + 変数の名前が正しくありません: %1 + + + VARNAME_EXISTS + 変数名「%1」が存在します。 + + + + SalomeApp_NoteBook + + NOTEBOOK_TITLE + ノート + + + BUT_UPDATE_STUDY + スタディ更新(&U) + + + BUT_REMOVE + 削除(&R) + + + BUT_APPLY_AND_CLOSE + 適用して閉じる(&p) + + + BUT_HELP + ヘルプ(&H) + + + CLOSE_CAPTION + レジストリを閉じます + + + CLOSE_DESCRIPTION + レジストリに変更を保存しますか? + + + INCORRECT_DATA + 少なくとも、一つの変数の定義が正しくありません。その設定を編集または一覧から削除して下さい。 + + + ERR_UPDATE_STUDY_FAILED + スタディの更新に失敗しました! + + + + SalomeApp_DoubleSpinBox + + VALID_RANGE_VAR_MSG + 小数点以下%3桁の精度で(%1; %2)の範囲の数値または変数名を入力してください。 + + + VALID_RANGE_NOVAR_MSG + %3桁の精度で(%1; %2)の範囲の浮動小数点値を入力します。 + + + + SalomeApp_IntSpinBox + + VALID_RANGE_VAR_MSG + 変数名または整数値のいずれか (%1;%2) の範囲で指定します + + + VALID_RANGE_NOVAR_MSG + (%1;%2) の範囲の整数値を指定します。 + + + diff --git a/src/ShaperApp/resources/shaper.png b/src/ShaperApp/resources/shaper.png new file mode 100644 index 0000000000000000000000000000000000000000..d4827e272dcd437ef6b677af77edad75c8ae0b22 GIT binary patch literal 1713 zcmV;i22S~jP)LVrrZsJ5vih=ha$)swc~(b2)z*Vnt9PN$uvH;5DV z;^N|`Vw^Us)v78gDvF?X)s>Z%kt&rc-()hWo@P9l&1RJ#2nA|lRKv0?qdZuC!12V5 zA6k_ThG8i4DmC!}6w2)X7Yo5%nJ};UY*4#wSy@>YJyDwCP&kM_2)qx1C_xN>?>$~d zaNm)()Rwrox8uj8`1Kcfe$+`ZVP-2b%!B7*7%G_X45$bC`>XTvY_IirL}*DUSfW(u zbb9@R_zj5v!8#M_q@pGhMhZy+yWQT}-O(=4ICK;GR+S`SMX?o=Qlp^~1@MHC0B}Bp zyMBasC<7D{12&uO-pLaugmu|D;25nmrzDdOW6WC2nP5Rv`v5LGocO2PJ*p(`Jwxc~xrNa<$DpPH1Z$*BfR8EZiIfCpC`eQ3Dt z#DJR%)PSJ}(QkoKM>?o$qUySY{K@K{GG66(Is4?gv z*}>9l2DxMOuq7KLCN8z~;Ovb~+$Ri$hI?QT20K7)vr3MprKQ2^^`g1C1<_g-GN~fG z9EbZ|oydrbKs;fA@eM$KhDbGL6IM1Ywc-5*Id~!4D5bH$Dc~eueTU`t_1Lg+3;GBv zR=oy#of^~!fut;TC_<~kOA`|C)#`j~UX_peQ<6wri4rqPIw}qXNT4*{oQEHeorK%v zf`%;4N_l;yY!+0x3&5Mk<7P`M-rcYf%h#^QnKNghXF0^^RFc+GX%=OSjf=*bIhi={ zPBA`Mln1ITWgtL;;NrkT3y(1uJNH$=YS7745tyQNC@X#rUh_nF(#yal7Ggk*!oL00 zSh8jvzSvxWf$mPp5z!}&;2YD+38-tjhkn;^2m>Ljq2!@H9gWvd;l|C|NJ>pbzm)d^ zifmTYH+A4vTOatSWRf1qVBEb>J00j60`9sPM3HxCpfW5ZX&RgEpkh}Qy0lpkwXvbA zVTc5j5pp?fv|;PEJtP*?Qc6m%kmIu1SyGWw^wb&5Sg~R$K76knDOM9WUX%>?x!l;g z_j`P{=}UBq3E)(Ee<=h(?V02oeYq z1QIx2)`%fp5_VM{L5d|(Dn4|UEHRdz6zfYrQA)vvt1bBWqfby<*950!I)*iI{zBy6 zyl^r?BpAs6AG9HHMP=i!i|283;atSUnbG6&NP7g4m8;`Fb}jBrWL*DVZjNT)FPRrcXb|pI2_7$5aH5+7hr8 z3*M5AW{Wc5^>{p@;?>n%i$Yd2x<*u2S7W%p3k8`eBrS*W_xW1%H(kcIjc;MxxN(oS zcYRQbdA6dWVu%=MXm4-l!*$STG$<)4LG9^N=