From 77262fdb4bf42ef5a70a8918f6bb3c86b0f6f3b3 Mon Sep 17 00:00:00 2001 From: rnc Date: Mon, 4 Feb 2013 14:56:06 +0000 Subject: [PATCH] integration of modifications from Gerald Nicolas --- doc/files/tutorial_1.00.med.gz | Bin 9751 -> 9751 bytes doc/files/tutorial_1.py | 13 +- doc/files/tutorial_2.00.med.gz | Bin 5796 -> 5796 bytes doc/files/tutorial_2.py | 13 +- doc/files/tutorial_3.00.med.gz | Bin 477401 -> 477401 bytes doc/files/tutorial_3.01.med.gz | Bin 789036 -> 789036 bytes doc/files/tutorial_3.py | 13 +- doc/files/tutorial_4.00.med.gz | Bin 75732 -> 75732 bytes doc/files/tutorial_4.fr.med.gz | Bin 638495 -> 638495 bytes doc/files/tutorial_4.py | 31 +- doc/files/tutorial_5.00.med.gz | Bin 10561 -> 10561 bytes doc/files/tutorial_5.fr.med.gz | Bin 190677 -> 190677 bytes doc/files/tutorial_5.py | 14 +- doc/gui_create_hypothese.rst | 5 +- doc/images/create_hypothese_ch_3.png | Bin 11343 -> 12170 bytes doc/tui_create_boundary.rst | 82 +- doc/tui_create_case.rst | 10 + doc/tui_create_hypothese.rst | 11 + doc/tui_create_iteration.rst | 40 +- doc/tui_create_zone.rst | 9 + doc/tutorials.rst | 17 +- idl/Gen.xml | 229 +---- idl/HOMARD_Boundary.idl | 27 +- idl/HOMARD_Cas.idl | 50 +- idl/HOMARD_Gen.idl | 83 +- idl/HOMARD_Hypothesis.idl | 94 +- idl/HOMARD_Iteration.idl | 57 +- idl/HOMARD_Zone.idl | 29 +- idl/Makefile.am | 4 +- resources/HOMARDCatalog.xml.in | 48 +- src/HOMARD/HOMARD_Boundary.cxx | 98 +- src/HOMARD/HOMARD_Boundary.hxx | 34 +- src/HOMARD/HOMARD_Cas.cxx | 146 ++- src/HOMARD/HOMARD_Cas.hxx | 35 +- src/HOMARD/HOMARD_DriverTools.cxx | 6 +- src/HOMARD/HOMARD_Hypothesis.cxx | 265 +++-- src/HOMARD/HOMARD_Hypothesis.hxx | 71 +- src/HOMARD/HOMARD_Iteration.cxx | 217 ++--- src/HOMARD/HOMARD_Iteration.hxx | 45 +- src/HOMARD/HOMARD_Zone.cxx | 87 +- src/HOMARD/HOMARD_Zone.hxx | 29 +- src/HOMARD/HomardDriver.cxx | 4 + src/HOMARDGUI/CreateHypothesis.h | 42 +- src/HOMARDGUI/CreateHypothesis.ui | 52 + src/HOMARDGUI/HOMARDGUI.cxx | 259 +++-- src/HOMARDGUI/HOMARDGUI.h | 11 +- src/HOMARDGUI/HOMARD_msg_en.ts | 68 +- src/HOMARDGUI/HOMARD_msg_fr.ts | 76 +- src/HOMARDGUI/HomardQtCommun.cxx | 47 +- src/HOMARDGUI/MonCreateBoundaryAn.cxx | 2 +- src/HOMARDGUI/MonCreateBoundaryDi.cxx | 2 +- src/HOMARDGUI/MonCreateCase.cxx | 10 +- src/HOMARDGUI/MonCreateCase.h | 4 +- src/HOMARDGUI/MonCreateHypothesis.cxx | 36 + src/HOMARDGUI/MonCreateHypothesis.h | 2 + src/HOMARDGUI/MonEditCase.cxx | 2 +- src/HOMARDGUI/MonEditHypothesis.cxx | 6 + src/HOMARD_I/HOMARD_Boundary_i.cxx | 105 +- src/HOMARD_I/HOMARD_Boundary_i.hxx | 38 +- src/HOMARD_I/HOMARD_Cas_i.cxx | 207 ++-- src/HOMARD_I/HOMARD_Cas_i.hxx | 49 +- src/HOMARD_I/HOMARD_Gen_i.cxx | 1300 ++++++++++++++++--------- src/HOMARD_I/HOMARD_Gen_i.hxx | 97 +- src/HOMARD_I/HOMARD_Hypothesis_i.cxx | 264 ++--- src/HOMARD_I/HOMARD_Hypothesis_i.hxx | 117 ++- src/HOMARD_I/HOMARD_Iteration_i.cxx | 268 +++-- src/HOMARD_I/HOMARD_Iteration_i.hxx | 51 +- src/HOMARD_I/HOMARD_Zone_i.cxx | 110 ++- src/HOMARD_I/HOMARD_Zone_i.hxx | 36 +- src/HOMARD_I/HomardMedCommun.cxx | 48 +- src/HOMARD_I/HomardMedCommun.h | 1 + tests/test_1.py | 7 +- tests/test_2.py | 7 +- tests/test_3.py | 67 +- 74 files changed, 3035 insertions(+), 2272 deletions(-) diff --git a/doc/files/tutorial_1.00.med.gz b/doc/files/tutorial_1.00.med.gz index 68242dfd0943fb04eb3954997d1d4eb3e9812cc9..fd09700b2e12f0fd23aba48060533d0363ea3aab 100644 GIT binary patch delta 17 YcmbR4Gu?+nzMF&N;tu72jU4=H05wYbTEiRzMF&N$`0j#jU1Mm06V(|0{{R3 delta 17 YcmX>YbTEiRzMF&N>-7}BjU1Mm06!Q8f&c&j diff --git a/doc/files/tutorial_5.fr.med.gz b/doc/files/tutorial_5.fr.med.gz index 4c9ccbdd11b066ea381bcdb2805ce9ef936cc8f4..aa586d051f3a83d45b9d87908f861835c7cacca5 100644 GIT binary patch delta 25 hcmcb5k^AaJZVvfw4vs53lmi+$S~(cEaxk5J0RV)s39kSE delta 25 hcmcb5k^AaJZVvfw4vwGKQ~Vk^S~(cEaxk5J0RW3X3Nioy diff --git a/doc/files/tutorial_5.py b/doc/files/tutorial_5.py index 48f0fcff..3104253b 100644 --- a/doc/files/tutorial_5.py +++ b/doc/files/tutorial_5.py @@ -24,15 +24,21 @@ Exemple de couplage HOMARD-Salome Copyright EDF-R&D 1996, 2010, 2013 """ -__revision__ = "V1.3" +__revision__ = "V1.4" +# +import os # # ================================== # Repertoire a personnaliser -# Ce repertoire contient les fichiers de donnees : tutorial_5.00.med, tutorial_5.fr.med # Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med -dircase = "/tmp" +if os.environ.has_key("LOGNAME") : + user = os.environ ["LOGNAME"] +else : + user = "anonymous" +dircase = os.path.join( os.sep, "tmp", "HOMARD_"+user) +if not os.path.isdir(dircase) : + os.mkdir (dircase) # ================================== -import os # Ce repertoire contient les fichiers de donnees : tutorial_5.00.med, tutorial_5.fr.med pathHomard = os.getenv('HOMARD_ROOT_DIR') data_dir = os.path.join(pathHomard, "share/doc/salome/gui/HOMARD/_downloads") diff --git a/doc/gui_create_hypothese.rst b/doc/gui_create_hypothese.rst index ea7f004e..1fc08f2b 100644 --- a/doc/gui_create_hypothese.rst +++ b/doc/gui_create_hypothese.rst @@ -45,11 +45,12 @@ On peut choisir de ne pas utiliser directement le champ, mais sa variation d'un Le raffinement se fait selon un seuil qui définit un critère haut de raffinement. Toutes les mailles pour lesquelles l'indicateur est supérieur à ce critère seront raffinées. -Pour le choix du critère, trois variantes sont possible : +Pour le choix du critère, quatre variantes sont possible : - selon un pourcentage de mailles à raffiner, nombre réel compris entre 0 et 100 ; HOMARD raffinera les x% des mailles qui ont la plus grande valeur du champ. - selon une valeur relative du champ, nombre compris entre 0 et 100 ; HOMARD raffinera les mailles où le champ est supérieur à x% de l'intervalle [mini,maxi]. - - selon une valeur absolue ; toutes les mailles avec une valeur de champ supérieure à cette valeur seront raffinées. + - au dela d'une valeur absolue ; toutes les mailles avec une valeur de champ supérieure à cette valeur seront raffinées. + - au dela d'une valeur absolue valant la moyenne de la répartition du champ augmentée de n fois son écart-type ; toutes les mailles avec une valeur de champ supérieure à cette valeur seront raffinées. La même convention s'applique au déraffinement, en remplaçant supérieur par inférieur. On peut inactiver une des fonctions (raffinement ou déraffinement) en cochant le bouton ad_hoc. diff --git a/doc/images/create_hypothese_ch_3.png b/doc/images/create_hypothese_ch_3.png index d1f146c6b61cc447a7f7a946893601de39f67c82..a78111d5b0f05ee1470fb04ba482b51b2c903826 100644 GIT binary patch literal 12170 zcmb_?by!s0-u57ZNDeI_Au7@(snpO?64H%;fOHRygou;~hzKJsUD7E70@5H|(%nPX zyYP9=InQ&xbDitGuJ7G{uwj@zv-a9+-M>42p-+`$@USVdArJ_joUEiO1ahqh{Eoo7 z27ZR3rHOzOx)V%J9SaL;m}O3PWz&fM9}*wGAPVQXh&#^z+|Xl7>X^uo@0 z3%vncLkE$Q6jyiuv@z+aMQkx9y3LpnC2LF``<1WQ{n|aPT+AE4d4rAZ9Q{hzz3ITaB45YF-zrzNxu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Vug9B#1 zGVv3YN)S8P%B;U6V7$H2i$5P2KCLV0b95RCB!jrRx~?3@pg<%j{UN>ht9moKwQqIV z_@jWDtY=RYC2OeL4z2!mh_a{k*2cz$)`X%|*F;xWf#5dk>hS})ir8POw&YtBihYXA zNvYZe%*w2Xa{6_C@_$qU66q*(!NOwa%&g3)$SClR?V%J)^Z#GlrT*7y`#(zk-%k<4 zQW=cBv{X&$@7m2Xds78XX@D1;_`ru583osPJUKjEy>v-%jKax`7@=ln06!`TcnT<{-7xs% zn)<`6wD$q9>!O!kM-=#ss)o&uup){-y-EMZHP!UrUM;KAGM+PT#`nOb6g@$Vm*-HN zR(KNYN60K8*2;9h=}7pb9d5#RPG)eng`rLAIeC}4W~V>n(fGEV=2{woUd_Y9Llnhl z(VK{Gl0%K?>+6%2mhOtCu(Gl{-Z7a6yHiFiw(oo>@M?K+$JEYD#DDrQeuiGgUt2r5 zEvF3@4GU|QcXh2$H!Jw$$Xt)FF*}0}ZFzd!9CX7FMAiJU@){J}TH^<+g-86kfw=r-6 zDP(P}$UTYv-c90+mDl>8dZ6;)Hnz6Fj=E1AffCfUN;uEK&%;BD*gid4C0vCp?5wrg zj+do54U&UgIr4D7q2+Z3nzr^>G^=Bd-;QEm8N^RXVU`L(v(k+@0{&~znkcOC+@v(4*2gMKfX0V8x&Abcb6z& z7jX#3(3{0Xiyj*G`HQlaSCrAJL+*oiC}ZOr-w*UsE=q?1ha~(A7&NrW55hW1OG?7u zzTI*~{ksb=`;?D&HX!Bozt%Q23g9<_?zWlb)4W$v@e|-er&=F53trA$c!S~zTmy|# zUR#5)YnAuDrl2b`K(g=Ly3UJ}tc6X`)Kf}Q5+!5c=XKS-$`P diff --git a/doc/tui_create_boundary.rst b/doc/tui_create_boundary.rst index 092bd711..aed6017d 100644 --- a/doc/tui_create_boundary.rst +++ b/doc/tui_create_boundary.rst @@ -64,31 +64,69 @@ Ces m | | +---------------------------------------------------------------+ +Méthodes de la classe cas +""""""""""""""""""""""""" +Voir également dans dans :ref:`tui_create_case`. + ++---------------------------------------------------------------+ ++---------------------------------------------------------------+ +| .. module:: AddBoundaryGroup | +| | +| **AddBoundaryGroup(boundary, group)** | +| Ajoute une frontière à la définition du cas | +| | +| - ``boundary`` : nom d'une frontière courbe à suivre | +| | +| Pour une frontière discrète : | +| | +| . si toutes les lignes courbes sont suivies, le second | +| argument est une chaîne vide. | +| . si seulement certaines lignes courbes sont suivies, | +| ``group`` est le nom d'un groupe de segments à suivre. | +| | +| Pour une frontière analytique : | +| | +| - ``group`` : nom d'un groupe de faces placées sur la | +| frontière | ++---------------------------------------------------------------+ + Méthodes de la classe boundary """""""""""""""""""""""""""""" -+-------------------------------------------------------------------+ -+-------------------------------------------------------------------+ -| .. module:: GetName | -| | -| **GetName()** | -| Retourne le nom de la frontière | -+-------------------------------------------------------------------+ -| .. module:: GetType | -| | -| **GetType()** | -| Retourne le type de la frontière : | -| | -| * 0 : discrète | -| * 1 : cylindre | -| * 2 : sphère | -+-------------------------------------------------------------------+ -| .. module:: GetCoords | -| | -| **GetCoords()** | -| Retourne un tableau contenant les coordonnées de la frontière | -| dans l'ordre d'entrée dans le CreateBoundaryXXXX associé | -+-------------------------------------------------------------------+ ++---------------------------------------------------------------+ ++---------------------------------------------------------------+ +| .. module:: GetName | +| | +| **GetName()** | +| Retourne le nom de la frontière | ++---------------------------------------------------------------+ +| .. module:: GetType | +| | +| **GetType()** | +| Retourne le type de la frontière : | +| | +| * 0 : discrète | +| * 1 : cylindre | +| * 2 : sphère | ++---------------------------------------------------------------+ +| .. module:: GetCoords | +| | +| **GetCoords()** | +| Retourne un tableau contenant les coordonnées de la | +| frontière dans l'ordre d'entrée dans le CreateBoundaryXXXX| +| associé | ++---------------------------------------------------------------+ +| .. index:: single: Delete | +| | +| **Delete()** | +| Detruit la frontière. | +| Pour une frontière discrète, le fichier du maillage | +| associé est conservé. | +| | +| Retourne un entier : | +| * 0 : destruction réussie | +| * autre valeur : problème | ++---------------------------------------------------------------+ Exemple diff --git a/doc/tui_create_case.rst b/doc/tui_create_case.rst index 420d1e90..21b6950d 100644 --- a/doc/tui_create_case.rst +++ b/doc/tui_create_case.rst @@ -109,6 +109,16 @@ M | - ``group`` : nom d'un groupe de faces placées sur la | | frontière | +---------------------------------------------------------------+ +| .. index:: single: Delete | +| | +| **Delete()** | +| Detruit le cas et toutes les itérations associées. | +| Le fichier du maillage associé est conservé. | +| | +| Retourne un entier : | +| * 0 : destruction réussie | +| * autre valeur : problème | ++---------------------------------------------------------------+ Les options avancées ^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/tui_create_hypothese.rst b/doc/tui_create_hypothese.rst index 71663fc4..93cfc15c 100644 --- a/doc/tui_create_hypothese.rst +++ b/doc/tui_create_hypothese.rst @@ -86,6 +86,15 @@ G | **GetUnRefType()** | | Retourne le type de déraffinement | +---------------------------------------------------------------+ +| .. index:: single: Delete | +| | +| **Delete()** | +| Detruit l'hypothèse | +| | +| Retourne un entier : | +| * 0 : destruction réussie | +| * autre valeur : problème | ++---------------------------------------------------------------+ Le champ et les seuils ^^^^^^^^^^^^^^^^^^^^^^ @@ -125,6 +134,7 @@ Le champ et les seuils | * 1 : valeur absolue | | * 2 : valeur relative en % | | * 3 : fraction des mailles en % | +| * 4 : moyenne + n fois l'écart-type | | | | - ``threshold`` : valeur du seuil | +---------------------------------------------------------------+ @@ -144,6 +154,7 @@ Le champ et les seuils | * 1 : valeur absolue | | * 2 : valeur relative en % | | * 3 : fraction des mailles en % | +| * 4 : moyenne - n fois l'écart-type | | | | - ``threshold`` : valeur du seuil | +---------------------------------------------------------------+ diff --git a/doc/tui_create_iteration.rst b/doc/tui_create_iteration.rst index d09ab686..4f4234bd 100644 --- a/doc/tui_create_iteration.rst +++ b/doc/tui_create_iteration.rst @@ -38,15 +38,24 @@ M | | | **NextIteration(iter_name)** | | Retourne une instance de la classe ``iteration`` après | -| sa création : celle qui suit immédiatement l'itération | +| sa création : elle suit immédiatement l'itération | | initiale, correspondant au maillage définissant le cas | | | -| - ``iter_name`` : le nom de l'itération | +| - ``iter_name`` : le nom à donner à la nouvelle itération | | | | Par défaut : | | | | * le maillage produit a le même nom que l'itération | +---------------------------------------------------------------+ +| .. module:: LastIteration | +| | +| **LastIteration()** | +| Retourne une instance de la classe ``iteration`` : la | +| dernière créée dans la descendance de l'itération initiale| +| du cas. C'est celle qui est sans fille. Il y a erreur s'il| +| existe plus d'une branche dans la descendance. | +| | ++---------------------------------------------------------------+ Méthodes de la classe iteration """"""""""""""""""""""""""""""" @@ -62,7 +71,7 @@ G | Retourne une instance de la classe ``iteration`` qui suit | | l'itération courante | | | -| - ``iter_name`` : le nom de l'itération | +| - ``iter_name`` : le nom à donner à la nouvelle itération | | | | Par défaut : | | | @@ -102,6 +111,14 @@ G | **GetIterParent()** | | Retourne l'itération mère | +---------------------------------------------------------------+ +| .. module:: LastIteration | +| | +| **LastIteration()** | +| Retourne une instance de la classe ``iteration`` : la | +| dernière créée dans la descendance de l'itération. C'est | +| celle qui est sans fille. Il y a erreur s'il existe plus | +| d'une branche dans la descendance. | ++---------------------------------------------------------------+ | .. module:: AssociateHypo | | | | **AssociateHypo(hypo_name)** | @@ -127,12 +144,29 @@ G | - ``0`` : itération non calculée | | - ``1`` : itération calculée correctement | +---------------------------------------------------------------+ +| .. index:: single: Delete | +| | +| **Delete()** | +| Detruit l'itération et toutes ses filles éventuelles. Les | +| fichiers des maillages associés sont supprimés. | +| | +| Retourne un entier : | +| * 0 : destruction réussie | +| * autre valeur : problème | ++---------------------------------------------------------------+ Informations sur les maillages ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +---------------------------------------------------------------+ +---------------------------------------------------------------+ +| .. module:: SetMeshName | +| | +| **SetMeshName(mesh_name)** | +| Définit le nom du maillage produit | +| | +| - ``mesh_name`` : le nom du maillage produit | ++---------------------------------------------------------------+ | .. module:: GetMeshName | | | | **GetMeshName()** | diff --git a/doc/tui_create_zone.rst b/doc/tui_create_zone.rst index dccbe8c9..1441360e 100644 --- a/doc/tui_create_zone.rst +++ b/doc/tui_create_zone.rst @@ -172,6 +172,15 @@ M | Retourne un tableau contenant les coordonnées de la zone | | dans l'ordre d'entrée dans le CreateZoneXXXX associé | +---------------------------------------------------------------+ +| .. index:: single: Delete | +| | +| **Delete()** | +| Detruit la zone | +| | +| Retourne un entier : | +| * 0 : destruction réussie | +| * autre valeur : problème | ++---------------------------------------------------------------+ Exemple diff --git a/doc/tutorials.rst b/doc/tutorials.rst index 72976ac3..41ca5c02 100644 --- a/doc/tutorials.rst +++ b/doc/tutorials.rst @@ -3,7 +3,8 @@ Exemples .. index:: single: exemple .. index:: single: python -On trouvera ici les instructions python pour quelques configurations caractéristiques. Les fichiers de données associés sont téléchargeables. Il faut penser à adapter la valeur de la variable ``data_dir`` : c'est le répertoire dans lequel les fichiers med auront été enregistrés. C'est dans ce répertoire ``dircase`` que seront écrits les fichiers résultant des adaptations successives. +On trouvera ici les instructions python pour quelques configurations caractéristiques. Les fichiers de données associés sont téléchargeables. Il faut penser à adapter la valeur de la variable ``data_dir`` : c'est le répertoire dans lequel les fichiers med auront été enregistrés. +C'est dans le répertoire ``dircase`` que seront écrits les fichiers résultant des adaptations successives. Ce répertoire est créé par défaut dans ``/tmp``. Raffinement uniforme """""""""""""""""""" @@ -215,7 +216,8 @@ Suivi de fronti """"""""""""""""""""""""""" .. index:: single: champ -On teste ici le suivi des frontières courbes : des frontières analytiques pour décrire les différentes surfaces des tuyaux et une frontière discrète pour décrire les lignes d'intersection des deux tuyaux. Le pilotage du raffinement est le suivant : raffinement uniforme de toutes les mailles contenues dans des groupes désignés. +On teste ici le suivi des frontières courbes : des frontières analytiques pour décrire les différentes surfaces des tuyaux et une frontière discrète pour décrire les lignes d'intersection des deux tuyaux. Le pilotage du raffinement est le suivant : raffinement uniforme de toutes les mailles contenues dans des groupes désignés. On commence par raffiner les faces internes aux tuyaux ; ensuite, on raffine deux fois de suite les faces externes aux tuyaux. +Le schéma YACS réalisant cette adaptation est téléchargeable. :: # @@ -260,18 +262,24 @@ On teste ici le suivi des fronti # # Creation of the iterations # ========================== - # Creation of the iteration Iter_1 + # Creation of the iteration Iter_1 : raffinement selon les faces internes Iter_1 = Case.NextIteration('Iter_1') Iter_1.SetMeshName('PIQUAGE_1') Iter_1.SetMeshFile(dircase+'/maill.01.med') Iter_1.AssociateHypo('Hypo_1') codret = Iter_1.Compute(1) - # Creation of the iteration Iter_2 + # Creation of the iteration Iter_2 : raffinement selon les faces externes Iter_2 = Iter_1.NextIteration('Iter_2') Iter_2.SetMeshName('PIQUAGE_2') Iter_2.SetMeshFile(dircase+'/maill.02.med') Iter_2.AssociateHypo('Hypo_2') codret = Iter_2.Compute(1) + # Creation of the iteration Iter_3 : second raffinement selon les faces externes + Iter_3 = Iter_2.NextIteration('Iter_3') + Iter_3.SetMeshName('PIQUAGE_3') + Iter_3.SetMeshFile(dircase+'/maill.03.med') + Iter_3.AssociateHypo('Hypo_2') + codret = Iter_3.Compute(1) .. note:: Téléchargement des fichiers @@ -279,6 +287,7 @@ On teste ici le suivi des fronti * :download:`maillage initial` * :download:`maillage de la frontière discrète` * :download:`commandes python` + * :download:`schéma YACS` Instructions spécifiques au 2D diff --git a/idl/Gen.xml b/idl/Gen.xml index d18a7f28..468db6d7 100644 --- a/idl/Gen.xml +++ b/idl/Gen.xml @@ -15,7 +15,7 @@ HOMARD OTHER HOMARD team - EDF RD - 1.2 + 1.3 unknown 1 1 @@ -79,33 +79,6 @@ - - CreateIteration - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - IterName - string - unknown - - - PreviousIterName - string - unknown - - - - - return - HOMARD/HOMARD_Iteration - unknown - - - - CreateZoneBox HOMARD team - EDF RD @@ -641,14 +614,14 @@ - GetZone + GetHypothesis HOMARD team - EDF RD 1.1 unknown 0 - ZoneName + HypoName string unknown @@ -656,21 +629,21 @@ return - HOMARD/HOMARD_Zone + HOMARD/HOMARD_Hypothesis unknown - GetHypothesis + GetIteration HOMARD team - EDF RD 1.1 unknown 0 - HypoName + IterName string unknown @@ -678,21 +651,21 @@ return - HOMARD/HOMARD_Hypothesis + HOMARD/HOMARD_Iteration unknown - GetIteration + GetZone HOMARD team - EDF RD 1.1 unknown 0 - IterName + ZoneName string unknown @@ -700,7 +673,7 @@ return - HOMARD/HOMARD_Iteration + HOMARD/HOMARD_Zone unknown @@ -787,121 +760,14 @@ - SetCurrentStudy - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - theStudy - SALOMEDS/Study - unknown - - - - - - - InvalideBoundary - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - BounName - string - unknown - - - - - - - InvalideZone + LastIteration HOMARD team - EDF RD 1.1 unknown 0 - ZoneName - string - unknown - - - - - - - InvalideHypo - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - HypoName - string - unknown - - - - - - - InvalideIter - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - IterName - string - unknown - - - - - - - Compute - HOMARD team - EDF RD - 1.2 - unknown - 0 - - - IterName - string - unknown - - - etatMenage - long - unknown - - - - - return - long - unknown - - - - - - VerifieDir - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - IterName + CaseName string unknown @@ -909,91 +775,28 @@ return - boolean + HOMARD/HOMARD_Iteration unknown - PublishFileUnderIteration - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - NomIter - string - unknown - - - NomFich - string - unknown - - - Commentaire - string - unknown - - - - - - - PublishResultInSmesh + SetCurrentStudy HOMARD team - EDF RD 1.1 unknown 0 - NomFich - string - unknown - - - IconeType - long + theStudy + SALOMEDS/Study unknown - - GetCurrentStudy - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - - return - SALOMEDS/Study - unknown - - - - - - GetCurrentStudyID - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - - return - long - unknown - - - - diff --git a/idl/HOMARD_Boundary.idl b/idl/HOMARD_Boundary.idl index 61d9d85d..78954a34 100644 --- a/idl/HOMARD_Boundary.idl +++ b/idl/HOMARD_Boundary.idl @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #ifndef _HOMARD_Boundary_IDL #define _HOMARD_Boundary_IDL @@ -32,10 +41,15 @@ module HOMARD { interface HOMARD_Boundary : Engines::EngineComponent { +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); + string GetName() raises (SALOME::SALOME_Exception); + + long Delete() raises (SALOME::SALOME_Exception); - void SetName (in string Name) raises (SALOME::SALOME_Exception); - string GetName () raises (SALOME::SALOME_Exception); + string GetDumpPython() raises (SALOME::SALOME_Exception); +// Caracteristiques void SetType (in long Type) raises (SALOME::SALOME_Exception); long GetType() raises (SALOME::SALOME_Exception); @@ -58,14 +72,13 @@ module HOMARD raises (SALOME::SALOME_Exception); HOMARD::double_array GetLimit() raises (SALOME::SALOME_Exception); - void SetCaseCreation(in string NomCas) raises (SALOME::SALOME_Exception); - string GetCaseCreation() raises (SALOME::SALOME_Exception); - void AddGroup(in string LeGroupe) raises (SALOME::SALOME_Exception); - ListGroupType GetGroups() raises (SALOME::SALOME_Exception); void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); + ListGroupType GetGroups() raises (SALOME::SALOME_Exception); - string GetDumpPython() raises (SALOME::SALOME_Exception); +// Liens avec les autres iterations + void SetCaseCreation(in string NomCas) raises (SALOME::SALOME_Exception); + string GetCaseCreation() raises (SALOME::SALOME_Exception); }; }; diff --git a/idl/HOMARD_Cas.idl b/idl/HOMARD_Cas.idl index 46909503..4dd2c3a7 100644 --- a/idl/HOMARD_Cas.idl +++ b/idl/HOMARD_Cas.idl @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #ifndef _HOMARD_CAS_IDL #define _HOMARD_CAS_IDL @@ -35,40 +44,47 @@ module HOMARD interface HOMARD_Cas : Engines::EngineComponent { - - void SetName(in string NomCas) raises (SALOME::SALOME_Exception); +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); string GetName() raises (SALOME::SALOME_Exception); + long Delete() raises (SALOME::SALOME_Exception); + + string GetDumpPython() raises (SALOME::SALOME_Exception); + +// Caracteristiques void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception); string GetDirName() raises (SALOME::SALOME_Exception); + long GetNumber() raises (SALOME::SALOME_Exception); + void SetConfType(in long ConfType) raises (SALOME::SALOME_Exception); long GetConfType() raises (SALOME::SALOME_Exception); - HOMARD_Iteration GetIter0 () raises (SALOME::SALOME_Exception); - string GetIter0Name () raises (SALOME::SALOME_Exception); - - HOMARD_Iteration NextIteration(in string NomIter) raises (SALOME::SALOME_Exception); - - void AddIteration (in string NomIteration) raises (SALOME::SALOME_Exception); - - extrema GetBoundingBox() raises (SALOME::SALOME_Exception); void SetBoundingBox(in extrema LesExtremes) raises (SALOME::SALOME_Exception); + extrema GetBoundingBox() raises (SALOME::SALOME_Exception); - ListGroupType GetGroups() raises (SALOME::SALOME_Exception); - void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); void AddGroup(in string Group) raises (SALOME::SALOME_Exception); + void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); + ListGroupType GetGroups() raises (SALOME::SALOME_Exception); - long GetNumber() raises (SALOME::SALOME_Exception); - string GetDumpPython() raises (SALOME::SALOME_Exception); - - ListBoundaryGroupType GetBoundaryGroup() raises (SALOME::SALOME_Exception); - void AddBoundaryGroup(in string NomBoundary, in string Group) + void AddBoundaryGroup(in string BoundaryName, in string Group) raises (SALOME::SALOME_Exception); + ListBoundaryGroupType GetBoundaryGroup() raises (SALOME::SALOME_Exception); void SetPyram(in long Pyram) raises (SALOME::SALOME_Exception); long GetPyram() raises (SALOME::SALOME_Exception); +// Liens avec les autres structures + string GetIter0Name () raises (SALOME::SALOME_Exception); + HOMARD_Iteration GetIter0 () raises (SALOME::SALOME_Exception); + + HOMARD_Iteration NextIteration(in string IterName) raises (SALOME::SALOME_Exception); + + HOMARD_Iteration LastIteration() raises (SALOME::SALOME_Exception); + + void AddIteration (in string IterName) raises (SALOME::SALOME_Exception); + }; }; #endif diff --git a/idl/HOMARD_Gen.idl b/idl/HOMARD_Gen.idl index baff2571..5780c428 100644 --- a/idl/HOMARD_Gen.idl +++ b/idl/HOMARD_Gen.idl @@ -47,6 +47,17 @@ module HOMARD // // A.1. Les creations // + HOMARD_Boundary CreateBoundaryDi (in string BoundaryName, in string MeshName, in string FileName) + raises (SALOME::SALOME_Exception); + HOMARD_Boundary CreateBoundaryCylinder (in string BoundaryName, + in double Xcentre, in double Ycentre, in double Zcentre, + in double Xaxis, in double Yaxis, in double Zaxis, + in double Radius) + raises (SALOME::SALOME_Exception); + HOMARD_Boundary CreateBoundarySphere (in string BoundaryName, + in double Xcentre, in double Ycentre, in double Zcentre, + in double Radius) + raises (SALOME::SALOME_Exception); HOMARD_Cas CreateCase(in string CaseName, in string MeshName, in string FileName ) raises (SALOME::SALOME_Exception); HOMARD_Hypothesis CreateHypothesis(in string HypoName ) @@ -56,25 +67,16 @@ module HOMARD in double Ymini, in double Ymaxi, in double Zmini, in double Zmaxi) raises (SALOME::SALOME_Exception); - HOMARD_Zone CreateZoneSphere (in string ZoneName, - in double Xcentre, in double Ycentre, in double Zcentre, - in double Radius) + HOMARD_Zone CreateZoneBox2D (in string ZoneName, + in double Umini, in double Umaxi, + in double Vmini, in double Vmaxi, + in long Orient) raises (SALOME::SALOME_Exception); HOMARD_Zone CreateZoneCylinder (in string ZoneName, in double Xcentre, in double Ycentre, in double Zcentre, in double Xaxis, in double Yaxis, in double Zaxis, in double Radius, in double Height) raises (SALOME::SALOME_Exception); - HOMARD_Zone CreateZonePipe (in string ZoneName, - in double Xcentre, in double Ycentre, in double Zcentre, - in double Xaxis, in double Yaxis, in double Zaxis, - in double Radius, in double Height, in double InternalRadius) - raises (SALOME::SALOME_Exception); - HOMARD_Zone CreateZoneBox2D (in string ZoneName, - in double Umini, in double Umaxi, - in double Vmini, in double Vmaxi, - in long Orient) - raises (SALOME::SALOME_Exception); HOMARD_Zone CreateZoneDisk (in string ZoneName, in double Ucentre, in double Vcentre, in double Radius, in long Orient) @@ -84,65 +86,76 @@ module HOMARD in double Radius, in double InternalRadius, in long Orient) raises (SALOME::SALOME_Exception); - HOMARD_Boundary CreateBoundaryDi (in string BounName, in string MeshName, in string FileName) - raises (SALOME::SALOME_Exception); - HOMARD_Boundary CreateBoundaryCylinder (in string BounName, + HOMARD_Zone CreateZonePipe (in string ZoneName, in double Xcentre, in double Ycentre, in double Zcentre, in double Xaxis, in double Yaxis, in double Zaxis, - in double Radius) + in double Radius, in double Height, in double InternalRadius) raises (SALOME::SALOME_Exception); - HOMARD_Boundary CreateBoundarySphere (in string BounName, - in double Xcentre, in double Ycentre, in double Zcentre, - in double Radius) + HOMARD_Zone CreateZoneSphere (in string ZoneName, + in double Xcentre, in double Ycentre, in double Zcentre, + in double Radius) raises (SALOME::SALOME_Exception); // // A.2. Les informations // + HOMARD_Boundary GetBoundary(in string BoundaryName) raises (SALOME::SALOME_Exception); HOMARD_Cas GetCase(in string CaseName) raises (SALOME::SALOME_Exception); - HOMARD_Boundary GetBoundary(in string BounName) raises (SALOME::SALOME_Exception); - HOMARD_Zone GetZone(in string ZoneName) raises (SALOME::SALOME_Exception); HOMARD_Hypothesis GetHypothesis(in string HypoName) raises (SALOME::SALOME_Exception); HOMARD_Iteration GetIteration(in string IterName) raises (SALOME::SALOME_Exception); + HOMARD_Zone GetZone(in string ZoneName) raises (SALOME::SALOME_Exception); - listeCases GetAllCasesName() raises (SALOME::SALOME_Exception); listeBoundarys GetAllBoundarysName() raises (SALOME::SALOME_Exception); + listeCases GetAllCasesName() raises (SALOME::SALOME_Exception); listeHypotheses GetAllHypothesesName() raises (SALOME::SALOME_Exception); - listeZones GetAllZonesName() raises (SALOME::SALOME_Exception); listeIterations GetAllIterationsName() raises (SALOME::SALOME_Exception); + listeZones GetAllZonesName() raises (SALOME::SALOME_Exception); + + HOMARD_Iteration LastIteration(in string CaseName) raises (SALOME::SALOME_Exception); // // A.3. L'etude // void SetCurrentStudy(in SALOMEDS::Study theStudy) raises (SALOME::SALOME_Exception); + SALOMEDS::Study GetCurrentStudy() raises (SALOME::SALOME_Exception); + long GetCurrentStudyID() raises (SALOME::SALOME_Exception); // // B. Les methodes qui suivent n'apparaissent pas dans le composant HOMARD dans YACS // L'utilisateur ne devrait pas les connaitre (ni s'en servir, a fortiori) // HOMARD_Iteration CreateIteration(in string IterName, in string PreviousIterName ) raises (SALOME::SALOME_Exception); +// + void InvalideBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception); + void InvalideHypo (in string HypoName) raises (SALOME::SALOME_Exception); + void InvalideIter (in string IterName) raises (SALOME::SALOME_Exception); + void InvalideZone (in string ZoneName) raises (SALOME::SALOME_Exception); + + long DeleteBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception); + long DeleteCase(in string CaseName) raises (SALOME::SALOME_Exception); + long DeleteHypo(in string HypoName) raises (SALOME::SALOME_Exception); + long DeleteIteration(in string IterName) raises (SALOME::SALOME_Exception); + long DeleteIterationOption(in string IterName, in long Option) + raises (SALOME::SALOME_Exception); + long DeleteZone (in string ZoneName) raises (SALOME::SALOME_Exception); // void AssociateIterHypo(in string IterName, in string HypoName) raises (SALOME::SALOME_Exception); // - void DissociateHypoZone(in string ZoneName, in string HypoName) + void AssociateHypoZone(in string HypoName, in string ZoneName, in long TypeUse) + raises (SALOME::SALOME_Exception); + void DissociateHypoZone(in string HypoName, in string ZoneName) raises (SALOME::SALOME_Exception); - void InvalideBoundary (in string BounName) raises (SALOME::SALOME_Exception); - void InvalideZone (in string ZoneName) raises (SALOME::SALOME_Exception); - void InvalideHypo (in string HypoName) raises (SALOME::SALOME_Exception); - void InvalideIter (in string IterName) raises (SALOME::SALOME_Exception); - - long Compute (in string IterName, in long etatMenage) raises (SALOME::SALOME_Exception); + long Compute (in string IterName, in long CleanOption) raises (SALOME::SALOME_Exception); boolean VerifieDir (in string IterName) raises (SALOME::SALOME_Exception); - void PublishFileUnderIteration(in string NomIter, in string NomFich, in string Commentaire) + void PublishFileUnderIteration(in string IterName, in string FileName, in string Comment) raises (SALOME::SALOME_Exception); - void PublishResultInSmesh(in string NomFich, in long IconeType) + void PublishBoundaryUnderCase(in string CaseName, in string BoundaryName); + void PublishResultInSmesh(in string FileName, in long IconeType) raises (SALOME::SALOME_Exception); - SALOMEDS::Study GetCurrentStudy() raises (SALOME::SALOME_Exception); - long GetCurrentStudyID() raises (SALOME::SALOME_Exception); }; }; diff --git a/idl/HOMARD_Hypothesis.idl b/idl/HOMARD_Hypothesis.idl index c8ce350e..032a1dae 100644 --- a/idl/HOMARD_Hypothesis.idl +++ b/idl/HOMARD_Hypothesis.idl @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #ifndef _HOMARD_HYPOTHESIS_IDL #define _HOMARD_HYPOTHESIS_IDL @@ -47,52 +56,38 @@ module HOMARD interface HOMARD_Hypothesis : Engines::EngineComponent { - - void SetName(in string NomHypothesis) raises (SALOME::SALOME_Exception); +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); string GetName() raises (SALOME::SALOME_Exception); - void SetCaseCreation(in string NomCas) raises (SALOME::SALOME_Exception); - string GetCaseCreation() raises (SALOME::SALOME_Exception); + long Delete() raises (SALOME::SALOME_Exception); + + string GetDumpPython() raises (SALOME::SALOME_Exception); - void SetAdapRefinUnRef(in long Adap, in long Raff, in long Dera) +// Caracteristiques + void SetAdapRefinUnRef(in long Adap, in long Raff, in long Dera) raises (SALOME::SALOME_Exception); listeTypes GetAdapRefinUnRef() raises (SALOME::SALOME_Exception); - long GetAdapType() raises (SALOME::SALOME_Exception); - long GetRefinType() raises (SALOME::SALOME_Exception); - long GetUnRefType() raises (SALOME::SALOME_Exception); + long GetAdapType() raises (SALOME::SALOME_Exception); + long GetRefinType() raises (SALOME::SALOME_Exception); + long GetUnRefType() raises (SALOME::SALOME_Exception); + + void SetField(in string FieldName) raises (SALOME::SALOME_Exception); + string GetFieldName() raises (SALOME::SALOME_Exception); + void SetUseField(in long UsField) raises (SALOME::SALOME_Exception); + InfosHypo GetField() raises (SALOME::SALOME_Exception); + + void SetUseComp(in long UsCmpI) raises (SALOME::SALOME_Exception); + void AddComp(in string NomComposant) raises (SALOME::SALOME_Exception); + void SupprComp() raises (SALOME::SALOME_Exception); + listeComposantsHypo GetListComp() raises (SALOME::SALOME_Exception); - void SetField(in string FieldName) raises (SALOME::SALOME_Exception); - string GetFieldName() raises (SALOME::SALOME_Exception); - void SetRefinThr(in long TypeThR, in double ThreshR) + void SetRefinThr(in long TypeThR, in double ThreshR) raises (SALOME::SALOME_Exception); - void SetUnRefThr(in long TypeThC, in double ThreshC) + long GetRefinThrType() raises (SALOME::SALOME_Exception); + void SetUnRefThr(in long TypeThC, in double ThreshC) raises (SALOME::SALOME_Exception); - long GetRefinThrType() raises (SALOME::SALOME_Exception); - long GetUnRefThrType() raises (SALOME::SALOME_Exception); - void SetUseComp(in long UsCmpI) raises (SALOME::SALOME_Exception); - void SetUseField(in long UsField) raises (SALOME::SALOME_Exception); - InfosHypo GetField() raises (SALOME::SALOME_Exception); - - void AddComp(in string NomComposant) raises (SALOME::SALOME_Exception); - void SupprComp() raises (SALOME::SALOME_Exception); - listeComposantsHypo GetListComp() raises (SALOME::SALOME_Exception); - - void AddZone(in string NomZone, in long TypeUse) raises (SALOME::SALOME_Exception); - void SupprZone(in string NomZone) raises (SALOME::SALOME_Exception); - listeZonesHypo GetZones() raises (SALOME::SALOME_Exception); - - listeIters GetIterations() raises (SALOME::SALOME_Exception); - void AddIteration(in string NomIteration) raises (SALOME::SALOME_Exception); - - ListGroupType GetGroups() raises (SALOME::SALOME_Exception); - void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); - void AddGroup(in string LeGroupe) raises (SALOME::SALOME_Exception); - - void SetTypeFieldInterp(in long TypeFieldInterp) raises (SALOME::SALOME_Exception); - long GetTypeFieldInterp() raises (SALOME::SALOME_Exception); - void AddFieldInterp(in string FieldInterp) raises (SALOME::SALOME_Exception); - void SupprFieldInterp() raises (SALOME::SALOME_Exception); - listFieldInterpHypo GetListFieldInterp() raises (SALOME::SALOME_Exception); + long GetUnRefThrType() raises (SALOME::SALOME_Exception); void SetNivMax(in long NivMax) raises (SALOME::SALOME_Exception); long GetNivMax() raises (SALOME::SALOME_Exception); @@ -106,7 +101,28 @@ module HOMARD void SetLevelOutput(in long LevelOutput) raises (SALOME::SALOME_Exception); long GetLevelOutput() raises (SALOME::SALOME_Exception); - string GetDumpPython() raises (SALOME::SALOME_Exception); + void AddGroup(in string LeGroupe) raises (SALOME::SALOME_Exception); + void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); + ListGroupType GetGroups() raises (SALOME::SALOME_Exception); + + void SetTypeFieldInterp(in long TypeFieldInterp) raises (SALOME::SALOME_Exception); + long GetTypeFieldInterp() raises (SALOME::SALOME_Exception); + void AddFieldInterp(in string FieldInterp) raises (SALOME::SALOME_Exception); + void SupprFieldInterp() raises (SALOME::SALOME_Exception); + listFieldInterpHypo GetListFieldInterp() raises (SALOME::SALOME_Exception); + +// Liens avec les autres structures + void SetCaseCreation(in string NomCas) raises (SALOME::SALOME_Exception); + string GetCaseCreation() raises (SALOME::SALOME_Exception); + + void LinkIteration(in string NomIteration) raises (SALOME::SALOME_Exception); + void UnLinkIteration(in string NomIteration) raises (SALOME::SALOME_Exception); + listeIters GetIterations() raises (SALOME::SALOME_Exception); + + void AddZone(in string NomZone, in long TypeUse) raises (SALOME::SALOME_Exception); + void AddZone0(in string NomZone, in long TypeUse) raises (SALOME::SALOME_Exception); + void SupprZone(in string NomZone) raises (SALOME::SALOME_Exception); + listeZonesHypo GetZones() raises (SALOME::SALOME_Exception); }; }; diff --git a/idl/HOMARD_Iteration.idl b/idl/HOMARD_Iteration.idl index 61d38e56..ad9703eb 100644 --- a/idl/HOMARD_Iteration.idl +++ b/idl/HOMARD_Iteration.idl @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #ifndef _HOMARD_ITERATION_IDL #define _HOMARD_ITERATION_IDL @@ -30,19 +39,27 @@ module HOMARD interface HOMARD_Iteration : Engines::EngineComponent { - void SetName(in string NomIter) raises (SALOME::SALOME_Exception); +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); string GetName() raises (SALOME::SALOME_Exception); - HOMARD_Iteration NextIteration(in string NomIter) raises (SALOME::SALOME_Exception); + long Delete() raises (SALOME::SALOME_Exception); - void SetEtat(in boolean State) raises (SALOME::SALOME_Exception); - boolean GetEtat() raises (SALOME::SALOME_Exception); + string GetDumpPython() raises (SALOME::SALOME_Exception); + +// Caracteristiques + void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception); + string GetDirName() raises (SALOME::SALOME_Exception); void SetNumber(in long NumIter) raises (SALOME::SALOME_Exception); long GetNumber() raises (SALOME::SALOME_Exception); + void SetEtat(in boolean State) raises (SALOME::SALOME_Exception); + boolean GetEtat() raises (SALOME::SALOME_Exception); + void SetMeshName(in string NomMesh) raises (SALOME::SALOME_Exception); string GetMeshName() raises (SALOME::SALOME_Exception); + void SetMeshFile(in string MeshFile) raises (SALOME::SALOME_Exception); string GetMeshFile() raises (SALOME::SALOME_Exception); @@ -53,31 +70,29 @@ module HOMARD long GetTimeStep() raises (SALOME::SALOME_Exception); long GetRank() raises (SALOME::SALOME_Exception); + void SetMessFile(in string MessFile) raises (SALOME::SALOME_Exception); + string GetMessFile() raises (SALOME::SALOME_Exception); + + long Compute(in long etatMenage) raises (SALOME::SALOME_Exception); + +// Liens avec les autres iterations + HOMARD_Iteration NextIteration(in string NomIter) raises (SALOME::SALOME_Exception); + + void LinkNextIteration(in string NomIter) raises (SALOME::SALOME_Exception); + void UnLinkNextIteration(in string NomIter) raises (SALOME::SALOME_Exception); + listeIterFilles GetIterations() raises (SALOME::SALOME_Exception); + void SetIterParentName(in string NomIterParent) raises (SALOME::SALOME_Exception); string GetIterParentName() raises (SALOME::SALOME_Exception); HOMARD_Iteration GetIterParent() raises (SALOME::SALOME_Exception); - void AddIteration(in string NomIter) raises (SALOME::SALOME_Exception); +// Liens avec les autres structures + void SetCaseName(in string NomCas) raises (SALOME::SALOME_Exception); + string GetCaseName() raises (SALOME::SALOME_Exception); void AssociateHypo(in string NomHypo) raises (SALOME::SALOME_Exception); - void SetHypoName(in string NomHypo) raises (SALOME::SALOME_Exception); string GetHypoName() raises (SALOME::SALOME_Exception); - - void SetCaseName(in string NomCas) raises (SALOME::SALOME_Exception); - string GetCaseName() raises (SALOME::SALOME_Exception); - - void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception); - string GetDirName() raises (SALOME::SALOME_Exception); - - listeIterFilles GetIterations() raises (SALOME::SALOME_Exception); - - void SetMessFile(in string MessFile) raises (SALOME::SALOME_Exception); - string GetMessFile() raises (SALOME::SALOME_Exception); - - long Compute(in long etatMenage) raises (SALOME::SALOME_Exception); - - string GetDumpPython() raises (SALOME::SALOME_Exception); }; }; #endif diff --git a/idl/HOMARD_Zone.idl b/idl/HOMARD_Zone.idl index b40cc945..cec49d5b 100644 --- a/idl/HOMARD_Zone.idl +++ b/idl/HOMARD_Zone.idl @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #ifndef _HOMARD_Zone_IDL #define _HOMARD_Zone_IDL @@ -31,18 +40,21 @@ module HOMARD interface HOMARD_Zone : Engines::EngineComponent { +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); + string GetName() raises (SALOME::SALOME_Exception); - void SetName (in string Name) raises (SALOME::SALOME_Exception); - string GetName () raises (SALOME::SALOME_Exception); + long Delete() raises (SALOME::SALOME_Exception); + + string GetDumpPython() raises (SALOME::SALOME_Exception); +// Caracteristiques void SetType (in long Type) raises (SALOME::SALOME_Exception); long GetType() raises (SALOME::SALOME_Exception); void SetBox (in double Xmini, in double Xmaxi, in double Ymini, in double Ymaxi, in double Zmini, in double Zmaxi) raises (SALOME::SALOME_Exception); - void SetSphere (in double Xcentre, in double Ycentre, in double Zcentre, in double rayon) - raises (SALOME::SALOME_Exception); void SetCylinder (in double Xcentre, in double Ycentre, in double Zcentre, in double Xaxis, in double Yaxis, in double Zaxis, in double Rayon, in double Haut) @@ -51,16 +63,19 @@ module HOMARD in double Xaxis, in double Yaxis, in double Zaxis, in double Rayon, in double Haut, in double Rayonint ) raises (SALOME::SALOME_Exception); + void SetSphere (in double Xcentre, in double Ycentre, in double Zcentre, in double rayon) + raises (SALOME::SALOME_Exception); + double_array GetCoords() raises (SALOME::SALOME_Exception); + void SetLimit (in double Xincr, in double Yincr, in double Zincr) raises (SALOME::SALOME_Exception); double_array GetLimit() raises (SALOME::SALOME_Exception); +// Liens avec les autres structures void AddHypo(in string NomHypo) raises (SALOME::SALOME_Exception); - void SupprHypo(in string NomHypo) raises (SALOME::SALOME_Exception); listeHypo GetHypo() raises (SALOME::SALOME_Exception); - - string GetDumpPython() raises (SALOME::SALOME_Exception); + void SupprHypo(in string NomHypo) raises (SALOME::SALOME_Exception); }; }; diff --git a/idl/Makefile.am b/idl/Makefile.am index f6e520d4..b23eab58 100644 --- a/idl/Makefile.am +++ b/idl/Makefile.am @@ -60,8 +60,8 @@ libSalomeIDLHOMARD_la_LDFLAGS = -no-undefined -version-info=0:0:0 libSalomeIDLHOMARD_la_LIBADD = \ $(KERNEL_LDFLAGS) -lSalomeIDLKernel \ @CORBA_LIBS@ -# $(VISU_LDFLAGS) -lSalomeIDLVisu -# $(MED_LDFLAGS) -lSalomeIDLMed +# $(VISU_LDFLAGS) -lSalomeIDLVisu +# $(MED_LDFLAGS) -lSalomeIDLMed # These variables defines the building process of CORBA files OMNIORB_IDL = @OMNIORB_IDL@ diff --git a/resources/HOMARDCatalog.xml.in b/resources/HOMARDCatalog.xml.in index dd73aff4..2aa347ed 100644 --- a/resources/HOMARDCatalog.xml.in +++ b/resources/HOMARDCatalog.xml.in @@ -483,7 +483,7 @@ 0 - BounName + BoundaryName string unknown @@ -515,7 +515,7 @@ 0 - BounName + BoundaryName string unknown @@ -572,7 +572,7 @@ 0 - BounName + BoundaryName string unknown @@ -636,7 +636,7 @@ 0 - BounName + BoundaryName string unknown @@ -651,14 +651,14 @@ - GetZone + GetHypothesis HOMARD team - EDF RD 1.1 unknown 0 - ZoneName + HypoName string unknown @@ -666,21 +666,21 @@ return - HOMARD_Zone + HOMARD_Hypothesis unknown - GetHypothesis + GetIteration HOMARD team - EDF RD 1.1 unknown 0 - HypoName + IterName string unknown @@ -688,21 +688,21 @@ return - HOMARD_Hypothesis + HOMARD_Iteration unknown - GetIteration + GetZone HOMARD team - EDF RD 1.1 unknown 0 - IterName + ZoneName string unknown @@ -710,7 +710,7 @@ return - HOMARD_Iteration + HOMARD_Zone unknown @@ -796,6 +796,28 @@ + + LastIteration + HOMARD team - EDF RD + 1.1 + unknown + 0 + + + CaseName + string + unknown + + + + + return + HOMARD_Iteration + unknown + + + + SetCurrentStudy HOMARD team - EDF RD diff --git a/src/HOMARD/HOMARD_Boundary.cxx b/src/HOMARD/HOMARD_Boundary.cxx index 596d3699..f73659de 100644 --- a/src/HOMARD/HOMARD_Boundary.cxx +++ b/src/HOMARD/HOMARD_Boundary.cxx @@ -21,6 +21,15 @@ // File : HOMARD_Boundary.cxx // Author : Paul RASCLE, EDF // Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier #include "HOMARD_Boundary.hxx" #include "utilities.h" @@ -45,19 +54,20 @@ HOMARD_Boundary::~HOMARD_Boundary() { MESSAGE("~HOMARD_Boundary"); } - +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= //============================================================================= void HOMARD_Boundary::SetName( const char* Name ) { _Name = std::string( Name ); } - //============================================================================= std::string HOMARD_Boundary::GetName() const { return _Name; } - //============================================================================= std::string HOMARD_Boundary::GetDumpPython() const { @@ -92,30 +102,20 @@ std::string HOMARD_Boundary::GetDumpPython() const return aScript.str(); } - - +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= //============================================================================= void HOMARD_Boundary::SetType( int Type ) { _Type = Type; } - //============================================================================= int HOMARD_Boundary::GetType() const { return _Type; } - -//============================================================================= -void HOMARD_Boundary::SetMeshFile( const char* MeshFile ) -{ - _MeshFile = std::string( MeshFile ); -} -//============================================================================= -std::string HOMARD_Boundary::GetMeshFile() const -{ - return _MeshFile; -} //============================================================================= void HOMARD_Boundary::SetMeshName( const char* MeshName ) { @@ -126,10 +126,15 @@ std::string HOMARD_Boundary::GetMeshName() const { return _MeshName; } -//====================================================================== -void HOMARD_Boundary::SetLimit( double X0, double X1, double X2 ) +//============================================================================= +void HOMARD_Boundary::SetMeshFile( const char* MeshFile ) { - _Xincr = X0; _Yincr = X1; _Zincr = X2; + _MeshFile = std::string( MeshFile ); +} +//============================================================================= +std::string HOMARD_Boundary::GetMeshFile() const +{ + return _MeshFile; } //======================================================================================= void HOMARD_Boundary::SetCylinder( double X0, double X1, double X2, @@ -140,24 +145,12 @@ void HOMARD_Boundary::SetCylinder( double X0, double X1, double X2, _Yaxe = X4; _Zaxe = X5; _rayon = X6; } - //====================================================================== void HOMARD_Boundary::SetSphere( double X0, double X1, double X2, double X3 ) { _Xcentre = X0; _Ycentre = X1; _Zcentre = X2; _rayon = X3; } - -//======================================================================================= -std::vector HOMARD_Boundary::GetLimit() const -{ - std::vector mesLimit; - mesLimit.push_back( _Xincr ); - mesLimit.push_back( _Yincr ); - mesLimit.push_back( _Zincr ); - return mesLimit; -} - //======================================================================================= std::vector HOMARD_Boundary::GetCoords() const { @@ -190,22 +183,24 @@ std::vector HOMARD_Boundary::GetCoords() const } return mesCoor; } -//============================================================================= -/*! - */ -//============================================================================= -void HOMARD_Boundary::SetCaseCreation( const char* NomCasCreation ) +//====================================================================== +void HOMARD_Boundary::SetLimit( double X0, double X1, double X2 ) { - _NomCasCreation = std::string( NomCasCreation ); + _Xincr = X0; _Yincr = X1; _Zincr = X2; +} +//======================================================================================= +std::vector HOMARD_Boundary::GetLimit() const +{ + std::vector mesLimit; + mesLimit.push_back( _Xincr ); + mesLimit.push_back( _Yincr ); + mesLimit.push_back( _Zincr ); + return mesLimit; } - -//============================================================================= -/*! -*/ //============================================================================= -const std::list& HOMARD_Boundary::GetGroups() const +void HOMARD_Boundary::AddGroup( const char* Group) { - return _ListGroupSelected; + _ListGroupSelected.push_back(Group); } //============================================================================= void HOMARD_Boundary::SetGroups( const std::list& ListGroup ) @@ -216,14 +211,19 @@ void HOMARD_Boundary::SetGroups( const std::list& ListGroup ) _ListGroupSelected.push_back((*it++)); } //============================================================================= -void HOMARD_Boundary::AddGroup( const char* Group) +const std::list& HOMARD_Boundary::GetGroups() const { - _ListGroupSelected.push_back(Group); + return _ListGroupSelected; } - //============================================================================= -/*! -*/ +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Boundary::SetCaseCreation( const char* NomCasCreation ) +{ + _NomCasCreation = std::string( NomCasCreation ); +} //============================================================================= std::string HOMARD_Boundary::GetCaseCreation() const { diff --git a/src/HOMARD/HOMARD_Boundary.hxx b/src/HOMARD/HOMARD_Boundary.hxx index f92456e7..5cf972aa 100644 --- a/src/HOMARD/HOMARD_Boundary.hxx +++ b/src/HOMARD/HOMARD_Boundary.hxx @@ -21,6 +21,15 @@ // File : HOMARD_Boundary.hxx // Author : Paul RASCLE, EDF // Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier #ifndef _HOMARD_Boundary_HXX_ #define _HOMARD_Boundary_HXX_ @@ -35,34 +44,39 @@ public: HOMARD_Boundary(); ~HOMARD_Boundary(); +// Generalites void SetName( const char* Name ); std::string GetName() const; - std::string GetDumpPython() const; - void SetLimit( double X0, double X1, double X2 ); - std::vector GetLimit() const; + std::string GetDumpPython() const; - void SetMeshFile( const char* MeshFile ); - std::string GetMeshFile() const; +// Caracteristiques + void SetType( int Type ); + int GetType() const; void SetMeshName( const char* MeshName ); std::string GetMeshName() const; + void SetMeshFile( const char* MeshFile ); + std::string GetMeshFile() const; + void SetCylinder( double X0, double X1, double X2, double X3, double X4, double X5, double X6 ); void SetSphere( double X0, double X1, double X2, double X3 ); - std::vector GetCoords() const; - void SetType( int Type ); - int GetType() const; + std::vector GetCoords() const; - std::string GetCaseCreation() const; - void SetCaseCreation( const char* NomCasCreation ); + void SetLimit( double X0, double X1, double X2 ); + std::vector GetLimit() const; void AddGroup( const char* LeGroupe); void SetGroups(const std::list& ListGroup ); const std::list& GetGroups() const; +// Liens avec les autres structures + std::string GetCaseCreation() const; + void SetCaseCreation( const char* NomCasCreation ); + private: std::string _Name; std::string _NomCasCreation; diff --git a/src/HOMARD/HOMARD_Cas.cxx b/src/HOMARD/HOMARD_Cas.cxx index 916b1b0a..a7ebbf4f 100644 --- a/src/HOMARD/HOMARD_Cas.cxx +++ b/src/HOMARD/HOMARD_Cas.cxx @@ -21,6 +21,15 @@ // File : HOMARD_Cas.cxx // Author : Paul RASCLE, EDF // Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier #include "HOMARD_Cas.hxx" #include "utilities.h" @@ -47,49 +56,22 @@ HOMARD_Cas::~HOMARD_Cas() { MESSAGE("~HOMARD_Cas"); } - -//============================================================================= -void HOMARD_Cas::SetDirName( const char* NomDir ) //============================================================================= -{ - MESSAGE("SetDirName, NomDir : "<& HOMARD_Cas::GetIterations() const //============================================================================= +void HOMARD_Cas::SetDirName( const char* NomDir ) { - return _ListIter; + MESSAGE("SetDirName, NomDir : "<& extremas ) -//============================================================================= { _Boite.clear(); _Boite.resize( extremas.size() ); for ( int i = 0; i < extremas.size(); i++ ) _Boite[i] = extremas[i]; } - //============================================================================= const std::vector& HOMARD_Cas::GetBoundingBox() const -//============================================================================= { return _Boite; } @@ -185,20 +155,12 @@ const std::vector& HOMARD_Cas::GetBoundingBox() const // Les groupes // //============================================================================= -const std::list& HOMARD_Cas::GetGroups() const -//============================================================================= -{ - return _ListGroup; -} -//============================================================================= -void HOMARD_Cas::SupprGroups() -//============================================================================= +void HOMARD_Cas::AddGroup( const char* Group ) { - _ListGroup.clear(); + _ListGroup.push_back(Group); } //============================================================================= void HOMARD_Cas::SetGroups( const std::list& ListGroup ) -//============================================================================= { _ListGroup.clear(); std::list::const_iterator it = ListGroup.begin(); @@ -208,19 +170,18 @@ void HOMARD_Cas::SetGroups( const std::list& ListGroup ) } } //============================================================================= -void HOMARD_Cas::AddGroup( const char* Group ) +const std::list& HOMARD_Cas::GetGroups() const { - _ListGroup.push_back(Group); + return _ListGroup; } -// -// Les frontieres -// -//============================================================================= -const std::list& HOMARD_Cas::GetBoundaryGroup() const //============================================================================= +void HOMARD_Cas::SupprGroups() { - return _ListBoundaryGroup; + _ListGroup.clear(); } +// +// Les frontieres +// //============================================================================= void HOMARD_Cas::AddBoundaryGroup( const char* Boundary, const char* Group ) { @@ -228,20 +189,49 @@ void HOMARD_Cas::AddBoundaryGroup( const char* Boundary, const char* Group ) _ListBoundaryGroup.push_back( Group ); } //============================================================================= -void HOMARD_Cas::SupprBoundaryGroup() +const std::list& HOMARD_Cas::GetBoundaryGroup() const +{ + return _ListBoundaryGroup; +} //============================================================================= +void HOMARD_Cas::SupprBoundaryGroup() { _ListBoundaryGroup.clear(); } //============================================================================= void HOMARD_Cas::SetPyram( int Pyram ) -//============================================================================= { _Pyram = Pyram; } //============================================================================= const int HOMARD_Cas::GetPyram() const -//============================================================================= { return _Pyram; } +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +std::string HOMARD_Cas::GetIter0Name() const +{ +// Par construction de la liste, l'iteration a ete mise en tete. + return (*(_ListIter.begin())); +} +//============================================================================= +void HOMARD_Cas::AddIteration( const char* NomIteration ) +{ + _ListIter.push_back( std::string( NomIteration ) ); +} +//============================================================================= +const std::list& HOMARD_Cas::GetIterations() const +{ + return _ListIter; +} +//============================================================================= +void HOMARD_Cas::SupprIterations() +{ + _ListIter.clear(); +} + + diff --git a/src/HOMARD/HOMARD_Cas.hxx b/src/HOMARD/HOMARD_Cas.hxx index 8c00114d..66ba421d 100644 --- a/src/HOMARD/HOMARD_Cas.hxx +++ b/src/HOMARD/HOMARD_Cas.hxx @@ -21,6 +21,15 @@ // File : HOMARD_Cas.hxx // Author : Paul RASCLE, EDF // Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier #ifndef _HOMARD_CAS_HXX_ #define _HOMARD_CAS_HXX_ @@ -35,34 +44,29 @@ public: HOMARD_Cas(); ~HOMARD_Cas(); +// Generalites void SetName( const char* Name ); std::string GetName() const; + std::string GetDumpPython() const; + +// Caracteristiques void SetDirName( const char* NomDir ); std::string GetDirName() const; - void SetConfType( int ConfType ); - const int GetConfType() const; int GetNumber(); - void AddIteration( const char* NomIteration ); - const std::list& GetIterations() const; - void SupprIterations(); - - std::string GetIter0Name() const; - std::string GetDumpPython() const; + void SetConfType( int ConfType ); + const int GetConfType() const; void SetBoundingBox( const std::vector& extremas ); const std::vector& GetBoundingBox() const; - void SetGroups( const std::list& ListGroup ); - void AddGroup( const char* Group); + void SetGroups( const std::list& ListGroup ); const std::list& GetGroups() const; void SupprGroups(); -// void SetBoundary( const std::list& ListBoundary ); - void AddBoundaryGroup( const char* Boundary, const char* Group ); const std::list& GetBoundaryGroup() const; void SupprBoundaryGroup(); @@ -70,6 +74,13 @@ public: void SetPyram( int Pyram ); const int GetPyram() const; +// Liens avec les autres structures + std::string GetIter0Name() const; + + void AddIteration( const char* NomIteration ); + const std::list& GetIterations() const; + void SupprIterations(); + private: std::string _Name; std::string _NomDir; diff --git a/src/HOMARD/HOMARD_DriverTools.cxx b/src/HOMARD/HOMARD_DriverTools.cxx index 8a262942..4bcc8146 100644 --- a/src/HOMARD/HOMARD_DriverTools.cxx +++ b/src/HOMARD/HOMARD_DriverTools.cxx @@ -202,7 +202,7 @@ namespace HOMARD os << separator() << hypothesis.GetUnRefThrType(); os << separator() << hypothesis.GetThreshC(); os << separator() << hypothesis.GetUseField(); - os << separator() << hypothesis.GetUseCompI(); + os << separator() << hypothesis.GetUseComp(); os << separator() << hypothesis.GetTypeFieldInterp(); std::list ListString = hypothesis.GetIterations(); @@ -458,7 +458,7 @@ namespace HOMARD for ( int i = 0; i < size; i++ ) { chunk = getNextChunk( stream, start, ok ); if ( !ok ) return false; - iteration.AddIteration( chunk.c_str() ); + iteration.LinkNextIteration( chunk.c_str() ); } // chunk = getNextChunk( stream, start, ok ); @@ -546,7 +546,7 @@ namespace HOMARD for ( int i = 0; i < size; i++ ) { chunk = getNextChunk( stream, start, ok ); if ( !ok ) return false; - hypothesis.AddIteration( chunk.c_str() ); + hypothesis.LinkIteration( chunk.c_str() ); } chunk = getNextChunk( stream, start, ok ); diff --git a/src/HOMARD/HOMARD_Hypothesis.cxx b/src/HOMARD/HOMARD_Hypothesis.cxx index da278216..0d274141 100644 --- a/src/HOMARD/HOMARD_Hypothesis.cxx +++ b/src/HOMARD/HOMARD_Hypothesis.cxx @@ -21,6 +21,15 @@ // File : HOMARD_Hypothesis.cxx // Author : Paul RASCLE, EDF // Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier #include "HOMARD_Hypothesis.hxx" #include "utilities.h" @@ -49,36 +58,15 @@ HOMARD_Hypothesis::~HOMARD_Hypothesis() { MESSAGE("~HOMARD_Hypothesis"); } - -//============================================================================= -/*! - */ -//============================================================================= -void HOMARD_Hypothesis::SetCaseCreation( const char* NomCasCreation ) -{ - _NomCasCreation = std::string( NomCasCreation ); -} - //============================================================================= -/*! -*/ //============================================================================= -std::string HOMARD_Hypothesis::GetCaseCreation() const -{ - return _NomCasCreation; -} +// Generalites //============================================================================= -/*! -*/ //============================================================================= void HOMARD_Hypothesis::SetName( const char* Name ) { _Name = std::string( Name ); } - -//============================================================================= -/*! -*/ //============================================================================= std::string HOMARD_Hypothesis::GetName() const { @@ -161,30 +149,21 @@ std::string HOMARD_Hypothesis::GetDumpPython() const return aScript.str(); } - - //============================================================================= -/*! -*/ +//============================================================================= +// Caracteristiques +//============================================================================= //============================================================================= void HOMARD_Hypothesis::SetAdapType( int TypeAdap ) { ASSERT (!((TypeAdap < -1) or (TypeAdap > 1))); _TypeAdap = TypeAdap; } - -//============================================================================= -/*! -*/ //============================================================================= int HOMARD_Hypothesis::GetAdapType() const { return _TypeAdap; } - -//============================================================================= -/*! -*/ //============================================================================= void HOMARD_Hypothesis::SetRefinTypeDera( int TypeRaff, int TypeDera ) { @@ -193,28 +172,16 @@ void HOMARD_Hypothesis::SetRefinTypeDera( int TypeRaff, int TypeDera ) ASSERT(! ((TypeDera < 0) or (TypeDera > 1))); _TypeDera = TypeDera; } - -//============================================================================= -/*! -*/ //============================================================================= int HOMARD_Hypothesis::GetRefinType() const { return _TypeRaff; } - -//============================================================================= -/*! -*/ //============================================================================= int HOMARD_Hypothesis::GetUnRefType() const { return _TypeDera; } - -//============================================================================= -/*! -*/ //============================================================================= void HOMARD_Hypothesis::SetField( const char* FieldName ) { @@ -222,19 +189,20 @@ void HOMARD_Hypothesis::SetField( const char* FieldName ) MESSAGE( "SetField : FieldName = " << FieldName ); } //============================================================================= -void HOMARD_Hypothesis::SetRefinThr( int TypeThR, double ThreshR ) +std::string HOMARD_Hypothesis::GetFieldName() const { - MESSAGE( "SetRefinThr : TypeThR = " << TypeThR << ", ThreshR = " << ThreshR ); - ASSERT(!(( TypeThR < 0) or (TypeThR > 3 ))); - _TypeThR = TypeThR; - _ThreshR = ThreshR; + return _Field; } //============================================================================= -void HOMARD_Hypothesis::SetUnRefThr( int TypeThC, double ThreshC ) +void HOMARD_Hypothesis::SetUseField( int UsField ) { - ASSERT(!((TypeThC < 0) or (TypeThC > 3))); - _TypeThC = TypeThC; - _ThreshC = ThreshC; + ASSERT(!((UsField < 0) or (UsField > 1 ))); + _UsField = UsField; +} +//============================================================================= +int HOMARD_Hypothesis::GetUseField() const +{ + return _UsField; } //============================================================================= void HOMARD_Hypothesis::SetUseComp( int UsCmpI ) @@ -243,19 +211,33 @@ void HOMARD_Hypothesis::SetUseComp( int UsCmpI ) _UsCmpI = UsCmpI; } //============================================================================= -void HOMARD_Hypothesis::SetUseField( int UsField ) +int HOMARD_Hypothesis::GetUseComp() const { - ASSERT(!((UsField < 0) or (UsField > 1 ))); - _UsField = UsField; + return _UsCmpI; } - //============================================================================= -/*! -*/ +void HOMARD_Hypothesis::AddComp( const char* NomComposant ) +{ + _ListComposant.push_back( std::string( NomComposant ) ); +} //============================================================================= -std::string HOMARD_Hypothesis::GetFieldName() const +void HOMARD_Hypothesis::SupprComp() { - return _Field; + MESSAGE ("SupprComp") ; + _ListComposant.clear(); +} +//============================================================================= +const std::list& HOMARD_Hypothesis::GetListComp() const +{ + return _ListComposant; +} +//============================================================================= +void HOMARD_Hypothesis::SetRefinThr( int TypeThR, double ThreshR ) +{ + MESSAGE( "SetRefinThr : TypeThR = " << TypeThR << ", ThreshR = " << ThreshR ); + ASSERT(!(( TypeThR < 0) or (TypeThR > 4 ))); + _TypeThR = TypeThR; + _ThreshR = ThreshR; } //============================================================================= int HOMARD_Hypothesis::GetRefinThrType() const @@ -268,101 +250,74 @@ double HOMARD_Hypothesis::GetThreshR() const return _ThreshR; } //============================================================================= +void HOMARD_Hypothesis::SetUnRefThr( int TypeThC, double ThreshC ) +{ + ASSERT(!((TypeThC < 0) or (TypeThC > 4))); + _TypeThC = TypeThC; + _ThreshC = ThreshC; +} +//============================================================================= int HOMARD_Hypothesis::GetUnRefThrType() const { return _TypeThC; } - //============================================================================= double HOMARD_Hypothesis::GetThreshC() const { return _ThreshC; } //============================================================================= -int HOMARD_Hypothesis::GetUseField() const -{ - return _UsField; -} +void HOMARD_Hypothesis::SetNivMax( int NivMax ) //============================================================================= -int HOMARD_Hypothesis::GetUseCompI() const { - return _UsCmpI; + _NivMax = NivMax; } //============================================================================= -/*! -*/ +const int HOMARD_Hypothesis::GetNivMax() const //============================================================================= -void HOMARD_Hypothesis::AddIteration( const char* NomIteration ) { - _ListIter.push_back( std::string( NomIteration ) ); + return _NivMax; } //============================================================================= -void HOMARD_Hypothesis::SupprIterations() -{ - _ListIter.clear(); -} +void HOMARD_Hypothesis::SetDiamMin( double DiamMin ) //============================================================================= -const std::list& HOMARD_Hypothesis::GetIterations() const { - return _ListIter; + _DiamMin = DiamMin; } //============================================================================= -/*! -*/ +const double HOMARD_Hypothesis::GetDiamMin() const //============================================================================= -void HOMARD_Hypothesis::AddZone( const char* NomZone, int TypeUse ) { - _ListZone.push_back( std::string( NomZone ) ); - std::stringstream saux1 ; - saux1 << TypeUse ; - std::string saux2 = saux1.str() ; - _ListZone.push_back( saux2 ); + return _DiamMin; } //============================================================================= -void HOMARD_Hypothesis::SupprZone( const char* NomZone ) -{ - std::list::iterator it = find( _ListZone.begin(), _ListZone.end(), NomZone ); - if ( it != _ListZone.end() ) - { - _ListZone.erase( it ); - } -} +void HOMARD_Hypothesis::SetAdapInit( int AdapInit ) //============================================================================= -void HOMARD_Hypothesis::SupprZones() { - _ListZone.clear(); + _AdapInit = AdapInit; } //============================================================================= -const std::list& HOMARD_Hypothesis::GetZones() const +const int HOMARD_Hypothesis::GetAdapInit() const +//============================================================================= { - return _ListZone; + return _AdapInit; } //============================================================================= -/*! -*/ +void HOMARD_Hypothesis::SetLevelOutput( int LevelOutput ) //============================================================================= -void HOMARD_Hypothesis::AddComp( const char* NomComposant ) { - _ListComposant.push_back( std::string( NomComposant ) ); + _LevelOutput = LevelOutput; } //============================================================================= -void HOMARD_Hypothesis::SupprComp() -{ - std::cerr << "HOMARD_Hypothesis::SupprComp" << std::endl; - _ListComposant.clear(); -} +const int HOMARD_Hypothesis::GetLevelOutput() const //============================================================================= -const std::list& HOMARD_Hypothesis::GetListComp() const { - return _ListComposant; + return _LevelOutput; } //============================================================================= -/*! -*/ -//============================================================================= -const std::list& HOMARD_Hypothesis::GetGroups() const +void HOMARD_Hypothesis::AddGroup( const char* Group) { - return _ListGroupSelected; + _ListGroupSelected.push_back(Group); } //============================================================================= void HOMARD_Hypothesis::SetGroups( const std::list& ListGroup ) @@ -373,30 +328,21 @@ void HOMARD_Hypothesis::SetGroups( const std::list& ListGroup ) _ListGroupSelected.push_back((*it++)); } //============================================================================= -void HOMARD_Hypothesis::AddGroup( const char* Group) +const std::list& HOMARD_Hypothesis::GetGroups() const { - _ListGroupSelected.push_back(Group); + return _ListGroupSelected; } //============================================================================= -/*! -*/ -//============================================================================= void HOMARD_Hypothesis::SetTypeFieldInterp( int TypeFieldInterp ) { ASSERT (!((TypeFieldInterp < -1) or (TypeFieldInterp > 2))); _TypeFieldInterp = TypeFieldInterp; } - -//============================================================================= -/*! -*/ //============================================================================= int HOMARD_Hypothesis::GetTypeFieldInterp() const { return _TypeFieldInterp; } -/*! -*/ //============================================================================= void HOMARD_Hypothesis::AddFieldInterp( const char* FieldInterp ) { @@ -405,7 +351,7 @@ void HOMARD_Hypothesis::AddFieldInterp( const char* FieldInterp ) //============================================================================= void HOMARD_Hypothesis::SupprFieldInterp() { - std::cerr << "HOMARD_Hypothesis::SupprFieldInterpp" << std::endl; + MESSAGE ("SupprFieldInterp") ; _ListFieldInterp.clear(); } //============================================================================= @@ -414,50 +360,71 @@ const std::list& HOMARD_Hypothesis::GetListFieldInterp() const return _ListFieldInterp; } //============================================================================= -void HOMARD_Hypothesis::SetNivMax( int NivMax ) //============================================================================= -{ - _NivMax = NivMax; -} +// Liens avec les autres structures //============================================================================= -const int HOMARD_Hypothesis::GetNivMax() const //============================================================================= +void HOMARD_Hypothesis::SetCaseCreation( const char* NomCasCreation ) { - return _NivMax; + _NomCasCreation = std::string( NomCasCreation ); } //============================================================================= -void HOMARD_Hypothesis::SetAdapInit( int AdapInit ) -//============================================================================= +std::string HOMARD_Hypothesis::GetCaseCreation() const { - _AdapInit = AdapInit; + return _NomCasCreation; } //============================================================================= -const int HOMARD_Hypothesis::GetAdapInit() const -//============================================================================= +void HOMARD_Hypothesis::LinkIteration( const char* NomIteration ) { - return _AdapInit; + _ListIter.push_back( std::string( NomIteration ) ); } //============================================================================= -void HOMARD_Hypothesis::SetDiamMin( double DiamMin ) -//============================================================================= +void HOMARD_Hypothesis::UnLinkIteration( const char* NomIteration ) { - _DiamMin = DiamMin; + std::list::iterator it = find( _ListIter.begin(), _ListIter.end(), NomIteration ) ; + if ( it != _ListIter.end() ) + { + MESSAGE ("Dans UnLinkIteration pour " << NomIteration) ; + _ListIter.erase( it ) ; + } } //============================================================================= -const double HOMARD_Hypothesis::GetDiamMin() const +void HOMARD_Hypothesis::UnLinkIterations() +{ + _ListIter.clear(); +} //============================================================================= +const std::list& HOMARD_Hypothesis::GetIterations() const { - return _DiamMin; + return _ListIter; } //============================================================================= -void HOMARD_Hypothesis::SetLevelOutput( int LevelOutput ) +void HOMARD_Hypothesis::AddZone( const char* NomZone, int TypeUse ) +{ + MESSAGE ("Dans AddZone pour " << NomZone) ; + _ListZone.push_back( std::string( NomZone ) ); + std::stringstream saux1 ; + saux1 << TypeUse ; + std::string saux2 = saux1.str() ; + _ListZone.push_back( saux2 ); +} //============================================================================= +void HOMARD_Hypothesis::SupprZone( const char* NomZone ) { - _LevelOutput = LevelOutput; + MESSAGE ("Dans SupprZone pour " << NomZone) ; + std::list::iterator it = find( _ListZone.begin(), _ListZone.end(), NomZone ); + if ( it != _ListZone.end() ) + { + _ListZone.erase( it ); + } } //============================================================================= -const int HOMARD_Hypothesis::GetLevelOutput() const +void HOMARD_Hypothesis::SupprZones() +{ + _ListZone.clear(); +} //============================================================================= +const std::list& HOMARD_Hypothesis::GetZones() const { - return _LevelOutput; + return _ListZone; } diff --git a/src/HOMARD/HOMARD_Hypothesis.hxx b/src/HOMARD/HOMARD_Hypothesis.hxx index fef6a2d4..4fa6fdac 100644 --- a/src/HOMARD/HOMARD_Hypothesis.hxx +++ b/src/HOMARD/HOMARD_Hypothesis.hxx @@ -21,6 +21,15 @@ // File : HOMARD_Hypothesis.hxx // Author : Paul RASCLE, EDF // Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier #ifndef _HOMARD_HYPOTHESIS_HXX_ #define _HOMARD_HYPOTHESIS_HXX_ @@ -34,44 +43,48 @@ public: HOMARD_Hypothesis(); ~HOMARD_Hypothesis(); +// Generalites void SetName( const char* Name ); std::string GetName() const; - void SetCaseCreation( const char* NomCasCreation ); - std::string GetCaseCreation() const; + std::string GetDumpPython() const; +// Caracteristiques void SetAdapType( int TypeAdap ); int GetAdapType() const; - void SetRefinTypeDera( int TypeRaff, int TypeDera ); int GetRefinType() const; int GetUnRefType() const; void SetField( const char* FieldName ); - void SetRefinThr( int TypeThR, double ThreshR ); - void SetUnRefThr( int TypeThC, double ThreshC ); - void SetUseComp( int UsCmpI ); - void SetUseField( int UsField ); std::string GetFieldName() const; - int GetRefinThrType() const; - double GetThreshR() const; - int GetUnRefThrType() const; - double GetThreshC() const; + void SetUseField( int UsField ); int GetUseField() const; - int GetUseCompI() const; + void SetUseComp( int UsCmpI ); + int GetUseComp() const; void AddComp( const char* NomComposant ); void SupprComp(); const std::list& GetListComp() const; - void AddIteration( const char* NomIter ); - void SupprIterations(); - const std::list& GetIterations() const; + void SetRefinThr( int TypeThR, double ThreshR ); + int GetRefinThrType() const; + double GetThreshR() const; + void SetUnRefThr( int TypeThC, double ThreshC ); + int GetUnRefThrType() const; + double GetThreshC() const; - void AddZone( const char* NomZone, int TypeUse ); - void SupprZone( const char* NomZone ); - void SupprZones(); - const std::list& GetZones() const; + void SetNivMax( int NivMax ); + const int GetNivMax() const; + + void SetDiamMin( double DiamMin ); + const double GetDiamMin() const; + + void SetAdapInit( int AdapInit ); + const int GetAdapInit() const; + + void SetLevelOutput( int LevelOutput ); + const int GetLevelOutput() const; void AddGroup( const char* LeGroupe); void SetGroups(const std::list& ListGroup ); @@ -83,15 +96,19 @@ public: void SupprFieldInterp(); const std::list& GetListFieldInterp() const; - void SetNivMax( int NivMax ); - const int GetNivMax() const; - void SetDiamMin( double DiamMin ); - const double GetDiamMin() const; - void SetAdapInit( int AdapInit ); - const int GetAdapInit() const; - void SetLevelOutput( int LevelOutput ); - const int GetLevelOutput() const; +// Liens avec les autres structures + void SetCaseCreation( const char* NomCasCreation ); + std::string GetCaseCreation() const; + void LinkIteration( const char* NomIter ); + void UnLinkIteration( const char* NomIter ); + void UnLinkIterations(); + const std::list& GetIterations() const; + + void AddZone( const char* NomZone, int TypeUse ); + void SupprZone( const char* NomZone ); + void SupprZones(); + const std::list& GetZones() const; private: std::string _Name; diff --git a/src/HOMARD/HOMARD_Iteration.cxx b/src/HOMARD/HOMARD_Iteration.cxx index 2633b4b1..c65ad823 100644 --- a/src/HOMARD/HOMARD_Iteration.cxx +++ b/src/HOMARD/HOMARD_Iteration.cxx @@ -21,6 +21,15 @@ // File : HOMARD_Iteration.cxx // Author : Paul RASCLE, EDF // Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier #include "HOMARD_Iteration.hxx" #include "utilities.h" @@ -51,28 +60,20 @@ HOMARD_Iteration::~HOMARD_Iteration() { MESSAGE("~HOMARD_Iteration"); } - //============================================================================= -/*! -*/ +//============================================================================= +// Generalites +//============================================================================= //============================================================================= void HOMARD_Iteration::SetName( const char* Name ) { _Name = std::string( Name ); } - -//============================================================================= -/*! -*/ //============================================================================= std::string HOMARD_Iteration::GetName() const { return _Name; } - -//============================================================================= -/*! -*/ //============================================================================= std::string HOMARD_Iteration::GetDumpPython() const { @@ -118,221 +119,155 @@ std::string HOMARD_Iteration::GetDumpPython() const return aScript.str(); } //============================================================================= -/*! -*/ //============================================================================= -void HOMARD_Iteration::SetEtat( bool etat ) -{ - _Etat = etat; -} - +// Caracteristiques //============================================================================= -/*! -*/ //============================================================================= -bool HOMARD_Iteration::GetEtat() const +void HOMARD_Iteration::SetDirName( const char* NomDir ) { - return _Etat; + _NomDir = std::string( NomDir ); } - //============================================================================= -/*! -*/ +std::string HOMARD_Iteration::GetDirName() const +{ + return _NomDir; +} //============================================================================= void HOMARD_Iteration::SetNumber( int NumIter ) { _NumIter = NumIter; } - -//============================================================================= -/*! -*/ //============================================================================= int HOMARD_Iteration::GetNumber() const { return _NumIter; } - //============================================================================= -/*! -*/ +void HOMARD_Iteration::SetEtat( bool etat ) +{ + _Etat = etat; +} +//============================================================================= +bool HOMARD_Iteration::GetEtat() const +{ + return _Etat; +} //============================================================================= void HOMARD_Iteration::SetMeshName( const char* NomMesh ) { _NomMesh = std::string( NomMesh ); } - -//============================================================================= -/*! -*/ //============================================================================= std::string HOMARD_Iteration::GetMeshName() const { return _NomMesh; } - -//============================================================================= -/*! -*/ //============================================================================= -void HOMARD_Iteration::SetIterParentName( const char* IterParent ) +void HOMARD_Iteration::SetMeshFile( const char* MeshFile ) { - _IterParent = IterParent; + _MeshFile = std::string( MeshFile ); } - //============================================================================= -/*! -*/ -//============================================================================= -std::string HOMARD_Iteration::GetIterParentName() const +std::string HOMARD_Iteration::GetMeshFile() const { - return _IterParent; + return _MeshFile; } - -//============================================================================= -/*! -*/ //============================================================================= -void HOMARD_Iteration::AddIteration( const char* NomIteration ) +void HOMARD_Iteration::SetFieldFile( const char* FieldFile ) { - _mesIterFilles.push_back( std::string( NomIteration ) ); + _FieldFile = std::string( FieldFile ); } - -//============================================================================= -/*! -*/ //============================================================================= -const std::list& HOMARD_Iteration::GetIterations() const +std::string HOMARD_Iteration::GetFieldFile() const { - return _mesIterFilles; + return _FieldFile; } - -//============================================================================= -/*! -*/ //============================================================================= -void HOMARD_Iteration::SupprIterations() +void HOMARD_Iteration::SetTimeStepRank( int TimeStep, int Rank ) { - _mesIterFilles.clear(); + _TimeStep = TimeStep; + _Rank = Rank; } - - -//============================================================================= -/*! -*/ //============================================================================= -void HOMARD_Iteration::SetHypoName( const char* NomHypo ) +int HOMARD_Iteration::GetTimeStep() const { - _NomHypo = std::string( NomHypo ); + return _TimeStep; } - //============================================================================= -/*! -*/ -//============================================================================= -std::string HOMARD_Iteration::GetHypoName() const +int HOMARD_Iteration::GetRank() const { - return _NomHypo; + return _Rank; } - -//============================================================================= -/*! -*/ //============================================================================= -void HOMARD_Iteration::SetMeshFile( const char* MeshFile ) +void HOMARD_Iteration::SetMessFile( const char* MessFile ) { - _MeshFile = std::string( MeshFile ); + _MessFile = std::string( MessFile ); } - //============================================================================= -/*! -*/ -//============================================================================= -std::string HOMARD_Iteration::GetMeshFile() const +std::string HOMARD_Iteration::GetMessFile() const { - return _MeshFile; + return _MessFile; } - //============================================================================= -/*! -*/ //============================================================================= -void HOMARD_Iteration::SetFieldFile( const char* FieldFile ) +// Liens avec les autres iterations +//============================================================================= +//============================================================================= +void HOMARD_Iteration::LinkNextIteration( const char* NomIteration ) { - _FieldFile = std::string( FieldFile ); + _mesIterFilles.push_back( std::string( NomIteration ) ); } //============================================================================= -std::string HOMARD_Iteration::GetFieldFile() const +void HOMARD_Iteration::UnLinkNextIteration( const char* NomIteration ) { - return _FieldFile; + std::list::iterator it = find( _mesIterFilles.begin(), _mesIterFilles.end(), NomIteration ) ; + if ( it != _mesIterFilles.end() ) + { + MESSAGE ("Dans UnLinkNextIteration pour " << NomIteration) ; + _mesIterFilles.erase( it ) ; + } } - //============================================================================= -/*! -*/ -//============================================================================= -void HOMARD_Iteration::SetTimeStepRank( int TimeStep, int Rank ) +void HOMARD_Iteration::UnLinkNextIterations() { - _TimeStep = TimeStep; - _Rank = Rank; + _mesIterFilles.clear(); } //============================================================================= -int HOMARD_Iteration::GetTimeStep() const +const std::list& HOMARD_Iteration::GetIterations() const { - return _TimeStep; + return _mesIterFilles; } //============================================================================= -int HOMARD_Iteration::GetRank() const +void HOMARD_Iteration::SetIterParentName( const char* IterParent ) { - return _Rank; + _IterParent = IterParent; } - -//============================================================================= -/*! -*/ //============================================================================= -void HOMARD_Iteration::SetCaseName( const char* NomCas ) +std::string HOMARD_Iteration::GetIterParentName() const { - _NomCas = std::string( NomCas ); + return _IterParent; } - //============================================================================= -/*! -*/ //============================================================================= -std::string HOMARD_Iteration::GetCaseName() const -{ - return _NomCas; -} +// Liens avec les autres structures //============================================================================= -/*! -*/ //============================================================================= -void HOMARD_Iteration::SetDirName( const char* NomDir ) +void HOMARD_Iteration::SetCaseName( const char* NomCas ) { - _NomDir = std::string( NomDir ); + _NomCas = std::string( NomCas ); } //============================================================================= -/*! -*/ -//============================================================================= -std::string HOMARD_Iteration::GetDirName() const +std::string HOMARD_Iteration::GetCaseName() const { - return _NomDir; + return _NomCas; } -/*! -*/ //============================================================================= -void HOMARD_Iteration::SetMessFile( const char* MessFile ) +void HOMARD_Iteration::SetHypoName( const char* NomHypo ) { - _MessFile = std::string( MessFile ); + _NomHypo = std::string( NomHypo ); } - -//============================================================================= -/*! -*/ //============================================================================= -std::string HOMARD_Iteration::GetMessFile() const +std::string HOMARD_Iteration::GetHypoName() const { - return _MessFile; + return _NomHypo; } diff --git a/src/HOMARD/HOMARD_Iteration.hxx b/src/HOMARD/HOMARD_Iteration.hxx index a8521263..78d1b270 100644 --- a/src/HOMARD/HOMARD_Iteration.hxx +++ b/src/HOMARD/HOMARD_Iteration.hxx @@ -21,6 +21,15 @@ // File : HOMARD_Iteration.hxx // Author : Paul RASCLE, EDF // Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier #ifndef _HOMARD_ITER_HXX_ #define _HOMARD_ITER_HXX_ @@ -34,46 +43,52 @@ public: HOMARD_Iteration(); ~HOMARD_Iteration(); +// Generalites void SetName( const char* Name ); std::string GetName() const; + std::string GetDumpPython() const; - void SetEtat( bool etat ); - bool GetEtat() const; +// Caracteristiques + void SetDirName( const char* NomDir ); + std::string GetDirName() const; void SetNumber( int NumIter ); int GetNumber() const; - void SetMeshFile( const char* MeshFile ); - std::string GetMeshFile() const; + void SetEtat( bool etat ); + bool GetEtat() const; void SetMeshName( const char* NomMesh ); std::string GetMeshName() const; + void SetMeshFile( const char* MeshFile ); + std::string GetMeshFile() const; + void SetFieldFile( const char* FieldFile ); std::string GetFieldFile() const; void SetTimeStepRank( int TimeStep, int Rank ); int GetTimeStep() const; int GetRank() const; - void SetIterParentName( const char* iterParent ); - std::string GetIterParentName() const; + void SetMessFile( const char* MessFile ); + std::string GetMessFile() const; - void AddIteration( const char* iter ); +// Liens avec les autres iterations + void LinkNextIteration( const char* NomIteration ); + void UnLinkNextIteration( const char* NomIteration ); + void UnLinkNextIterations(); const std::list& GetIterations() const; - void SupprIterations(); - void SetHypoName( const char* NomHypo ); - std::string GetHypoName() const; + void SetIterParentName( const char* iterParent ); + std::string GetIterParentName() const; +// Liens avec les autres structures void SetCaseName( const char* NomCas ); std::string GetCaseName() const; - void SetDirName( const char* NomDir ); - std::string GetDirName() const; - - void SetMessFile( const char* MessFile ); - std::string GetMessFile() const; + void SetHypoName( const char* NomHypo ); + std::string GetHypoName() const; private: std::string _Name; diff --git a/src/HOMARD/HOMARD_Zone.cxx b/src/HOMARD/HOMARD_Zone.cxx index 6e8473be..742d594c 100644 --- a/src/HOMARD/HOMARD_Zone.cxx +++ b/src/HOMARD/HOMARD_Zone.cxx @@ -21,6 +21,15 @@ // File : HOMARD_Zone.cxx // Author : Paul RASCLE, EDF // Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier #include "HOMARD_Zone.hxx" #include "utilities.h" @@ -45,19 +54,20 @@ HOMARD_Zone::~HOMARD_Zone() { MESSAGE("~HOMARD_Zone") ; } - +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= //============================================================================= void HOMARD_Zone::SetName( const char* Name ) { - _Name = std::string( Name ) ; + _Name = std::string( Name ); } - //============================================================================= std::string HOMARD_Zone::GetName() const { return _Name; } - //============================================================================= std::string HOMARD_Zone::GetDumpPython() const { @@ -137,24 +147,20 @@ std::string HOMARD_Zone::GetDumpPython() const return aScript.str() ; } - +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= //============================================================================= void HOMARD_Zone::SetType( int Type ) { _Type = Type; } - //============================================================================= int HOMARD_Zone::GetType() const { return _Type; } - -//====================================================================== -void HOMARD_Zone::SetLimit( double X0, double X1, double X2 ) -{ - _Xincr = X0; _Yincr = X1; _Zincr = X2; -} //======================================================================================= void HOMARD_Zone::SetBox( double X0, double X1, double X2, double X3, double X4, double X5 ) { @@ -162,16 +168,6 @@ void HOMARD_Zone::SetBox( double X0, double X1, double X2, double X3, double X4, _Ymin = X2; _Ymax = X3; _Zmin = X4; _Zmax = X5; } - -//====================================================================== -void HOMARD_Zone::SetSphere( double X0, double X1, double X2, double X3 ) -{ - _Xcentre = X0; - _Ycentre = X1; - _Zcentre = X2; - _Rayon = X3; -} - //======================================================================================= void HOMARD_Zone::SetCylinder( double X0, double X1, double X2, double X3, double X4, double X5, double X6, double X7 ) @@ -199,17 +195,14 @@ void HOMARD_Zone::SetPipe( double X0, double X1, double X2, _Haut = X7; _Rayonint = X8; } - -//======================================================================================= -std::vector HOMARD_Zone::GetLimit() const +//====================================================================== +void HOMARD_Zone::SetSphere( double X0, double X1, double X2, double X3 ) { - std::vector mesLimit; - mesLimit.push_back( _Xincr ) ; - mesLimit.push_back( _Yincr ) ; - mesLimit.push_back( _Zincr ) ; - return mesLimit; + _Xcentre = X0; + _Ycentre = X1; + _Zcentre = X2; + _Rayon = X3; } - //======================================================================================= std::vector HOMARD_Zone::GetCoords() const { @@ -286,13 +279,34 @@ std::vector HOMARD_Zone::GetCoords() const } return mesCoor; } - +//====================================================================== +void HOMARD_Zone::SetLimit( double X0, double X1, double X2 ) +{ + _Xincr = X0; _Yincr = X1; _Zincr = X2; +} +//======================================================================================= +std::vector HOMARD_Zone::GetLimit() const +{ + std::vector mesLimit; + mesLimit.push_back( _Xincr ) ; + mesLimit.push_back( _Yincr ) ; + mesLimit.push_back( _Zincr ) ; + return mesLimit; +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= //============================================================================= void HOMARD_Zone::AddHypo( const char* NomHypo ) { _ListHypo.push_back( std::string( NomHypo ) ) ; } - +//============================================================================= +const std::list& HOMARD_Zone::GetHypo() const +{ + return _ListHypo; +} //============================================================================= void HOMARD_Zone::SupprHypo( const char* NomHypo ) { @@ -303,13 +317,6 @@ void HOMARD_Zone::SupprHypo( const char* NomHypo ) _ListHypo.erase( it ) ; } } - -//============================================================================= -const std::list& HOMARD_Zone::GetHypo() const -{ - return _ListHypo; -} - //============================================================================= void HOMARD_Zone::SupprHypos() { diff --git a/src/HOMARD/HOMARD_Zone.hxx b/src/HOMARD/HOMARD_Zone.hxx index d38492c9..68c0f2ca 100644 --- a/src/HOMARD/HOMARD_Zone.hxx +++ b/src/HOMARD/HOMARD_Zone.hxx @@ -21,6 +21,15 @@ // File : HOMARD_Zone.hxx // Author : Paul RASCLE, EDF // Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier #ifndef _HOMARD_Zone_HXX_ #define _HOMARD_Zone_HXX_ @@ -35,30 +44,36 @@ public: HOMARD_Zone(); ~HOMARD_Zone(); +// Generalites void SetName( const char* Name ); std::string GetName() const; + std::string GetDumpPython() const; +// Caracteristiques + void SetType( int Type ); + int GetType() const; + void SetBox( double X0, double X1, double X2, double X3, double X4, double X5 ); - std::vector GetCoords() const; - - void SetSphere( double X0, double X1, double X2, double X3 ); void SetCylinder( double X0, double X1, double X2, double X3, double X4, double X5, double X6, double X7 ); + void SetPipe( double X0, double X1, double X2, double X3, double X4, double X5, double X6, double X7, double X8 ); + void SetSphere( double X0, double X1, double X2, double X3 ); + + std::vector GetCoords() const; + void SetLimit( double X0, double X1, double X2 ); std::vector GetLimit() const; - void SetType( int Type ); - int GetType() const; - +// Liens avec les autres structures void AddHypo( const char* NomHypo ); - void SupprHypo( const char* NomHypo ); const std::list& GetHypo() const; + void SupprHypo( const char* NomHypo ); void SupprHypos(); private: diff --git a/src/HOMARD/HomardDriver.cxx b/src/HOMARD/HomardDriver.cxx index 55d14f94..76396541 100644 --- a/src/HOMARD/HomardDriver.cxx +++ b/src/HOMARD/HomardDriver.cxx @@ -535,6 +535,8 @@ void HomardDriver::TexteField( const std::string FieldName, const std::string Fi { saux = "HRe" ; } if ( TypeThR == 3 ) { saux = "HPE" ; } + if ( TypeThR == 4 ) + { saux = "HMS" ; } if ( saux != " " ) { std::stringstream saux1 ; @@ -550,6 +552,8 @@ void HomardDriver::TexteField( const std::string FieldName, const std::string Fi { saux = "BRe" ; } if ( TypeThC == 3 ) { saux = "BPE" ; } + if ( TypeThC == 4 ) + { saux = "BMS" ; } if ( saux != " " ) { std::stringstream saux1 ; diff --git a/src/HOMARDGUI/CreateHypothesis.h b/src/HOMARDGUI/CreateHypothesis.h index 6c28306b..b3daf396 100644 --- a/src/HOMARDGUI/CreateHypothesis.h +++ b/src/HOMARDGUI/CreateHypothesis.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'CreateHypothesis.ui' ** -** Created: Wed Nov 14 11:07:43 2012 +** Created: Mon Jan 14 14:54:59 2013 ** by: Qt User Interface Compiler version 4.6.3 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! @@ -75,6 +75,8 @@ public: QDoubleSpinBox *SpinBox_RRel; QRadioButton *RBRAbs; QDoubleSpinBox *SpinBox_RAbs; + QRadioButton *RBRMuSigma; + QDoubleSpinBox *SpinBox_RMuSigma; QRadioButton *RBRNo; QGroupBox *GBCoarseningThresholds; QGridLayout *gridLayout4; @@ -84,6 +86,8 @@ public: QDoubleSpinBox *SpinBox_CRel; QRadioButton *RBCAbs; QDoubleSpinBox *SpinBox_CAbs; + QRadioButton *RBCMuSigma; + QDoubleSpinBox *SpinBox_CMuSigma; QRadioButton *RBCNo; QGroupBox *GBAreaManagement; QGridLayout *gridLayout_4; @@ -395,10 +399,25 @@ public: gridLayout3->addWidget(SpinBox_RAbs, 2, 1, 1, 1); + RBRMuSigma = new QRadioButton(GBRefinementThresholds); + RBRMuSigma->setObjectName(QString::fromUtf8("RBRMuSigma")); + + gridLayout3->addWidget(RBRMuSigma, 3, 0, 1, 1); + + SpinBox_RMuSigma = new QDoubleSpinBox(GBRefinementThresholds); + SpinBox_RMuSigma->setObjectName(QString::fromUtf8("SpinBox_RMuSigma")); + SpinBox_RMuSigma->setEnabled(false); + SpinBox_RMuSigma->setDecimals(8); + SpinBox_RMuSigma->setMinimum(0); + SpinBox_RMuSigma->setMaximum(1e+12); + SpinBox_RMuSigma->setSingleStep(0.1); + + gridLayout3->addWidget(SpinBox_RMuSigma, 3, 1, 1, 1); + RBRNo = new QRadioButton(GBRefinementThresholds); RBRNo->setObjectName(QString::fromUtf8("RBRNo")); - gridLayout3->addWidget(RBRNo, 3, 0, 1, 1); + gridLayout3->addWidget(RBRNo, 4, 0, 1, 1); hboxLayout4->addWidget(GBRefinementThresholds); @@ -458,11 +477,26 @@ public: gridLayout4->addWidget(SpinBox_CAbs, 2, 1, 1, 1); + RBCMuSigma = new QRadioButton(GBCoarseningThresholds); + RBCMuSigma->setObjectName(QString::fromUtf8("RBCMuSigma")); + + gridLayout4->addWidget(RBCMuSigma, 3, 0, 1, 1); + + SpinBox_CMuSigma = new QDoubleSpinBox(GBCoarseningThresholds); + SpinBox_CMuSigma->setObjectName(QString::fromUtf8("SpinBox_CMuSigma")); + SpinBox_CMuSigma->setEnabled(false); + SpinBox_CMuSigma->setDecimals(8); + SpinBox_CMuSigma->setMinimum(0); + SpinBox_CMuSigma->setMaximum(1e+12); + SpinBox_CMuSigma->setSingleStep(0.1); + + gridLayout4->addWidget(SpinBox_CMuSigma, 3, 1, 1, 1); + RBCNo = new QRadioButton(GBCoarseningThresholds); RBCNo->setObjectName(QString::fromUtf8("RBCNo")); RBCNo->setChecked(true); - gridLayout4->addWidget(RBCNo, 3, 0, 1, 1); + gridLayout4->addWidget(RBCNo, 4, 0, 1, 1); hboxLayout4->addWidget(GBCoarseningThresholds); @@ -748,6 +782,7 @@ public: RBRRel->setText(QApplication::translate("CreateHypothesis", "Relative", 0, QApplication::UnicodeUTF8)); SpinBox_RRel->setSuffix(QApplication::translate("CreateHypothesis", " %", 0, QApplication::UnicodeUTF8)); RBRAbs->setText(QApplication::translate("CreateHypothesis", "Absolute", 0, QApplication::UnicodeUTF8)); + RBRMuSigma->setText(QApplication::translate("CreateHypothesis", "Mean + n*(std deviation)", 0, QApplication::UnicodeUTF8)); RBRNo->setText(QApplication::translate("CreateHypothesis", "No refinement", 0, QApplication::UnicodeUTF8)); GBCoarseningThresholds->setTitle(QApplication::translate("CreateHypothesis", "Coarsening threshold", 0, QApplication::UnicodeUTF8)); RBCPE->setText(QApplication::translate("CreateHypothesis", "Percentage of meshes", 0, QApplication::UnicodeUTF8)); @@ -755,6 +790,7 @@ public: RBCRel->setText(QApplication::translate("CreateHypothesis", "Relative", 0, QApplication::UnicodeUTF8)); SpinBox_CRel->setSuffix(QApplication::translate("CreateHypothesis", " %", 0, QApplication::UnicodeUTF8)); RBCAbs->setText(QApplication::translate("CreateHypothesis", "Absolute", 0, QApplication::UnicodeUTF8)); + RBCMuSigma->setText(QApplication::translate("CreateHypothesis", "Mean - n*(std deviation)", 0, QApplication::UnicodeUTF8)); RBCNo->setText(QApplication::translate("CreateHypothesis", "No coarsening", 0, QApplication::UnicodeUTF8)); GBAreaManagement->setTitle(QApplication::translate("CreateHypothesis", "Zone management", 0, QApplication::UnicodeUTF8)); QTableWidgetItem *___qtablewidgetitem2 = TWZone->horizontalHeaderItem(0); diff --git a/src/HOMARDGUI/CreateHypothesis.ui b/src/HOMARDGUI/CreateHypothesis.ui index 2c4d96b6..177c5074 100644 --- a/src/HOMARDGUI/CreateHypothesis.ui +++ b/src/HOMARDGUI/CreateHypothesis.ui @@ -420,6 +420,32 @@ + + + Mean + n*(std deviation) + + + + + + + false + + + 8 + + + 0.000000000000000 + + + 1000000000000.000000000000000 + + + 0.100000000000000 + + + + No refinement @@ -526,6 +552,32 @@ + + + Mean - n*(std deviation) + + + + + + + false + + + 8 + + + 0.000000000000000 + + + 1000000000000.000000000000000 + + + 0.100000000000000 + + + + No coarsening diff --git a/src/HOMARDGUI/HOMARDGUI.cxx b/src/HOMARDGUI/HOMARDGUI.cxx index aa243a99..9b8d9b11 100644 --- a/src/HOMARDGUI/HOMARDGUI.cxx +++ b/src/HOMARDGUI/HOMARDGUI.cxx @@ -126,7 +126,7 @@ void HOMARDGUI::initialize( CAM_Application* app ) //================================================ void HOMARDGUI::createHOMARDAction( const int id, const QString& po_id, const QString& icon_id, const int key, const bool toggle ) { -// MESSAGE("HOMARDGUI::createHOMARDAction"); +// MESSAGE("createHOMARDAction"); QIcon icon; QWidget* parent = application()->desktop(); SUIT_ResourceMgr* resMgr = application()->resourceMgr(); @@ -155,12 +155,11 @@ void HOMARDGUI::createActions(){ createHOMARDAction( 1101, "NEW_CASE", "cas_calcule.png" ); createHOMARDAction( 1102, "NEW_ITERATION", "iter_next.png" ); createHOMARDAction( 1111, "COMPUTE", "mesh_compute.png" ); - createHOMARDAction( 1120, "EDIT_CASE", "whatis.png" ); - createHOMARDAction( 1121, "EDIT_ITERATION", "whatis.png" ); - createHOMARDAction( 1122, "EDIT_HYPO", "whatis.png" ); - createHOMARDAction( 1123, "EDIT_ZONE", "whatis.png" ); - createHOMARDAction( 1124, "EDIT_BOUNDARY", "whatis.png" ); - createHOMARDAction( 1130, "EDIT_MESS_FILE", "texte.png" ); +// + createHOMARDAction( 1201, "EDIT", "whatis.png" ); + createHOMARDAction( 1211, "DELETE", "delete.png" ); +// + createHOMARDAction( 1301, "EDIT_MESS_FILE", "texte.png" ); // } @@ -182,26 +181,30 @@ void HOMARDGUI::createPreferences(){ // Verifier l'avant dernier nombre passe en parametre //================================================ void HOMARDGUI::createMenus(){ - MESSAGE("HOMARDGUI::createMenus") - int HOMARD_Id = createMenu( tr( "HOMARD" ), -1, 5, 10 ); + MESSAGE("createMenus") +// + int HOMARD_Id = createMenu( tr( "HOM_MEN_HOMARD" ), -1, 5, 10 ); createMenu( 1101, HOMARD_Id, -1 ); //Create_Case createMenu( 1102, HOMARD_Id, -1 ); //Create_Iteration createMenu( 1111, HOMARD_Id, -1 ); //COMPUTE +// + HOMARD_Id = createMenu( tr( "HOM_MEN_MODIFICATION" ), -1, 5, 10 ); + createMenu( 1201, HOMARD_Id, -1 ); //Edit + createMenu( 1211, HOMARD_Id, -1 ); //Delete +// + HOMARD_Id = createMenu( tr( "HOM_MEN_INFORMATION" ), -1, 5, 10 ); + createMenu( 1301, HOMARD_Id, -1 ); //EditAsciiFile pour le fichier listeStd ou bilan createMenu( separator(), HOMARD_Id,-1); - createMenu( 1120, HOMARD_Id, -1 ); //Edit_Case - createMenu( 1121, HOMARD_Id, -1 ); //Edit_Iteration - createMenu( 1122, HOMARD_Id, -1 ); //Edit Hypo - createMenu( 1123, HOMARD_Id, -1 ); //Edit_Zone - createMenu( 1124, HOMARD_Id, -1 ); //Edit_Boundary + createMenu( 1201, HOMARD_Id, -1 ); //Edit createMenu( separator(), HOMARD_Id,-1); - createMenu( 1130, HOMARD_Id, -1 ); //EditAsciiFile pour le fichier listeStd ou bilan +// createMenu( 1201, HOMARD_Id, -1 ); //Edit } //================================================ void HOMARDGUI::OnGUIEvent() //================================================ { - MESSAGE("HOMARDGUI::OnGUIEvent()") + MESSAGE("OnGUIEvent()") setOrb(); const QObject* obj = sender(); if ( !obj || !obj->inherits( "QAction" ) ) @@ -210,7 +213,7 @@ void HOMARDGUI::OnGUIEvent() bool ret; if ( id != -1 ) ret = OnGUIEvent( id ); - MESSAGE("************** End of HOMARDGUI::OnGUIEvent()"); + MESSAGE("************** End of OnGUIEvent()"); } //======================================================================= @@ -218,7 +221,7 @@ void HOMARDGUI::OnGUIEvent() //======================================================================= bool HOMARDGUI::OnGUIEvent (int theCommandID) { - MESSAGE("HOMARDGUI::OnGUIEvent(int)"); + MESSAGE("OnGUIEvent(int)"); SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() ); if ( !app ) return false; @@ -286,72 +289,134 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID) break; } - case 1120: // Edition d un cas + case 1201: // Edition d'un objet { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + MESSAGE("command " << theCommandID << " activated"); + QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); + if (nomObjet == QString("")) break; _PTR(SObject) obj = chercheMonObjet(); - if ((obj) and (HOMARD_UTILS::isCase(obj))) + if (obj) { + // Edition d'un cas + if (HOMARD_UTILS::isCase(obj)) + { MonEditCase *aDlg = new MonEditCase(parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; aDlg->show(); - } - } - - case 1121: // Edition d une iteration - { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - _PTR(SObject) obj = chercheMonObjet(); - if ((obj) and (HOMARD_UTILS::isIter(obj))) - { + } + // Edition d'une iteration + else if (HOMARD_UTILS::isIter(obj)) + { MonEditIteration *aDlg = new MonEditIteration(parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; aDlg->show(); - } - } - - case 1122: // Edition d une hypothese - { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - _PTR(SObject) obj = chercheMonObjet(); - if ((obj) and (HOMARD_UTILS::isHypo(obj))) - { + } + // Edition d'une hypothese + else if (HOMARD_UTILS::isHypo(obj)) + { MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName, QString(""), QString("")) ; aDlg->show(); - } - } - - case 1123: // Edition d une zone - { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - _PTR(SObject) obj = chercheMonObjet(); - if ((obj) and (HOMARD_UTILS::isZone(obj))) - { + } + // Edition d'une zone + else if (HOMARD_UTILS::isZone(obj)) + { MonEditZone *aDlg = new MonEditZone(0, TRUE, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; aDlg->show(); + } + // Edition d'une frontiere discrete + else if (HOMARD_UTILS::isBoundaryDi(obj)) + { + MESSAGE(".. Lancement de MonEditBoundaryDi" ); + MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, TRUE, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + aDlg->show(); + } + // Edition d'une frontiere analytique + else if (HOMARD_UTILS::isBoundaryAn(obj)) + { + MESSAGE(".. Lancement de MonEditBoundaryAn" ); + MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, TRUE, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + aDlg->show(); + } } + break; } - case 1124: // Edition d une frontiere + case 1211: // Suppression d'un objet { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + MESSAGE("command " << theCommandID << " activated"); + QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); + if (nomObjet == QString("")) break; _PTR(SObject) obj = chercheMonObjet(); - if ((obj)) + if (obj) { - if (HOMARD_UTILS::isBoundaryDi(obj)) + // Suppression d'un cas + if (HOMARD_UTILS::isCase(obj)) + { + try + { homardGen->DeleteCase(_ObjectName.toStdString().c_str()); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QString(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + } + // Suppression d'une iteration + else if (HOMARD_UTILS::isIter(obj)) + { + try + { homardGen->DeleteIteration(_ObjectName.toStdString().c_str()); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QString(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + } + // Suppression d'une hypothese + else if (HOMARD_UTILS::isHypo(obj)) + { + try + { homardGen->DeleteHypo(_ObjectName.toStdString().c_str()); } + catch( SALOME::SALOME_Exception& S_ex ) { - MESSAGE(".. Lancement de MonEditBoundaryDi" ); - MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, TRUE, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; - aDlg->show(); + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QString(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; } - if (HOMARD_UTILS::isBoundaryAn(obj)) + } + // Suppression d'une zone + else if (HOMARD_UTILS::isZone(obj)) + { + try + { homardGen->DeleteZone(_ObjectName.toStdString().c_str()); } + catch( SALOME::SALOME_Exception& S_ex ) { - MESSAGE(".. Lancement de MonEditBoundaryAn" ); - MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, TRUE, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; - aDlg->show(); + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QString(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; } + } + // Suppression d'une frontiere + else if ( HOMARD_UTILS::isBoundaryDi(obj) or HOMARD_UTILS::isBoundaryAn(obj) ) + { + try + { homardGen->DeleteBoundary(_ObjectName.toStdString().c_str()); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QString(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + } } + break; } - case 1130: // Edition du fichier mess + case 1301: // Affichage du fichier mess { MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); _PTR(SObject) obj = chercheMonObjet(); @@ -360,7 +425,9 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID) MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; aDlg->show(); } + break; } + } getApp()->updateObjectBrowser(); return true; @@ -457,53 +524,69 @@ _PTR(SObject) HOMARDGUI::chercheMonObjet() void HOMARDGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& title ) //============================================================================= { - MESSAGE("Debut de HOMARDGUI::contextMenuPopup"); + MESSAGE("Debut de contextMenuPopup"); _PTR(SObject) obj = chercheMonObjet(); if ( obj ) { title = QString( obj->GetName().c_str() ); _ObjectName = title; SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); +// + QPixmap pix ; + bool DeleteObject = false ; + bool EditObject = false ; // if ( HOMARD_UTILS::isBoundaryAn(obj) ) { - QPixmap pix = resMgr->loadPixmap( "HOMARD", "whatis.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_BOUNDARY").toLatin1().data()), this,SLOT(EditBoDi())); + EditObject = true ; + DeleteObject = true ; } else if ( HOMARD_UTILS::isBoundaryDi(obj) ) { - QPixmap pix = resMgr->loadPixmap( "HOMARD", "whatis.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_BOUNDARY").toLatin1().data()), this,SLOT(EditBoDi())); + EditObject = true ; + DeleteObject = true ; } else if ( HOMARD_UTILS::isZone(obj) ) { - QPixmap pix = resMgr->loadPixmap( "HOMARD", "whatis.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_ZONE").toLatin1().data()), this,SLOT(EditZone())); + EditObject = true ; + DeleteObject = true ; } else if ( HOMARD_UTILS::isHypo(obj) ) { - QPixmap pix = resMgr->loadPixmap( "HOMARD", "whatis.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_HYPO").toLatin1().data()), this,SLOT(EditHypo())); + EditObject = true ; + DeleteObject = true ; } else if ( HOMARD_UTILS::isIter(obj) ) { - QPixmap pix = resMgr->loadPixmap( "HOMARD", "iter_next.png" ); + pix = resMgr->loadPixmap( "HOMARD", "iter_next.png" ); menu->addAction(QIcon(pix), tr(QString("HOM_MEN_NEW_ITERATION").toLatin1().data()), this,SLOT(NextIter())); - QPixmap pix1 = resMgr->loadPixmap( "HOMARD", "whatis.png" ); - menu->addAction(QIcon(pix1), tr(QString("HOM_MEN_EDIT_ITERATION").toLatin1().data()), this,SLOT(EditIter())); QPixmap pix2 = resMgr->loadPixmap( "HOMARD", "mesh_compute.png" ); menu->addAction(QIcon(pix2), tr(QString("HOM_MEN_COMPUTE").toLatin1().data()), this,SLOT(LanceCalcul())); + EditObject = true ; + DeleteObject = true ; } else if ( HOMARD_UTILS::isCase(obj) ) { - QPixmap pix = resMgr->loadPixmap( "HOMARD", "whatis.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_CASE").toLatin1().data()), this,SLOT(EditCase())); + EditObject = true ; + DeleteObject = true ; } else if ( HOMARD_UTILS::isFileMess(obj) or HOMARD_UTILS::isFileSummary(obj) ) { - QPixmap pix = resMgr->loadPixmap( "HOMARD", "texte.png" ); + pix = resMgr->loadPixmap( "HOMARD", "texte.png" ); menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_MESS_FILE").toLatin1().data()), this,SLOT(EditAsciiFile())); } +// Ajout d'un menu d'edition pour les objets qui le proposent + if ( EditObject ) + { + pix = resMgr->loadPixmap( "HOMARD", "whatis.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT").toLatin1().data()), this,SLOT(Edit())); + } +// Ajout d'un menu de destruction pour les objets qui le proposent + if ( DeleteObject ) + { + pix = resMgr->loadPixmap( "HOMARD", "delete.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_DELETE").toLatin1().data()), this,SLOT(Delete())); + } } } @@ -517,35 +600,21 @@ void HOMARDGUI::LanceCalcul() this->OnGUIEvent(1111); } -void HOMARDGUI::EditCase() +void HOMARDGUI::Edit() { - this->OnGUIEvent(1120); + this->OnGUIEvent(1201); } -void HOMARDGUI::EditIter() +void HOMARDGUI::Delete() { - this->OnGUIEvent(1121); -} - -void HOMARDGUI::EditHypo() -{ - this->OnGUIEvent(1122); -} - -void HOMARDGUI::EditZone() -{ - this->OnGUIEvent(1123); -} - -void HOMARDGUI::EditBoDi() -{ - this->OnGUIEvent(1124); + this->OnGUIEvent(1211); } void HOMARDGUI::EditAsciiFile() { - this->OnGUIEvent(1130); + this->OnGUIEvent(1301); } + // //============================================================================= // Export the module diff --git a/src/HOMARDGUI/HOMARDGUI.h b/src/HOMARDGUI/HOMARDGUI.h index 6db12449..610571f8 100644 --- a/src/HOMARDGUI/HOMARDGUI.h +++ b/src/HOMARDGUI/HOMARDGUI.h @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// HOMARDGUI : HOMARD component GUI implemetation +// HOMARDGUI : HOMARD component GUI implemetation // #ifndef _HOMARDGUI_H_ @@ -36,7 +36,7 @@ class SalomeApp_Application; -class HOMARDGUI: public SalomeApp_Module +class HOMARDGUI: public SalomeApp_Module { Q_OBJECT @@ -61,14 +61,11 @@ public slots: private slots: void OnGUIEvent(); - void EditBoDi(); - void EditZone(); - void EditHypo(); - void EditIter(); - void EditCase(); void EditAsciiFile(); void LanceCalcul(); void NextIter(); + void Edit(); + void Delete(); void XmGraceFichier(); public: diff --git a/src/HOMARDGUI/HOMARD_msg_en.ts b/src/HOMARDGUI/HOMARD_msg_en.ts index ab5b6538..d740bb40 100644 --- a/src/HOMARDGUI/HOMARD_msg_en.ts +++ b/src/HOMARDGUI/HOMARD_msg_en.ts @@ -7,6 +7,14 @@ HOM_MEN_HOMARD HOMARD + + HOM_MEN_MODIFICATION + Modification + + + HOM_MEN_INFORMATION + Information + HOM_MEN_NEW_CASE New case @@ -20,24 +28,12 @@ Compute - HOM_MEN_EDIT_CASE - Edit the case - - - HOM_MEN_EDIT_ITERATION - Edit the iteration + HOM_MEN_EDIT + Edit - HOM_MEN_EDIT_HYPO - Edit the hypothesis - - - HOM_MEN_EDIT_ZONE - Edit the zone - - - HOM_MEN_EDIT_BOUNDARY - Edit the boundary + HOM_MEN_DELETE + Delete HOM_MEN_EDIT_MESS_FILE @@ -60,24 +56,12 @@ Compute - HOM_TOP_EDIT_CASE - Edit the case - - - HOM_TOP_EDIT_ITERATION - Edit the iteration - - - HOM_TOP_EDIT_HYPO - Edit the hypothesis + HOM_TOP_EDIT + Edit - HOM_TOP_EDIT_ZONE - Edit the zone - - - HOM_TOP_EDIT_BOUNDARY - Edit the boundary + HOM_TOP_DELETE + Delete HOM_TOP_EDIT_MESS_FILE @@ -100,24 +84,12 @@ Compute - HOM_STB_EDIT_CASE - Edit the case - - - HOM_STB_EDIT_ITERATION - Edit the iteration - - - HOM_STB_EDIT_HYPO - Edit the hypothesis - - - HOM_STB_EDIT_ZONE - Edit the zone + HOM_STB_EDIT + Edit - HOM_STB_EDIT_BOUNDARY - Edit the boundary + HOM_STB_DELETE + Delete HOM_STB_EDIT_MESS_FILE diff --git a/src/HOMARDGUI/HOMARD_msg_fr.ts b/src/HOMARDGUI/HOMARD_msg_fr.ts index 6f791274..a4cb3ae1 100644 --- a/src/HOMARDGUI/HOMARD_msg_fr.ts +++ b/src/HOMARDGUI/HOMARD_msg_fr.ts @@ -7,6 +7,14 @@ HOM_MEN_HOMARD HOMARD + + HOM_MEN_MODIFICATION + Modification + + + HOM_MEN_INFORMATION + Information + HOM_MEN_NEW_CASE Nouveau cas @@ -20,24 +28,12 @@ Calculer - HOM_MEN_EDIT_CASE - Editer le cas - - - HOM_MEN_EDIT_ITERATION - Editer l'itération - - - HOM_MEN_EDIT_HYPO - Editer l'hypothèse - - - HOM_MEN_EDIT_ZONE - Editer la zone + HOM_MEN_EDIT + Editer - HOM_MEN_EDIT_BOUNDARY - Editer la frontière + HOM_MEN_DELETE + Supprimer HOM_MEN_EDIT_MESS_FILE @@ -60,24 +56,12 @@ Calculer - HOM_TOP_EDIT_CASE - Editer le cas - - - HOM_TOP_EDIT_ITERATION - Editer l'itération - - - HOM_TOP_EDIT_HYPO - Editer l'hypothèse - - - HOM_TOP_EDIT_ZONE - Editer la zone + HOM_TOP_EDIT + Editer - HOM_TOP_EDIT_BOUNDARY - Editer la frontière + HOM_TOP_DELETE + Supprimer HOM_TOP_EDIT_MESS_FILE @@ -100,24 +84,12 @@ Calculer - HOM_STB_EDIT_CASE - Editer le cas - - - HOM_STB_EDIT_ITERATION - Editer l'itération - - - HOM_STB_EDIT_HYPO - Editer l'hypothèse - - - HOM_STB_EDIT_ZONE - Editer la zone + HOM_STB_EDIT + Editer - HOM_STB_EDIT_BOUNDARY - Editer la frontière + HOM_STB_DELETE + Supprimer HOM_STB_EDIT_MESS_FILE @@ -523,10 +495,18 @@ Percentage of meshes Pourcentage de mailles + + Mean + n*(std deviation) + Moyenne + n*(ecart-type) + No refinement Sans raffinement + + Mean - n*(std deviation) + Moyenne - n*(ecart-type) + No coarsening Sans déraffinement diff --git a/src/HOMARDGUI/HomardQtCommun.cxx b/src/HOMARDGUI/HomardQtCommun.cxx index 1858afed..f0168645 100644 --- a/src/HOMARDGUI/HomardQtCommun.cxx +++ b/src/HOMARDGUI/HomardQtCommun.cxx @@ -41,21 +41,27 @@ extern "C" // ============================================================================ -QString HOMARD_QT_COMMUN::SelectionArbreEtude(QString commentaire, int grave ) +QString HOMARD_QT_COMMUN::SelectionArbreEtude(QString commentaire, int option ) // ============================================================================ -// Regarde si l'objet selectionne correspond a un objet de tyoe -// commentaire. si c'est le cas, retourne le nom de cet objet, -// sinon retourne une QString("") -// Si grave = 0, ce n'est pas grave de ne rien trouver et pas de message -// Si grave = 1, ce n'est pas grave de ne rien trouver mais on emet un message +// Retourne l'objet selectionne dans l'arbre d'etudes +// commentaire : +// . si le commentaire est une chaine vide, on ne tient pas compte du type de l'objet +// et on retourne le nom de cet objet +// . sinon : +// . si l'objet est du type defini par commentaitr, retourne le nom de cet objet +// . sinon on retourne une QString("") +// option : +// . Si option = 0, ce n'est pas grave de ne rien trouver ; aucun message n'est emis +// . Si option = 1, ce n'est pas grave de ne rien trouver mais on emet un message { + MESSAGE("SelectionArbreEtude : commentaire = " << commentaire.toStdString().c_str() << " et option = " << option); int nbSel = HOMARD_UTILS::IObjectCount() ; if ( nbSel == 0 ) { - if ( grave == 1 ) + if ( option == 1 ) { QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), - QObject::tr("HOM_SELECT_OBJECT_1") ); + QObject::tr("HOM_SELECT_OBJECT_1") ); } return QString(""); } @@ -74,14 +80,19 @@ QString HOMARD_QT_COMMUN::SelectionArbreEtude(QString commentaire, int grave ) _PTR(GenericAttribute) anAttr; if (aSO->FindAttribute(anAttr, "AttributeComment") ) { - _PTR(AttributeComment) attributComment = anAttr; - QString aComment= QString(attributComment->Value().data()); - int iteration = aComment.lastIndexOf(commentaire); - if ( iteration !=0 ) + if ( commentaire != "" ) { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_SELECT_OBJECT_3").arg(commentaire) ); - return QString(""); + _PTR(AttributeComment) attributComment = anAttr; + QString aComment= QString(attributComment->Value().data()); + MESSAGE("... aComment = " << aComment.toStdString().c_str()); + int iaux = aComment.lastIndexOf(commentaire); + MESSAGE("... iaux = " << iaux); + if ( iaux !=0 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_SELECT_OBJECT_3").arg(commentaire) ); + return QString(""); + } } if (aSO->FindAttribute(anAttr, "AttributeName") ) { @@ -139,7 +150,7 @@ QString HOMARD_QT_COMMUN::PushNomFichier(bool avertir) // 2) retourne le nom du fichier asocie a l objet // selectionne dans l arbre d etude { - MESSAGE("HOMARD_QT_COMMUN::PushNomFichier"); + MESSAGE("PushNomFichier"); QString aFile=QString::null; int nbSel = HOMARD_UTILS::IObjectCount() ; if ( nbSel == 0 ) @@ -276,7 +287,7 @@ std::list HOMARD_QT_COMMUN::GetListeChamps(QString aFile) { // Il faut voir si plusieurs maillages - MESSAGE("HOMARD_QT_COMMUN::GetListeChamps"); + MESSAGE("GetListeChamps"); std::list ListeChamp; char *comp, *unit; @@ -373,7 +384,7 @@ std::list HOMARD_QT_COMMUN::GetListeComposants(QString aFile, QString a MEDfileClose(medIdt); return ListeComposants; } - + if ( QString(nomcha) != aChamp ) { free(comp); free(unit); diff --git a/src/HOMARDGUI/MonCreateBoundaryAn.cxx b/src/HOMARDGUI/MonCreateBoundaryAn.cxx index fb3238f4..57fa3090 100644 --- a/src/HOMARDGUI/MonCreateBoundaryAn.cxx +++ b/src/HOMARDGUI/MonCreateBoundaryAn.cxx @@ -268,7 +268,7 @@ bool MonCreateBoundaryAn:: CreateOrUpdateBoundaryAn() break; } } - _parent->addBoundaryAn(_aName); + _parent->AddBoundaryAn(_aName); } // Mise en place des attributs aBoundaryAn->SetLimit(_Xincr, _Yincr, _Zincr); diff --git a/src/HOMARDGUI/MonCreateBoundaryDi.cxx b/src/HOMARDGUI/MonCreateBoundaryDi.cxx index d969f210..08d9799a 100644 --- a/src/HOMARDGUI/MonCreateBoundaryDi.cxx +++ b/src/HOMARDGUI/MonCreateBoundaryDi.cxx @@ -109,7 +109,7 @@ bool MonCreateBoundaryDi::PushOnApply() { _aBoundaryName=aBoundaryName; _aBoundary=_myHomardGen->CreateBoundaryDi(CORBA::string_dup(_aBoundaryName.toStdString().c_str()), aMeshName.toStdString().c_str(), aMeshFile.toStdString().c_str()); - _parent->addBoundaryDi(_aBoundaryName); + _parent->AddBoundaryDi(_aBoundaryName); _aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str()); } catch( SALOME::SALOME_Exception& S_ex ) diff --git a/src/HOMARDGUI/MonCreateCase.cxx b/src/HOMARDGUI/MonCreateCase.cxx index eb6f1504..1d9fafc5 100644 --- a/src/HOMARDGUI/MonCreateCase.cxx +++ b/src/HOMARDGUI/MonCreateCase.cxx @@ -124,7 +124,7 @@ void MonCreateCase::InitBoundarys() myBoundary = _myHomardGen->GetBoundary(mesBoundarys[i]); int type_obj = myBoundary->GetType() ; if ( type_obj==0 ) { CBBoundaryDi->addItem(QString(mesBoundarys[i])); } - else { addBoundaryAn(QString(mesBoundarys[i])); } + else { AddBoundaryAn(QString(mesBoundarys[i])); } } // Ajustement TWBoundary->resizeColumnsToContents(); @@ -395,7 +395,7 @@ void MonCreateCase::SetBoundaryD() adjustSize(); } // ------------------------------------------------------------------------ -void MonCreateCase::addBoundaryDi(QString newBoundary) +void MonCreateCase::AddBoundaryDi(QString newBoundary) // ------------------------------------------------------------------------ { CBBoundaryDi->insertItem(0,newBoundary); @@ -443,10 +443,10 @@ void MonCreateCase::SetBoundaryA() // MESSAGE("Fin de SetBoundaryA "); } // ------------------------------------------------------------------------ -void MonCreateCase::addBoundaryAn(QString newBoundary) +void MonCreateCase::AddBoundaryAn(QString newBoundary) // ------------------------------------------------------------------------ { - MESSAGE("Debut de addBoundaryAn "); + MESSAGE("Debut de AddBoundaryAn "); // Ajout d'une nouvelle colonne int nbcol = TWBoundary->columnCount(); // MESSAGE("nbcol " << nbcol); @@ -468,7 +468,7 @@ void MonCreateCase::addBoundaryAn(QString newBoundary) } TWBoundary->resizeColumnToContents(nbcol-1); // TWBoundary->resizeRowsToContents(); -// MESSAGE("Fin de addBoundaryAn "); +// MESSAGE("Fin de AddBoundaryAn "); } // ------------------------------------------------------------------------ void MonCreateCase::PushBoundaryAnNew() diff --git a/src/HOMARDGUI/MonCreateCase.h b/src/HOMARDGUI/MonCreateCase.h index 34c66065..a1bd4189 100644 --- a/src/HOMARDGUI/MonCreateCase.h +++ b/src/HOMARDGUI/MonCreateCase.h @@ -38,8 +38,8 @@ public: MonCreateCase( QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen); ~MonCreateCase(); - void addBoundaryAn(QString newBoundary); - void addBoundaryDi(QString newBoundary); + void AddBoundaryAn(QString newBoundary); + void AddBoundaryDi(QString newBoundary); protected : QString _aCaseName; diff --git a/src/HOMARDGUI/MonCreateHypothesis.cxx b/src/HOMARDGUI/MonCreateHypothesis.cxx index ec15ee04..6f0dc14b 100644 --- a/src/HOMARDGUI/MonCreateHypothesis.cxx +++ b/src/HOMARDGUI/MonCreateHypothesis.cxx @@ -94,10 +94,12 @@ void MonCreateHypothesis::InitConnect() connect( CBFieldName, SIGNAL(activated(int)), this, SLOT( SetFieldName())); connect( RBRPE, SIGNAL(clicked()), this, SLOT(SetRPE())); connect( RBRRel, SIGNAL(clicked()), this, SLOT(SetRRel())); + connect( RBRMuSigma, SIGNAL(clicked()), this, SLOT(SetRMS())); connect( RBRAbs, SIGNAL(clicked()), this, SLOT(SetRAbs())); connect( RBRNo, SIGNAL(clicked()), this, SLOT(SetRNo())); connect( RBCPE, SIGNAL(clicked()), this, SLOT(SetCPE())); connect( RBCRel, SIGNAL(clicked()), this, SLOT(SetCRel())); + connect( RBCMuSigma, SIGNAL(clicked()), this, SLOT(SetCMS())); connect( RBCAbs, SIGNAL(clicked()), this, SLOT(SetCAbs())); connect( RBCNo, SIGNAL(clicked()), this, SLOT(SetCNo())); connect( RBL2, SIGNAL(clicked()), this, SLOT(SetUCL2())); @@ -541,6 +543,7 @@ void MonCreateHypothesis::SetRPE() SpinBox_RPE->setEnabled(true); SpinBox_RRel->setEnabled(false); SpinBox_RAbs->setEnabled(false); + SpinBox_RMuSigma->setEnabled(false); } // ------------------------------------------------------------------------ void MonCreateHypothesis::SetRRel() @@ -552,6 +555,7 @@ void MonCreateHypothesis::SetRRel() SpinBox_RPE->setEnabled(false); SpinBox_RRel->setEnabled(true); SpinBox_RAbs->setEnabled(false); + SpinBox_RMuSigma->setEnabled(false); } // ------------------------------------------------------------------------ void MonCreateHypothesis::SetRAbs() @@ -563,6 +567,19 @@ void MonCreateHypothesis::SetRAbs() SpinBox_RPE->setEnabled(false); SpinBox_RRel->setEnabled(false); SpinBox_RAbs->setEnabled(true); + SpinBox_RMuSigma->setEnabled(false); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetRMS() +// ------------------------------------------------------------------------ +{ + _aTypeRaff = 1 ; + _TypeThR = 4 ; + RBRMuSigma->setChecked(true); + SpinBox_RPE->setEnabled(false); + SpinBox_RRel->setEnabled(false); + SpinBox_RAbs->setEnabled(false); + SpinBox_RMuSigma->setEnabled(true); } // ------------------------------------------------------------------------ void MonCreateHypothesis::SetRNo() @@ -574,6 +591,7 @@ void MonCreateHypothesis::SetRNo() SpinBox_RPE->setEnabled(false); SpinBox_RRel->setEnabled(false); SpinBox_RAbs->setEnabled(false); + SpinBox_RMuSigma->setEnabled(false); } // ------------------------------------------------------------------------ void MonCreateHypothesis::SetCPE() @@ -585,6 +603,7 @@ void MonCreateHypothesis::SetCPE() SpinBox_CPE->setEnabled(true); SpinBox_CRel->setEnabled(false); SpinBox_CAbs->setEnabled(false); + SpinBox_CMuSigma->setEnabled(false); } // ------------------------------------------------------------------------ void MonCreateHypothesis::SetCRel() @@ -596,6 +615,7 @@ void MonCreateHypothesis::SetCRel() SpinBox_CPE->setEnabled(false); SpinBox_CRel->setEnabled(true); SpinBox_CAbs->setEnabled(false); + SpinBox_CMuSigma->setEnabled(false); } // ------------------------------------------------------------------------ void MonCreateHypothesis::SetCAbs() @@ -607,6 +627,19 @@ void MonCreateHypothesis::SetCAbs() SpinBox_CPE->setEnabled(false); SpinBox_CRel->setEnabled(false); SpinBox_CAbs->setEnabled(true); + SpinBox_CMuSigma->setEnabled(false); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetCMS() +// ------------------------------------------------------------------------ +{ + _aTypeDera = 1 ; + _TypeThC = 4 ; + RBCMuSigma->setChecked(true); + SpinBox_CPE->setEnabled(false); + SpinBox_CRel->setEnabled(false); + SpinBox_CAbs->setEnabled(false); + SpinBox_CMuSigma->setEnabled(true); } // ------------------------------------------------------------------------ void MonCreateHypothesis::SetCNo() @@ -618,6 +651,7 @@ void MonCreateHypothesis::SetCNo() SpinBox_CPE->setEnabled(false); SpinBox_CRel->setEnabled(false); SpinBox_CAbs->setEnabled(false); + SpinBox_CMuSigma->setEnabled(false); } // ------------------------------------------------------------------------ void MonCreateHypothesis::SetUCL2() @@ -717,11 +751,13 @@ void MonCreateHypothesis::AssocieComposants() if ( _TypeThR == 1 ) { _ThreshR = SpinBox_RAbs->value();} if ( _TypeThR == 2 ) { _ThreshR = SpinBox_RRel->value();} if ( _TypeThR == 3 ) { _ThreshR = SpinBox_RPE->value(); } + if ( _TypeThR == 4 ) { _ThreshR = SpinBox_RMuSigma->value(); } _ThreshC = 0; if ( _TypeThC == 1 ) { _ThreshC = SpinBox_CAbs->value();} if ( _TypeThC == 2 ) { _ThreshC = SpinBox_CRel->value();} if ( _TypeThC == 3 ) { _ThreshC = SpinBox_CPE->value(); } + if ( _TypeThC == 4 ) { _ThreshC = SpinBox_CMuSigma->value(); } _aFieldName=CBFieldName->currentText(); _aHypothesis->SetField(CORBA::string_dup(_aFieldName.toStdString().c_str()) ) ; diff --git a/src/HOMARDGUI/MonCreateHypothesis.h b/src/HOMARDGUI/MonCreateHypothesis.h index 0680a69c..5adbc021 100644 --- a/src/HOMARDGUI/MonCreateHypothesis.h +++ b/src/HOMARDGUI/MonCreateHypothesis.h @@ -106,10 +106,12 @@ public slots: virtual void SetRPE(); virtual void SetRAbs(); virtual void SetRRel(); + virtual void SetRMS(); virtual void SetRNo(); virtual void SetCPE(); virtual void SetCAbs(); virtual void SetCRel(); + virtual void SetCMS(); virtual void SetCNo(); virtual void SetUCL2(); virtual void SetUCInf(); diff --git a/src/HOMARDGUI/MonEditCase.cxx b/src/HOMARDGUI/MonEditCase.cxx index dddba45d..93161c54 100644 --- a/src/HOMARDGUI/MonEditCase.cxx +++ b/src/HOMARDGUI/MonEditCase.cxx @@ -150,7 +150,7 @@ void MonEditCase::InitValEdit() { ListeFron.append(NomFron); ok = ListeFron.size() ; - addBoundaryAn(NomFron); + AddBoundaryAn(NomFron); } // on coche la case correspondant au couple (frontiere,groupe) en cours d'examen TWBoundary->item( 0, ok )->setCheckState( Qt::Checked ); diff --git a/src/HOMARDGUI/MonEditHypothesis.cxx b/src/HOMARDGUI/MonEditHypothesis.cxx index 0192379f..fe0c1fa2 100644 --- a/src/HOMARDGUI/MonEditHypothesis.cxx +++ b/src/HOMARDGUI/MonEditHypothesis.cxx @@ -285,6 +285,7 @@ void MonEditHypothesis::InitAdaptChamps() RBRAbs->setEnabled(false) ; RBRRel->setEnabled(false) ; RBRPE->setEnabled(false) ; + RBRMuSigma->setEnabled(false) ; RBRNo->setEnabled(false) ; if (_aTypeRaff== 0 ) { @@ -296,12 +297,14 @@ void MonEditHypothesis::InitAdaptChamps() if ( _TypeThR == 1 ) { SpinBox_RAbs->setValue(_ThreshR); SetRAbs(); RBRAbs->setEnabled(true);} if ( _TypeThR == 2 ) { SpinBox_RRel->setValue(_ThreshR); SetRRel(); RBRRel->setEnabled(true);} if ( _TypeThR == 3 ) { SpinBox_RPE->setValue(_ThreshR); SetRPE(); RBRPE->setEnabled(true);} + if ( _TypeThR == 4 ) { SpinBox_RMuSigma->setValue(_ThreshR); SetRMS(); RBRMuSigma->setEnabled(true);} } // Les seuils de deraffinement RBCAbs->setEnabled(false) ; RBCRel->setEnabled(false) ; RBCPE->setEnabled(false) ; + RBCMuSigma->setEnabled(false) ; RBCNo->setEnabled(false) ; if (_aTypeDera== 0 ) { @@ -313,6 +316,7 @@ void MonEditHypothesis::InitAdaptChamps() if ( _TypeThC == 1 ) { SpinBox_CAbs->setValue(_ThreshC); SetCAbs(); RBCAbs->setEnabled(true);} if ( _TypeThC == 2 ) { SpinBox_CRel->setValue(_ThreshC); SetCRel(); RBCRel->setEnabled(true);} if ( _TypeThC == 3 ) { SpinBox_CPE->setValue(_ThreshC); SetCPE(); RBCPE->setEnabled(true);} + if ( _TypeThC == 4 ) { SpinBox_CMuSigma->setValue(_ThreshC); SetCMS(); RBCMuSigma->setEnabled(true);} } // Le choix de la prise en compte des composantes if ( TWCMP->rowCount() == 1 ) @@ -405,6 +409,7 @@ bool MonEditHypothesis::PushOnApply() if (_TypeThR == 1) { _ThreshR = SpinBox_RAbs->value(); } if (_TypeThR == 2) { _ThreshR = SpinBox_RRel->value(); } if (_TypeThR == 3) { _ThreshR = SpinBox_RPE->value(); } + if (_TypeThR == 4) { _ThreshR = SpinBox_RMuSigma->value(); } _aHypothesis->SetRefinThr(_TypeThR, _ThreshR) ; } if (_aTypeDera!= 0 ) @@ -412,6 +417,7 @@ bool MonEditHypothesis::PushOnApply() if (_TypeThC == 1) { _ThreshC = SpinBox_CAbs->value() ; } if (_TypeThC == 2) { _ThreshC = SpinBox_CRel->value() ; } if (_TypeThC == 3) { _ThreshC = SpinBox_CPE->value() ; } + if (_TypeThC == 4) { _ThreshC = SpinBox_CMuSigma->value() ; } _aHypothesis->SetUnRefThr(_TypeThC, _ThreshC) ; } diff --git a/src/HOMARD_I/HOMARD_Boundary_i.cxx b/src/HOMARD_I/HOMARD_Boundary_i.cxx index e57b7e79..d10e2ade 100644 --- a/src/HOMARD_I/HOMARD_Boundary_i.cxx +++ b/src/HOMARD_I/HOMARD_Boundary_i.cxx @@ -16,7 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #include "HOMARD_Boundary_i.hxx" #include "HOMARD_Gen_i.hxx" #include "HOMARD_Boundary.hxx" @@ -58,75 +66,88 @@ HOMARD_Boundary_i::HOMARD_Boundary_i( CORBA::ORB_ptr orb, HOMARD_Boundary_i::~HOMARD_Boundary_i() { } - //============================================================================= -/*! - */ +//============================================================================= +// Generalites +//============================================================================= //============================================================================= void HOMARD_Boundary_i::SetName( const char* Name ) { ASSERT( myHomardBoundary ); myHomardBoundary->SetName( Name ); } - //============================================================================= char* HOMARD_Boundary_i::GetName() { ASSERT( myHomardBoundary ); return CORBA::string_dup( myHomardBoundary->GetName().c_str() ); } - +//============================================================================= +CORBA::Long HOMARD_Boundary_i::Delete() +{ + ASSERT( myHomardBoundary ); + char* BoundaryName = GetName() ; + MESSAGE ( "Delete : destruction de la frontiere " << BoundaryName ); + return _gen_i->DeleteBoundary(BoundaryName) ; +} //============================================================================= char* HOMARD_Boundary_i::GetDumpPython() { ASSERT( myHomardBoundary ); return CORBA::string_dup( myHomardBoundary->GetDumpPython().c_str() ); } +//============================================================================= +std::string HOMARD_Boundary_i::Dump() const +{ + return HOMARD::Dump( *myHomardBoundary ); +} - +//============================================================================= +bool HOMARD_Boundary_i::Restore( const std::string& stream ) +{ + return HOMARD::Restore( *myHomardBoundary, stream ); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= //============================================================================= void HOMARD_Boundary_i::SetType( CORBA::Long Type ) { ASSERT( myHomardBoundary ); myHomardBoundary->SetType( Type ); } - //============================================================================= CORBA::Long HOMARD_Boundary_i::GetType() { ASSERT( myHomardBoundary ); return CORBA::Long( myHomardBoundary->GetType() ); } - //============================================================================= -void HOMARD_Boundary_i::SetMeshFile( const char* MeshFile ) +void HOMARD_Boundary_i::SetMeshName( const char* MeshName ) { ASSERT( myHomardBoundary ); - myHomardBoundary->SetMeshFile( MeshFile ); - _gen_i->PublishResultInSmesh(MeshFile, 0); + myHomardBoundary->SetMeshName( MeshName ); } //============================================================================= -char* HOMARD_Boundary_i::GetMeshFile() +char* HOMARD_Boundary_i::GetMeshName() { ASSERT( myHomardBoundary ); - return CORBA::string_dup( myHomardBoundary->GetMeshFile().c_str() ); + return CORBA::string_dup( myHomardBoundary->GetMeshName().c_str() ); } - //============================================================================= -void HOMARD_Boundary_i::SetMeshName( const char* MeshName ) +void HOMARD_Boundary_i::SetMeshFile( const char* MeshFile ) { ASSERT( myHomardBoundary ); - myHomardBoundary->SetMeshName( MeshName ); + myHomardBoundary->SetMeshFile( MeshFile ); + _gen_i->PublishResultInSmesh(MeshFile, 0); } - //============================================================================= -char* HOMARD_Boundary_i::GetMeshName() +char* HOMARD_Boundary_i::GetMeshFile() { ASSERT( myHomardBoundary ); - return CORBA::string_dup( myHomardBoundary->GetMeshName().c_str() ); + return CORBA::string_dup( myHomardBoundary->GetMeshFile().c_str() ); } - - //============================================================================= void HOMARD_Boundary_i::SetCylinder( double X0, double X1, double X2, double X3, double X4, double X5, double X6 ) { @@ -139,7 +160,6 @@ void HOMARD_Boundary_i::SetSphere( double Xcentre, double Ycentre, double ZCentr ASSERT( myHomardBoundary ); myHomardBoundary->SetSphere( Xcentre, Ycentre, ZCentre, rayon ); } - //============================================================================= HOMARD::double_array* HOMARD_Boundary_i::GetCoords() { @@ -153,14 +173,12 @@ HOMARD::double_array* HOMARD_Boundary_i::GetCoords() aResult[i++] = (*it); return aResult._retn(); } - //============================================================================= void HOMARD_Boundary_i::SetLimit( double Xincr, double Yincr, double Zincr ) { ASSERT( myHomardBoundary ); myHomardBoundary->SetLimit( Xincr, Yincr, Zincr ); } - //============================================================================= HOMARD::double_array* HOMARD_Boundary_i::GetLimit() { @@ -175,22 +193,6 @@ HOMARD::double_array* HOMARD_Boundary_i::GetLimit() return aResult._retn(); } //============================================================================= -/*! - */ -//============================================================================= -void HOMARD_Boundary_i::SetCaseCreation( const char* NomCaseCreation ) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetCaseCreation( NomCaseCreation ); -} - -//============================================================================= -char* HOMARD_Boundary_i::GetCaseCreation() -{ - ASSERT( myHomardBoundary ); - return CORBA::string_dup( myHomardBoundary->GetCaseCreation().c_str() ); -} -//============================================================================= void HOMARD_Boundary_i::AddGroup( const char* Group) { ASSERT( myHomardBoundary ); @@ -222,17 +224,22 @@ HOMARD::ListGroupType* HOMARD_Boundary_i::GetGroups() } return aResult._retn(); } - - - //============================================================================= -std::string HOMARD_Boundary_i::Dump() const +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Boundary_i::SetCaseCreation( const char* NomCaseCreation ) { - return HOMARD::Dump( *myHomardBoundary ); + ASSERT( myHomardBoundary ); + myHomardBoundary->SetCaseCreation( NomCaseCreation ); } - //============================================================================= -bool HOMARD_Boundary_i::Restore( const std::string& stream ) +char* HOMARD_Boundary_i::GetCaseCreation() { - return HOMARD::Restore( *myHomardBoundary, stream ); + ASSERT( myHomardBoundary ); + return CORBA::string_dup( myHomardBoundary->GetCaseCreation().c_str() ); } + + + diff --git a/src/HOMARD_I/HOMARD_Boundary_i.hxx b/src/HOMARD_I/HOMARD_Boundary_i.hxx index 6c6caf81..4752c866 100644 --- a/src/HOMARD_I/HOMARD_Boundary_i.hxx +++ b/src/HOMARD_I/HOMARD_Boundary_i.hxx @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #ifndef _HOMARD_Boundary_I_HXX_ #define _HOMARD_Boundary_I_HXX_ @@ -43,41 +52,46 @@ public: virtual ~HOMARD_Boundary_i(); +// Generalites void SetName( const char* Name ); char* GetName(); + + CORBA::Long Delete(); + char* GetDumpPython(); - void SetType( CORBA::Long Type ); + std::string Dump() const; + bool Restore( const std::string& stream ); +// Caracteristiques + void SetType( CORBA::Long Type ); CORBA::Long GetType(); - void SetMeshFile( const char* MeshFile ); - char* GetMeshFile(); - void SetMeshName( const char* MeshName ); char* GetMeshName(); + void SetMeshFile( const char* MeshFile ); + char* GetMeshFile(); + void SetCylinder( double Xcentre, double Ycentre, double ZCentre, double Xaxe, double Yaxe, double Zaxe, double rayon ); void SetSphere( double Xcentre, double Ycentre, double ZCentre, double rayon ); + HOMARD::double_array* GetCoords(); - HOMARD::double_array* GetLimit(); void SetLimit( double Xincr, double Yincr, double Zincr); + HOMARD::double_array* GetLimit(); + void AddGroup( const char* Group); + void SetGroups(const HOMARD::ListGroupType& ListGroup); + HOMARD::ListGroupType* GetGroups(); - std::string Dump() const; - bool Restore( const std::string& stream ); - +// Liens avec les autres structures void SetCaseCreation( const char* NomCaseCreation ); char* GetCaseCreation(); - void AddGroup( const char* Group); - void SetGroups(const HOMARD::ListGroupType& ListGroup); - HOMARD::ListGroupType* GetGroups(); - private: ::HOMARD_Boundary* myHomardBoundary; diff --git a/src/HOMARD_I/HOMARD_Cas_i.cxx b/src/HOMARD_I/HOMARD_Cas_i.cxx index d95893f9..8e456ec3 100755 --- a/src/HOMARD_I/HOMARD_Cas_i.cxx +++ b/src/HOMARD_I/HOMARD_Cas_i.cxx @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #include "HOMARD_Cas_i.hxx" #include "HOMARD_Gen_i.hxx" @@ -59,108 +68,93 @@ HOMARD_Cas_i::HOMARD_Cas_i( CORBA::ORB_ptr orb, HOMARD_Cas_i::~HOMARD_Cas_i() { } - //============================================================================= -/*! - */ //============================================================================= -void HOMARD_Cas_i::SetDirName( const char* NomDir ) -{ - ASSERT( myHomardCas ); - myHomardCas->SetDirName( NomDir ); -} - +// Generalites //============================================================================= -/*! - */ //============================================================================= void HOMARD_Cas_i::SetName( const char* Name ) { ASSERT( myHomardCas ); myHomardCas->SetName( Name ); } - -//============================================================================= -/*! - */ //============================================================================= char* HOMARD_Cas_i::GetName() { ASSERT( myHomardCas ); return CORBA::string_dup( myHomardCas->GetName().c_str() ); } - //============================================================================= -/*! - */ +CORBA::Long HOMARD_Cas_i::Delete() +{ + ASSERT( myHomardCas ); + char* CaseName = GetName() ; + MESSAGE ( "Delete : destruction du cas " << CaseName ); + return _gen_i->DeleteCase(CaseName) ; +} //============================================================================= char* HOMARD_Cas_i::GetDumpPython() { ASSERT( myHomardCas ); return CORBA::string_dup( myHomardCas->GetDumpPython().c_str() ); } - //============================================================================= -char* HOMARD_Cas_i::GetDirName() +std::string HOMARD_Cas_i::Dump() const { - ASSERT( myHomardCas ); - return CORBA::string_dup( myHomardCas->GetDirName().c_str() ); + return HOMARD::Dump( *myHomardCas ); } - //============================================================================= -void HOMARD_Cas_i::SetConfType( CORBA::Long ConfType ) +bool HOMARD_Cas_i::Restore( const std::string& stream ) { - ASSERT( myHomardCas ); - myHomardCas->SetConfType( ConfType ); + return HOMARD::Restore( *myHomardCas, stream ); } //============================================================================= -CORBA::Long HOMARD_Cas_i::GetNumber() +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Cas_i::SetDirName( const char* NomDir ) { ASSERT( myHomardCas ); - return myHomardCas->GetNumber(); + myHomardCas->SetDirName( NomDir ); } - //============================================================================= -CORBA::Long HOMARD_Cas_i::GetConfType() +char* HOMARD_Cas_i::GetDirName() { ASSERT( myHomardCas ); - return myHomardCas->GetConfType(); + return CORBA::string_dup( myHomardCas->GetDirName().c_str() ); } - //============================================================================= -char* HOMARD_Cas_i::GetIter0Name() +CORBA::Long HOMARD_Cas_i::GetNumber() { ASSERT( myHomardCas ); - return CORBA::string_dup( myHomardCas->GetIter0Name().c_str() ); + return myHomardCas->GetNumber(); } //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::GetIter0() +void HOMARD_Cas_i::SetConfType( CORBA::Long ConfType ) { -// Nom de l'iteration parent - char* Iter0Name = GetIter0Name() ; - MESSAGE ( "GetIter0 : Iter0Name = " << Iter0Name ); -// On passe par la methode sur l'objet HOMARD -// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte - return _gen_i->GetIteration(Iter0Name) ; + ASSERT( myHomardCas ); + myHomardCas->SetConfType( ConfType ); } - //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::NextIteration( const char* IterName ) +CORBA::Long HOMARD_Cas_i::GetConfType() { -// Nom de l'iteration parent - char* NomIterParent = GetIter0Name() ; - MESSAGE ( "NextIteration : IterName = " << IterName ); - MESSAGE ( "NextIteration : NomIterParent = " << NomIterParent ); -// On passe par la methode sur l'objet HOMARD -// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte - return _gen_i->CreateIteration(IterName, NomIterParent) ; + ASSERT( myHomardCas ); + return myHomardCas->GetConfType(); } - //============================================================================= -void HOMARD_Cas_i::AddIteration( const char* NomIteration ) +void HOMARD_Cas_i::SetBoundingBox( const HOMARD::extrema& LesExtrema ) { ASSERT( myHomardCas ); - myHomardCas->AddIteration( NomIteration ); + std::vector VExtrema; + ASSERT( LesExtrema.length() == 10 ); + VExtrema.resize( LesExtrema.length() ); + for ( int i = 0; i < LesExtrema.length(); i++ ) + { + VExtrema[i] = LesExtrema[i]; + } + + myHomardCas->SetBoundingBox( VExtrema ); } //============================================================================= HOMARD::extrema* HOMARD_Cas_i::GetBoundingBox() @@ -177,20 +171,6 @@ HOMARD::extrema* HOMARD_Cas_i::GetBoundingBox() return aResult._retn(); } //============================================================================= -void HOMARD_Cas_i::SetBoundingBox( const HOMARD::extrema& LesExtrema ) -{ - ASSERT( myHomardCas ); - std::vector VExtrema; - ASSERT( LesExtrema.length() == 10 ); - VExtrema.resize( LesExtrema.length() ); - for ( int i = 0; i < LesExtrema.length(); i++ ) - { - VExtrema[i] = LesExtrema[i]; - } - - myHomardCas->SetBoundingBox( VExtrema ); -} -//============================================================================= void HOMARD_Cas_i::AddGroup( const char* Group) { ASSERT( myHomardCas ); @@ -223,31 +203,47 @@ HOMARD::ListGroupType* HOMARD_Cas_i::GetGroups() } return aResult._retn(); } - //============================================================================= -void HOMARD_Cas_i::AddBoundaryGroup( const char* Boundary, const char* Group) +void HOMARD_Cas_i::AddBoundaryGroup( const char* BoundaryName, const char* Group) { - MESSAGE ("AddBoundaryGroup"); + MESSAGE ("AddBoundaryGroup : BoundaryName = "<< BoundaryName << ", Group = " << Group ); ASSERT( myHomardCas ); - myHomardCas->AddBoundaryGroup( Boundary, Group ); + // La frontiere est-elle deja enregistree pour ce cas ? + const std::list& ListBoundaryGroup = myHomardCas->GetBoundaryGroup(); + std::list::const_iterator it; + int existe = 0; + for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) + { + if ( *it == BoundaryName ) + { existe = 1 ; } + it++ ; + } + // Enregistrement de la frontiere dans la reference du cas + myHomardCas->AddBoundaryGroup( BoundaryName, Group ); + // Pour une nouvelle frontiere, publication dans l'arbre d'etudes sous le cas + if ( existe == 0 ) + { + char* CaseName = GetName() ; + MESSAGE ( "AddBoundaryGroup : insertion de la frontiere dans l'arbre de " << CaseName ); + _gen_i->PublishBoundaryUnderCase(CaseName, BoundaryName) ; + } } //============================================================================= HOMARD::ListBoundaryGroupType* HOMARD_Cas_i::GetBoundaryGroup() { MESSAGE ("GetBoundaryGroup"); ASSERT(myHomardCas ); - const std::list& ListString = myHomardCas->GetBoundaryGroup(); + const std::list& ListBoundaryGroup = myHomardCas->GetBoundaryGroup(); HOMARD::ListBoundaryGroupType_var aResult = new HOMARD::ListBoundaryGroupType(); - aResult->length( ListString.size() ); + aResult->length( ListBoundaryGroup.size() ); std::list::const_iterator it; int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) + for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) { aResult[i++] = CORBA::string_dup( (*it).c_str() ); } return aResult._retn(); } - //============================================================================= void HOMARD_Cas_i::SetPyram( CORBA::Long Pyram ) { @@ -263,13 +259,64 @@ CORBA::Long HOMARD_Cas_i::GetPyram() return myHomardCas->GetPyram(); } //============================================================================= -std::string HOMARD_Cas_i::Dump() const +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +char* HOMARD_Cas_i::GetIter0Name() { - return HOMARD::Dump( *myHomardCas ); + ASSERT( myHomardCas ); + return CORBA::string_dup( myHomardCas->GetIter0Name().c_str() ); } - //============================================================================= -bool HOMARD_Cas_i::Restore( const std::string& stream ) +HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::GetIter0() { - return HOMARD::Restore( *myHomardCas, stream ); +// Nom de l'iteration parent + char* Iter0Name = GetIter0Name() ; + MESSAGE ( "GetIter0 : Iter0Name = " << Iter0Name ); + return _gen_i->GetIteration(Iter0Name) ; +} +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::NextIteration( const char* IterName ) +{ +// Nom de l'iteration parent + char* NomIterParent = GetIter0Name() ; + MESSAGE ( "NextIteration : IterName = " << IterName ); + MESSAGE ( "NextIteration : NomIterParent = " << NomIterParent ); + return _gen_i->CreateIteration(IterName, NomIterParent) ; +} +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::LastIteration( ) +{ + HOMARD::HOMARD_Iteration_ptr Iter ; + HOMARD::listeIterFilles_var ListeIterFilles ; + char* IterName ; +// Iteration initiale du cas + IterName = GetIter0Name() ; +// On va explorer la descendance de cette iteration initiale +// jusqu'a trouver celle qui n'a pas de filles + int nbiterfilles = 1 ; + while ( nbiterfilles == 1 ) + { +// L'iteration associee +// MESSAGE ( ".. IterName = " << IterName ); + Iter = _gen_i->GetIteration(IterName) ; +// Les filles de cette iteration + ListeIterFilles = Iter->GetIterations() ; + nbiterfilles = ListeIterFilles->length() ; +// MESSAGE ( ".. nbiterfilles = " << nbiterfilles ); +// S'il y a au moins 2 filles, arret : on ne sait pas faire + ASSERT( nbiterfilles <= 1 ) ; +// S'il y a une fille unique, on recupere le nom de la fille et on recommence + if ( nbiterfilles == 1 ) + { IterName = ListeIterFilles[0] ; } + } +// + return Iter ; +} +//============================================================================= +void HOMARD_Cas_i::AddIteration( const char* NomIteration ) +{ + ASSERT( myHomardCas ); + myHomardCas->AddIteration( NomIteration ); } diff --git a/src/HOMARD_I/HOMARD_Cas_i.hxx b/src/HOMARD_I/HOMARD_Cas_i.hxx index 8e37f6e4..740e2eef 100644 --- a/src/HOMARD_I/HOMARD_Cas_i.hxx +++ b/src/HOMARD_I/HOMARD_Cas_i.hxx @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #ifndef _HOMARD_CAS_I_HXX_ #define _HOMARD_CAS_I_HXX_ @@ -43,40 +52,48 @@ public: virtual ~HOMARD_Cas_i(); - void SetDirName( const char* NomDir ); - char* GetDirName(); - +// Generalites void SetName( const char* Name ); char* GetName(); - void SetConfType( CORBA::Long ConfType ); - CORBA::Long GetConfType(); + CORBA::Long Delete(); - char* GetIter0Name(); - HOMARD::HOMARD_Iteration_ptr GetIter0() ; + char* GetDumpPython(); - HOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name) ; + std::string Dump() const; + bool Restore( const std::string& stream ); - void AddIteration( const char* NomIteration ); +// Caracteristiques + void SetDirName( const char* NomDir ); + char* GetDirName(); + + CORBA::Long GetNumber(); + + void SetConfType( CORBA::Long ConfType ); + CORBA::Long GetConfType(); - HOMARD::extrema* GetBoundingBox(); void SetBoundingBox( const HOMARD::extrema& LesExtremes ); + HOMARD::extrema* GetBoundingBox(); - HOMARD::ListGroupType* GetGroups(); void AddGroup( const char* Group); void SetGroups(const HOMARD::ListGroupType& ListGroup); + HOMARD::ListGroupType* GetGroups(); - HOMARD::ListBoundaryGroupType* GetBoundaryGroup(); void AddBoundaryGroup( const char* Boundary, const char* Group); + HOMARD::ListBoundaryGroupType* GetBoundaryGroup(); void SetPyram( CORBA::Long Pyram ); CORBA::Long GetPyram(); - std::string Dump() const; - bool Restore( const std::string& stream ); +// Liens avec les autres structures + char* GetIter0Name(); + HOMARD::HOMARD_Iteration_ptr GetIter0() ; - char * GetDumpPython(); - CORBA::Long GetNumber(); + HOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name ) ; + + HOMARD::HOMARD_Iteration_ptr LastIteration() ; + + void AddIteration( const char* NomIteration ); private: ::HOMARD_Cas* myHomardCas; diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index df0e1679..9b53284b 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -49,13 +49,11 @@ #include #include - using namespace std; -//======================================================================= -//function : RemoveTabulation -//purpose : -//======================================================================= +//============================================================================= +//functions +//============================================================================= std::string RemoveTabulation( std::string theScript ) { std::string::size_type aPos = 0; @@ -69,7 +67,6 @@ std::string RemoveTabulation( std::string theScript ) } return theScript; } - //============================================================================= /*! * standard constructor @@ -91,7 +88,6 @@ Engines_Component_i(orb, poa, contId, instanceName, interfaceName) ASSERT(SINGLETON_::IsAlreadyExisting()); _NS->init_orb(_orb); } - //================================= /*! * standard destructor @@ -101,9 +97,9 @@ HOMARD_Gen_i::~HOMARD_Gen_i() { } //============================================================================= -/*! - * Ajoute le composant homard dans l etude si necessaire - */ +//============================================================================= +// Utilitaires pour l'étude +//============================================================================= //============================================================================= void HOMARD_Gen_i::addInStudy(SALOMEDS::Study_ptr theStudy) { @@ -142,12 +138,6 @@ void HOMARD_Gen_i::addInStudy(SALOMEDS::Study_ptr theStudy) myBuilder->CommitCommand(); } } - -//============================================================================= -/*! - * - * Set current study - */ //============================================================================= void HOMARD_Gen_i::SetCurrentStudy(SALOMEDS::Study_ptr theStudy) { @@ -155,7 +145,6 @@ void HOMARD_Gen_i::SetCurrentStudy(SALOMEDS::Study_ptr theStudy) myCurrentStudy = SALOMEDS::Study::_duplicate(theStudy); this->addInStudy(myCurrentStudy); } - //============================================================================= SALOMEDS::Study_ptr HOMARD_Gen_i::GetCurrentStudy() //============================================================================= @@ -163,66 +152,24 @@ SALOMEDS::Study_ptr HOMARD_Gen_i::GetCurrentStudy() MESSAGE("GetCurrentStudy: study Id = " << GetCurrentStudyID()); return SALOMEDS::Study::_duplicate(myCurrentStudy); } - //============================================================================= CORBA::Long HOMARD_Gen_i::GetCurrentStudyID() //============================================================================= { return myCurrentStudy->_is_nil() ? -1 : myCurrentStudy->StudyId(); } - //============================================================================= -void HOMARD_Gen_i::AssociateCaseIter(const char* nomCas, const char* nomIter, const char* labelIter) -{ - MESSAGE( "AssociateCaseIter : " << nomCas << " ," << nomIter << "," << labelIter ); - IsValidStudy () ; - - HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas]; - if (CORBA::is_nil(myCase)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid Case "; - throw SALOME::SALOME_Exception(es); - return ; - }; - - HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter]; - if (CORBA::is_nil(myIteration)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid Case "; - throw SALOME::SALOME_Exception(es); - return ; - }; - - SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); - SALOMEDS::SObject_var aCasSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myCase))); - if (CORBA::is_nil(aCasSO)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid Case "; - throw SALOME::SALOME_Exception(es); - return ; - }; - - aStudyBuilder->NewCommand(); - SALOMEDS::SObject_var newStudyIter = aStudyBuilder->NewObject(aCasSO); - PublishInStudyAttr(aStudyBuilder, newStudyIter, nomIter , labelIter, - "iter_non_calculee.png", _orb->object_to_string(myIteration)) ; - aStudyBuilder->CommitCommand(); - - myCase->AddIteration(nomIter); - myIteration->SetCaseName(nomCas); -} +//============================================================================= -//===================================================================================== +//============================================================================= +//============================================================================= +// Utilitaires pour l'iteration +//============================================================================= +//============================================================================= void HOMARD_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Boolean EtatCalcul) //===================================================================================== { - MESSAGE( "SetEtatIter : nomIter = " << nomIter << " etat " << EtatCalcul ); + MESSAGE( "SetEtatIter : affectation de l etat " << EtatCalcul << " a l iteration " << nomIter ); HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter]; if (CORBA::is_nil(myIteration)) { @@ -237,14 +184,6 @@ void HOMARD_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Boolean EtatCal SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration))); - if (CORBA::is_nil(myIteration)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid Iteration "; - throw SALOME::SALOME_Exception(es); - return ; - }; int number = myIteration->GetNumber() ; const char* icone ; @@ -259,38 +198,310 @@ void HOMARD_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Boolean EtatCal aStudyBuilder->CommitCommand(); } -//===================================================================================== -void HOMARD_Gen_i::InvalideBoundary(const char* BoundaryName) -//===================================================================================== +//============================================================================= +//============================================================================= +// +//============================================================================= +//============================================================================= +// Destruction des structures identifiees par leurs noms +//============================================================================= +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteBoundary(const char* BoundaryName) { - MESSAGE( "InvalideBoundary : BoundaryName = " << BoundaryName ); + MESSAGE ( "DeleteBoundary : BoundaryName = " << BoundaryName ); HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName]; if (CORBA::is_nil(myBoundary)) { +// const char* message = "Invalid Boundary " ; +// SALOMEException(message) ; + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid Boundary "; + throw SALOME::SALOME_Exception(es); + return 1 ; + }; + +// On verifie que la frontiere n'est plus utilisee + HOMARD::listeCases* maListe = GetAllCasesName(); + int numberOfCases = maListe->length(); + MESSAGE ( ".. Nombre de cas = " << numberOfCases ); + std::string CaseName ; + HOMARD::ListBoundaryGroupType* ListBoundaryGroupType ; + int numberOfitems ; + HOMARD::HOMARD_Cas_var myCase ; + for (int NumeCas = 0; NumeCas< numberOfCases; NumeCas++) + { + CaseName = std::string((*maListe)[NumeCas]); + MESSAGE ( "... Examen du cas = " << CaseName.c_str() ); + myCase = myContextMap[GetCurrentStudyID()]._mesCas[CaseName]; + ASSERT(!CORBA::is_nil(myCase)); + ListBoundaryGroupType = myCase->GetBoundaryGroup(); + numberOfitems = ListBoundaryGroupType->length(); + MESSAGE ( "... number of string for Boundary+Group = " << numberOfitems); + for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2) + { + if ( std::string((*ListBoundaryGroupType)[NumBoundary]) == BoundaryName ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This boundary is used in a case and cannot be deleted."; + throw SALOME::SALOME_Exception(es); + return 2 ; + }; + }; + } + + // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete + myContextMap[GetCurrentStudyID()]._mesBoundarys.erase(BoundaryName); + SALOMEDS::Study::ListOfSObject_var listSO = myCurrentStudy->FindObjectByName(BoundaryName, ComponentDataType()); + SALOMEDS::SObject_var aSO =listSO[0]; + SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); + myCurrentStudy->NewBuilder()->RemoveObjectWithChildren(aSO); + + return 0 ; +} +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteCase(const char* nomCas) +{ + // Pour detruire un cas + MESSAGE ( "DeleteCase : nomCas = " << nomCas ); + HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas]; + if (CORBA::is_nil(myCase)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid Case Context "; + throw SALOME::SALOME_Exception(es); + return 1; + }; + // On commence par detruire toutes les iterations en partant de l'initiale et y compris elle + CORBA::String_var nomIter = myCase->GetIter0Name(); + CORBA::Long Option = 0 ; + if ( DeleteIterationOption(nomIter, Option) != 0 ) + { + return 2; + }; + + // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete + myContextMap[GetCurrentStudyID()]._mesCas.erase(nomCas); + SALOMEDS::Study::ListOfSObject_var listSO = myCurrentStudy->FindObjectByName(nomCas, ComponentDataType()); + SALOMEDS::SObject_var aSO =listSO[0]; + SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); + myCurrentStudy->NewBuilder()->RemoveObjectWithChildren(aSO); + + return 0 ; +} +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteHypo(const char* nomHypo) +{ + MESSAGE ( "DeleteHypo : nomHypo = " << nomHypo ); + HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo]; + if (CORBA::is_nil(myHypo)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid Hypothesis "; + throw SALOME::SALOME_Exception(es); + return 1 ; + }; + +// On verifie que l'hypothese n'est plus utilisee + HOMARD::listeIters* maListeIter = myHypo->GetIterations(); + int numberOfIter = maListeIter->length(); + if ( numberOfIter > 0 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This hypothesis is used and cannot be deleted."; + throw SALOME::SALOME_Exception(es); + return 2 ; + }; + + // suppression du lien avec les zones eventuelles + HOMARD::listeZonesHypo* maListe = myHypo->GetZones(); + int numberOfZones = maListe->length(); + MESSAGE ( ".. Nombre de zones = " << numberOfZones ); + for (int NumeZone = 0; NumeZone< numberOfZones; NumeZone++) + { + std::string ZoneName = std::string((*maListe)[NumeZone]); + MESSAGE ( ".. suppression du lien avec la zone = " << ZoneName.c_str() ); + DissociateHypoZone(nomHypo, ZoneName.c_str()) ; + NumeZone += 1 ; + } + + // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete + myContextMap[GetCurrentStudyID()]._mesHypotheses.erase(nomHypo); + SALOMEDS::Study::ListOfSObject_var listSO = myCurrentStudy->FindObjectByName(nomHypo, ComponentDataType()); + SALOMEDS::SObject_var aSO =listSO[0]; + SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); + myCurrentStudy->NewBuilder()->RemoveObjectWithChildren(aSO); + + return 0 ; +} +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteIteration(const char* nomIter) +{ + // Pour detruire une iteration courante + MESSAGE ( "DeleteIteration : nomIter = " << nomIter ); + CORBA::Long Option = 1 ; + return DeleteIterationOption(nomIter, Option); +} +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long Option) +{ + // Option = 0 : On autorise la destruction de l'iteration 0 + // Option = 1 : On interdit la destruction de l'iteration 0 + MESSAGE ( "DeleteIterationOption : nomIter = " << nomIter << ", avec option = " << Option ); + HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter]; + if (CORBA::is_nil(myIteration)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid Iteration "; + throw SALOME::SALOME_Exception(es); + return 1 ; + }; + + int numero = myIteration->GetNumber(); + MESSAGE ( "DeleteIterationOption : numero = " << numero ); + if ( numero == 0 and Option == 1 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This iteration cannot be deleted."; + throw SALOME::SALOME_Exception(es); + return 2 ; + }; + + // On detruit recursivement toutes les filles + HOMARD::listeIterFilles* maListe = myIteration->GetIterations(); + int numberOfIter = maListe->length(); + for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) + { + std::string nomIterFille = std::string((*maListe)[NumeIter]); + MESSAGE ( ".. appel recursif de DeleteIterationOption pour nomIter = " << nomIterFille.c_str() ); + DeleteIterationOption(nomIterFille.c_str(), Option); + } + + // On arrive ici pour une iteration sans fille + MESSAGE ( "Destruction effective de " << nomIter ); + // On commence par invalider l'iteration pour faire le menage des dependances + // et des publications dans SMESH + InvalideIter(nomIter) ; + + // Retrait dans la descendance de l'iteration parent + if ( numero > 0 ) + { + const char* nomIterationParent = myIteration->GetIterParentName(); + MESSAGE ( "Retrait dans la descendance de nomIterationParent " << nomIterationParent ); + HOMARD::HOMARD_Iteration_var myIterationParent = myContextMap[GetCurrentStudyID()]._mesIterations[nomIterationParent]; + if (CORBA::is_nil(myIterationParent)) + { SALOME::ExceptionStruct es; es.type = SALOME::BAD_PARAM; - es.text = "Invalid Boundary "; + es.text = "Invalid Iteration "; throw SALOME::SALOME_Exception(es); - return ; + return 3 ; + }; + myIterationParent->UnLinkNextIteration(nomIter); + } + + // suppression du lien avec l'hypothese + if ( numero > 0 ) + { + const char* nomHypo = myIteration->GetHypoName(); + HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo]; + ASSERT(!CORBA::is_nil(myHypo)); + myHypo->UnLinkIteration(nomIter); + } + + // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete + myContextMap[GetCurrentStudyID()]._mesIterations.erase(nomIter); + SALOMEDS::Study::ListOfSObject_var listSO = myCurrentStudy->FindObjectByName(nomIter, ComponentDataType()); + SALOMEDS::SObject_var aSO =listSO[0]; + SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); + myCurrentStudy->NewBuilder()->RemoveObjectWithChildren(aSO); + // on peut aussi faire RemoveObject +// MESSAGE ( "Au final" ); +// HOMARD::listeIterations* Liste = GetAllIterationsName() ; +// numberOfIter = Liste->length(); +// for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) +// { +// std::string nomIterFille = std::string((*Liste)[NumeIter]); +// MESSAGE ( ".. nomIter = " << nomIterFille.c_str() ); +// } + + return 0 ; +} +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteZone(const char* nomZone) +{ + MESSAGE ( "DeleteZone : nomZone = " << nomZone ); + HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[nomZone]; + if (CORBA::is_nil(myZone)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid Zone "; + throw SALOME::SALOME_Exception(es); + return 1 ; }; - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "No change is allowed in boundary. Ask for evolution."; - throw SALOME::SALOME_Exception(es); - return ; -/* HOMARD::listeHypo* maListe = myBoundary->GetHypo(); + +// On verifie que la zone n'est plus utilisee + HOMARD::listeHypo* maListe = myZone->GetHypo(); int numberOfHypo = maListe->length(); - for (int NumeHypo = 0; NumeHypo< numberOfHypo; NumeHypo++) + MESSAGE ( ".. Nombre d'hypotheses = " << numberOfHypo ); + if ( numberOfHypo > 0 ) { - std::string nomHypo = std::string((*maListe)[NumeHypo]); - InvalideHypo(nomHypo.c_str()); - }*/ + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This zone is used and cannot be deleted."; + throw SALOME::SALOME_Exception(es); + return 2 ; + }; +// + // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete + myContextMap[GetCurrentStudyID()]._mesZones.erase(nomZone); + SALOMEDS::Study::ListOfSObject_var listSO = myCurrentStudy->FindObjectByName(nomZone, ComponentDataType()); + SALOMEDS::SObject_var aSO =listSO[0]; + SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); + myCurrentStudy->NewBuilder()->RemoveObjectWithChildren(aSO); + + return 0 ; } -//===================================================================================== +//============================================================================= +//============================================================================= +// +//============================================================================= +//============================================================================= +// Invalidation des structures identifiees par leurs noms +//============================================================================= +//============================================================================= +void HOMARD_Gen_i::InvalideBoundary(const char* BoundaryName) +{ + MESSAGE( "InvalideBoundary : BoundaryName = " << BoundaryName ); + HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName]; + if (CORBA::is_nil(myBoundary)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid Boundary "; + throw SALOME::SALOME_Exception(es); + return ; + } + else + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "No change is allowed in a boundary. Ask for evolution."; + throw SALOME::SALOME_Exception(es); + return ; + }; +} +//============================================================================= void HOMARD_Gen_i::InvalideZone(const char* ZoneName) -//===================================================================================== { - MESSAGE( "InvalideZone : ZoneName = " << ZoneName ); + MESSAGE( "InvalideZone : ZoneName = " << ZoneName ); HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName]; if (CORBA::is_nil(myZone)) { @@ -302,15 +513,16 @@ void HOMARD_Gen_i::InvalideZone(const char* ZoneName) }; HOMARD::listeHypo* maListe = myZone->GetHypo(); int numberOfHypo = maListe->length(); + MESSAGE( ".. numberOfHypo = " << numberOfHypo ); for (int NumeHypo = 0; NumeHypo< numberOfHypo; NumeHypo++) { std::string nomHypo = std::string((*maListe)[NumeHypo]); + MESSAGE( ".. nomHypo = " << nomHypo ); InvalideHypo(nomHypo.c_str()); } } -//===================================================================================== +//============================================================================= void HOMARD_Gen_i::InvalideHypo(const char* nomHypo) -//===================================================================================== { MESSAGE( "InvalideHypo : nomHypo = " << nomHypo ); HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo]; @@ -328,16 +540,14 @@ void HOMARD_Gen_i::InvalideHypo(const char* nomHypo) for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) { std::string nomIter = std::string((*maListe)[NumeIter]); + MESSAGE( ".. nomIter = " << nomIter ); InvalideIter(nomIter.c_str()); } } -// -//===================================================================================== +//============================================================================= void HOMARD_Gen_i::InvalideIter(const char* nomIter) -//===================================================================================== { - MESSAGE("InvalideIter : nomIter = " << nomIter); - SetEtatIter(nomIter,false); + MESSAGE("InvalideIter : nomIter = " << nomIter); HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter]; if (CORBA::is_nil(myIteration)) { @@ -353,9 +563,12 @@ void HOMARD_Gen_i::InvalideIter(const char* nomIter) for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) { std::string nomIterFille = std::string((*maListe)[NumeIter]); + MESSAGE ( ".. appel recursif de InvalideIter pour nomIter = " << nomIterFille.c_str() ); InvalideIter(nomIterFille.c_str()); } + // On arrive ici pour une iteration sans fille + MESSAGE ( "Invalidation effective de " << nomIter ); SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration))); SALOMEDS::ChildIterator_var aIter = myCurrentStudy->NewChildIterator(aIterSO); for (; aIter->More(); aIter->Next()) @@ -369,40 +582,97 @@ void HOMARD_Gen_i::InvalideIter(const char* nomIter) SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); aStudyBuilder->RemoveObject(so); } - const char * nomCas = myIteration->GetCaseName(); - HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas]; - if (CORBA::is_nil(myCase)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid Case Context "; - throw SALOME::SALOME_Exception(es); - return ; - }; - const char* dirParent = myCase->GetDirName(); - const char* nomDir = myIteration->GetDirName(); - const char* nomFichier = myIteration->GetMeshFile(); - std::string commande= "rm -rf " + std::string(dirParent) + "/" + std::string(nomDir); - commande = commande + ";rm -rf " + std::string(nomFichier); - if ((system(commande.c_str())) != 0) + + int number = myIteration->GetNumber(); + if ( number > 0 ) { + SetEtatIter(nomIter,false); + const char * nomCas = myIteration->GetCaseName(); + HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas]; + if (CORBA::is_nil(myCase)) + { SALOME::ExceptionStruct es; es.type = SALOME::BAD_PARAM; - es.text = "Menage du repertoire de calcul impossible" ; + es.text = "Invalid Case Context "; throw SALOME::SALOME_Exception(es); return ; - } -// Suppression du maillage publie dans SMESH - const char* MeshName = myIteration->GetMeshName(); - DeleteResultInSmesh(nomFichier, MeshName) ; + }; + const char* dirParent = myCase->GetDirName(); + const char* nomDir = myIteration->GetDirName(); + const char* nomFichier = myIteration->GetMeshFile(); + std::string commande= "rm -rf " + std::string(dirParent) + "/" + std::string(nomDir); + commande = commande + ";rm -rf " + std::string(nomFichier); + if ((system(commande.c_str())) != 0) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Menage du repertoire de calcul impossible" ; + throw SALOME::SALOME_Exception(es); + return ; + } + // Suppression du maillage publie dans SMESH + const char* MeshName = myIteration->GetMeshName(); + DeleteResultInSmesh(nomFichier, MeshName) ; + }; + } +//============================================================================= +//============================================================================= // -//===================================================================================== -void HOMARD_Gen_i::DissociateHypoZone(const char* ZoneName, const char* nomHypothesis) -{ - MESSAGE ( "DissociateHypoZone : ZoneName= " << ZoneName << ", nomHypo = " << nomHypothesis); - IsValidStudy () ; - +//============================================================================= +//============================================================================= +// Association de lien entre des structures identifiees par leurs noms +//============================================================================= +//============================================================================= +void HOMARD_Gen_i::AssociateCaseIter(const char* nomCas, const char* nomIter, const char* labelIter) +{ + MESSAGE( "AssociateCaseIter : " << nomCas << " ," << nomIter << "," << labelIter ); + + HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas]; + if (CORBA::is_nil(myCase)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid Case "; + throw SALOME::SALOME_Exception(es); + return ; + }; + + HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter]; + if (CORBA::is_nil(myIteration)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid iteration "; + throw SALOME::SALOME_Exception(es); + return ; + }; + + SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); + SALOMEDS::SObject_var aCasSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myCase))); + if (CORBA::is_nil(aCasSO)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid Case "; + throw SALOME::SALOME_Exception(es); + return ; + }; + + aStudyBuilder->NewCommand(); + SALOMEDS::SObject_var newStudyIter = aStudyBuilder->NewObject(aCasSO); + PublishInStudyAttr(aStudyBuilder, newStudyIter, nomIter , labelIter, + "iter_non_calculee.png", _orb->object_to_string(myIteration)) ; + aStudyBuilder->CommitCommand(); + + myCase->AddIteration(nomIter); + myIteration->SetCaseName(nomCas); +} +//===================================================================================== +void HOMARD_Gen_i::AssociateHypoZone(const char* nomHypothesis, const char* ZoneName, CORBA::Long TypeUse) +{ + MESSAGE ( "AssociateHypoZone : nomHypo = " << nomHypothesis << ", ZoneName= " << ZoneName << ", TypeUse = " << TypeUse); + HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypothesis]; ASSERT(!CORBA::is_nil(myHypo)); SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myHypo))); @@ -413,6 +683,66 @@ void HOMARD_Gen_i::DissociateHypoZone(const char* ZoneName, const char* nomHypot SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myZone))); ASSERT(!CORBA::is_nil(aZoneSO)); + SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); + + aStudyBuilder->NewCommand(); + + SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aHypoSO); + aStudyBuilder->Addreference(aSubSO, aZoneSO); + + aStudyBuilder->CommitCommand(); + + myZone->AddHypo(nomHypothesis); + myHypo->AddZone0(ZoneName, TypeUse); +}; +//============================================================================= +void HOMARD_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo) +{ + MESSAGE("AssociateIterHypo : nomHypo = " << nomHypo << " nomIter = " << nomIter); + + HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo]; + ASSERT(!CORBA::is_nil(myHypo)); + SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myHypo))); + ASSERT(!CORBA::is_nil(aHypoSO)); + + HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter]; + ASSERT(!CORBA::is_nil(myIteration)); + SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration))); + ASSERT(!CORBA::is_nil(aIterSO)); + + SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); + + aStudyBuilder->NewCommand(); + + SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO); + aStudyBuilder->Addreference(aSubSO, aHypoSO); + + aStudyBuilder->CommitCommand(); + + myIteration->SetHypoName(nomHypo); + myHypo->LinkIteration(nomIter); +}; +//============================================================================= +//============================================================================= +// +//============================================================================= +//============================================================================= +// Dissociation de lien entre des structures identifiees par leurs noms +//============================================================================= +//============================================================================= +void HOMARD_Gen_i::DissociateHypoZone(const char* nomHypothesis, const char* ZoneName) +{ + MESSAGE ( "DissociateHypoZone : ZoneName= " << ZoneName << ", nomHypo = " << nomHypothesis); + + HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypothesis]; + ASSERT(!CORBA::is_nil(myHypo)); + SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myHypo))); + ASSERT(!CORBA::is_nil(aHypoSO)); + + HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName]; + ASSERT(!CORBA::is_nil(myZone)); + SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myZone))); + ASSERT(!CORBA::is_nil(aZoneSO)); SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); @@ -436,48 +766,218 @@ void HOMARD_Gen_i::DissociateHypoZone(const char* ZoneName, const char* nomHypot myZone->SupprHypo(nomHypothesis); myHypo->SupprZone(ZoneName); }; +//============================================================================= +//============================================================================= +// -//=================================================================================== -void HOMARD_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo) +//============================================================================= +//============================================================================= +// Recuperation des listes +//============================================================================= +//============================================================================= +HOMARD::listeCases* HOMARD_Gen_i::GetAllCasesName() { - MESSAGE("AssociateIterHypo : nomHypo = " << nomHypo << " nomIter = " << nomIter); + MESSAGE("GetAllCasesName"); IsValidStudy () ; - HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo]; - ASSERT(!CORBA::is_nil(myHypo)); - SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myHypo))); - ASSERT(!CORBA::is_nil(aHypoSO)); + HOMARD::listeCases_var ret = new HOMARD::listeCases; + ret->length(myContextMap[GetCurrentStudyID()]._mesCas.size()); + std::map::const_iterator it; + int i = 0; + for (it = myContextMap[GetCurrentStudyID()]._mesCas.begin(); + it != myContextMap[GetCurrentStudyID()]._mesCas.end(); it++) + { + ret[i++] = CORBA::string_dup((*it).first.c_str()); + } - HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter]; - ASSERT(!CORBA::is_nil(myIteration)); - SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration))); - ASSERT(!CORBA::is_nil(aIterSO)); + return ret._retn(); +} +//============================================================================= +HOMARD::listeHypotheses* HOMARD_Gen_i::GetAllHypothesesName() +{ + MESSAGE("GetAllHypothesesName"); + IsValidStudy () ; - SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); + HOMARD::listeHypotheses_var ret = new HOMARD::listeHypotheses; + ret->length(myContextMap[GetCurrentStudyID()]._mesHypotheses.size()); + std::map::const_iterator it; + int i = 0; + for (it = myContextMap[GetCurrentStudyID()]._mesHypotheses.begin(); + it != myContextMap[GetCurrentStudyID()]._mesHypotheses.end(); it++) + { + ret[i++] = CORBA::string_dup((*it).first.c_str()); + } - aStudyBuilder->NewCommand(); + return ret._retn(); +} +//============================================================================= +HOMARD::listeZones* HOMARD_Gen_i::GetAllZonesName() +{ + MESSAGE("GetAllZonesName"); + IsValidStudy () ; - SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO); - aStudyBuilder->Addreference(aSubSO, aHypoSO); + HOMARD::listeZones_var ret = new HOMARD::listeZones; + ret->length(myContextMap[GetCurrentStudyID()]._mesZones.size()); + std::map::const_iterator it; + int i = 0; + for (it = myContextMap[GetCurrentStudyID()]._mesZones.begin(); + it != myContextMap[GetCurrentStudyID()]._mesZones.end(); it++) + { + ret[i++] = CORBA::string_dup((*it).first.c_str()); + } - aStudyBuilder->CommitCommand(); + return ret._retn(); +} +//============================================================================= +HOMARD::listeIterations* HOMARD_Gen_i::GetAllIterationsName() +{ + MESSAGE("GetAllIterationsName"); + IsValidStudy () ; - myIteration->SetHypoName(nomHypo); - myHypo->AddIteration(nomIter); -}; + HOMARD::listeIterations_var ret = new HOMARD::listeIterations; + ret->length(myContextMap[GetCurrentStudyID()]._mesIterations.size()); + std::map::const_iterator it; + int i = 0; + for (it = myContextMap[GetCurrentStudyID()]._mesIterations.begin(); + it != myContextMap[GetCurrentStudyID()]._mesIterations.end(); it++) + { + ret[i++] = CORBA::string_dup((*it).first.c_str()); + } + return ret._retn(); +} //============================================================================= -CORBA::Boolean HOMARD_Gen_i::VerifieDir(const char* nomDir) +HOMARD::listeBoundarys* HOMARD_Gen_i::GetAllBoundarysName() { - std::map::const_iterator it; - for (it = myContextMap[GetCurrentStudyID()]._mesCas.begin(); - it != myContextMap[GetCurrentStudyID()]._mesCas.end(); it++) + MESSAGE("GetAllBoundarysName"); + IsValidStudy () ; + + HOMARD::listeBoundarys_var ret = new HOMARD::listeBoundarys; + ret->length(myContextMap[GetCurrentStudyID()]._mesBoundarys.size()); + std::map::const_iterator it; + int i = 0; + for (it = myContextMap[GetCurrentStudyID()]._mesBoundarys.begin(); + it != myContextMap[GetCurrentStudyID()]._mesBoundarys.end(); it++) { - if (std::string(nomDir) == std::string(it->second->GetDirName())) return false; + ret[i++] = CORBA::string_dup((*it).first.c_str()); } - return true; + + return ret._retn(); } +//============================================================================= +//============================================================================= +//============================================================================= +//============================================================================= +// Recuperation des structures identifiees par leurs noms +//============================================================================= +//============================================================================= +HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::GetCase(const char* nomCas) +{ + HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas]; + ASSERT(!CORBA::is_nil(myCase)); + return HOMARD::HOMARD_Cas::_duplicate(myCase); +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::GetZone(const char* ZoneName) +{ + HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName]; + ASSERT(!CORBA::is_nil(myZone)); + return HOMARD::HOMARD_Zone::_duplicate(myZone); +} +//============================================================================= +HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::GetHypothesis(const char* nomHypothesis) +{ + HOMARD::HOMARD_Hypothesis_var myHypothesis = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypothesis]; + ASSERT(!CORBA::is_nil(myHypothesis)); + return HOMARD::HOMARD_Hypothesis::_duplicate(myHypothesis); +} +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::GetIteration(const char* NomIterationation) +{ + HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[NomIterationation]; + ASSERT(!CORBA::is_nil(myIteration)); + return HOMARD::HOMARD_Iteration::_duplicate(myIteration); +} +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::GetBoundary(const char* nomBoundary) +{ + HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[nomBoundary]; + ASSERT(!CORBA::is_nil(myBoundary)); + return HOMARD::HOMARD_Boundary::_duplicate(myBoundary); +} +//============================================================================= +//============================================================================= + +//============================================================================= +//============================================================================= +// Recuperation des structures par le contexte +//============================================================================= +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::LastIteration(const char* nomCas) +{ + HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas]; + ASSERT(!CORBA::is_nil(myCase)); +// + HOMARD::HOMARD_Iteration_var myIteration = myCase->LastIteration(); + ASSERT(!CORBA::is_nil(myIteration)); +// + return HOMARD::HOMARD_Iteration::_duplicate(myIteration); +} +//============================================================================= +//============================================================================= + +//============================================================================= +//============================================================================= +// Nouvelles structures +//============================================================================= +//============================================================================= +HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::newCase() +{ + HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + HOMARD_Cas_i* aServant = new HOMARD_Cas_i(_orb, engine); + HOMARD::HOMARD_Cas_var aCase = HOMARD::HOMARD_Cas::_narrow(aServant->_this()); + return aCase._retn(); +} +//============================================================================= +HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::newHypothesis() +{ + HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + HOMARD_Hypothesis_i* aServant = new HOMARD_Hypothesis_i(_orb, engine); + HOMARD::HOMARD_Hypothesis_var aHypo = HOMARD::HOMARD_Hypothesis::_narrow(aServant->_this()); + return aHypo._retn(); +} +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::newIteration() +{ + HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + HOMARD_Iteration_i* aServant = new HOMARD_Iteration_i(_orb, engine); + HOMARD::HOMARD_Iteration_var aIter = HOMARD::HOMARD_Iteration::_narrow(aServant->_this()); + return aIter._retn(); +} +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::newBoundary() +{ + HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + HOMARD_Boundary_i* aServant = new HOMARD_Boundary_i(_orb, engine); + HOMARD::HOMARD_Boundary_var aBoundary = HOMARD::HOMARD_Boundary::_narrow(aServant->_this()); + return aBoundary._retn(); +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::newZone() +{ + HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + HOMARD_Zone_i* aServant = new HOMARD_Zone_i(_orb, engine); + HOMARD::HOMARD_Zone_var aZone = HOMARD::HOMARD_Zone::_narrow(aServant->_this()); + return aZone._retn(); +} +//============================================================================= +//============================================================================= + +//============================================================================= +//============================================================================= +// Creation des structures identifiees par leurs noms +//============================================================================= //============================================================================= HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase(const char* nomCas, const char* MeshName, const char* MeshFile) { @@ -486,20 +986,29 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase(const char* nomCas, const char* if ((myContextMap[GetCurrentStudyID()]._mesCas).find(nomCas)!=(myContextMap[GetCurrentStudyID()]._mesCas).end()) { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This case has already been defined"; - throw SALOME::SALOME_Exception(es); - return 0; + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This case has already been defined"; + throw SALOME::SALOME_Exception(es); + return 0; }; + int existe = MEDFileExist ( MeshFile ) ; + if ( existe == 0 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The mesh file does not exist."; + throw SALOME::SALOME_Exception(es); + return 0; + } + HOMARD::HOMARD_Cas_var myCase = newCase(); myCase->SetName(nomCas); SALOMEDS::SObject_var aSO; PublishInStudy(myCurrentStudy, aSO, myCase, nomCas); myContextMap[GetCurrentStudyID()]._mesCas[nomCas] = myCase; - std::vector LesExtremes =GetBoundingBoxInMedFile(MeshFile); HOMARD::extrema_var aSeq = new HOMARD::extrema(); if (LesExtremes.size()!=10) { return false; } @@ -520,93 +1029,37 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase(const char* nomCas, const char* // Recherche d'un nom pour l'iteration 0. Par defaut, on prend le nom // du maillage du cas. Si ce nom existe deja, on incremente avec 0, 1, 2, etc. int monNum=0; - std::string nomIter = std::string(MeshName) ; - while ((myContextMap[GetCurrentStudyID()]._mesIterations).find(nomIter) != (myContextMap[GetCurrentStudyID()]._mesIterations.end())) + std::string NomIteration = std::string(MeshName) ; + while ((myContextMap[GetCurrentStudyID()]._mesIterations).find(NomIteration) != (myContextMap[GetCurrentStudyID()]._mesIterations.end())) { std::ostringstream nom; nom << MeshName << monNum; - nomIter=nom.str(); + NomIteration=nom.str(); monNum = monNum+1; } - MESSAGE ( "CreateCase : nomIter = " << nomIter ); - - HOMARD::HOMARD_Iteration_var anIter = newIteration(); - myContextMap[GetCurrentStudyID()]._mesIterations[nomIter] = anIter; - std::ostringstream DirName; - DirName << "I_00"; - - anIter->SetDirName(DirName.str().c_str()); - anIter->SetName(nomIter.c_str()); - anIter->SetMeshFile(MeshFile); - anIter->SetMeshName(MeshName); - anIter->SetNumber(0); + MESSAGE ( "CreateCase : NomIteration = " << NomIteration ); - AssociateCaseIter (nomCas,nomIter.c_str(),"IterationHomard"); - SetEtatIter(nomIter.c_str(),true); -// - PublishResultInSmesh(MeshFile, 0); - -// Valeurs par defaut des filtrages - myCase->SetPyram(0); - - return HOMARD::HOMARD_Cas::_duplicate(myCase); -} - -//============================================================================= -HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::GetCase(const char* nomCas) -{ - IsValidStudy () ; - HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas]; - if (CORBA::is_nil(myCase)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid Case"; - throw SALOME::SALOME_Exception(es); - return 0; - }; - - return HOMARD::HOMARD_Cas::_duplicate(myCase); -} - -//============================================================================= -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::GetZone(const char* ZoneName) -{ - IsValidStudy () ; - HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName]; - ASSERT(!CORBA::is_nil(myZone)); - return HOMARD::HOMARD_Zone::_duplicate(myZone); -} + HOMARD::HOMARD_Iteration_var anIter = newIteration(); + myContextMap[GetCurrentStudyID()]._mesIterations[NomIteration] = anIter; + std::ostringstream DirName; + DirName << "I_00"; -//============================================================================= -HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::GetHypothesis(const char* nomHypothesis) -{ - MESSAGE ( "GetHypothesis : nomHypothesis = " << nomHypothesis ); - IsValidStudy () ; - MESSAGE ( "GetHypothesis : GetCurrentStudyID() = " << GetCurrentStudyID() ); - HOMARD::HOMARD_Hypothesis_var myHypothesis = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypothesis]; - ASSERT(!CORBA::is_nil(myHypothesis)); - return HOMARD::HOMARD_Hypothesis::_duplicate(myHypothesis); -} + anIter->SetDirName(DirName.str().c_str()); + anIter->SetName(NomIteration.c_str()); + anIter->SetMeshFile(MeshFile); + anIter->SetMeshName(MeshName); + anIter->SetNumber(0); -//============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::GetIteration(const char* nomIteration) -{ - IsValidStudy () ; - HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIteration]; - ASSERT(!CORBA::is_nil(myIteration)); - return HOMARD::HOMARD_Iteration::_duplicate(myIteration); -} -//============================================================================= -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::GetBoundary(const char* nomBoundary) -{ - IsValidStudy () ; + AssociateCaseIter (nomCas,NomIteration.c_str(),"IterationHomard"); + SetEtatIter(NomIteration.c_str(),true); +// + PublishResultInSmesh(MeshFile, 0); - HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[nomBoundary]; - ASSERT(!CORBA::is_nil(myBoundary)); - return HOMARD::HOMARD_Boundary::_duplicate(myBoundary); -} +// Valeurs par defaut des filtrages + myCase->SetPyram(0); + return HOMARD::HOMARD_Cas::_duplicate(myCase); +} //============================================================================= HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::CreateHypothesis(const char* nomHypothesis) { @@ -637,11 +1090,11 @@ HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::CreateHypothesis(const char* nomHypo return HOMARD::HOMARD_Hypothesis::_duplicate(myHypothesis); } -//============================================================================================================ -HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* nomIteration, const char* nomIterParent) -//============================================================================================================ +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIteration, const char* nomIterParent) +//============================================================================= { - MESSAGE ("CreateIteration : nomIteration = " << nomIteration << "nomIterParent = " << nomIterParent); + MESSAGE ("CreateIteration : NomIteration = " << NomIteration << ", nomIterParent = " << nomIterParent); IsValidStudy () ; HOMARD::HOMARD_Iteration_var myIterationParent = myContextMap[GetCurrentStudyID()]._mesIterations[nomIterParent]; @@ -666,7 +1119,7 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* nomIterat return 0; }; - if ((myContextMap[GetCurrentStudyID()]._mesIterations).find(nomIteration)!=(myContextMap[GetCurrentStudyID()]._mesIterations).end()) + if ((myContextMap[GetCurrentStudyID()]._mesIterations).find(NomIteration)!=(myContextMap[GetCurrentStudyID()]._mesIterations).end()) { SALOME::ExceptionStruct es; es.type = SALOME::BAD_PARAM; @@ -684,10 +1137,10 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* nomIterat throw SALOME::SALOME_Exception(es); return 0; }; - myContextMap[GetCurrentStudyID()]._mesIterations[std::string(nomIteration)] = myIteration; + myContextMap[GetCurrentStudyID()]._mesIterations[std::string(NomIteration)] = myIteration; // Nom de l'iteration et du maillage - myIteration->SetName(nomIteration); - myIteration->SetMeshName(nomIteration); + myIteration->SetName(NomIteration); + myIteration->SetMeshName(NomIteration); int numero = myIterationParent->GetNumber() + 1; myIteration->SetNumber(numero); @@ -703,9 +1156,9 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* nomIterat // Le nom du fichier du maillage MED est indice par le nombre d'iterations du cas. // Si on a une chaine unique depuis le depart, ce nombre est le meme que le -// numero d'iteration dans la sucession : maill.01.med, maill.02.med, etc... C'est le -// cas le plus frequent. -// Si on a plusieurs branches, donc des iterations a meme niveau d'adaptation, utiliser +// numero d'iteration dans la sucession : maill.01.med, maill.02.med, etc... C'est la +// situation la plus frequente. +// Si on a plusieurs branches, donc des iterations du meme niveau d'adaptation, utiliser // le nombre d'iterations du cas permet d'eviter les collisions. std::stringstream MeshFile; const char* nomDir = myCase->GetDirName(); @@ -714,15 +1167,13 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* nomIterat // Association avec le cas std::string label = "IterationHomard_" + std::string(nomIterParent); - AssociateCaseIter(nomCas, nomIteration, label.c_str()); -// Association avec l'iteration precedente - myIterationParent->AddIteration(nomIteration); + AssociateCaseIter(nomCas, NomIteration, label.c_str()); +// Lien avec l'iteration precedente + myIterationParent->LinkNextIteration(NomIteration); myIteration->SetIterParentName(nomIterParent); return HOMARD::HOMARD_Iteration::_duplicate(myIteration); } - - //============================================================================= HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundary(const char* BoundaryName, CORBA::Long BoundaryType) { @@ -782,8 +1233,6 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundarySphere(const char* Bound return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; } - - //============================================================================= HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZone(const char* ZoneName, CORBA::Long ZoneType) { @@ -956,17 +1405,22 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneDiskWithHole(const char* ZoneNam return HOMARD::HOMARD_Zone::_duplicate(myZone) ; } +//============================================================================= +//============================================================================= //============================================================================= -CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMenage) +//============================================================================= +// Calcul d'une iteration +//============================================================================= +//============================================================================= +CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMenage) { - MESSAGE ( "Compute : calcul de " << nomIteration ); - IsValidStudy () ; + MESSAGE ( "Compute : calcul de " << NomIteration ); - HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIteration]; + HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[NomIteration]; ASSERT(!CORBA::is_nil(myIteration)); // on ne calcule pas l iteration 0 @@ -993,21 +1447,12 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMena HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypo]; ASSERT(!CORBA::is_nil(myHypo)); - // A.4. L'iteration parent const char* nomIterationParent = myIteration->GetIterParentName(); HOMARD::HOMARD_Iteration_var myIterationParent = myContextMap[GetCurrentStudyID()]._mesIterations[nomIterationParent]; ASSERT(!CORBA::is_nil(myIterationParent)); if ( ! myIterationParent->GetEtat() ) { - /* - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text = "The iteration cannot be computed because the previous iteration " + std::string(nomIterationParent) + " is not valid."; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - return 0; - */ int codret = Compute(nomIterationParent, etatMenage); if (codret != 0) { @@ -1033,16 +1478,16 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMena // B. Les repertoires // B.1. Le repertoire du cas - const char* nomDir = myCase->GetDirName(); - MESSAGE ( ". nomDir = " << nomDir ); + const char* nomDirCase = myCase->GetDirName(); + MESSAGE ( ". nomDirCase = " << nomDirCase ); // B.2. Le sous-repertoire de l'iteration a calculer, puis le repertoire complet a creer // B.2.1. Le nom du sous-repertoire - const char* nomDirIt = myIteration->GetDirName(); + const char* nomDirIt = myIteration->GetDirName(); // B.2.2. Le nom complet du sous-repertoire std::stringstream DirCompute ; - DirCompute << nomDir << "/" << nomDirIt; + DirCompute << nomDirCase << "/" << nomDirIt; MESSAGE (". DirCompute = " << DirCompute.str() ); // B.2.3. Si le sous-repertoire n'existe pas, on le cree @@ -1110,7 +1555,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMena else { nomDirItPa = myIterationParent->GetDirName(); - DirComputePa << nomDir << "/" << nomDirItPa; + DirComputePa << nomDirCase << "/" << nomDirItPa; } MESSAGE( ". nomDirItPa = " << nomDirItPa); MESSAGE( ". DirComputePa = " << DirComputePa.str() ); @@ -1173,7 +1618,6 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMena codret = 0 ; }; - // D.4. Les types de raffinement et de deraffinement // Les appels corba sont lourds, il vaut mieux les grouper HOMARD::listeTypes* ListTypes = myHypo->GetAdapRefinUnRef(); @@ -1435,12 +1879,12 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMena MESSAGE ( "Erreur en executant HOMARD : " << codretexec ); if (codretexec == 0) { - SetEtatIter(nomIteration,true); + SetEtatIter(NomIteration,true); } else { // GERALD -- QMESSAGE BOX - SetEtatIter(nomIteration,false); + SetEtatIter(NomIteration,false); } } @@ -1450,7 +1894,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMena // H.1. Le fichier des messages, dans tous les cas std::stringstream saux1 ; saux1 << "Mess " << NumeIter ; - PublishFileUnderIteration(nomIteration, MessFile.c_str(), saux1.str().c_str()); + PublishFileUnderIteration(NomIteration, MessFile.c_str(), saux1.str().c_str()); // H.2. Si tout s'est bien passe : if (codretexec == 0) @@ -1459,11 +1903,11 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMena std::stringstream saux2 ; saux2 << "Summary " << NumeIter ; std::string SummaryFile = DirCompute.str() + "/apad." + siterp1 + ".bilan" ; - PublishFileUnderIteration(nomIteration, SummaryFile.c_str(), saux2.str().c_str()); + PublishFileUnderIteration(NomIteration, SummaryFile.c_str(), saux2.str().c_str()); // H.2.2. Le fichier de maillage obtenu std::stringstream saux0 ; saux0 <<"Iteration " << NumeIter ; - PublishFileUnderIteration(nomIteration, MeshFile, saux0.str().c_str()); + PublishFileUnderIteration(NomIteration, MeshFile, saux0.str().c_str()); PublishResultInSmesh(MeshFile, 1); } // H.3 Message d'erreur en cas de probleme @@ -1487,15 +1931,21 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMena } } - // I. Menage + // I. Menage et retour dans le repertoire du cas if (codret == 0) { delete myDriver; + chdir(nomDirCase); } - // + return codretexec ; } +//=========================================================================== +//=========================================================================== +//=========================================================================== +// Publications +//=========================================================================== //=========================================================================== SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject, @@ -1560,11 +2010,11 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishCaseInStudy(SALOMEDS::Study_ptr theSt SALOMEDS::GenericAttribute_var anAttr; if (CORBA::is_nil(theObject)) { - MESSAGE("HOMARD_Gen_i.cxx::theObject->_is_nil()"); + MESSAGE("HOMARD_Gen_i::theObject->_is_nil()"); return aResultSO._retn(); } if (theStudy->_is_nil()) { - MESSAGE("HOMARD_Gen_i.cxx::theStudy->_is_nil()"); + MESSAGE("HOMARD_Gen_i::theStudy->_is_nil()"); return aResultSO._retn(); } @@ -1592,18 +2042,18 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theSt if (CORBA::is_nil(theObject)) { - MESSAGE("HOMARD_Gen_i.cxx::theObject->_is_nil()"); + MESSAGE("PublishZoneInStudy : theObject->_is_nil()"); return aResultSO._retn(); } if (theStudy->_is_nil()) { - MESSAGE("HOMARD_Gen_i.cxx::theStudy->_is_nil()"); + MESSAGE("PublishZoneInStudy : theStudy->_is_nil()"); return aResultSO._retn(); } SALOMEDS::SComponent_var theFatherHomard = theStudy->FindComponent(ComponentDataType()); if (theFatherHomard->_is_nil()) { - MESSAGE("theFatherHomard->_is_nil()"); + MESSAGE("PublishZoneInStudy : theFatherHomard->_is_nil()"); return aResultSO._retn(); } @@ -1798,100 +2248,31 @@ void HOMARD_Gen_i::PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder, } }; -//============================================================================= -HOMARD::listeCases* HOMARD_Gen_i::GetAllCasesName() -{ - MESSAGE("GetAllCasesName"); - IsValidStudy () ; - - HOMARD::listeCases_var ret = new HOMARD::listeCases; - ret->length(myContextMap[GetCurrentStudyID()]._mesCas.size()); - std::map::const_iterator it; - int i = 0; - for (it = myContextMap[GetCurrentStudyID()]._mesCas.begin(); - it != myContextMap[GetCurrentStudyID()]._mesCas.end(); it++) - { - ret[i++] = CORBA::string_dup((*it).first.c_str()); - } - - return ret._retn(); -} - -//============================================================================= -HOMARD::listeHypotheses* HOMARD_Gen_i::GetAllHypothesesName() -{ - MESSAGE("GetAllHypothesesName"); - IsValidStudy () ; - - HOMARD::listeHypotheses_var ret = new HOMARD::listeHypotheses; - ret->length(myContextMap[GetCurrentStudyID()]._mesHypotheses.size()); - std::map::const_iterator it; - int i = 0; - for (it = myContextMap[GetCurrentStudyID()]._mesHypotheses.begin(); - it != myContextMap[GetCurrentStudyID()]._mesHypotheses.end(); it++) - { - ret[i++] = CORBA::string_dup((*it).first.c_str()); - } - - return ret._retn(); -} - -//============================================================================= -HOMARD::listeZones* HOMARD_Gen_i::GetAllZonesName() +//===================================================================================== +void HOMARD_Gen_i::PublishBoundaryUnderCase(const char* CaseName, const char* BoundaryName) { - MESSAGE("GetAllZonesName"); - IsValidStudy () ; - - HOMARD::listeZones_var ret = new HOMARD::listeZones; - ret->length(myContextMap[GetCurrentStudyID()]._mesZones.size()); - std::map::const_iterator it; - int i = 0; - for (it = myContextMap[GetCurrentStudyID()]._mesZones.begin(); - it != myContextMap[GetCurrentStudyID()]._mesZones.end(); it++) - { - ret[i++] = CORBA::string_dup((*it).first.c_str()); - } + MESSAGE ( "PublishBoundaryUnderCase : CaseName = " << CaseName << ", BoundaryName= " << BoundaryName ); - return ret._retn(); -} + HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[CaseName]; + ASSERT(!CORBA::is_nil(myCase)); + SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myCase))); + ASSERT(!CORBA::is_nil(aCaseSO)); -//============================================================================= -HOMARD::listeIterations* HOMARD_Gen_i::GetAllIterationsName() -{ - MESSAGE("GetAllIterationsName"); - IsValidStudy () ; + HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName]; + ASSERT(!CORBA::is_nil(myBoundary)); + SALOMEDS::SObject_var aBoundarySO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myBoundary))); + ASSERT(!CORBA::is_nil(aBoundarySO)); - HOMARD::listeIterations_var ret = new HOMARD::listeIterations; - ret->length(myContextMap[GetCurrentStudyID()]._mesIterations.size()); - std::map::const_iterator it; - int i = 0; - for (it = myContextMap[GetCurrentStudyID()]._mesIterations.begin(); - it != myContextMap[GetCurrentStudyID()]._mesIterations.end(); it++) - { - ret[i++] = CORBA::string_dup((*it).first.c_str()); - } + SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); - return ret._retn(); -} -//============================================================================= -HOMARD::listeBoundarys* HOMARD_Gen_i::GetAllBoundarysName() -{ - MESSAGE("GetAllBoundarysName"); - IsValidStudy () ; + aStudyBuilder->NewCommand(); - HOMARD::listeBoundarys_var ret = new HOMARD::listeBoundarys; - ret->length(myContextMap[GetCurrentStudyID()]._mesBoundarys.size()); - std::map::const_iterator it; - int i = 0; - for (it = myContextMap[GetCurrentStudyID()]._mesBoundarys.begin(); - it != myContextMap[GetCurrentStudyID()]._mesBoundarys.end(); it++) - { - ret[i++] = CORBA::string_dup((*it).first.c_str()); - } + SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aCaseSO); + aStudyBuilder->Addreference(aSubSO, aBoundarySO); - return ret._retn(); -} + aStudyBuilder->CommitCommand(); +}; //============================================================================= void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long IconeType) { @@ -1965,7 +2346,7 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long IconeTy //============================================================================= void HOMARD_Gen_i::DeleteResultInSmesh(const char* NomFich, const char* MeshName) { - MESSAGE (" DeleteResultInSmesh pour "<< NomFich << "et le maillage "<< MeshName); + MESSAGE (" DeleteResultInSmesh pour le maillage " << MeshName << " dans le fichier " << NomFich ); if (CORBA::is_nil(myCurrentStudy)) { SALOME::ExceptionStruct es; @@ -2058,29 +2439,14 @@ void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* No aStudyBuilder->CommitCommand(); } - -//===================================================================================== -void HOMARD_Gen_i::IsValidStudy( ) -//===================================================================================== -{ - MESSAGE( "IsValidStudy" ); - if (CORBA::is_nil(myCurrentStudy)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid Study Context"; - throw SALOME::SALOME_Exception(es); - }; - return ; -} - -//=========================================================================== +//============================================================================= +//============================================================================= // +//============================================================================= +//============================================================================= // Next functions are inherited from SALOMEDS::Driver interface -// -//=========================================================================== - -//=========================================================================== +//============================================================================= +//============================================================================= SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, const char* theURL, CORBA::Boolean isMultiFile) @@ -2473,49 +2839,6 @@ PortableServer::ServantBase_var HOMARD_Gen_i::GetServant(CORBA::Object_ptr theOb return aServant; } -//=========================================================================== -HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::newCase() -{ - HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); - HOMARD_Cas_i* aServant = new HOMARD_Cas_i(_orb, engine); - HOMARD::HOMARD_Cas_var aCase = HOMARD::HOMARD_Cas::_narrow(aServant->_this()); - return aCase._retn(); -} - -//=========================================================================== -HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::newHypothesis() -{ - HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); - HOMARD_Hypothesis_i* aServant = new HOMARD_Hypothesis_i(_orb, engine); - HOMARD::HOMARD_Hypothesis_var aHypo = HOMARD::HOMARD_Hypothesis::_narrow(aServant->_this()); - return aHypo._retn(); -} - -//=========================================================================== -HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::newIteration() -{ - HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); - HOMARD_Iteration_i* aServant = new HOMARD_Iteration_i(_orb, engine); - HOMARD::HOMARD_Iteration_var aIter = HOMARD::HOMARD_Iteration::_narrow(aServant->_this()); - return aIter._retn(); -} - -//=========================================================================== -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::newBoundary() -{ - HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); - HOMARD_Boundary_i* aServant = new HOMARD_Boundary_i(_orb, engine); - HOMARD::HOMARD_Boundary_var aBoundary = HOMARD::HOMARD_Boundary::_narrow(aServant->_this()); - return aBoundary._retn(); -} -//=========================================================================== -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::newZone() -{ - HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); - HOMARD_Zone_i* aServant = new HOMARD_Zone_i(_orb, engine); - HOMARD::HOMARD_Zone_var aZone = HOMARD::HOMARD_Zone::_narrow(aServant->_this()); - return aZone._retn(); -} //========================================================================== Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, CORBA::Boolean isPublished, @@ -2534,7 +2857,7 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, std::string aScript = "\"\"\"\n"; aScript += "Python script for HOMARD\n"; - aScript += "Copyright EDF-R&D 2010\n"; + aScript += "Copyright EDF-R&D 2013\n"; aScript += "\"\"\"\n"; aScript += "__revision__ = \"V1.2\"\n"; aScript += "import HOMARD\n"; @@ -2564,7 +2887,7 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, CORBA::String_var dumpCorbaBoundary = maBoundary->GetDumpPython(); std::string dumpBoundary = dumpCorbaBoundary.in(); MESSAGE (dumpBoundary<<"\n"); - aScript+=dumpBoundary; + aScript += dumpBoundary; } @@ -2582,13 +2905,16 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, CORBA::String_var dumpCorbaZone = maZone->GetDumpPython(); std::string dumpZone = dumpCorbaZone.in(); MESSAGE (dumpZone<<"\n"); - aScript+=dumpZone; + aScript += dumpZone; } - MESSAGE (". Ecritures des hypotheses"); - aScript += "#\n# Creation of the hypotheses"; - aScript += "\n# =========================="; + if (myContextMap[GetCurrentStudyID()]._mesHypotheses.size() > 0) + { + MESSAGE (". Ecritures des hypotheses"); + aScript += "#\n# Creation of the hypotheses"; + aScript += "\n# =========================="; + } std::map::const_iterator it_hypo; for ( it_hypo = myContextMap[GetCurrentStudyID()]._mesHypotheses.begin(); it_hypo != myContextMap[GetCurrentStudyID()]._mesHypotheses.end(); it_hypo++) @@ -2597,13 +2923,16 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, CORBA::String_var dumpCorbaHypo = monHypo->GetDumpPython(); std::string dumpHypo = dumpCorbaHypo.in(); MESSAGE (dumpHypo<<"\n"); - aScript+=dumpHypo; + aScript += dumpHypo; } - MESSAGE (". Ecritures des cas"); - aScript += "#\n# Creation of the cases"; - aScript += "\n# ====================="; + if (myContextMap[GetCurrentStudyID()]._mesCas.size() > 0) + { + MESSAGE (". Ecritures des cas"); + aScript += "#\n# Creation of the cases"; + aScript += "\n# ====================="; + } std::map::const_iterator it_cas; for (it_cas = myContextMap[GetCurrentStudyID()]._mesCas.begin(); it_cas != myContextMap[GetCurrentStudyID()]._mesCas.end(); it_cas++) @@ -2628,13 +2957,16 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, std::string dumpCas2= dumpCorbaCase.in(); MESSAGE (dumpCas< 0) + { + MESSAGE (". Ecritures des iterations"); + aScript += "#\n# Creation of the iterations" ; + aScript += "\n# =========================="; + } std::map::const_iterator it_iter; for (it_iter = myContextMap[GetCurrentStudyID()]._mesIterations.begin(); it_iter != myContextMap[GetCurrentStudyID()]._mesIterations.end(); ++it_iter) @@ -2643,31 +2975,69 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, CORBA::String_var dumpCorbaIter = aIter->GetDumpPython(); std::string dumpIter = dumpCorbaIter.in(); MESSAGE (dumpIter<<"\n"); - aScript+=dumpIter; + aScript += dumpIter; } - MESSAGE (". Ecritures finales"); - if( isMultiFile ) - aScript += "\n\tpass"; - aScript += "\n"; + MESSAGE (". Ecritures finales"); + if( isMultiFile ) + aScript += "\n\tpass"; + aScript += "\n"; - if( !isMultiFile ) // remove unnecessary tabulation - aScript = RemoveTabulation( aScript ); + if( !isMultiFile ) // remove unnecessary tabulation + aScript = RemoveTabulation( aScript ); -/* MESSAGE ("A ecrire \n"<::const_iterator it; + for (it = myContextMap[GetCurrentStudyID()]._mesCas.begin(); + it != myContextMap[GetCurrentStudyID()]._mesCas.end(); it++) + { + if (std::string(nomDir) == std::string(it->second->GetDirName())) return false; + } + return true; +} +/*//============================================================================= +void SALOMEException( std::string message ) +{ + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = message; + throw SALOME::SALOME_Exception(es); + return ; +}*/ +//============================================================================= char* HOMARD_Gen_i::getVersion() { #if HOMARD_DEVELOPMENT diff --git a/src/HOMARD_I/HOMARD_Gen_i.hxx b/src/HOMARD_I/HOMARD_Gen_i.hxx index c0ee27f9..5d9033f4 100644 --- a/src/HOMARD_I/HOMARD_Gen_i.hxx +++ b/src/HOMARD_I/HOMARD_Gen_i.hxx @@ -52,13 +52,25 @@ public: virtual ~HOMARD_Gen_i(); - SALOMEDS::Study_ptr GetCurrentStudy(); - void SetCurrentStudy(SALOMEDS::Study_ptr theStudy); - CORBA::Long GetCurrentStudyID(); +// Generalites + +// Les creations + HOMARD::HOMARD_Boundary_ptr CreateBoundary (const char* nomBoundary, CORBA::Long typeBoundary); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryDi (const char* nomBoundary, + const char* MeshName, const char* FileName); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryCylinder (const char* nomBoundary, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, + CORBA::Double Rayon); + HOMARD::HOMARD_Boundary_ptr CreateBoundarySphere (const char* nomBoundary, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Rayon); HOMARD::HOMARD_Cas_ptr CreateCase (const char* nomCas, const char* MeshName, const char* FileName); + HOMARD::HOMARD_Hypothesis_ptr CreateHypothesis(const char* nomHypothesis); + HOMARD::HOMARD_Iteration_ptr CreateIteration (const char* nomIter, const char* nomIterParent); HOMARD::HOMARD_Zone_ptr CreateZone (const char* nomZone, CORBA::Long typeZone); @@ -66,20 +78,14 @@ public: CORBA::Double Xmini, CORBA::Double Xmaxi, CORBA::Double Ymini, CORBA::Double Ymaxi, CORBA::Double Zmini, CORBA::Double Zmaxi); - HOMARD::HOMARD_Zone_ptr CreateZoneSphere (const char* nomZone, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon); - HOMARD::HOMARD_Zone_ptr CreateZoneCylinder (const char* nomZone, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, - CORBA::Double Rayon, CORBA::Double Haut); - HOMARD::HOMARD_Zone_ptr CreateZonePipe (const char* nomZone, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, - CORBA::Double Rayon, CORBA::Double Haut, CORBA::Double Rayonint); HOMARD::HOMARD_Zone_ptr CreateZoneBox2D (const char* nomZone, CORBA::Double Umini, CORBA::Double Umaxi, CORBA::Double Vmini, CORBA::Double Vmaxi, CORBA::Long Orient); + HOMARD::HOMARD_Zone_ptr CreateZoneCylinder (const char* nomZone, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, + CORBA::Double Rayon, CORBA::Double Haut); HOMARD::HOMARD_Zone_ptr CreateZoneDisk (const char* nomZone, CORBA::Double Ucentre, CORBA::Double Vcentre, CORBA::Double Rayon, @@ -88,41 +94,55 @@ public: CORBA::Double Ucentre, CORBA::Double Vcentre, CORBA::Double Rayon, CORBA::Double Rayonint, CORBA::Long Orient); - - HOMARD::HOMARD_Boundary_ptr CreateBoundary (const char* nomBoundary, CORBA::Long typeBoundary); - HOMARD::HOMARD_Boundary_ptr CreateBoundaryDi (const char* nomBoundary, - const char* MeshName, const char* FileName); - HOMARD::HOMARD_Boundary_ptr CreateBoundaryCylinder (const char* nomBoundary, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, - CORBA::Double Rayon); - HOMARD::HOMARD_Boundary_ptr CreateBoundarySphere (const char* nomBoundary, + HOMARD::HOMARD_Zone_ptr CreateZonePipe (const char* nomZone, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Rayon); + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, + CORBA::Double Rayon, CORBA::Double Haut, CORBA::Double Rayonint); + HOMARD::HOMARD_Zone_ptr CreateZoneSphere (const char* nomZone, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon); +// Les informations + HOMARD::HOMARD_Boundary_ptr GetBoundary (const char* nomBoundary); HOMARD::HOMARD_Cas_ptr GetCase (const char* nomCas); - HOMARD::HOMARD_Zone_ptr GetZone (const char* nomZone); HOMARD::HOMARD_Hypothesis_ptr GetHypothesis (const char* nomHypothesis); HOMARD::HOMARD_Iteration_ptr GetIteration (const char* nomIteration); - HOMARD::HOMARD_Boundary_ptr GetBoundary (const char* nomBoundary); + HOMARD::HOMARD_Zone_ptr GetZone (const char* nomZone); - void AssociateCaseIter(const char* nomCas, const char* nomIter, - const char* labelIter); - void AssociateIterHypo(const char* nomIter, const char* nomHypothesis); - void DissociateHypoZone(const char* nomZone, const char* nomHypothesis); + HOMARD::listeBoundarys* GetAllBoundarysName(); + HOMARD::listeCases* GetAllCasesName(); + HOMARD::listeHypotheses* GetAllHypothesesName(); + HOMARD::listeIterations* GetAllIterationsName(); + HOMARD::listeZones* GetAllZonesName(); + HOMARD::HOMARD_Iteration_ptr LastIteration (const char* nomCas); + +// L'etude + SALOMEDS::Study_ptr GetCurrentStudy(); + void SetCurrentStudy(SALOMEDS::Study_ptr theStudy); + CORBA::Long GetCurrentStudyID(); + +// Liens entre structures void InvalideBoundary(const char* nomBoundary); - void InvalideZone(const char* nomZone); void InvalideHypo(const char* nomHypo); void InvalideIter(const char* nomIter); + void InvalideZone(const char* nomZone); - void SetEtatIter(const char* nomIter,const CORBA::Boolean EtatCalcul); + CORBA::Long DeleteBoundary(const char* nomBoundary); + CORBA::Long DeleteCase(const char* nomCas); + CORBA::Long DeleteHypo(const char* nomHypothesis); + CORBA::Long DeleteIteration(const char* nomIter); + CORBA::Long DeleteIterationOption(const char* nomIter, CORBA::Long Option); + CORBA::Long DeleteZone(const char* nomZone); - HOMARD::listeCases* GetAllCasesName(); - HOMARD::listeHypotheses* GetAllHypothesesName(); - HOMARD::listeZones* GetAllZonesName(); - HOMARD::listeIterations* GetAllIterationsName(); - HOMARD::listeBoundarys* GetAllBoundarysName(); + void AssociateIterHypo(const char* nomIter, const char* nomHypothesis); + + void AssociateHypoZone(const char* nomHypothesis, const char* nomZone, CORBA::Long TypeUse); + void DissociateHypoZone(const char* nomHypothesis, const char* nomZone); + + void AssociateCaseIter(const char* nomCas, const char* nomIter, + const char* labelIter); + + void SetEtatIter(const char* nomIter,const CORBA::Boolean EtatCalcul); CORBA::Long Compute(const char* nomIteration, CORBA::Long etatMenage); CORBA::Boolean VerifieDir(const char* nomDir); @@ -131,6 +151,7 @@ public: void DeleteResultInSmesh(const char* NomFich, const char* MeshName); void PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire); + void PublishBoundaryUnderCase(const char* CaseName, const char* BoundaryName); void IsValidStudy(); @@ -191,6 +212,7 @@ public: CORBA::Long theObjectID, SALOMEDS::SObject_ptr theObject); +// virtual void SALOMEException( std::string message ); private: void addInStudy(SALOMEDS::Study_ptr theStudy); @@ -207,7 +229,8 @@ private: virtual void PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder, SALOMEDS::SObject_var aResultSO, const char* theName, const char* value, const char* icone, const char* ior); - PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject); + +PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject); HOMARD::HOMARD_Cas_ptr newCase(); HOMARD::HOMARD_Hypothesis_ptr newHypothesis(); diff --git a/src/HOMARD_I/HOMARD_Hypothesis_i.cxx b/src/HOMARD_I/HOMARD_Hypothesis_i.cxx index adec5d80..3cc0a6c5 100644 --- a/src/HOMARD_I/HOMARD_Hypothesis_i.cxx +++ b/src/HOMARD_I/HOMARD_Hypothesis_i.cxx @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #include "HOMARD_Hypothesis_i.hxx" #include "HOMARD_Gen_i.hxx" @@ -58,17 +67,16 @@ HOMARD_Hypothesis_i::HOMARD_Hypothesis_i( CORBA::ORB_ptr orb, HOMARD_Hypothesis_i::~HOMARD_Hypothesis_i() { } - //============================================================================= -/*! - */ +//============================================================================= +// Generalites +//============================================================================= //============================================================================= void HOMARD_Hypothesis_i::SetName( const char* Name ) { ASSERT( myHomardHypothesis ); myHomardHypothesis->SetName( Name ); } - //============================================================================= char* HOMARD_Hypothesis_i::GetName() { @@ -76,31 +84,33 @@ char* HOMARD_Hypothesis_i::GetName() return CORBA::string_dup( myHomardHypothesis->GetName().c_str() ); } //============================================================================= -/*! - */ -//============================================================================= -void HOMARD_Hypothesis_i::SetCaseCreation( const char* NomCaseCreation ) +CORBA::Long HOMARD_Hypothesis_i::Delete() { ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetCaseCreation( NomCaseCreation ); + char* HypoName = GetName() ; + MESSAGE ( "Delete : destruction de l'hypothese " << HypoName ); + return _gen_i->DeleteHypo(HypoName) ; } - //============================================================================= -char* HOMARD_Hypothesis_i::GetCaseCreation() +char* HOMARD_Hypothesis_i::GetDumpPython() { ASSERT( myHomardHypothesis ); - return CORBA::string_dup( myHomardHypothesis->GetCaseCreation().c_str() ); + return CORBA::string_dup( myHomardHypothesis->GetDumpPython().c_str() ); } //============================================================================= -char* HOMARD_Hypothesis_i::GetDumpPython() +std::string HOMARD_Hypothesis_i::Dump() const { - ASSERT( myHomardHypothesis ); - return CORBA::string_dup( myHomardHypothesis->GetDumpPython().c_str() ); + return HOMARD::Dump( *myHomardHypothesis ); } - //============================================================================= -/*! - */ +bool HOMARD_Hypothesis_i::Restore( const std::string& stream ) +{ + return HOMARD::Restore( *myHomardHypothesis, stream ); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= //============================================================================= void HOMARD_Hypothesis_i::SetAdapRefinUnRef( CORBA::Long TypeAdap,CORBA::Long TypeRaff, CORBA::Long TypeDera ) { @@ -108,7 +118,6 @@ void HOMARD_Hypothesis_i::SetAdapRefinUnRef( CORBA::Long TypeAdap,CORBA::Long Ty myHomardHypothesis->SetAdapType( TypeAdap ); myHomardHypothesis->SetRefinTypeDera( TypeRaff, TypeDera ); } - //============================================================================= HOMARD::listeTypes* HOMARD_Hypothesis_i::GetAdapRefinUnRef() { @@ -138,36 +147,22 @@ CORBA::Long HOMARD_Hypothesis_i::GetUnRefType() ASSERT( myHomardHypothesis ); return CORBA::Long( myHomardHypothesis->GetUnRefType() ); } - -//============================================================================= -/*! - */ //============================================================================= void HOMARD_Hypothesis_i::SetField( const char* FieldName ) { myHomardHypothesis->SetField( FieldName ); } //============================================================================= -void HOMARD_Hypothesis_i::SetRefinThr( CORBA::Long TypeThR, CORBA::Double ThreshR ) -{ - myHomardHypothesis->SetRefinThr( TypeThR, ThreshR ); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetUnRefThr( CORBA::Long TypeThC, CORBA::Double ThreshC ) -{ - myHomardHypothesis->SetUnRefThr( TypeThC, ThreshC ); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetUseComp( CORBA::Long UsCmpI ) +char* HOMARD_Hypothesis_i::GetFieldName() { - myHomardHypothesis->SetUseComp( UsCmpI ); + ASSERT( myHomardHypothesis ); + return CORBA::string_dup( myHomardHypothesis->GetFieldName().c_str() ); } //============================================================================= void HOMARD_Hypothesis_i::SetUseField( CORBA::Long UsField ) { myHomardHypothesis->SetUseField( UsField ); } - //============================================================================= HOMARD::InfosHypo* HOMARD_Hypothesis_i::GetField() { @@ -179,14 +174,45 @@ HOMARD::InfosHypo* HOMARD_Hypothesis_i::GetField() aInfosHypo->TypeThC = CORBA::Long( myHomardHypothesis->GetUnRefThrType() ); aInfosHypo->ThreshC = CORBA::Double( myHomardHypothesis->GetThreshC() ); aInfosHypo->UsField = CORBA::Long( myHomardHypothesis->GetUseField() ); - aInfosHypo->UsCmpI = CORBA::Long( myHomardHypothesis->GetUseCompI() ); + aInfosHypo->UsCmpI = CORBA::Long( myHomardHypothesis->GetUseComp() ); return aInfosHypo; } //============================================================================= -char* HOMARD_Hypothesis_i::GetFieldName() +void HOMARD_Hypothesis_i::SetUseComp( CORBA::Long UsCmpI ) +{ + myHomardHypothesis->SetUseComp( UsCmpI ); +} +//============================================================================= +void HOMARD_Hypothesis_i::AddComp( const char* NomComposant ) { ASSERT( myHomardHypothesis ); - return CORBA::string_dup( myHomardHypothesis->GetFieldName().c_str() ); + myHomardHypothesis->AddComp( NomComposant ); +} +//============================================================================= +void HOMARD_Hypothesis_i::SupprComp() +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SupprComp(); +} +//============================================================================= +HOMARD::listeComposantsHypo* HOMARD_Hypothesis_i::GetListComp() +{ + ASSERT( myHomardHypothesis ); + const std::list& ListString = myHomardHypothesis->GetListComp(); + HOMARD::listeComposantsHypo_var aResult = new HOMARD::listeComposantsHypo; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Hypothesis_i::SetRefinThr( CORBA::Long TypeThR, CORBA::Double ThreshR ) +{ + myHomardHypothesis->SetRefinThr( TypeThR, ThreshR ); } //============================================================================= CORBA::Long HOMARD_Hypothesis_i::GetRefinThrType() @@ -195,93 +221,63 @@ CORBA::Long HOMARD_Hypothesis_i::GetRefinThrType() return CORBA::Long( myHomardHypothesis->GetRefinThrType() ); } //============================================================================= +void HOMARD_Hypothesis_i::SetUnRefThr( CORBA::Long TypeThC, CORBA::Double ThreshC ) +{ + myHomardHypothesis->SetUnRefThr( TypeThC, ThreshC ); +} +//============================================================================= CORBA::Long HOMARD_Hypothesis_i::GetUnRefThrType() { ASSERT( myHomardHypothesis ); return CORBA::Long( myHomardHypothesis->GetUnRefThrType() ); } - -/*! - */ //============================================================================= -void HOMARD_Hypothesis_i::AddIteration( const char* NomIteration ) +void HOMARD_Hypothesis_i::SetNivMax( CORBA::Long NivMax ) { - ASSERT(myHomardHypothesis); - myHomardHypothesis->AddIteration( NomIteration ); + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SetNivMax( NivMax ); } - //============================================================================= -void HOMARD_Hypothesis_i::AddZone( const char* NomZone, CORBA::Long TypeUse ) +CORBA::Long HOMARD_Hypothesis_i::GetNivMax() { ASSERT( myHomardHypothesis ); - myHomardHypothesis->AddZone( NomZone, TypeUse ); + return myHomardHypothesis->GetNivMax(); } //============================================================================= -void HOMARD_Hypothesis_i::SupprZone (const char * NomZone) +void HOMARD_Hypothesis_i::SetDiamMin( CORBA::Double DiamMin ) { - ASSERT(myHomardHypothesis); - myHomardHypothesis->SupprZone( NomZone); + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SetDiamMin( DiamMin ); } //============================================================================= -HOMARD::listeZonesHypo* HOMARD_Hypothesis_i::GetZones() +CORBA::Double HOMARD_Hypothesis_i::GetDiamMin() { - ASSERT(myHomardHypothesis); - const std::list& ListString = myHomardHypothesis->GetZones(); - HOMARD::listeZonesHypo_var aResult = new HOMARD::listeZonesHypo; - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); + ASSERT( myHomardHypothesis ); + return myHomardHypothesis->GetDiamMin(); } - //============================================================================= -HOMARD::listeIters* HOMARD_Hypothesis_i::GetIterations() +void HOMARD_Hypothesis_i::SetAdapInit( CORBA::Long AdapInit ) { - ASSERT(myHomardHypothesis); - const std::list& ListString = myHomardHypothesis->GetIterations(); - HOMARD::listeIters_var aResult = new HOMARD::listeIters; - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SetAdapInit( AdapInit ); } - //============================================================================= -void HOMARD_Hypothesis_i::AddComp( const char* NomComposant ) +CORBA::Long HOMARD_Hypothesis_i::GetAdapInit() { ASSERT( myHomardHypothesis ); - myHomardHypothesis->AddComp( NomComposant ); + return myHomardHypothesis->GetAdapInit(); } - //============================================================================= -void HOMARD_Hypothesis_i::SupprComp() +void HOMARD_Hypothesis_i::SetLevelOutput( CORBA::Long LevelOutput ) { ASSERT( myHomardHypothesis ); - myHomardHypothesis->SupprComp(); + myHomardHypothesis->SetLevelOutput( LevelOutput ); } - //============================================================================= -HOMARD::listeComposantsHypo* HOMARD_Hypothesis_i::GetListComp() +CORBA::Long HOMARD_Hypothesis_i::GetLevelOutput() { ASSERT( myHomardHypothesis ); - const std::list& ListString = myHomardHypothesis->GetListComp(); - HOMARD::listeComposantsHypo_var aResult = new HOMARD::listeComposantsHypo; - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); + return myHomardHypothesis->GetLevelOutput(); } //============================================================================= void HOMARD_Hypothesis_i::AddGroup( const char* Group) @@ -316,9 +312,6 @@ HOMARD::ListGroupType* HOMARD_Hypothesis_i::GetGroups() return aResult._retn(); } //============================================================================= -/*! - */ -//============================================================================= void HOMARD_Hypothesis_i::SetTypeFieldInterp( CORBA::Long TypeFieldInterp ) { ASSERT( myHomardHypothesis ); @@ -336,14 +329,12 @@ void HOMARD_Hypothesis_i::AddFieldInterp( const char* FieldInterp ) ASSERT( myHomardHypothesis ); myHomardHypothesis->AddFieldInterp( FieldInterp ); } - //============================================================================= void HOMARD_Hypothesis_i::SupprFieldInterp() { ASSERT( myHomardHypothesis ); myHomardHypothesis->SupprFieldInterp(); } - //============================================================================= HOMARD::listFieldInterpHypo* HOMARD_Hypothesis_i::GetListFieldInterp() { @@ -360,62 +351,81 @@ HOMARD::listFieldInterpHypo* HOMARD_Hypothesis_i::GetListFieldInterp() return aResult._retn(); } //============================================================================= -void HOMARD_Hypothesis_i::SetNivMax( CORBA::Long NivMax ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetNivMax( NivMax ); -} //============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetNivMax() +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Hypothesis_i::SetCaseCreation( const char* NomCaseCreation ) { ASSERT( myHomardHypothesis ); - return myHomardHypothesis->GetNivMax(); + myHomardHypothesis->SetCaseCreation( NomCaseCreation ); } //============================================================================= -void HOMARD_Hypothesis_i::SetDiamMin( CORBA::Double DiamMin ) +char* HOMARD_Hypothesis_i::GetCaseCreation() { ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetDiamMin( DiamMin ); + return CORBA::string_dup( myHomardHypothesis->GetCaseCreation().c_str() ); } //============================================================================= -CORBA::Double HOMARD_Hypothesis_i::GetDiamMin() +void HOMARD_Hypothesis_i::LinkIteration( const char* NomIteration ) { - ASSERT( myHomardHypothesis ); - return myHomardHypothesis->GetDiamMin(); + ASSERT(myHomardHypothesis); + myHomardHypothesis->LinkIteration( NomIteration ); } //============================================================================= -void HOMARD_Hypothesis_i::SetAdapInit( CORBA::Long AdapInit ) +void HOMARD_Hypothesis_i::UnLinkIteration( const char* NomIteration ) { - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetAdapInit( AdapInit ); + ASSERT(myHomardHypothesis); + myHomardHypothesis->UnLinkIteration( NomIteration ); } //============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetAdapInit() +HOMARD::listeIters* HOMARD_Hypothesis_i::GetIterations() { - ASSERT( myHomardHypothesis ); - return myHomardHypothesis->GetAdapInit(); + ASSERT(myHomardHypothesis); + const std::list& ListString = myHomardHypothesis->GetIterations(); + HOMARD::listeIters_var aResult = new HOMARD::listeIters; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); } //============================================================================= -void HOMARD_Hypothesis_i::SetLevelOutput( CORBA::Long LevelOutput ) +void HOMARD_Hypothesis_i::AddZone( const char* NomZone, CORBA::Long TypeUse ) { + MESSAGE ("Dans AddZone pour " << NomZone) ; ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetLevelOutput( LevelOutput ); + char* NomHypo = GetName() ; + return _gen_i->AssociateHypoZone(NomHypo, NomZone, TypeUse) ; } //============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetLevelOutput() +void HOMARD_Hypothesis_i::AddZone0( const char* NomZone, CORBA::Long TypeUse ) { + MESSAGE ("Dans AddZone0 pour " << NomZone) ; ASSERT( myHomardHypothesis ); - return myHomardHypothesis->GetLevelOutput(); + myHomardHypothesis->AddZone( NomZone, TypeUse ); } - //============================================================================= -std::string HOMARD_Hypothesis_i::Dump() const +void HOMARD_Hypothesis_i::SupprZone(const char * NomZone) { - return HOMARD::Dump( *myHomardHypothesis ); + ASSERT(myHomardHypothesis); + myHomardHypothesis->SupprZone( NomZone); } - //============================================================================= -bool HOMARD_Hypothesis_i::Restore( const std::string& stream ) +HOMARD::listeZonesHypo* HOMARD_Hypothesis_i::GetZones() { - return HOMARD::Restore( *myHomardHypothesis, stream ); + ASSERT(myHomardHypothesis); + const std::list& ListString = myHomardHypothesis->GetZones(); + HOMARD::listeZonesHypo_var aResult = new HOMARD::listeZonesHypo; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); } diff --git a/src/HOMARD_I/HOMARD_Hypothesis_i.hxx b/src/HOMARD_I/HOMARD_Hypothesis_i.hxx index 30c898a5..2c92b62d 100644 --- a/src/HOMARD_I/HOMARD_Hypothesis_i.hxx +++ b/src/HOMARD_I/HOMARD_Hypothesis_i.hxx @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #ifndef _HOMARD_HYPOTHESIS_I_HXX_ #define _HOMARD_HYPOTHESIS_I_HXX_ @@ -43,59 +52,73 @@ public: virtual ~HOMARD_Hypothesis_i(); - void SetName( const char* Name ); - char* GetName(); - void SetCaseCreation( const char* NomCaseCreation ); - char* GetCaseCreation(); - char* GetDumpPython(); - - void SetAdapRefinUnRef( CORBA::Long TypeAdap, CORBA::Long TypeRaff, CORBA::Long TypeDera ); - HOMARD::listeTypes* GetAdapRefinUnRef(); - CORBA::Long GetAdapType(); - CORBA::Long GetRefinType(); - CORBA::Long GetUnRefType(); - - void SetField( const char* FieldName ); - char* GetFieldName(); - void SetRefinThr(CORBA::Long TypeThR, CORBA::Double ThreshR); - CORBA::Long GetRefinThrType(); - void SetUnRefThr(CORBA::Long TypeThC, CORBA::Double ThreshC); - CORBA::Long GetUnRefThrType(); - void SetUseComp(CORBA::Long UsCmpI); - void SetUseField(CORBA::Long UsField); - HOMARD::InfosHypo* GetField(); - - void AddIteration( const char* NomIteration ); - void AddZone( const char* NomZone, CORBA::Long TypeUse ); - void SupprZone( const char* NomZone ); - void AddComp( const char* NomComposant ); - void SupprComp(); +// Generalites + void SetName( const char* Name ); + char* GetName(); + + CORBA::Long Delete(); + + char* GetDumpPython(); + + std::string Dump() const; + bool Restore( const std::string& stream ); + +// Caracteristiques + void SetAdapRefinUnRef( CORBA::Long TypeAdap, CORBA::Long TypeRaff, CORBA::Long TypeDera ); + HOMARD::listeTypes* GetAdapRefinUnRef(); + CORBA::Long GetAdapType(); + CORBA::Long GetRefinType(); + CORBA::Long GetUnRefType(); + + void SetField( const char* FieldName ); + char* GetFieldName(); + void SetUseField(CORBA::Long UsField); + HOMARD::InfosHypo* GetField(); + void SetUseComp(CORBA::Long UsCmpI); + void AddComp( const char* NomComposant ); + void SupprComp(); HOMARD::listeComposantsHypo* GetListComp(); - HOMARD::listeIters* GetIterations(); - HOMARD::listeZonesHypo* GetZones(); - void AddGroup( const char* Group); - void SetGroups(const HOMARD::ListGroupType& ListGroup); - HOMARD::ListGroupType* GetGroups(); + void SetRefinThr(CORBA::Long TypeThR, CORBA::Double ThreshR); + CORBA::Long GetRefinThrType(); + void SetUnRefThr(CORBA::Long TypeThC, CORBA::Double ThreshC); + CORBA::Long GetUnRefThrType(); - void SetTypeFieldInterp( CORBA::Long TypeFieldInterp ); - CORBA::Long GetTypeFieldInterp(); - void AddFieldInterp( const char* FieldInterp ); - void SupprFieldInterp(); + void SetNivMax( CORBA::Long NivMax ); + CORBA::Long GetNivMax(); + + void SetDiamMin( CORBA::Double DiamMin ); + CORBA::Double GetDiamMin(); + + void SetAdapInit( CORBA::Long AdapInit ); + CORBA::Long GetAdapInit(); + + void SetLevelOutput( CORBA::Long LevelOutput ); + CORBA::Long GetLevelOutput(); + + void AddGroup( const char* Group); + void SetGroups(const HOMARD::ListGroupType& ListGroup); + HOMARD::ListGroupType* GetGroups(); + + void SetTypeFieldInterp( CORBA::Long TypeFieldInterp ); + CORBA::Long GetTypeFieldInterp(); + void AddFieldInterp( const char* FieldInterp ); + void SupprFieldInterp(); HOMARD::listFieldInterpHypo* GetListFieldInterp(); - void SetNivMax( CORBA::Long NivMax ); - CORBA::Long GetNivMax(); - void SetDiamMin( CORBA::Double DiamMin ); - CORBA::Double GetDiamMin(); - void SetAdapInit( CORBA::Long AdapInit ); - CORBA::Long GetAdapInit(); - void SetLevelOutput( CORBA::Long LevelOutput ); - CORBA::Long GetLevelOutput(); - - std::string Dump() const; - bool Restore( const std::string& stream ); +// Liens avec les autres structures + void SetCaseCreation( const char* NomCaseCreation ); + char* GetCaseCreation(); + + void LinkIteration( const char* NomIteration ); + void UnLinkIteration( const char* NomIteration ); + HOMARD::listeIters* GetIterations(); + + void AddZone( const char* NomZone, CORBA::Long TypeUse ); + void AddZone0( const char* NomZone, CORBA::Long TypeUse ); + void SupprZone( const char* NomZone ); + HOMARD::listeZonesHypo* GetZones(); private: ::HOMARD_Hypothesis* myHomardHypothesis; diff --git a/src/HOMARD_I/HOMARD_Iteration_i.cxx b/src/HOMARD_I/HOMARD_Iteration_i.cxx index a5693f32..295aacca 100644 --- a/src/HOMARD_I/HOMARD_Iteration_i.cxx +++ b/src/HOMARD_I/HOMARD_Iteration_i.cxx @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #include "HOMARD_Iteration_i.hxx" #include "HOMARD_Gen_i.hxx" @@ -60,286 +69,257 @@ HOMARD_Iteration_i::HOMARD_Iteration_i( CORBA::ORB_ptr orb, HOMARD_Iteration_i::~HOMARD_Iteration_i() { } - //============================================================================= -/*! - */ +//============================================================================= +// Generalites +//============================================================================= //============================================================================= void HOMARD_Iteration_i::SetName( const char* Name ) { ASSERT( myHomardIteration ); myHomardIteration->SetName( Name ); } - //============================================================================= char* HOMARD_Iteration_i::GetName() { ASSERT( myHomardIteration ); return CORBA::string_dup( myHomardIteration->GetName().c_str() ); } - +//============================================================================= +CORBA::Long HOMARD_Iteration_i::Delete() +{ + ASSERT( myHomardIteration ); + char* IterName = GetName() ; + MESSAGE ( "Delete : destruction de l'iteration " << IterName ); + return _gen_i->DeleteIteration(IterName) ; +} //============================================================================= char* HOMARD_Iteration_i::GetDumpPython() { ASSERT( myHomardIteration ); return CORBA::string_dup( myHomardIteration->GetDumpPython().c_str() ); } - //============================================================================= -void HOMARD_Iteration_i::SetEtat( CORBA::Boolean Etat ) +std::string HOMARD_Iteration_i::Dump() const { - ASSERT( myHomardIteration ); - myHomardIteration->SetEtat( Etat ); + return HOMARD::Dump( *myHomardIteration ); } - //============================================================================= -CORBA::Boolean HOMARD_Iteration_i::GetEtat() +bool HOMARD_Iteration_i::Restore( const std::string& stream ) { - ASSERT( myHomardIteration ); - return CORBA::Boolean( myHomardIteration->GetEtat()); + return HOMARD::Restore( *myHomardIteration, stream ); } - //============================================================================= -void HOMARD_Iteration_i::SetNumber( CORBA::Long NumIter ) +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Iteration_i::SetDirName( const char* NomDir ) { ASSERT( myHomardIteration ); - myHomardIteration->SetNumber( NumIter ); + myHomardIteration->SetDirName( NomDir ); } - //============================================================================= -CORBA::Long HOMARD_Iteration_i::GetNumber() +char* HOMARD_Iteration_i::GetDirName() { ASSERT( myHomardIteration ); - return myHomardIteration->GetNumber() ; + return CORBA::string_dup( myHomardIteration->GetDirName().c_str() ); } - //============================================================================= -void HOMARD_Iteration_i::SetMeshName( const char* NomMesh ) +void HOMARD_Iteration_i::SetNumber( CORBA::Long NumIter ) { ASSERT( myHomardIteration ); - myHomardIteration->SetMeshName( NomMesh ); + myHomardIteration->SetNumber( NumIter ); } - //============================================================================= -char* HOMARD_Iteration_i::GetMeshName() +CORBA::Long HOMARD_Iteration_i::GetNumber() { ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetMeshName().c_str() ); + return myHomardIteration->GetNumber() ; } - //============================================================================= -char* HOMARD_Iteration_i::GetIterParentName() +void HOMARD_Iteration_i::SetEtat( CORBA::Boolean Etat ) { ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetIterParentName().c_str() ); - + myHomardIteration->SetEtat( Etat ); } //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Iteration_i::GetIterParent() +CORBA::Boolean HOMARD_Iteration_i::GetEtat() { -// Nom de l'iteration parent - char* NomIterParent = GetIterParentName() ; - MESSAGE ( "GetIterParent : NomIterParent = " << NomIterParent ); -// On passe par la methode sur l'objet HOMARD -// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte - return _gen_i->GetIteration(NomIterParent) ; + ASSERT( myHomardIteration ); + return CORBA::Boolean( myHomardIteration->GetEtat()); } - - - //============================================================================= -HOMARD::listeIterFilles* HOMARD_Iteration_i::GetIterations() +void HOMARD_Iteration_i::SetMeshName( const char* NomMesh ) { ASSERT( myHomardIteration ); - const std::list& maListe = myHomardIteration->GetIterations(); - HOMARD::listeIterFilles_var aResult = new HOMARD::listeIterFilles; - aResult->length( maListe.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = maListe.begin(); it != maListe.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); + myHomardIteration->SetMeshName( NomMesh ); } - //============================================================================= -void HOMARD_Iteration_i::SetIterParentName( const char* NomIterParent ) +char* HOMARD_Iteration_i::GetMeshName() { ASSERT( myHomardIteration ); - myHomardIteration->SetIterParentName( NomIterParent ); + return CORBA::string_dup( myHomardIteration->GetMeshName().c_str() ); } - //============================================================================= -void HOMARD_Iteration_i::AddIteration( const char* NomIteration ) +void HOMARD_Iteration_i::SetMeshFile( const char* MeshFile ) { ASSERT( myHomardIteration ); - myHomardIteration->AddIteration( NomIteration ); + myHomardIteration->SetMeshFile( MeshFile ); } - //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Iteration_i::NextIteration( const char* IterName ) +char* HOMARD_Iteration_i::GetMeshFile() { -// Nom de l'iteration parent - char* NomIterParent = GetName() ; - MESSAGE ( "NextIteration : IterName = " << IterName ); - MESSAGE ( "NextIteration : NomIterParent = " << NomIterParent ); -// On passe par la methode sur l'objet HOMARD -// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte - return _gen_i->CreateIteration(IterName, NomIterParent) ; + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetMeshFile().c_str() ); } - - //============================================================================= -CORBA::Long HOMARD_Iteration_i::Compute(CORBA::Long etatMenage) +void HOMARD_Iteration_i::SetFieldFile( const char* FieldFile ) { - MESSAGE ( "Compute : calcul d'une iteration" ); ASSERT( myHomardIteration ); -// -// Nom de l'iteration - char* IterName = GetName() ; - MESSAGE ( ". IterName = " << IterName ); -// On passe par la methode sur l'objet HOMARD -// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte - return _gen_i->Compute(IterName, etatMenage) ; + myHomardIteration->SetFieldFile( FieldFile ); } - //============================================================================= -void HOMARD_Iteration_i::SetMeshFile( const char* MeshFile ) +char* HOMARD_Iteration_i::GetFieldFile() { ASSERT( myHomardIteration ); - myHomardIteration->SetMeshFile( MeshFile ); + return CORBA::string_dup( myHomardIteration->GetFieldFile().c_str() ); } - //============================================================================= -char* HOMARD_Iteration_i::GetMeshFile() +void HOMARD_Iteration_i::SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank ) { ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetMeshFile().c_str() ); + myHomardIteration->SetTimeStepRank( TimeStep, Rank ); } - //============================================================================= -char* HOMARD_Iteration_i::GetCaseName() +CORBA::Long HOMARD_Iteration_i::GetTimeStep() { ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetCaseName().c_str() ); + return CORBA::Long( myHomardIteration->GetTimeStep() ); } - //============================================================================= -void HOMARD_Iteration_i::SetCaseName( const char* NomCas ) +CORBA::Long HOMARD_Iteration_i::GetRank() { ASSERT( myHomardIteration ); - myHomardIteration->SetCaseName( NomCas ); + return CORBA::Long( myHomardIteration->GetRank() ); } - //============================================================================= -char* HOMARD_Iteration_i::GetDirName() +void HOMARD_Iteration_i::SetMessFile( const char* MessFile ) { ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetDirName().c_str() ); + myHomardIteration->SetMessFile( MessFile ); } - //============================================================================= -void HOMARD_Iteration_i::SetDirName( const char* NomDir ) +char* HOMARD_Iteration_i::GetMessFile() { ASSERT( myHomardIteration ); - myHomardIteration->SetDirName( NomDir ); + return CORBA::string_dup( myHomardIteration->GetMessFile().c_str() ); } - //============================================================================= -void HOMARD_Iteration_i::AssociateHypo( const char* NomHypo ) +CORBA::Long HOMARD_Iteration_i::Compute(CORBA::Long etatMenage) { + MESSAGE ( "Compute : calcul d'une iteration" ); ASSERT( myHomardIteration ); // // Nom de l'iteration char* IterName = GetName() ; - MESSAGE ( ". IterName = " << IterName ); -// On passe par la methode sur l'objet HOMARD -// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte - return _gen_i->AssociateIterHypo(IterName, NomHypo) ; + MESSAGE ( "Compute : calcul de l'teration " << IterName ); + return _gen_i->Compute(IterName, etatMenage) ; } - //============================================================================= -char* HOMARD_Iteration_i::GetHypoName() +//============================================================================= +// Liens avec les autres iterations +//============================================================================= +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Iteration_i::NextIteration( const char* IterName ) { - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetHypoName().c_str() ); +// Nom de l'iteration parent + char* NomIterParent = GetName() ; + MESSAGE ( "NextIteration : creation de l'iteration " << IterName << " comme fille de " << NomIterParent ); + return _gen_i->CreateIteration(IterName, NomIterParent) ; } - -//============================================================================= -// HOMARD::HOMARD_Hypothesis_ptr HOMARD_Iteration_i::GetHypo() -// { -// // Nom de l'hypothese -// char* NomHypo = GetHypoName() ; -// MESSAGE ( "GetHypo : NomHypo = " << NomHypo ); -// // On passe par la methode sur l'objet HOMARD -// // Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte -// return _gen_i->GetHypothesis(NomHypo) ; -// } - //============================================================================= -void HOMARD_Iteration_i::SetHypoName( const char* NomHypo ) +void HOMARD_Iteration_i::LinkNextIteration( const char* NomIteration ) { ASSERT( myHomardIteration ); - myHomardIteration->SetHypoName( NomHypo ); + myHomardIteration->LinkNextIteration( NomIteration ); } - //============================================================================= -void HOMARD_Iteration_i::SetFieldFile( const char* FieldFile ) +void HOMARD_Iteration_i::UnLinkNextIteration( const char* NomIteration ) { ASSERT( myHomardIteration ); - myHomardIteration->SetFieldFile( FieldFile ); + myHomardIteration->UnLinkNextIteration( NomIteration ); } - //============================================================================= -char* HOMARD_Iteration_i::GetFieldFile() +HOMARD::listeIterFilles* HOMARD_Iteration_i::GetIterations() { ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetFieldFile().c_str() ); + const std::list& maListe = myHomardIteration->GetIterations(); + HOMARD::listeIterFilles_var aResult = new HOMARD::listeIterFilles; + aResult->length( maListe.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = maListe.begin(); it != maListe.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); } - //============================================================================= -void HOMARD_Iteration_i::SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank ) +void HOMARD_Iteration_i::SetIterParentName( const char* NomIterParent ) { ASSERT( myHomardIteration ); - myHomardIteration->SetTimeStepRank( TimeStep, Rank ); + myHomardIteration->SetIterParentName( NomIterParent ); } - //============================================================================= -CORBA::Long HOMARD_Iteration_i::GetTimeStep() +char* HOMARD_Iteration_i::GetIterParentName() { ASSERT( myHomardIteration ); - return CORBA::Long( myHomardIteration->GetTimeStep() ); + return CORBA::string_dup( myHomardIteration->GetIterParentName().c_str() ); } - //============================================================================= -CORBA::Long HOMARD_Iteration_i::GetRank() +HOMARD::HOMARD_Iteration_ptr HOMARD_Iteration_i::GetIterParent() +{ +// Nom de l'iteration parent + char* NomIterParent = GetIterParentName() ; + MESSAGE ( "GetIterParent : NomIterParent = " << NomIterParent ); + return _gen_i->GetIteration(NomIterParent) ; +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Iteration_i::SetCaseName( const char* NomCas ) { ASSERT( myHomardIteration ); - return CORBA::Long( myHomardIteration->GetRank() ); + myHomardIteration->SetCaseName( NomCas ); } - //============================================================================= -void HOMARD_Iteration_i::SetMessFile( const char* MessFile ) +char* HOMARD_Iteration_i::GetCaseName() { ASSERT( myHomardIteration ); - myHomardIteration->SetMessFile( MessFile ); + return CORBA::string_dup( myHomardIteration->GetCaseName().c_str() ); } - //============================================================================= -char* HOMARD_Iteration_i::GetMessFile() +void HOMARD_Iteration_i::AssociateHypo( const char* NomHypo ) { ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetMessFile().c_str() ); +// +// Nom de l'iteration + char* IterName = GetName() ; + MESSAGE ( ". IterName = " << IterName ); + return _gen_i->AssociateIterHypo(IterName, NomHypo) ; } //============================================================================= -std::string HOMARD_Iteration_i::Dump() const +void HOMARD_Iteration_i::SetHypoName( const char* NomHypo ) { - return HOMARD::Dump( *myHomardIteration ); + ASSERT( myHomardIteration ); + myHomardIteration->SetHypoName( NomHypo ); } - //============================================================================= -bool HOMARD_Iteration_i::Restore( const std::string& stream ) +char* HOMARD_Iteration_i::GetHypoName() { - return HOMARD::Restore( *myHomardIteration, stream ); + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetHypoName().c_str() ); } diff --git a/src/HOMARD_I/HOMARD_Iteration_i.hxx b/src/HOMARD_I/HOMARD_Iteration_i.hxx index f15cfa2f..0b9b807b 100644 --- a/src/HOMARD_I/HOMARD_Iteration_i.hxx +++ b/src/HOMARD_I/HOMARD_Iteration_i.hxx @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #ifndef _HOMARD_ITERATION_I_HXX_ #define _HOMARD_ITERATION_I_HXX_ @@ -44,21 +53,27 @@ public: virtual ~HOMARD_Iteration_i(); +// Generalites void SetName( const char* Name ); char* GetName(); - HOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name) ; + CORBA::Long Delete(); - void SetIterParentName( const char* NomIterParent ); - char* GetIterParentName(); - HOMARD::HOMARD_Iteration_ptr GetIterParent() ; + char* GetDumpPython(); - void SetEtat( CORBA::Boolean etat ); - CORBA::Boolean GetEtat(); + std::string Dump() const; + bool Restore( const std::string& stream ); + +// Caracteristiques + void SetDirName( const char* NomDir ); + char* GetDirName(); void SetNumber( CORBA::Long NumIter ); CORBA::Long GetNumber(); + void SetEtat( CORBA::Boolean etat ); + CORBA::Boolean GetEtat(); + void SetMeshName( const char* NomMesh ); char* GetMeshName(); @@ -74,27 +89,27 @@ public: void SetMessFile( const char* MessFile ); char* GetMessFile(); - void AddIteration( const char* NomIteration ); + CORBA::Long Compute(CORBA::Long etatMenage); + +// Liens avec les autres iterations + HOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name) ; + + void LinkNextIteration( const char* NomIteration ); + void UnLinkNextIteration( const char* NomIteration ); HOMARD::listeIterFilles* GetIterations(); + void SetIterParentName( const char* NomIterParent ); + char* GetIterParentName(); + HOMARD::HOMARD_Iteration_ptr GetIterParent() ; + +// Liens avec les autres structures void SetCaseName( const char* NomCas ); char* GetCaseName(); - void SetDirName( const char* NomDir ); - char* GetDirName(); - void AssociateHypo( const char* NomHypo); - void SetHypoName( const char* NomHypo ); char* GetHypoName(); - CORBA::Long Compute(CORBA::Long etatMenage); - - std::string Dump() const; - bool Restore( const std::string& stream ); - - char* GetDumpPython(); - private: ::HOMARD_Iteration* myHomardIteration; diff --git a/src/HOMARD_I/HOMARD_Zone_i.cxx b/src/HOMARD_I/HOMARD_Zone_i.cxx index b7774231..c794bd84 100644 --- a/src/HOMARD_I/HOMARD_Zone_i.cxx +++ b/src/HOMARD_I/HOMARD_Zone_i.cxx @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #include "HOMARD_Zone_i.hxx" #include "HOMARD_Gen_i.hxx" @@ -58,74 +67,68 @@ HOMARD_Zone_i::HOMARD_Zone_i( CORBA::ORB_ptr orb, HOMARD_Zone_i::~HOMARD_Zone_i() { } - //============================================================================= -/*! - */ +//============================================================================= +// Generalites +//============================================================================= //============================================================================= void HOMARD_Zone_i::SetName( const char* Name ) { ASSERT( myHomardZone ); myHomardZone->SetName( Name ); } - //============================================================================= char* HOMARD_Zone_i::GetName() { ASSERT( myHomardZone ); return CORBA::string_dup( myHomardZone->GetName().c_str() ); } - +//============================================================================= +CORBA::Long HOMARD_Zone_i::Delete() +{ + ASSERT( myHomardZone ); + char* ZoneName = GetName() ; + MESSAGE ( "Delete : destruction de la zonee " << ZoneName ); + return _gen_i->DeleteZone(ZoneName) ; +} //============================================================================= char* HOMARD_Zone_i::GetDumpPython() { ASSERT( myHomardZone ); return CORBA::string_dup( myHomardZone->GetDumpPython().c_str() ); } - - //============================================================================= -void HOMARD_Zone_i::SetType( CORBA::Long Type ) +std::string HOMARD_Zone_i::Dump() const { - ASSERT( myHomardZone ); - myHomardZone->SetType( Type ); + return HOMARD::Dump( *myHomardZone ); } - //============================================================================= -CORBA::Long HOMARD_Zone_i::GetType() +bool HOMARD_Zone_i::Restore( const std::string& stream ) { - ASSERT( myHomardZone ); - return CORBA::Long( myHomardZone->GetType() ); + return HOMARD::Restore( *myHomardZone, stream ); } - //============================================================================= -void HOMARD_Zone_i::SetBox( double X0, double X1, double X2, double X3, double X4, double X5 ) +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Zone_i::SetType( CORBA::Long Type ) { ASSERT( myHomardZone ); - myHomardZone->SetBox( X0, X1, X2, X3, X4, X5 ); + myHomardZone->SetType( Type ); } - //============================================================================= -HOMARD::double_array* HOMARD_Zone_i::GetCoords() +CORBA::Long HOMARD_Zone_i::GetType() { ASSERT( myHomardZone ); - HOMARD::double_array_var aResult = new HOMARD::double_array(); - std::vector mesCoor = myHomardZone->GetCoords(); - aResult->length( mesCoor .size() ); - std::vector::const_iterator it; - int i = 0; - for ( it = mesCoor.begin(); it != mesCoor.end(); it++ ) - aResult[i++] = (*it); - return aResult._retn(); + return CORBA::Long( myHomardZone->GetType() ); } - //============================================================================= -void HOMARD_Zone_i::SetSphere( double Xcentre, double Ycentre, double Zcentre, double Rayon ) +void HOMARD_Zone_i::SetBox( double X0, double X1, double X2, double X3, double X4, double X5 ) { ASSERT( myHomardZone ); - myHomardZone->SetSphere( Xcentre, Ycentre, Zcentre, Rayon ); + myHomardZone->SetBox( X0, X1, X2, X3, X4, X5 ); } - //============================================================================= void HOMARD_Zone_i::SetCylinder( double Xcentre, double Ycentre, double Zcentre, double Xaxis, double Yaxis, double Zaxis, @@ -142,7 +145,25 @@ void HOMARD_Zone_i::SetPipe( double Xcentre, double Ycentre, double Zcentre, ASSERT( myHomardZone ); myHomardZone->SetPipe( Xcentre, Ycentre, Zcentre, Xaxis, Yaxis, Zaxis, Rayon, Haut, Rayonint ); } - +//============================================================================= +void HOMARD_Zone_i::SetSphere( double Xcentre, double Ycentre, double Zcentre, double Rayon ) +{ + ASSERT( myHomardZone ); + myHomardZone->SetSphere( Xcentre, Ycentre, Zcentre, Rayon ); +} +//============================================================================= +HOMARD::double_array* HOMARD_Zone_i::GetCoords() +{ + ASSERT( myHomardZone ); + HOMARD::double_array_var aResult = new HOMARD::double_array(); + std::vector mesCoor = myHomardZone->GetCoords(); + aResult->length( mesCoor .size() ); + std::vector::const_iterator it; + int i = 0; + for ( it = mesCoor.begin(); it != mesCoor.end(); it++ ) + aResult[i++] = (*it); + return aResult._retn(); +} //============================================================================= void HOMARD_Zone_i::SetLimit( double Xincr, double Yincr, double Zincr ) { @@ -150,7 +171,6 @@ void HOMARD_Zone_i::SetLimit( double Xincr, double Yincr, double Zincr ) ASSERT( myHomardZone ); myHomardZone->SetLimit( Xincr, Yincr, Zincr ); } - //============================================================================= HOMARD::double_array* HOMARD_Zone_i::GetLimit() { @@ -164,21 +184,16 @@ HOMARD::double_array* HOMARD_Zone_i::GetLimit() aResult[i++] = (*it); return aResult._retn(); } - +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= //============================================================================= void HOMARD_Zone_i::AddHypo( const char* NomHypo ) { MESSAGE ( " AddHypo, NomHypo= " << NomHypo); ASSERT( myHomardZone ); myHomardZone->AddHypo( NomHypo ); - MESSAGE ( " FIn de AddHypo"); -} - -//============================================================================= -void HOMARD_Zone_i::SupprHypo( const char* NomHypo ) -{ - ASSERT( myHomardZone ); - myHomardZone->SupprHypo( NomHypo ); } //============================================================================= HOMARD::listeHypo* HOMARD_Zone_i::GetHypo() @@ -193,15 +208,10 @@ HOMARD::listeHypo* HOMARD_Zone_i::GetHypo() aResult[i++] = CORBA::string_dup( (*it).c_str() ); return aResult._retn(); } - //============================================================================= -std::string HOMARD_Zone_i::Dump() const +void HOMARD_Zone_i::SupprHypo( const char* NomHypo ) { - return HOMARD::Dump( *myHomardZone ); + ASSERT( myHomardZone ); + myHomardZone->SupprHypo( NomHypo ); } -//============================================================================= -bool HOMARD_Zone_i::Restore( const std::string& stream ) -{ - return HOMARD::Restore( *myHomardZone, stream ); -} diff --git a/src/HOMARD_I/HOMARD_Zone_i.hxx b/src/HOMARD_I/HOMARD_Zone_i.hxx index 33d4a0c7..e792e1bb 100644 --- a/src/HOMARD_I/HOMARD_Zone_i.hxx +++ b/src/HOMARD_I/HOMARD_Zone_i.hxx @@ -16,6 +16,15 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// #ifndef _HOMARD_Zone_I_HXX_ #define _HOMARD_Zone_I_HXX_ @@ -43,38 +52,45 @@ public: virtual ~HOMARD_Zone_i(); +// Generalites void SetName( const char* Name ); char* GetName(); + + CORBA::Long Delete(); + char* GetDumpPython(); - void SetType( CORBA::Long Type ); + std::string Dump() const; + bool Restore( const std::string& stream ); +// Caracteristiques + void SetType( CORBA::Long Type ); CORBA::Long GetType(); - HOMARD::double_array* GetCoords(); void SetBox( double Xmini, double Xmaxi, double Ymini, double Ymaxi, double Zmini, double Zmaxi ); - void SetSphere( double Xcentre, double Ycentre, double ZCentre, - double Rayon ); - void SetCylinder( double Xcentre, double Ycentre, double ZCentre, double Xaxis, double Yaxis, double Zaxis, double Rayon, double Haut ); + void SetPipe( double Xcentre, double Ycentre, double ZCentre, double Xaxis, double Yaxis, double Zaxis, double Rayon, double Haut, double Rayonint ); - HOMARD::double_array* GetLimit(); + void SetSphere( double Xcentre, double Ycentre, double ZCentre, + double Rayon ); + + HOMARD::double_array* GetCoords(); + void SetLimit( double Xincr, double Yincr, double Zincr); + HOMARD::double_array* GetLimit(); +// Liens avec les autres structures void AddHypo( const char *NomHypo ); - void SupprHypo( const char *NomHypo ); HOMARD::listeHypo* GetHypo(); - - std::string Dump() const; - bool Restore( const std::string& stream ); + void SupprHypo( const char *NomHypo ); private: ::HOMARD_Zone* myHomardZone; diff --git a/src/HOMARD_I/HomardMedCommun.cxx b/src/HOMARD_I/HomardMedCommun.cxx index 8aab75c3..ded97622 100644 --- a/src/HOMARD_I/HomardMedCommun.cxx +++ b/src/HOMARD_I/HomardMedCommun.cxx @@ -25,13 +25,25 @@ #include #include -extern "C" +extern "C" { #include } #include "utilities.h" // ======================================================================= +int MEDFileExist( const char * aFile ) +// Retourne 1 si le fichier existe, 0 sinon +// ======================================================================= +{ + int existe ; + med_idt medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY); + if ( medIdt < 0 ) { existe = 0 ; } + else { MEDfileClose(medIdt); + existe = 1 ; } + return existe ; +} +// ======================================================================= std::set GetListeGroupesInMedFile(const char * aFile) // ======================================================================= { @@ -64,15 +76,15 @@ std::set GetListeGroupesInMedFile(const char * aFile) axisname, axisunit); if ( aRet < 0 ) { return ListeGroupes; }; - + med_int nfam, ngro, natt; if ((nfam = MEDnFamily(medIdt,meshname)) < 0) { return ListeGroupes; }; - + char familyname[MED_NAME_SIZE+1]; med_int numfam; - for (int i=0;i GetListeGroupesInMedFile(const char * aFile) } if (ngro == 0) continue; - if ((natt = MEDnFamily23Attribute(medIdt,meshname,i+1)) < 0) + if ((natt = MEDnFamily23Attribute(medIdt,meshname,i+1)) < 0) { // GERALD -- QMESSAGE BOX std::cerr << " Error : Families are unreadable" << std::endl; @@ -93,7 +105,7 @@ std::set GetListeGroupesInMedFile(const char * aFile) med_int* attval = (med_int*) malloc(sizeof(med_int)*natt); char* attdes = (char *) malloc(MED_COMMENT_SIZE*natt+1); char* gro = (char*) malloc(MED_LNAME_SIZE*ngro+1); - + med_err aRet = MEDfamily23Info(medIdt, meshname, i+1, @@ -103,9 +115,9 @@ std::set GetListeGroupesInMedFile(const char * aFile) attdes, &numfam, gro); - - if (aRet < 0) - { + + if (aRet < 0) + { // GERALD -- QMESSAGE BOX std::cerr << " Error : Families are unreadable" << std::endl; std::cerr << "Pb avec la famille : " << i+1 << std::endl; @@ -116,7 +128,7 @@ std::set GetListeGroupesInMedFile(const char * aFile) free(attdes); if ((numfam )> 0) { continue;} // On ne garde que les familles d elts - for (int j=0;j GetBoundingBoxInMedFile(const char * aFile) // 9 distance max dans le maillage std::vector LesExtremes; - + // Ouverture du Fichier Med med_idt medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY); - if (medIdt <0) + if (medIdt <0) { // GERALD -- QMESSAGE BOX std::cerr << "Error : mesh is unreadable" << std::endl; @@ -153,7 +165,7 @@ std::vector GetBoundingBoxInMedFile(const char * aFile) // Le fichier Med est lisible // Boucle sur les noms de maillage med_int numberOfMeshes = MEDnMesh(medIdt) ; - if (numberOfMeshes != 1 ) + if (numberOfMeshes != 1 ) { // GERALD -- QMESSAGE BOX std::cerr << "Error : file contains more than one mesh" << std::endl; @@ -185,7 +197,7 @@ std::vector GetBoundingBoxInMedFile(const char * aFile) axisname, axisunit); - if (aRet < 0) + if (aRet < 0) { // GERALD -- QMESSAGE BOX std::cerr << "Error : mesh is unreadable" << std::endl; @@ -203,7 +215,7 @@ std::vector GetBoundingBoxInMedFile(const char * aFile) MED_NO_CMODE, &chgt, &trsf); - if ( nnoe < 0) + if ( nnoe < 0) { // GERALD -- QMESSAGE BOX std::cerr << "Error : mesh is unreadable" << std::endl; @@ -218,7 +230,7 @@ std::vector GetBoundingBoxInMedFile(const char * aFile) MED_NO_IT, MED_NO_INTERLACE, coo); - if ( aRet < 0) + if ( aRet < 0) { // GERALD -- QMESSAGE BOX std::cerr << "Error : mesh coordinates are unreadable" << std::endl; @@ -226,7 +238,7 @@ std::vector GetBoundingBoxInMedFile(const char * aFile) } med_float xmin,xmax,ymin,ymax,zmin,zmax; - + xmin=coo[0]; xmax=coo[0]; for (int i=1;i #include +int MEDFileExist( const char * aFile ); std::vector GetBoundingBoxInMedFile( const char * aFile); std::set GetListeGroupesInMedFile(const char * aFile); diff --git a/tests/test_1.py b/tests/test_1.py index 71e7dac8..7f7801d6 100644 --- a/tests/test_1.py +++ b/tests/test_1.py @@ -22,7 +22,7 @@ Python script for HOMARD Copyright EDF-R&D 2010, 2013 Test test_1 """ -__revision__ = "V1.7" +__revision__ = "V1.8" #======================================================================== Test_Name = "test_1" @@ -166,9 +166,8 @@ except Exception, e: # # Test of the result # -s_iter_test_file = str(n_iter_test_file) -test_file_suff = "apad.0" + s_iter_test_file + ".bilan" -rep_test_file = "I0" + s_iter_test_file +test_file_suff = "apad.%02d.bilan" % n_iter_test_file +rep_test_file = "I%02d" % n_iter_test_file # test_file = os.path.join(Rep_Test, Test_Name + "." + test_file_suff) mess_error_ref = "\nReference file: " + test_file diff --git a/tests/test_2.py b/tests/test_2.py index d6dd949a..d5ac783f 100644 --- a/tests/test_2.py +++ b/tests/test_2.py @@ -22,7 +22,7 @@ Python script for HOMARD Copyright EDF-R&D 2010, 2013 Test test_2 """ -__revision__ = "V1.6" +__revision__ = "V1.7" #======================================================================== Test_Name = "test_2" @@ -154,9 +154,8 @@ except Exception, e: # # Test of the result # -s_iter_test_file = str(n_iter_test_file) -test_file_suff = "apad.0" + s_iter_test_file + ".bilan" -rep_test_file = "I0" + s_iter_test_file +test_file_suff = "apad.%02d.bilan" % n_iter_test_file +rep_test_file = "I%02d" % n_iter_test_file # test_file = os.path.join(Rep_Test, Test_Name + "." + test_file_suff) mess_error_ref = "\nReference file: " + test_file diff --git a/tests/test_3.py b/tests/test_3.py index 36a9e8e3..e977157c 100644 --- a/tests/test_3.py +++ b/tests/test_3.py @@ -22,10 +22,11 @@ Python script for HOMARD Copyright EDF-R&D 2011, 2013 Test test_3 """ -__revision__ = "V1.4" +__revision__ = "V1.5" #======================================================================== Test_Name = "test_3" +n_boucle = 2 n_iter_test_file = 2 #======================================================================== import os @@ -110,27 +111,46 @@ Copyright EDF-R&D 2010, 2013 Case_1.AddBoundaryGroup('sphere_1', 'END_1') Case_1.AddBoundaryGroup('sphere_2', 'END_2') # -# Creation of the iterations -# ========================== -# Creation of the iteration Iter_1 - Iter_1 = Case_1.NextIteration('Iter_1') - Iter_1.SetMeshName('MOYEU_1') - Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) - Iter_1.AssociateHypo('Hypo') - error = Iter_1.Compute(1) - if error : - error = 1 - break +# Creation and destruction of the iterations +# ========================================== +# + for iaux in range (n_boucle+1) : +# + # Creation of the iteration Iter_1 + Iter_1 = Case_1.NextIteration('Iter_1') + Iter_1.SetMeshName('MOYEU_1') + Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) + Iter_1.AssociateHypo('Hypo') + error = Iter_1.Compute(1) + if error : + error = 10*iaux + 1 + break + + # Creation of the iteration Iter_2 + Iter_2 = Iter_1.NextIteration('Iter_2') + Iter_2.SetMeshName('MOYEU_2') + Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) + Iter_2.AssociateHypo('Hypo') + error = Iter_2.Compute(1) + if error : + error = 10*iaux + 2 + break -# Creation of the iteration Iter_2 - Iter_2 = Iter_1.NextIteration('Iter_2') - Iter_2.SetMeshName('MOYEU_2') - Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) - Iter_2.AssociateHypo('Hypo') - error = Iter_2.Compute(1) - if error : - error = 2 - break + # Destruction + if ( iaux < n_boucle ) : + # Recursive destruction of the iterations + error = Iter_1.Delete() + if error : + error = 10*iaux + 3 + break + # Destruction and creation of the hypothese + if ( iaux == 1 ) : + error = Hypo.Delete() + if error : + error = 10*iaux + 4 + break + Hypo = homard.CreateHypothesis('Hypo') + Hypo.SetAdapRefinUnRef(-1, 1, 0) # break # @@ -154,9 +174,8 @@ except Exception, e: # # Test of the result # -s_iter_test_file = str(n_iter_test_file) -test_file_suff = "apad.0" + s_iter_test_file + ".bilan" -rep_test_file = "I0" + s_iter_test_file +test_file_suff = "apad.%02d.bilan" % n_iter_test_file +rep_test_file = "I%02d" % (n_iter_test_file*(n_boucle+1)) # test_file = os.path.join(Rep_Test, Test_Name + "." + test_file_suff) mess_error_ref = "\nReference file: " + test_file -- 2.30.2