-// Copyright (C) 2011-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2011-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// File : HOMARDGUI.cxx
-// Author : Paul RASCLE, EDF
+// Author : Gerald NICOLAS, EDF
// Module : HOMARD
#include "HOMARDGUI.h"
// SALOME Includes
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
+#include "OpUtil.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
#include "SUIT_ResourceMgr.h"
#include "OB_Browser.h"
#include "SALOME_ListIO.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
#include "SalomeApp_Application.h"
#include "SalomeApp_DataModel.h"
#include "SalomeApp_Module.h"
#include "SALOMEconfig.h"
#include <SALOME_LifeCycleCORBA.hxx>
+#include <SALOME_NamingService_Abstract.hxx>
+#include <SALOME_KernelServices.hxx>
#include <utilities.h>
#include "MonCreateIteration.h"
#include "MonPursueIteration.h"
#include "MonCreateYACS.h"
+#include "MonEditBoundaryCAO.h"
#include "MonEditBoundaryAn.h"
#include "MonEditBoundaryDi.h"
#include "MonEditCase.h"
//=======================================================================
HOMARD::HOMARD_Gen_var HOMARDGUI::InitHOMARDGen(SalomeApp_Application* app)
{
- Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","HOMARD" );
+ Engines::EngineComponent_var comp;
+ comp = app->lcc()->FindOrLoad_Component( "FactoryServer","HOMARD" );
HOMARD::HOMARD_Gen_var clr = HOMARD::HOMARD_Gen::_narrow(comp);
ASSERT(!CORBA::is_nil(clr));
return clr;
createMenu( separator(), HOMARD_Id,-1);
//
HOMARD_Id = createMenu( tr( "HOM_MEN_YACS" ), -1, 5, 10 );
- createMenu( 1401, HOMARD_Id, -1 ); // Création d'un schéma YACS
+ createMenu( 1401, HOMARD_Id, -1 ); // Création d'un schéma YACS
createMenu( separator(), HOMARD_Id,-1);
}
//================================================
void HOMARDGUI::recupPreferences()
{
- MESSAGE("recupPreferences")
+ INFOS("recupPreferences")
//
// A. Declarations
//
// B. Les valeurs
// B.1. La langue
//
+ SUIT_ResourceMgr* resMgr0 = getApp()->resourceMgr();
+ QString lang = resMgr0->stringValue( resMgr0->langSection(), "language", "en" );
+ INFOS ("Récupération de lang = " << lang.toStdString().c_str() );
defaut_s = homardGen->GetLanguageShort();
+ INFOS ("Récupération de defaut_s = " << defaut_s.c_str() );
SUIT_ResourceMgr* resMgr = getApp()->resourceMgr();
_LanguageShort = resMgr->stringValue("language", "language", QString(defaut_s.c_str()) );
+ INFOS ("Récupération de LanguageShort = " << _LanguageShort.toStdString().c_str() );
//
// B.2. Les publications
bool publish_mesh ;
//
// C. Enregistrement dans l'objet general
//
- MESSAGE ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() );
- MESSAGE ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT);
- MESSAGE ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem);
- MESSAGE ("Enregistrement de YACSTypeTest = " << _YACSTypeTest);
+ INFOS ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() );
+ INFOS ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT);
+ INFOS ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem);
+ INFOS ("Enregistrement de YACSTypeTest = " << _YACSTypeTest);
//
homardGen->SetLanguageShort(_LanguageShort.toStdString().c_str());
homardGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT);
}
SUIT_Desktop* parent = application()->desktop();
+
HOMARD::HOMARD_Gen_var homardGen = HOMARDGUI::InitHOMARDGen(app);
if (!CORBA::is_nil(homardGen))
- {
- // Set current study
- SalomeApp_Study* aSAStudy =dynamic_cast<SalomeApp_Study*>(app->activeStudy());
- _PTR(Study) aStudy = aSAStudy->studyDS();
- SALOMEDS::Study_ptr aStudyDS;
- if (aStudy)
- aStudyDS = _CAST(Study,aStudy)->GetStudy();
- homardGen->SetCurrentStudy(aStudyDS);
- }
+ homardGen->UpdateStudy();
+
getApp()->updateObjectBrowser();
// B. Choix selon les commandes
_PTR(SObject) obj = chercheMonObjet();
if (obj)
{
+ // Edition d'une frontiere CAO
+ if (HOMARD_UTILS::isBoundaryCAO(obj))
+ {
+ MonEditBoundaryCAO *aDlg = new MonEditBoundaryCAO(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ;
+ aDlg->show();
+ }
// Edition d'une frontiere discrete
- if (HOMARD_UTILS::isBoundaryDi(obj))
+ else if (HOMARD_UTILS::isBoundaryDi(obj))
{
MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ;
aDlg->show();
if (obj)
{
// Suppression d'une frontiere
- if ( HOMARD_UTILS::isBoundaryDi(obj) || HOMARD_UTILS::isBoundaryAn(obj) )
+ if ( HOMARD_UTILS::isBoundaryCAO(obj) || HOMARD_UTILS::isBoundaryDi(obj) || HOMARD_UTILS::isBoundaryAn(obj) )
{
try
{ homardGen->DeleteBoundary(_ObjectName.toStdString().c_str()); }
break;
}
- case 1401: // Création d'un schema YACS
+ case 1401: // Création d'un schema YACS
{
MESSAGE("etape 1401")
MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() );
break;
}
- case 1402: // Ecriture d'un schéma YACS
+ case 1402: // Ecriture d'un schéma YACS
{
MESSAGE("etape 1402")
MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() );
{
theMap.clear();
theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
+#ifndef DISABLE_PYCONSOLE
theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
+#endif
}
//=============================================================================
{
try
{
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- _orb = init( 0 , 0 );
+ _orb = KERNEL::GetRefToORB();
}
catch (...)
{
bool DeleteObject = false ;
bool EditObject = false ;
//
- if ( HOMARD_UTILS::isBoundaryAn(obj) )
+ if ( HOMARD_UTILS::isBoundaryCAO(obj) )
+ {
+ EditObject = true ;
+ DeleteObject = true ;
+ }
+ else if ( HOMARD_UTILS::isBoundaryAn(obj) )
{
EditObject = true ;
DeleteObject = true ;